/* ==========================================================================
   Jaroth Gonzalez — portfolio
   One stylesheet. Tokens → base → frame → components → pages → motion.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable) -------------------------------- */
/* Display: Unbounded stands in for Owners XWide (licensed face not on hand).
   To switch: add OwnersXWide-*.woff2 to /assets/fonts and put "Owners XWide"
   first in --font-display. */
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/unbounded-latin.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;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin.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;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens -------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Ground + ink */
  --graphite-950: #08090b;
  --graphite-900: #0e1013;
  --graphite-800: #171a1f;
  --graphite-700: #23272e;
  --hairline: rgb(255 255 255 / 0.32);
  --hairline-soft: rgb(255 255 255 / 0.14);
  --glass-edge: #545454;
  --glass-fill: rgb(255 255 255 / 0.09);
  --text: #f3f4f5;
  --text-2: #b9bec6;           /* 9.6:1 on graphite-950 */
  --text-3: #8b929c;           /* 5.9:1 on graphite-950 — labels only */
  --accent: #ff6a1a;           /* Fractalis strap orange */

  /* Chapter tints, sampled from the Figma slides */
  --fern: #76dc8a;
  --wine: #5e323f;
  --wine-to: #5f6b7b;           /* deepened from #8497aa so white text holds 4.5:1 */
  --fjord: #325061;
  --fjord-to: #556985;          /* deepened from #9aaec9 for contrast */
  --steel: #7d8798;              /* lifted from #667183 so dark text holds 4.5:1 */
  --steel-to: #bbbfc2;
  --mist: #789ba8;
  --mist-to: #98a5b2;

  /* Type */
  --font-display: "Owners XWide", "Unbounded", "Arial Black", sans-serif;
  --font-text: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);  /* labels */
  --step-0: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);  /* body */
  --step-1: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  --step-2: clamp(1.25rem, 1.05rem + 0.9vw, 1.875rem);
  --step-3: clamp(1.625rem, 1.2rem + 1.9vw, 2.875rem);
  --step-4: clamp(2.25rem, 1.4rem + 3.8vw, 4.75rem);
  --step-5: clamp(2.75rem, 1.2rem + 6.4vw, 6rem);

  /* Space (4-based) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 144px;

  /* Frame */
  --gutter: clamp(16px, 2.6vw, 100px);       /* Figma: 100px @ 3840 */
  --bar-h: clamp(56px, 4.6vw, 88px);
  --radius: 10px;                            /* Figma panel radius */

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* expo-out */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 220ms;
  --t-med: 650ms;
  --t-slow: 1100ms;
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--graphite-700) var(--graphite-950);
  scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--graphite-950);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: var(--accent); color: var(--graphite-950); }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: inherit; line-height: 1.05; text-wrap: balance; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--text); color: var(--graphite-950);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--s-3); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Type primitives ---------------------------------------------- */
/* The bold/regular lockup: SKODA / FRACTALIS, SOFTWARE / SKILLS */
.lockup {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.12;
}
.lockup b, .lockup strong { font-weight: 800; }
.lockup--stack b, .lockup--stack span { display: block; }

.slug {                      /* frame metadata: "TRANSPORTATION DESIGN" */
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.slug b { font-weight: 700; }

.tag {                       /* "// STRUCTURAL FUNCTION" */
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag::before { content: "// "; color: var(--accent); font-weight: 700; }

.lede { font-size: var(--step-1); line-height: 1.5; color: var(--text); max-width: 34ch; }
.prose { max-width: 62ch; color: var(--text-2); }
.ch-wine .prose { color: var(--text); }
.prose p + p { margin-top: 1em; }
.prose b, .prose strong { color: var(--text); font-weight: 600; }

/* ---------- Frame: top bar ------------------------------------------------ */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--bar-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-5);
  padding-inline: var(--gutter);
  transition: background-color var(--t-med) var(--ease-out),
              backdrop-filter var(--t-med) var(--ease-out);
}
.bar::after {               /* the slide's hairline rule */
  content: ""; position: absolute; left: 0; right: var(--gutter); bottom: 0;
  height: 1px; background: var(--hairline);
}
.bar.is-solid {
  background: rgb(8 9 11 / 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}
.bar__name {
  font-family: var(--font-display);
  font-size: clamp(0.8125rem, 0.6rem + 0.55vw, 1.25rem);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.bar__name b { font-weight: 800; }
.bar__name span { font-weight: 400; }

.nav { justify-self: end; }
.nav__list { display: flex; gap: clamp(var(--s-4), 2.2vw, var(--s-7)); }
.nav__link {
  position: relative;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: var(--s-2);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--t-med) var(--ease-out);
}
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current="page"] { color: var(--text); }
.nav__badge {
  display: inline-block; margin-left: 0.35em;
  font-size: 0.75em; color: var(--accent); vertical-align: super; letter-spacing: 0;
}

