/* ============================================================
   Dharmil Asawla — portfolio
   Design system: see DESIGN.md
   Tokens: paper ground, ink text, one solid teal accent.
   No gradients, no shadows, no glass, no emoji.
   ============================================================ */

:root {
  /* Light theme (default, light-first) */
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f3f1eb;
  --text: #101418;
  --muted: #5a6068;
  --border: #e4e2dc;
  --border-strong: #c9c6bd;
  --accent: #0f766e;
  --accent-hover: #0b5e57;
  --accent-ink: #ffffff;
  --focus: #0f766e;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --container: 1120px;
  --gutter: 24px;
  --section-pad: 96px;
  --radius: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0b1520;
  --surface: #111f2e;
  --surface-2: #0e1a27;
  --text: #f2f0eb;
  --muted: #a9b2bc;
  --border: #22303f;
  --border-strong: #3a4a5c;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-ink: #06231f;
  --focus: #2dd4bf;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

/* Visible focus everywhere */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius);
}

::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.625rem 1rem;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Type ---------- */

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(3.5rem, 8vw, 6rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); }
h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section { padding: var(--section-pad) 0; }
/* Keep section tops clear of the sticky header on anchor jumps */
main section[id] { scroll-margin-top: 88px; }
.section-header { margin-bottom: 3rem; max-width: 34rem; position: relative; }
.section-header h2 { text-wrap: balance; }

/* Ghost section numerals: decorative only (aria-hidden, duplicates the
   heading), hairline fill + stroke, barely visible by design. */
.section-ghost {
  position: absolute;
  right: -1.5rem;
  top: -3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4rem, 7vw, 6rem);
  line-height: 1;
  color: var(--border);
  -webkit-text-stroke: 1px var(--border-strong);
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}
.contact-info { position: relative; }
/* Contact's heading fills its column, so the numeral sits in the
   whitespace below the channel list instead of beside the heading. */
.contact-info .section-ghost { top: auto; bottom: -0.5rem; right: 0; }

/* Scroll reveals: headers lead, content follows a beat later, one-shot
   and gentle (0.5s, 16px). Uses the standalone `translate` property so the
   hover lift on cards (which uses `transform`) keeps its own 0.2s timing.
   Gated on .js so no-JS still shows everything. */
.js .section-header,
.js .contact-info,
.js .reveal {
  opacity: 0;
  translate: 0 16px;
  transition: opacity 0.5s var(--ease), translate 0.5s var(--ease),
    transform 0.2s var(--ease);
}
.js .section-header.in-view,
.js .contact-info.in-view,
.js .reveal.in-view { opacity: 1; translate: 0 0; }
/* Content trails its header by a beat. Delays are per-property
   (opacity, translate, transform): the reveal waits, the hover lift stays
   instant so taps never feel laggy. */
.js .reveal { transition-delay: 0.1s, 0.1s, 0s; }
/* Cards and blocks stagger within their grid. */
.js .expertise-grid .expertise-card:nth-child(2),
.js .project-featured .project-card:nth-child(2),
.js .project-grid .project-card:nth-child(2),
.js .experience-list .experience-block:nth-child(2) { transition-delay: 0.2s, 0.2s, 0s; }
.js .expertise-grid .expertise-card:nth-child(3),
.js .project-featured .project-card:nth-child(3),
.js .project-grid .project-card:nth-child(3),
.js .experience-list .experience-block:nth-child(3) { transition-delay: 0.3s, 0.3s, 0s; }

/* Crisyn scope rows light up one by one after the lead card has arrived:
   each row fades in from faint, and its label turns accent. */
