/* valipoor.com
   Palette is sampled from the road image: mountain blue, ridge blue, sky teal,
   horizon light, lane-marking amber. Type is Overpass, a highway-signage family. */

@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/overpass-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/overpass-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night-rgb: 24 58 104;   /* page background: the blue of the mountain range */
  --night: rgb(var(--night-rgb));
  --ridge: #34629c;
  --sky: #b4dbda;
  --horizon: #ffdcb2;
  --lane: #f2901c;
  --glow: #4cc6e6;
  --ink: #dbe4ee;
  --ink-strong: #f2f6fa;

  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --key: 15rem;      /* left of the lane line: labels and dates */
  --gap: 4rem;       /* the lane line runs down the middle of this gap */
  --measure: 40rem;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 106.25%; /* 17px */
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: "Overpass", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, p, ul, dl, dd, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--glow); text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
a:hover { color: var(--horizon); }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--lane); color: var(--night); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.3em; height: 1.3em; flex: none; fill: currentColor; }

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.6rem 1rem; background: var(--horizon); color: var(--night);
  font-weight: 700; text-decoration: none; border-radius: 4px;
}
.skip:focus { top: 1rem; }

/* ---------- Navigation ---------- */

.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: flex-end; gap: 1.5rem;
  height: 4rem; padding-inline: var(--gutter);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.js .nav { position: fixed; }
.nav.is-solid {
  background: rgb(var(--night-rgb) / 0.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--ridge);
}
.nav a { color: var(--ink-strong); text-decoration: none; }
.nav-links { display: flex; gap: clamp(1.25rem, 3vw, 2.25rem); }
.nav-links a {
  position: relative; padding-block: 0.5rem; font-weight: 600;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 3px;
  background: var(--lane); transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- Hero: the word rises behind the mountains ---------- */

.hero {
  /* --s is the side of the square scene; it always covers the hero.
     --y is where the scene's top edge sits. Both resolve against .hero. */
  --s: max(100cqw, 100cqh);
  --y: calc((100cqh - var(--s)) * 0.38);
  position: relative;
  height: 100svh; min-height: 34rem; max-height: 72rem;
  overflow: hidden;
  container-type: size;
  background: #0b4a6e;
}
.hero-bg, .hero-ridge {
  position: absolute; max-width: none;
  left: calc(50% - var(--s) / 2);
  width: var(--s);
}
.hero-bg { top: var(--y); height: var(--s); }
/* the ridge cut-out covers 20.166% to 59.961% of the scene's height */
.hero-ridge { top: calc(var(--y) + var(--s) * 0.20166); height: calc(var(--s) * 0.39795); z-index: 2; }

.welcome-msg {
  position: absolute; z-index: 1;
  left: 0; right: 0;
  top: calc(var(--y) + var(--s) * 0.372);
  transform: translateY(-100%);
  text-align: center;
  font-size: min(calc(var(--s) * 0.128), 21cqw);
  font-weight: 900; line-height: 0.8; letter-spacing: -0.035em;
  color: #021235;
  white-space: nowrap;
}
.hero::before, .hero::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none;
}
.hero::before { top: 0; height: 9rem; background: linear-gradient(rgb(2 18 53 / 0.6), rgb(2 18 53 / 0)); }
.hero::after { bottom: 0; height: 36%; background: linear-gradient(rgb(var(--night-rgb) / 0), rgb(var(--night-rgb) / 0.7) 55%, var(--night)); }

.welcome-label {
  position: absolute; z-index: 4;
  left: var(--gutter); right: var(--gutter); bottom: clamp(2.25rem, 9cqh, 5.5rem);
  text-align: center; text-wrap: balance;
  font-size: clamp(1.3rem, 1rem + 1.6cqw, 2.1rem);
  font-weight: 600; line-height: 1.25; letter-spacing: -0.01em;
  color: var(--ink-strong);
}
.welcome-label a { color: inherit; text-decoration-color: #fff; }
.welcome-label a:hover { color: var(--horizon); }

/* portrait screens: the valley is narrower, so the word sits a little lower in it */
@container (max-aspect-ratio: 4 / 5) {
  .welcome-msg { top: calc(var(--y) + var(--s) * 0.4); font-size: min(calc(var(--s) * 0.105), 21cqw); }
}

@media (prefers-reduced-motion: no-preference) {
  .welcome-msg { animation: rise 1.9s cubic-bezier(0.16, 0.8, 0.24, 1) 0.15s both; }
  .welcome-label { animation: arrive 0.9s ease-out 1.1s both; }
  @keyframes rise { from { transform: translateY(65%); } }
  @keyframes arrive { from { opacity: 0; } }
}

/* ---------- The road: one lane line, labels left, content right ---------- */

.road {
  position: relative;
  max-width: calc(var(--key) + var(--gap) + var(--measure) + 12rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  --line-x: calc(var(--gutter) + var(--key) + var(--gap) / 2);
}
.road-line {
  position: absolute; left: var(--line-x); top: 0; bottom: 0; width: 3px; margin-left: -1.5px;
  -webkit-mask-image: linear-gradient(transparent, #000 6rem, #000 calc(100% - 6rem), transparent);
          mask-image: linear-gradient(transparent, #000 6rem, #000 calc(100% - 6rem), transparent);
}
/* dashed: the road ahead */
.road-line::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(var(--lane) 0 1.4rem, transparent 1.4rem 2.5rem);
  opacity: 0.42;
}
/* solid: the stretch already travelled (height is set on scroll) */
.road-done {
  position: absolute; inset: 0 0 auto 0;
  height: var(--done, 0px); max-height: 100%;
  background: var(--lane);
}

.section {
  display: grid;
  grid-template-columns: var(--key) minmax(0, 1fr);
  column-gap: var(--gap);
  row-gap: 3.25rem;
  padding-block: clamp(5rem, 12vw, 8.5rem) 0;
}
.section > * { grid-column: 2; min-width: 0; }

h2 {
  font-size: clamp(3rem, 2rem + 5.5vw, 5.6rem);
  font-weight: 900; line-height: 0.95; letter-spacing: -0.035em;
  color: var(--horizon);
}

.lead h3 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.015em;
  color: var(--ink-strong);
}
.lead blockquote { margin-top: 0.9rem; max-width: var(--measure); font-size: 1.2rem; line-height: 1.55; color: var(--sky); }

/* labels on the left of the lane line */
.section > .key {
  grid-column: 1;
  text-align: right; text-wrap: balance;
  font-size: 1rem; font-weight: 700; line-height: 1.3;
  color: var(--horizon);
  padding-top: 0.15rem;
}

.facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.75rem, 1fr));
  gap: 1.75rem 1.25rem;
}
.facts dt { font-size: 0.875rem; font-weight: 600; color: var(--sky); margin-bottom: 0.2rem; }
.facts dd { font-weight: 600; color: var(--ink-strong); line-height: 1.5; }
.with-ico { display: inline-flex; align-items: center; gap: 0.5rem; }