.bar__mark {
  display: flex; align-items: center; gap: var(--s-4);
  padding-left: var(--s-4); margin-left: var(--s-2);
  border-left: 1px solid var(--hairline);
  height: 60%;
}
.bar__mark img { height: clamp(18px, 1.6vw, 30px); width: auto; }

.menu-toggle { display: none; }

@media (max-width: 760px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar__mark { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: var(--s-2);
    background: none; border: 1px solid var(--hairline); border-radius: 999px;
    padding: var(--s-2) var(--s-4);
    font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer;
  }
  .menu-toggle__lines { width: 14px; height: 8px; position: relative; }
  .menu-toggle__lines::before, .menu-toggle__lines::after {
    content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
    transition: transform var(--t-fast) var(--ease-out), top var(--t-fast) var(--ease-out);
  }
  .menu-toggle__lines::before { top: 0; }
  .menu-toggle__lines::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__lines::before { top: 3px; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle__lines::after { top: 3px; transform: rotate(-45deg); }

  .nav {
    position: fixed; inset: var(--bar-h) 0 auto 0;
    justify-self: stretch; width: 100%;
    height: calc(100svh - var(--bar-h));
    background: var(--graphite-950);
    padding: var(--s-7) var(--gutter);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
  }
  .nav.is-open {
    clip-path: inset(0 0 0 0); visibility: visible;
    transition: clip-path var(--t-med) var(--ease-out), visibility 0s;
  }
  .nav__list { flex-direction: column; gap: var(--s-5); }
  .nav__link {
    font-family: var(--font-display); font-size: var(--step-3);
    letter-spacing: 0; text-transform: uppercase; font-weight: 400;
  }
  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] { font-weight: 800; }
}

/* ---------- Frame: footer ------------------------------------------------- */
.foot {
  position: relative;
  padding: var(--s-9) var(--gutter) 0;
  background: var(--graphite-950);
}
.foot__ask {
  display: grid; gap: var(--s-6);
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: var(--s-9);
}
.foot__title { font-size: var(--step-4); }
.foot__mail {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.6rem + 3.2vw, 3.5rem);
  font-weight: 400;
  text-decoration: none;
  word-break: break-word;
  background: linear-gradient(currentColor, currentColor) left 100% / 0% 1px no-repeat;
  transition: background-size var(--t-med) var(--ease-out);
  justify-self: start;
}
.foot__mail:hover { background-size: 100% 1px; }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-7); }
.foot__links a { text-decoration: none; color: var(--text-2); }
.foot__links a:hover { color: var(--text); }
.foot__links dt { font-size: var(--step--1); color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }
.foot__links dd { font-weight: 500; }

.foot__bar {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-4);
  min-height: var(--bar-h);
  border-top: 1px solid var(--hairline);
  margin-right: calc(var(--gutter) * -1);
  padding-right: var(--gutter);
}
.foot__bar .slug:last-child {
  padding-left: var(--s-5); border-left: 1px solid var(--hairline); align-self: stretch;
  display: flex; align-items: center;
}
.foot__coords { color: var(--text-3); }

/* ---------- Generic section + media -------------------------------------- */
.section { position: relative; padding: var(--s-10) var(--gutter); }
.section--tight { padding-block: var(--s-9); }

.media {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--graphite-800);
}
.media img { width: 100%; height: auto; }
.media--contain img { object-fit: contain; }
.media figcaption,
.caption {
  margin-top: var(--s-3);
  font-size: var(--step--1); color: var(--text-2);
  letter-spacing: 0.04em; text-transform: uppercase;
}

.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  box-shadow: 0 5px 25px 4px rgb(0 0 0 / 0.12);
}

/* Link with a sliding arrow — the one CTA shape */
.go {
  display: inline-flex; align-items: center; gap: var(--s-3);
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--hairline);
  transition: border-color var(--t-fast) var(--ease-out), gap var(--t-med) var(--ease-out);
}
.go svg { width: 18px; height: 18px; transition: transform var(--t-med) var(--ease-out); }
.go:hover { border-color: var(--text); gap: var(--s-4); }
.go:hover svg { transform: translateX(4px); }
.go--accent { border-color: var(--accent); }