.js .scope-list > div {
  opacity: 0.35;
  transform: translateX(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.js .scope-list > div.in-view { opacity: 1; transform: none; }
.js .scope-list > div:nth-child(1) { transition-delay: 0.35s; }
.js .scope-list > div:nth-child(2) { transition-delay: 0.47s; }
.js .scope-list > div:nth-child(3) { transition-delay: 0.59s; }
.js .scope-list > div.in-view dt { color: var(--accent); }
.scope-list dt { transition: color 0.4s var(--ease); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-quiet {
  color: var(--text);
  padding-inline: 0.25rem;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}
.btn-quiet:hover { color: var(--accent); text-decoration-color: var(--accent); }
.btn-quiet:active { transform: translateY(1px); }
/* Visible keyboard focus everywhere (inputs already use --focus). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Touch press states: hover has no equivalent on a phone, so taps get
   the same feedback a hover gives a mouse. */
.btn:active { transform: translateY(1px); }
.building-link:active .building-name { text-decoration: underline; text-underline-offset: 3px; }
.building-link:active svg { transform: translate(2px, -2px); }
.channel:active { background: var(--surface-2); }
.channel:active .channel-value { color: var(--accent); }
.menu-toggle:active { transform: scale(0.96); }
.btn-quiet svg { transition: transform 0.2s var(--ease); }
.btn-quiet:hover svg { transform: translate(2px, -2px); }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

/* Reading progress: a 2px teal line at the very top of the viewport.
   Scroll-linked (scaleX follows scroll position), never covers content,
   and it is a position indicator, so it stays live under reduced motion. */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.scroll-progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* Current chapter while scrolling — mobile only (desktop has the nav
   with its scrollspy underline). Sits in the header's free middle space;
   hidden on desktop so it never fights the navigation. */
.chapter-indicator {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .chapter-indicator { display: block; order: 1; }
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--accent-ink);
  background: var(--accent);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav-link:hover,
.nav-link.active { color: var(--text); }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-cta { padding: 0.625rem 1.125rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle:active { transform: scale(0.97); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0.5rem;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 20, 24, 0.45);
}

/* ---------- Hero ---------- */

/* A real hero: fills the first screen alone (viewport minus the sticky
   header). The grid takes the free height and centres its content; the
   building strip sits at the bottom of the section. */
.hero {
  position: relative;
  overflow: clip;
  min-height: calc(100svh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
/* Contour-map art: static, faint, peeking out from behind the photo.
   One motif only, hero only. Never behind body copy. */
.hero-contours {
  position: absolute;
  right: -3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 30rem;
  height: 30rem;
  color: var(--border-strong);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.hero-contours .contour-dot { fill: var(--accent); stroke: none; }
.hero-grid, .hero > .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 4rem;
  align-items: center;
  flex: 1 0 auto;
  align-content: center;
}
.hero-copy .eyebrow { margin-bottom: 1.25rem; }
.hero-copy h1 { margin-bottom: 1.5rem; }
.hero-statement {
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 32rem;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Credentials strip: three plain facts, value over label */
.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.hero-fact { display: flex; flex-direction: column; gap: 0.25rem; }
.hero-fact-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
}
.hero-fact-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Hero entrance — the only load animation on the page */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-copy { animation: rise 0.6s var(--ease) both; }
.hero-photo { animation: rise 0.6s var(--ease) both; }

/* Hero photograph: flat frame, no overlay, no text over the image.
   The photo pans a few px as you scroll (--hero-shift, set by JS; the
   cover crop has enough slack on mobile that the frame never shows a gap). */
.hero-photo { position: relative; align-self: stretch; min-height: 25rem; }
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% calc(50% + var(--hero-shift, 0px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Mobile contour motif: hidden on desktop, where the large .hero-contours
   peeks from behind the photo instead. On small screens it is a faint
   background watermark on the hero's plain ground — large, mostly off the
   right edge, hairlines behind the copy, never on the photo and never bold
   (the bold-on-photo version was rejected by Dharmil, 1 Dec 2026: the art
   belongs in the very background, faint). */
.hero-contours-mobile { display: none; }
.hero-contours-mobile .contour-dot { fill: var(--accent); stroke: none; }

/* Currently building strip */
.building-strip {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 2.5rem;
  padding: 1.25rem 0.25rem;
  border-top: 1px solid var(--border);
}
.building-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  text-decoration: none;
  color: inherit;
}
.building-link:hover .building-name { text-decoration: underline; text-underline-offset: 3px; }
.building-link svg {
  width: 16px;
  height: 16px;
  align-self: center;
  color: var(--accent);
  transition: transform 0.2s var(--ease);
}
.building-link:hover svg { transform: translate(2px, -2px); }
.building-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.building-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
}

/* Real product logos — small wayfinding marks, never recoloured.
   Crisyn's mark ships on an opaque white ground, so it sits in a flat
   white chip in both themes; QuoteBuilder's icon is a self-contained
   tile and needs no chip. Logos are decorative next to the name text
   (alt=""). */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.brand-logo img { display: block; }
.brand-icon { flex-shrink: 0; }
.building-link .brand-logo img,
.building-link .brand-icon { width: 20px; height: 20px; }
.building-link .brand-icon { align-self: center; }
.project-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.project-title .brand-logo img,
.project-title .brand-icon { width: 28px; height: 28px; }

/* ---------- Journey timeline ---------- */

#journey { border-bottom: 1px solid var(--border); }

.timeline {
  list-style: none;
  position: relative;
  max-width: 56rem;
}
/* The rail is two lines: a faint full-height track (::before) and the
   accent progress line (::after), whose length follows the scroll position
   via --timeline-progress (JS, rAF-throttled; no transition — it is
   scroll-linked, not animated). Without JS the variable is unset and the
   rail simply renders full. */
.timeline::before {
  content: "";
  position: absolute;
  left: 83px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
}
.timeline::after {
  content: "";
  position: absolute;
  left: 83px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--accent);
  transform: scaleY(var(--timeline-progress, 1));
  transform-origin: top;
}

.timeline-step {
  display: grid;
  grid-template-columns: 72px 24px 1fr;
  gap: 0;
  padding: 2rem 0;
  position: relative;
}
/* Each step activates as it reaches the reading line: the whole row fades
   in and its dot fills. Gated on .js so no-JS still shows every step. */
.js .timeline-step {
  opacity: 0;
  translate: 0 12px;
  transition: opacity 0.5s var(--ease), translate 0.5s var(--ease);
}
.js .timeline-step.is-active { opacity: 1; translate: 0 0; }
.timeline-step.is-active .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.timeline-step:first-child { padding-top: 0; }
.timeline-step:last-child { padding-bottom: 0; }

.timeline-year {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  margin: 0.3rem auto 0;
  position: relative;
  z-index: 1;
}
.timeline-step-current .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
}
/* Dots pop as their step activates — one small 0.25s pop, once. */
@keyframes dot-in {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}
.timeline-step.is-active .timeline-dot { animation: dot-in 0.25s var(--ease) both; }
.timeline-dot { transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease); }
.timeline-body { padding-left: 1.5rem; }
.timeline-body h3 { margin-bottom: 0.25rem; }
.timeline-meta {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.timeline-body > p:last-of-type { color: var(--muted); max-width: 32rem; }
.current-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.75rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tag-list li {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.65rem;
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tag-list li:hover { border-color: var(--border-strong); transform: translateY(-1px); }

/* ---------- Expertise ---------- */

#expertise { border-bottom: 1px solid var(--border); }

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.expertise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.expertise-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.card-icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.expertise-card h3 { margin-bottom: 0.625rem; }
.expertise-card > p { color: var(--muted); margin-bottom: 1.5rem; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 0.625rem; }
.check-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.925rem;
}
.check-list li::before {
  content: "";
  width: 10px;
  height: 2px;
  flex-shrink: 0;
  background: var(--accent);
}

/* ---------- Experience ---------- */

#experience { border-bottom: 1px solid var(--border); }

.experience-list { max-width: 56rem; }
.experience-block {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}
.experience-block:first-child { border-top: none; padding-top: 0; }
.experience-block:last-child { padding-bottom: 0; }
.experience-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}
.experience-head h3 { margin-bottom: 0.125rem; }
.experience-company { color: var(--accent); font-weight: 500; }
.experience-date {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.3rem;
}
.experience-block > p { color: var(--muted); max-width: 38rem; margin-bottom: 1.25rem; }
.fact-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem 1.5rem;
}
.fact-list li {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-size: 0.925rem;
  font-weight: 500;
}
.fact-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: var(--accent);
  transform: translateY(-1px);
}