.kit {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.75rem, 1fr));
  gap: 1.1rem 1.25rem;
}
.kit li {
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: var(--ink-strong);
}
.kit .ico { color: var(--sky); width: 1.4rem; height: 1.4rem; }
.kit-wide { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.kit-wide li { font-weight: 400; color: var(--ink); align-items: flex-start; }
.kit-wide .ico { margin-top: 0.05rem; }

/* ---------- Resume: every stop sits on the line ---------- */

.section > .sub {
  font-size: 1.6rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--ink-strong);
}
.section > .sub:not(:first-of-type) { margin-top: 2.5rem; }

.section > .stop {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: subgrid;
  position: relative;
}
.stop::before {
  content: ""; position: absolute;
  left: calc(var(--key) + var(--gap) / 2); top: 0.42rem;
  width: 15px; height: 15px; margin-left: -7.5px;
  border: 3px solid var(--lane); border-radius: 50%;
  background: var(--night);
}
.when {
  grid-column: 1; align-self: start;
  position: sticky; top: 5.25rem;
  text-align: right; text-wrap: balance;
  font-size: 0.9375rem; font-weight: 600; line-height: 1.4;
  color: var(--sky);
  padding-top: 0.3rem;
}
.what { grid-column: 2; max-width: var(--measure); }
.what h4 {
  font-size: 1.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--horizon);
}
.what > p { margin-top: 0.6rem; }
.project { margin-top: 1.4rem; }
.project + .project { margin-top: 3rem; padding-top: 2.4rem; border-top: 1px solid var(--ridge); }
.project h5 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; color: var(--ink-strong); }
.period { font-size: 0.9375rem; font-weight: 600; color: var(--sky); }
.project > p:not(.period):not(.list-title) { margin-top: 0.7rem; }
.list-title { margin-top: 1.5rem; line-height: 1.4; }
.list-title strong { font-weight: 700; color: var(--ink-strong); }
.tri { margin-top: 0.45rem; }
.tri li { position: relative; padding-left: 1.4rem; }
.tri li + li { margin-top: 0.3rem; }
.tri li::before { content: "\25B8"; position: absolute; left: 0; color: var(--lane); }

#resume { padding-bottom: 7rem; }

/* ---------- Footer ---------- */

.footer {
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--ridge);
  text-align: center; font-size: 0.875rem; color: var(--sky);
}

/* ---------- Narrow screens: the line moves to the left edge ---------- */

@media (max-width: 56rem) {
  :root { --key: 0rem; --gap: 0rem; }
  .road { padding-left: calc(var(--gutter) + 1.75rem); --line-x: calc(var(--gutter) + 1.5px); }
  .section { grid-template-columns: minmax(0, 1fr); row-gap: 1.1rem; }
  .section > *, .section > .key, .section > .stop, .when, .what { grid-column: 1; }
  .section > .key { text-align: left; margin-top: 2.2rem; font-size: 1.125rem; }
  .section > h2 { margin-bottom: 0.75rem; }
  .section > .sub { margin-top: 1.5rem; }
  .section > .stop { display: block; margin-top: 1.4rem; }
  .stop::before { left: calc(-1.75rem + 1.5px); top: 0.3rem; }
  .when { position: static; text-align: left; padding-top: 0; margin-bottom: 0.35rem; }
  .kit, .facts { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
  .facts > div:first-child { grid-column: 1 / -1; }
  .kit-wide { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .nav { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .nav, .hero-bg, .hero-ridge, .road-line, .skip { display: none !important; }
  .hero { height: auto; min-height: 0; background: none; }
  .hero::before, .hero::after { display: none; }
  .welcome-msg, .welcome-label { position: static; transform: none; color: #000; font-size: 2rem; animation: none; }
  body { background: #fff; color: #000; }
  h2, .what h4, .section > .key, .facts dd, .kit li { color: #000; }
}