/* ==========================================================================
   HOME
   ========================================================================== */
.cover {
  position: relative;
  height: 100svh; min-height: 560px;
  overflow: clip;
  background: var(--graphite-800);
}
.cover__img {
  position: absolute; inset: -6% 0;
  width: 100%; height: 112%;
  object-fit: cover; object-position: 50% 45%;
  will-change: transform;
}
.cover::before {             /* top scrim so the nav reads over a light render */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 28%; z-index: 1;
  background: linear-gradient(rgb(8 9 11 / 0.55), transparent);
  pointer-events: none;
}
.cover::after {              /* bottom scrim for the title */
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%; z-index: 1;
  background: linear-gradient(transparent, rgb(8 9 11 / 0.82));
  pointer-events: none;
}
.cover__title {
  position: absolute; z-index: 2;
  left: var(--gutter); right: var(--gutter); bottom: calc(var(--bar-h) + var(--s-7));
  display: grid; gap: var(--s-4);
}
.cover__title h1 { font-size: var(--step-5); }
.cover__title p { font-size: var(--step-1); color: var(--text); max-width: 40ch; }
.cover__title p b { font-weight: 700; }
.cover__bar {
  position: absolute; z-index: 2; inset: auto 0 0 0;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  height: var(--bar-h); padding-left: var(--gutter);
}
.cover__bar::before {
  content: ""; position: absolute; top: 0; left: 0; right: var(--gutter); height: 1px; background: var(--hairline);
}
.cover__bar .slug:last-child {
  height: 100%; display: flex; align-items: center;
  padding-inline: var(--s-5) var(--gutter);
  border-left: 1px solid var(--hairline);
}
.scroll-cue {
  display: inline-flex; align-items: center; gap: var(--s-3);
  color: var(--text-2); text-decoration: none;
}
.scroll-cue i {
  width: 1px; height: 28px; background: var(--hairline); position: relative; overflow: hidden;
}
.scroll-cue i::after {
  content: ""; position: absolute; inset: 0; background: var(--text);
  animation: cue 2.4s var(--ease-in-out) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* Disciplines */
.disciplines { display: grid; gap: var(--s-5); grid-template-columns: 1.25fr 1fr; }
.disciplines__head {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: end; gap: var(--s-6);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--hairline-soft);
  margin-bottom: var(--s-4);
}
.disciplines__head h2 { font-size: var(--step-4); }
.disciplines__head p { max-width: 38ch; color: var(--text-2); }

.door {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(420px, 52vw, 720px);
  border-radius: var(--radius);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(var(--s-5), 3vw, var(--s-8));
  text-decoration: none;
  border: 1px solid var(--glass-edge);
}
.door__no { font-family: var(--font-display); font-weight: 900; font-size: var(--step-4); line-height: 1; }
.door__name { font-size: var(--step-3); margin-top: var(--s-3); }
.door__body { display: grid; gap: var(--s-5); max-width: 42ch; }
.door__body p { color: var(--text-2); }
.door__status {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.door__status::before {
  content: ""; width: 14px; height: 1px; background: var(--accent);
}

.door--yacht {
  background:
    radial-gradient(120% 80% at 80% 110%, rgb(154 174 201 / 0.28), transparent 60%),
    linear-gradient(180deg, #10161c 0%, #0b0f13 100%);
}
.door--yacht .door__waterline {          /* drawn hull line, authored SVG */
  position: absolute; inset: 30% -2% auto -2%; z-index: -1;
  width: 104%; height: auto; opacity: 0.55;
}
.door--yacht .door__waterline path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js.motion .door--yacht:not(.is-in) .door__waterline path { stroke-dashoffset: 0.6; }
.door--yacht .door__waterline path { transition: stroke-dashoffset 2.4s var(--ease-out) 300ms; }

.door--auto { color: var(--text); }
.door--auto .door__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);
  transition: transform var(--t-slow) var(--ease-out), filter var(--t-slow) var(--ease-out);
  filter: grayscale(0.35) brightness(0.72);
}
.door--auto::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(8 9 11 / 0.15) 30%, rgb(8 9 11 / 0.85));
}
.door--auto:hover .door__bg,
.door--auto:focus-visible .door__bg { transform: scale(1); filter: grayscale(0) brightness(0.85); }
.door .go { justify-self: start; }

@media (max-width: 900px) {
  .disciplines { grid-template-columns: 1fr; }
  .disciplines__head { flex-direction: column; align-items: start; }
}