/* ---------- Projects ---------- */

#projects { border-bottom: 1px solid var(--border); }

.project-lead {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 1.5rem;
  transition: transform 0.2s var(--ease);
}
.project-lead:hover { transform: translateY(-2px); }
.project-lead-visual {
  background: var(--surface-2);
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}
.scope-list { width: 100%; display: flex; flex-direction: column; }
.scope-list > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}
.scope-list > div:last-child { border-bottom: none; }
.scope-list dt {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.2rem;
}
.scope-list dd { font-weight: 500; }
.project-lead-body { padding: 2.5rem 2rem; display: flex; flex-direction: column; justify-content: center; }
.project-lead-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.15;
  margin-bottom: 0.375rem;
}
.project-role {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.project-lead-body > p:last-of-type { color: var(--muted); margin-bottom: 1.5rem; }
.project-lead-body .btn-quiet { margin-top: 1.5rem; }

/* Crisyn tagline at the top of the lead visual */
.scope-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

/* Featured row: QuoteBuilder + Highway Asset Management + Ascend */
.project-featured {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.project-card .tag-list { margin-top: 1.25rem; }
.project-link { margin-top: 1.25rem; }

/* Divider label above the academic cards */
.projects-subhead {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  margin-bottom: 1.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.project-card {
  border-top: 2px solid var(--text);
  padding: 1.5rem 0.25rem 0;
  transition: transform 0.2s var(--ease);
}
.project-card:hover { transform: translateY(-2px); }
.project-meta {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.project-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}
.project-card > p:last-child { color: var(--muted); }

/* Video embed inside a project card: responsive 16:9, hairline frame,
   same radius as the cards, no new colours. The iframe is lazy and
   cannot autoplay; it is exempt from the motion rules. */
.video-embed {
  margin-top: 1.25rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.video-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 4rem;
  align-items: start;
}
.contact-info h2 { margin-bottom: 1rem; }
.contact-desc { color: var(--muted); max-width: 26rem; margin-bottom: 2.5rem; }

.channel-list { list-style: none; }
.channel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 0.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.2s var(--ease);
}
.channel-list li:first-child .channel { border-top: 1px solid var(--border); }
.channel:hover { transform: translateX(4px); }
.channel > svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.channel-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.channel-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.channel-value {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.channel:hover .channel-value { color: var(--accent); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-field { margin-bottom: 1.25rem; }
.form-field label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), outline-color 0.2s var(--ease);
}
.form-field textarea { resize: vertical; min-height: 7.5rem; }
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--accent);
}
.honeypot { display: none; }
.btn-submit { width: 100%; justify-content: center; margin-top: 0.25rem; }