/* Featured project band */
.feature {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 100svh;
  display: grid; align-content: end;
  padding: var(--s-10) var(--gutter) var(--s-9);
  text-decoration: none;
}
.feature__img {
  position: absolute; inset: -10% 0; z-index: -2;
  width: 100%; height: 120%; object-fit: cover; object-position: 60% 50%;
}
.feature::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(8 9 11 / 0.78) 0%, rgb(8 9 11 / 0.15) 60%),
              linear-gradient(0deg, rgb(8 9 11 / 0.7), transparent 45%);
}
.feature__inner { display: grid; gap: var(--s-5); max-width: 760px; }
.feature__title { font-size: var(--step-5); }
.feature__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); color: var(--text-2); }

/* Profile */
.profile {
  display: grid; gap: var(--s-8);
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: center;
}
.profile__img {
  position: relative; aspect-ratio: 3 / 4; justify-self: center;
  width: min(100%, calc(82svh * 0.75));
  mask-image: linear-gradient(180deg, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.profile__img img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; }
.profile__body { display: grid; gap: var(--s-6); }
.profile__body h2 { font-size: var(--step-4); }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--hairline-soft);
}
.facts > div { padding: var(--s-5) var(--s-5) var(--s-5) 0; border-bottom: 1px solid var(--hairline-soft); }
.facts dt { font-size: var(--step--1); color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }
.facts dd { margin-top: var(--s-2); font-weight: 500; }
@media (max-width: 900px) {
  .profile { grid-template-columns: 1fr; }
  .profile__img { width: min(100%, 420px); }
}

/* ==========================================================================
   AUTOMOTIVE INDEX — the strips
   ========================================================================== */
.index-page main {
  padding-top: var(--bar-h);
  display: flex; flex-direction: column;
  height: 100svh; min-height: 640px;
}
.index-head {
  display: flex; justify-content: space-between; align-items: end; gap: var(--s-6);
  padding: var(--s-6) var(--gutter) var(--s-5);
}
.index-head h1 { font-size: var(--step-3); }
.index-head p { color: var(--text-2); max-width: 44ch; }

.strips {
  display: flex; gap: clamp(6px, 0.8vw, 30px);
  flex: 1; min-height: 0;
  padding-inline: 0;
}
.strip {
  --grow: 1;
  position: relative; flex: var(--grow) 1 0; min-width: 0;
  overflow: hidden; isolation: isolate;
  container-type: inline-size;
  background: var(--graphite-900);
  transition: flex-grow var(--t-slow) var(--ease-out);
}
.strip:first-child { border-radius: 0 var(--radius) var(--radius) 0; }
.strip:last-child { border-radius: var(--radius) 0 0 var(--radius); }
.strip:not(:first-child):not(:last-child) { border-radius: var(--radius); }
.strip__link, .strip__inner {
  position: absolute; inset: 0;
  display: grid; grid-template-rows: auto auto 1fr auto;
  padding: var(--s-5) var(--s-4);
  text-decoration: none; text-align: center;
}
.strip__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) brightness(0.55) contrast(1.05);
  transform: scale(1.08);
  transition: filter var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.strip::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgb(8 9 11 / 0.65) 0%, transparent 30%, transparent 60%, rgb(8 9 11 / 0.8) 100%);
}
.strip__name, .strip__group {
  font-size: clamp(10px, 8.5cqi, 14px); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip__name::before { content: "// "; }
.strip__no {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.5rem, 34cqi, 6rem); line-height: 1.1; margin-top: var(--s-2);
}
.strip--soon .strip__no { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.strip__group::before { content: "// "; }
.strip__group--rule { align-self: end; height: 1px; background: var(--hairline); margin: 0 calc(var(--s-4) * -1) 0.6em; }
.strip__group--rule::before { content: none; }
.strip__state {
  font-size: var(--step--1); color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase;
  align-self: end; margin-bottom: var(--s-4);
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.strip__cta {
  justify-self: center; align-self: end; margin-bottom: var(--s-4);
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border: 1px solid var(--text); border-radius: 999px;
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), background-color var(--t-fast), color var(--t-fast);
}
.strip__link:hover .strip__cta { background: var(--text); color: var(--graphite-950); }

@media (hover: hover) and (min-width: 761px) {
  .strips:hover .strip, .strips:focus-within .strip { --grow: 0.75; }
  .strips .strip:hover, .strips .strip:focus-within { --grow: 3.4; }
  .strip:hover .strip__img, .strip:focus-within .strip__img { filter: grayscale(0) brightness(0.9); transform: scale(1); }
  .strip:hover .strip__state, .strip:focus-within .strip__state,
  .strip:hover .strip__cta, .strip:focus-within .strip__cta { opacity: 1; transform: none; transition-delay: 200ms; }
}
.strip--live { --grow: 1.6; }
.strip--live .strip__img { filter: grayscale(0.2) brightness(0.75); }

@media (max-width: 760px) {
  .index-head { flex-direction: column; align-items: start; }
  .strips { flex-direction: column; height: auto; gap: 6px; padding-inline: var(--gutter); }
  .strip { flex: none; height: 132px; border-radius: var(--radius) !important; }
  .strip--live { height: 300px; }
  .index-page main { height: auto; min-height: 0; }
  .strip { container-type: normal; }
  .strip__name, .strip__group { font-size: var(--step--1); }
  .strip__link, .strip__inner {
    grid-template-columns: 7.25rem 1fr; grid-template-rows: auto 1fr auto; column-gap: var(--s-3);
    text-align: left; padding: var(--s-4);
  }
  .strip__no { grid-row: 1 / 4; grid-column: 1; align-self: center; margin: 0; font-size: 2.6rem; }
  .strip__group--rule { display: none; }
  .strip__name { grid-column: 2; }
  .strip__group { grid-column: 2; grid-row: 3; justify-self: start; }
  .strip__state, .strip__cta { opacity: 1; transform: none; grid-column: 2; grid-row: 2; align-self: center; justify-self: start; margin: 0; }
  .strip__img { filter: grayscale(0.8) brightness(0.55); transform: none; }
  .strip--live .strip__img { filter: brightness(0.7); }
}

.index-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4);
  padding: var(--s-4) var(--gutter); color: var(--text-2);
}