.form-status {
  padding: 0.875rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.925rem;
  margin-bottom: 1.25rem;
}
.form-status.error {
  border-color: var(--text);
  color: var(--text);
}

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

.site-footer {
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}
.footer-brand { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
}
.footer-role { color: var(--muted); }
.footer-credits { color: var(--muted); font-size: 0.9rem; }
/* The one photograph credit line (Taste: credits in one footer line) */
.footer-photo-credit {
  width: 100%;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--muted);
}
.footer-photo-credit a { color: inherit; text-underline-offset: 3px; }
.footer-photo-credit a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { padding-top: 4rem; }
  /* Stacked hero: the photo becomes a 16:10 band under the copy */
  .hero-photo { min-height: 0; }
  .hero-photo img { height: auto; aspect-ratio: 16 / 10; }
  /* Contour art: the large desktop motif hides on stacked layouts, and
     the faint mobile watermark takes over — large, mostly off the right
     edge, hairlines on the hero's plain ground behind the copy. */
  .hero-contours { display: none; }
  .hero-contours-mobile {
    display: block;
    position: absolute;
    right: -8rem;
    top: 2rem;
    width: 22rem;
    height: 22rem;
    color: var(--border-strong);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
  }
  .expertise-grid,
  .project-grid,
  .project-featured { grid-template-columns: 1fr; }
  .fact-list { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
  .project-lead { grid-template-columns: 1fr; }
  .project-lead-visual { border-right: none; border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; gap: 1.5rem; }
}

@media (max-width: 1100px) {
  .nav-cta { display: none; }
  .nav-menu { gap: 1.5rem; }
}

@media (max-width: 900px) {
  .nav-container { gap: 1rem; }
  .theme-toggle .theme-label { display: none; }
  .theme-toggle { padding: 0.5rem 0.6rem; }
  .nav-actions { order: 2; }
  .menu-toggle { order: 3; }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(78vw, 320px);
    height: 100dvh;
    z-index: 100;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 5.5rem 1.75rem 2rem;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transition: right 0.3s var(--ease);
  }
  .nav-menu.open { right: 0; }
  .nav-menu li { width: 100%; }
  .nav-link { display: block; width: 100%; padding: 0.75rem 0; font-size: 1.05rem; }
  .menu-toggle { display: flex; position: relative; z-index: 101; }
  .nav-cta { display: none; }
  .brand-name { display: none; }
}

@media (max-width: 768px) {
  :root { --section-pad: 64px; }
  /* Ghost numerals become visible chapter numbers: small mono numerals
     in normal flow above the eyebrow, so they can never collide with a
     heading (the "05" lesson). */
  .section-ghost {
    position: static;
    display: block;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: var(--muted);
    -webkit-text-stroke: 0;
    opacity: 1;
    margin-bottom: 0.5rem;
  }
  .form-row { grid-template-columns: 1fr; }
  .timeline::before,
  .timeline::after { left: 67px; }
  .timeline-step { grid-template-columns: 56px 24px 1fr; }
  .timeline-body { padding-left: 1rem; }
  .contact-form { padding: 1.75rem 1.25rem; }
  .project-lead-visual,
  .project-lead-body { padding: 1.75rem 1.25rem; }
  .scope-list > div { grid-template-columns: 5.5rem 1fr; }
  .hero-facts { gap: 1rem; }
  .hero-fact-value { font-size: 1.5rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .hero-copy, .hero-photo { animation: none; }
  .timeline::before { transform: scaleY(1); transition: none; }
  .timeline::after { transform: scaleY(1); }
  /* Reveals start visible — no waiting on the observer. */
  .js .section-header, .js .contact-info,
  .js .reveal, .js .timeline-step { opacity: 1; translate: 0 0; }
  .js .scope-list > div { opacity: 1; transform: none; }
  .js .scope-list > div dt { color: var(--muted); }
  .timeline-step.is-active .timeline-dot { animation: none; }
}