/* ==========================================================================
   ABOUT / CV
   ========================================================================== */
.about-page main { padding-top: var(--bar-h); }
.cv {
  display: grid; gap: var(--s-5);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr) minmax(0, 1.4fr);
  grid-template-areas:
    "intro skills exp"
    "lang  edu    photo";
  padding: var(--s-7) var(--gutter) var(--s-9);
}
.cv { align-items: start; }
.cv__panel { padding: clamp(var(--s-5), 2.4vw, var(--s-8)); min-width: 0; }
.cv__panel h2 { font-size: clamp(1.125rem, 0.8rem + 0.9vw, 1.75rem); margin-bottom: var(--s-6); overflow-wrap: anywhere; }
.cv__intro { grid-area: intro; }
.cv__intro h1 { font-size: clamp(1.25rem, 0.8rem + 1.1vw, 2rem); margin-bottom: var(--s-6); overflow-wrap: anywhere; }
.cv__intro p { color: var(--text-2); line-height: 1.7; letter-spacing: 0.01em; }
.cv__skills { grid-area: skills; }
.cv__exp { grid-area: exp; }
.cv__lang { grid-area: lang; }
.cv__edu { grid-area: edu; }
.cv__photo {
  grid-area: photo; position: relative; min-height: 420px; align-self: stretch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%), linear-gradient(180deg, transparent 0%, #000 22%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 28%), linear-gradient(180deg, transparent 0%, #000 22%, #000 82%, transparent 100%);
  mask-composite: intersect;
}
.cv__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: grayscale(1); }

.skills { columns: 2; column-gap: var(--s-7); }
.skills li { break-inside: avoid; padding-block: var(--s-2); color: var(--text-2); }
.skills li b { color: var(--text); font-weight: 600; }

.rows { display: grid; }
.rows > div {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--s-4);
  padding-block: var(--s-4); border-top: 1px solid var(--hairline-soft);
}
.rows dt { font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.rows dt small { font-weight: 400; color: var(--text-2); font-size: 1em; }
.rows dd { color: var(--text-2); text-transform: uppercase; letter-spacing: 0.02em; }
.rows dd b { color: var(--text); font-weight: 700; display: block; }
.rows--lang > div { grid-template-columns: 1fr auto; }
.rows--lang dd b { display: inline; }

.cv__download { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--s-6); flex-wrap: wrap; align-items: center; padding-top: var(--s-5); border-top: 1px solid var(--hairline-soft); }

@media (max-width: 1100px) {
  .cv { grid-template-columns: 1fr 1fr; grid-template-areas: "intro photo" "skills skills" "exp exp" "edu lang"; }
}
@media (max-width: 700px) {
  .cv { grid-template-columns: 1fr; grid-template-areas: "intro" "photo" "exp" "skills" "edu" "lang"; }
  .skills { columns: 1; }
  .rows > div { grid-template-columns: 1fr; gap: var(--s-1); }
  .cv__photo { min-height: 360px; }
}

/* ==========================================================================
   PROJECT — Skoda Fractalis
   ========================================================================== */
.p-hero {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 100svh;
  display: grid; align-content: end;
  padding: calc(var(--bar-h) + var(--s-7)) var(--gutter) var(--s-8);
  background: #cfd2d5;
  color: var(--graphite-950);
}
.p-hero__img {                    /* render anchored right, its pale concrete fading into the matching ground */
  position: absolute; z-index: -2; right: 0; top: calc(var(--bar-h) + var(--s-6));
  width: min(70vw, 1500px); height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%), linear-gradient(180deg, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%), linear-gradient(180deg, #000 78%, transparent 100%);
  mask-composite: intersect;
}
.p-hero__title { font-size: var(--step-5); }
.p-hero__body { max-width: 640px; min-width: 0; }
.p-hero > * { min-width: 0; }
.p-hero__intro { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
.p-hero__intro .lede { color: var(--graphite-950); font-weight: 500; }
.p-hero .meta { color: var(--graphite-950); border-color: rgb(8 9 11 / 0.3); }
.p-hero .meta dt { color: rgb(8 9 11 / 0.7); }
.p-hero__slugs {
  position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--bar-h) + var(--s-4));
  display: flex; gap: var(--s-7); color: var(--graphite-950);
}
@media (max-width: 900px) {
  .p-hero { padding-top: calc(var(--bar-h) + var(--s-5)); align-content: start; }
  .p-hero__img { position: relative; inset: auto; width: calc(100% + var(--gutter) * 2); max-width: none; margin: var(--s-5) calc(var(--gutter) * -1) var(--s-6); -webkit-mask-image: none; mask-image: none; }
  .p-hero__slugs { position: static; flex-direction: column; gap: var(--s-1); }
}

.meta { color: var(--graphite-950); border-color: rgb(8 9 11 / 0.25); }
.p-hero .meta dt { color: rgb(8 9 11 / 0.62); }
.p-hero__outline {
  position: absolute; left: var(--gutter); right: 40%; bottom: 46%; z-index: -2; opacity: 0.55;
}
@media (max-width: 900px) {
  .p-hero { grid-template-columns: 1fr; align-content: end; }
  .p-hero__img { position: relative; inset: auto; width: 118%; max-width: none; margin: 0 -9% var(--s-6); order: -1; }
  .p-hero__outline { display: none; }
}

.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  border-top: 1px solid var(--hairline); max-width: 760px;
}
.meta > div { padding: var(--s-4) var(--s-4) 0 0; }
.meta dt { font-size: var(--step--1); color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }
.meta dd { margin-top: var(--s-1); font-weight: 500; }

/* Chapter rail: sticky progress index */
.rail {
  position: fixed; z-index: 40; right: var(--gutter); top: 50%; transform: translateY(-50%);
  display: grid; gap: var(--s-3);
  mix-blend-mode: difference;
}
.rail a {
  display: grid; grid-template-columns: auto 22px; align-items: center; gap: var(--s-3);
  justify-items: end;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; color: #fff;
}
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out); }
.rail a i { height: 1px; width: 12px; background: #fff; opacity: 0.6; transition: width var(--t-med) var(--ease-out), opacity var(--t-fast); justify-self: end; }
.rail a:hover span, .rail a:focus-visible span, .rail a[aria-current="true"] span { opacity: 1; transform: none; }
.rail a[aria-current="true"] i { width: 22px; opacity: 1; }
@media (max-width: 1100px) { .rail { display: none; } }

/* Chapters */
.chapter { position: relative; isolation: isolate; padding: var(--s-10) var(--gutter); }
.chapter__head {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr); gap: var(--s-7);
  align-items: end; margin-bottom: var(--s-8);
}
.chapter__head h2 { font-size: var(--step-3); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--hairline); }
@media (max-width: 900px) { .chapter__head { grid-template-columns: 1fr; gap: var(--s-5); } }

/* 01 — overview + theme 01 (fern) */
.ch-fern { background: #000; }
.ch-fern__forest {
  position: absolute; inset: 0 auto 0 0; width: 42%; z-index: -1; overflow: hidden;
}
.ch-fern__forest img { width: 100%; height: 100%; object-fit: cover; }
.ch-fern__forest::before {      /* Figma: #76dc8a in color blend */
  content: ""; position: absolute; inset: 0; background: var(--fern); mix-blend-mode: color; z-index: 1;
}
.ch-fern__forest::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(90deg, transparent 0%, #000 92%), linear-gradient(0deg, #000 0%, transparent 25%);
}
.overview {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr); gap: var(--s-7); align-items: start;
}
.overview__panel {
  position: sticky; top: calc(var(--bar-h) + var(--s-6));
  padding: clamp(var(--s-5), 2.4vw, var(--s-7));
  display: grid; gap: var(--s-5);
  background: rgb(8 9 11 / 0.72);
}
.overview__panel h3 { font-size: var(--step-1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.qa { display: grid; gap: var(--s-4); }
.qa dt { font-weight: 600; color: var(--text); display: inline; }
.qa dd { display: inline; color: #e2e5e9; }
.qa div { line-height: 1.6; }
.overview__work { display: grid; gap: var(--s-6); }
.theme-mark {
  display: flex; align-items: end; gap: var(--s-5); justify-content: space-between;
  padding-top: var(--s-6); border-top: 1px solid var(--hairline);
}
.theme-mark h3 { font-size: var(--step-3); }
.theme-mark img { width: clamp(110px, 13vw, 220px); height: auto; margin-bottom: calc(var(--s-6) * -1); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
@media (max-width: 900px) {
  .overview { grid-template-columns: 1fr; }
  .overview__panel { position: relative; top: 0; }
  .ch-fern__forest { width: 100%; height: 70svh; }
  .ch-fern__forest::after { background: linear-gradient(180deg, transparent 0%, #000 95%); }
  .duo { grid-template-columns: 1fr; }
}

/* 02 — barchetta (wine) */
.ch-wine { background: linear-gradient(180deg, var(--wine) 0%, var(--wine-to) 100%); }
.ideas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.ideas figure { margin: 0; }
.ideas figure .media { background: transparent; }
.sketch-strip {
  margin: var(--s-8) calc(var(--gutter) * -1);
  background: #000;
  padding: var(--s-6) var(--gutter);
  display: grid; grid-template-columns: 1fr 1.1fr 1.15fr; gap: var(--s-5); align-items: center;
  overflow: hidden;
}
.sketch-strip img { width: 100%; height: auto; mix-blend-mode: screen; }
.sketch-strip img:last-child { transform: rotate(2.36deg); }
@media (max-width: 700px) { .sketch-strip { grid-template-columns: 1fr; } }
.asym {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s-8); align-items: center;
}
.asym__text { display: grid; gap: var(--s-5); }
.asym__text img { width: min(100%, 420px); height: auto; opacity: 0.9; }
.asym__visual { position: relative; }
.asym__persona {
  position: absolute; left: -12%; bottom: -6%; width: 34%; z-index: 2;
  filter: drop-shadow(0 20px 30px rgb(0 0 0 / 0.35));
}
@media (max-width: 900px) {
  .ideas { grid-template-columns: 1fr 1fr; }
  .ideas figure:last-child { grid-column: 1 / -1; }
  .asym { grid-template-columns: 1fr; }
  .asym__persona { position: relative; left: 0; bottom: 0; width: 46%; margin-top: calc(var(--s-8) * -1); }
}

/* 03 — features (fjord): pinned horizontal gallery */
.ch-fjord { background: linear-gradient(180deg, var(--fjord) 0%, var(--fjord-to) 100%); padding-inline: 0; }
.ch-fjord .chapter__head { padding-inline: var(--gutter); }
.hscroll { position: relative; }
.hscroll__track {
  display: flex; gap: var(--s-5);
  padding-inline: var(--gutter);
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll__track::-webkit-scrollbar { display: none; }
.hscroll__item {
  flex: 0 0 min(78vw, 70svh); aspect-ratio: 1; scroll-snap-align: center;
  margin: 0; border-radius: var(--radius); overflow: hidden;
}
.hscroll__item img { width: 100%; height: 100%; object-fit: cover; }
.hscroll__hint { padding: var(--s-5) var(--gutter) 0; color: rgb(8 9 11 / 0.75); font-weight: 500; }
/* Pinned mode — set by JS on wide screens with motion allowed */
.hscroll.is-pinned { height: var(--pin-h, 300vh); }
.hscroll.is-pinned .hscroll__sticky {
  position: sticky; top: var(--bar-h); height: calc(100svh - var(--bar-h));
  display: flex; flex-direction: column; justify-content: center; overflow: hidden;
}
.hscroll.is-pinned .hscroll__track { overflow: visible; scroll-snap-type: none; will-change: transform; }
.hscroll.is-pinned .hscroll__hint { display: none; }
.hscroll__progress {
  margin: var(--s-6) var(--gutter) 0; height: 1px; background: rgb(255 255 255 / 0.35); position: relative;
}
.hscroll__progress i { position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); }

/* 04 — final design (steel) */
.ch-steel { background: linear-gradient(180deg, var(--steel) 0%, var(--steel-to) 100%); color: var(--graphite-950); }
.ch-steel .chapter__head h2, .ch-steel .tag { color: var(--graphite-950); }
.ch-steel .tags { border-color: rgb(8 9 11 / 0.3); }
.final { display: grid; gap: var(--s-5); grid-template-columns: 1fr 1fr; align-items: start; }
.final__top { grid-column: 1 / -1; }
.final__hero, .final__rear { min-width: 0; }
@media (max-width: 900px) { .final { grid-template-columns: 1fr; } }

/* 05 — model (mist) */
.ch-mist { background: linear-gradient(180deg, var(--mist) 0%, var(--mist-to) 100%); color: var(--graphite-950); }
.ch-mist .prose, .ch-mist .tag { color: var(--graphite-950); }
.model { display: grid; gap: var(--s-5); grid-template-columns: 1fr 1fr; align-items: start; }
.model__side { grid-column: 1 / -1; }
.model__side .media, .model__front .media, .model__quarter .media { background: #f1f1f1; }
.model__clay {
  grid-column: 1 / -1; display: grid; gap: var(--s-4); align-items: end;
  grid-template-columns: 0.56fr 0.56fr 1.78fr 1.33fr;   /* proportional to each photo's ratio → equal heights */
}
.model__label { grid-column: 1 / -1; margin-top: var(--s-6); }
@media (max-width: 900px) { .model { grid-template-columns: 1fr; } .model__clay { grid-template-columns: 1fr 1fr; align-items: start; } }

/* 06 — closing (desert) */
.closing {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 110svh; display: grid; align-content: end;
  padding: var(--s-10) var(--gutter) var(--s-8);
}
.closing__img { position: absolute; inset: -12% 0; z-index: -2; width: 100%; height: 124%; object-fit: cover; object-position: 50% 60%; }
.closing::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgb(8 9 11 / 0.85), transparent 55%); }
.closing__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-6);
  align-items: end; padding-top: var(--s-6); border-top: 1px solid var(--hairline);
}
.closing__grid dt { font-size: var(--step--1); color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; }
.closing__grid dd { font-weight: 500; margin-top: var(--s-1); }

.next {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-6); align-items: center;
  padding: var(--s-8) var(--gutter);
  border-bottom: 1px solid var(--hairline-soft);
  text-decoration: none;
}
.next h2 { font-size: var(--step-4); transition: transform var(--t-med) var(--ease-out); }
.next:hover h2 { transform: translateX(12px); }

/* ==========================================================================
   MOTION
   Content is visible by default. JS adds .js + arms reveals; reduced motion
   never arms them.
   ========================================================================== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 420ms var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 620ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-1.5%); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(2%); } }

.js.motion [data-reveal="wipe"] {
  clip-path: inset(14% 0 0 0 round var(--radius));
  transition: clip-path var(--t-slow) var(--ease-out);
}
.js.motion [data-reveal="wipe"] img { transform: scale(1.12); transition: transform 1600ms var(--ease-out); }
.js.motion [data-reveal="wipe"].is-in { clip-path: inset(0 0 0 0 round var(--radius)); }
.js.motion [data-reveal="wipe"].is-in img { transform: scale(1); }

.js.motion [data-reveal="rise"] {
  transform: translateY(28px);
  transition: transform 900ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 80ms);
}
.js.motion [data-reveal="rise"].is-in { transform: none; }


.js.motion .cover__img { animation: settle 2200ms var(--ease-out) both; }
@keyframes settle { from { scale: 1.12; } to { scale: 1; } }
.js.motion .cover__title > * { animation: lift 1200ms var(--ease-out) both; }
.js.motion .cover__title > *:nth-child(2) { animation-delay: 140ms; }
.js.motion .cover__title > *:nth-child(3) { animation-delay: 280ms; }
@keyframes lift { from { transform: translateY(32px); } }

.js.motion .strip__img { animation: strip-in 1400ms var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes strip-in { from { translate: 0 6%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
