/* =========================================================
   INBAL KELLER — PORTFOLIO
   Shared styles for every page (mobile-first).
   Source: Figma "portfolio-claude" (exported frames, 1512px wide).
   Desktop (>= 900px) keeps the Figma proportions:
   sidebar 525 / content 987 (of 1512).
   ========================================================= */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 700; font-style: italic; font-display: swap; src: url("fonts/ibm-plex-mono-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); }

/* ---------- Design tokens ---------- */
:root {
  --blue: #0004FF;
  --bg: #FCF8FF;            /* page background (home + project pages) */
  --bg-soft: #FCF8FF;       /* one white for the whole site (same as --bg) */
  --bg-dia: #FCF8FF;
  --white: #FCF8FF;          /* one white everywhere */

  --font-plex: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* ---- Type scale: exactly three sizes, used everywhere ----
     S = body copy, list items, captions
     M = navigation, sub-headings, buttons, labels
     L = section titles                                         */
  --fs-s: clamp(13px, 0.4vw + 9px, 15px);
  --fs-m: clamp(15px, 0.45vw + 11px, 18px);
  --fs-l: clamp(20px, 0.8vw + 12px, 26px);
  --lh-s: 1.6;
  --lh-m: 1.35;
  --lh-l: 1.2;

  /* ---- Navigation: one system for every page ----
     primary rows (Inbal keller / projects / playground) = M text
     project rows (the four projects)                   = S text */
  /* golden ratio: a main tab is φ (1.618) × a project row */
  --nav-sub-h: clamp(30px, 4.2vh, 40px);
  --nav-h: calc(var(--nav-sub-h) * 1.618);

  /* theme (overridden per page) */
  --c: var(--blue);          /* text, borders, "projects" fill */
  --c-active: #E6E6FF;       /* current project row */
  --c-on: var(--bg);         /* text on filled boxes */
  --font: var(--font-plex);

  --mobile-bar-h: 64px;
  /* one left edge for every nav label, the welcome text and the descriptions */
  --indent: clamp(20px, 2.5vw, 40px);
}

/* Per-page themes (colors from Figma) */
.theme-neighborhology { --c: #E62E36; --c-active: #FFDCE9; }
.theme-kabai          { --c: #0E5140; --c-active: #3AD5AE; }
.theme-missp          { --c: #000000; --c-active: #CECFDE; }
.theme-dia            { --c: #8365AE; --c-active: #E6D5FF; }
.theme-about,
.theme-playground     { --bg: var(--bg-soft); }

/* ---------- Page transitions (cross-document View Transitions) ----------
   Every page opts in, so moving between pages on the same site cross-fades
   instead of flashing white. Browsers without support simply navigate. */
@view-transition { navigation: auto; }

/* Page change ("smart animate"): the old page closes — its tabs lift up and fade,
   bottom tab first — and then the new page opens — everything drops straight down
   from the top, tabs one after another, top tab first. Straight moves only. */
:root { --vt-ease: cubic-bezier(0.25, 1, 0.5, 1); }
::view-transition-old(root) { animation: vt-close 0.38s cubic-bezier(0.5, 0, 0.75, 0) both; }
::view-transition-new(root) { animation: vt-open 0.7s var(--vt-ease) 0.22s both; }
@media (min-width: 900px) {
  .side__nav > :nth-child(1), .snav > :nth-child(1) { view-transition-name: tab-1; }
  .side__nav > :nth-child(2), .snav > :nth-child(2) { view-transition-name: tab-2; }
  .side__nav > :nth-child(3), .snav > :nth-child(3) { view-transition-name: tab-3; }
  .snav > :nth-child(4) { view-transition-name: tab-4; }
  .snav > :nth-child(5) { view-transition-name: tab-5; }
  .snav > :nth-child(6) { view-transition-name: tab-6; }
  .snav > :nth-child(7) { view-transition-name: tab-7; }
}
/* tabs never stretch or slide sideways between pages */
::view-transition-group(tab-1), ::view-transition-group(tab-2), ::view-transition-group(tab-3), ::view-transition-group(tab-4), ::view-transition-group(tab-5), ::view-transition-group(tab-6), ::view-transition-group(tab-7) { animation: none; }
/* closing: the old tabs stay in place, strokes and all, until the new tab
   has landed on top of them, so the lines between tabs never disappear */
::view-transition-old(tab-1), ::view-transition-old(tab-2), ::view-transition-old(tab-3), ::view-transition-old(tab-4), ::view-transition-old(tab-5), ::view-transition-old(tab-6), ::view-transition-old(tab-7) { animation: vt-hold 1.3s linear both; }
/* opening: tabs drop in from the top, top tab first */
::view-transition-new(tab-1), ::view-transition-new(tab-2), ::view-transition-new(tab-3), ::view-transition-new(tab-4), ::view-transition-new(tab-5), ::view-transition-new(tab-6), ::view-transition-new(tab-7) { animation: vt-open 0.7s var(--vt-ease) both; }
::view-transition-new(tab-1) { animation-delay: 0.26s; }
::view-transition-new(tab-2) { animation-delay: 0.32s; }
::view-transition-new(tab-3) { animation-delay: 0.38s; }
::view-transition-new(tab-4) { animation-delay: 0.43s; }
::view-transition-new(tab-5) { animation-delay: 0.47s; }
::view-transition-new(tab-6) { animation-delay: 0.51s; }
::view-transition-new(tab-7) { animation-delay: 0.55s; }
@keyframes vt-close { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-36px); } }
@keyframes vt-open  { from { opacity: 0; transform: translateY(-48px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-hold { 0%, 99% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

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

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--c);
  font-family: var(--font);
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
strong, b { font-weight: 700; }
em { font-style: italic; }

/* Type roles */
.t-s { font-size: var(--fs-s); line-height: var(--lh-s); }
.t-m { font-size: var(--fs-m); line-height: var(--lh-m); }
.t-l { font-size: var(--fs-l); line-height: var(--lh-l); font-weight: 500; letter-spacing: -0.01em; }

:focus-visible { outline: 2px solid var(--c); outline-offset: -4px; }

body.is-loading { overflow: hidden; }

/* =========================================================
   LOADER (home only — first visit in a session)
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader__img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader.crop { position: fixed; }
.loader-seen .loader { display: none; }
/* Phone: zoom the loader onto the pot's dark opening (no face) */
@media (max-width: 899px) {
  .loader.crop { --w: 106vh !important; --fx: -45% !important; --fy: -73.5% !important; background-size: auto 189vh; background-position: 45% 94%; }  /* shows the hands and the blue writing, never the face */
}
.loader-seen body.is-loading { overflow: auto; }

/* =========================================================
   HOME — nav building blocks
   ========================================================= */
.nav-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0 var(--indent);
  background: var(--bg);
  color: var(--c);
  border-bottom: 1px solid var(--c);
  text-align: left;
  transition: background-color 0.2s ease;
  font-size: var(--fs-m);
  line-height: var(--lh-m);
}
.nav-box--active { background: var(--c); color: var(--c-on); }

.nav-box { height: var(--nav-h); flex: none; }

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  height: var(--nav-sub-h);
  padding: 0 var(--indent);
  background: var(--bg);
  color: var(--c);
  border-bottom: 1px solid var(--c);
  font-size: var(--fs-s);
  line-height: 1.35;
  transition: background-color 0.2s ease;
}
.nav-item:hover, .nav-item.is-hover { background: #E6E6FF; }

/* ---------- Home: mobile bar + hamburger ---------- */
.mobile-bar {
  font-size: var(--fs-m);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--mobile-bar-h);
  padding: 0 var(--indent);
  background: var(--bg);
  border-bottom: 1px solid var(--c);
}
.menu-toggle { position: relative; width: 32px; height: 24px; }
.menu-toggle__line {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--c);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-toggle__line:nth-child(1) { top: 0; }
.menu-toggle__line:nth-child(2) { top: 11px; }
.menu-toggle__line:nth-child(3) { top: 22px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: var(--mobile-bar-h); left: 0; right: 0; bottom: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.35s ease, visibility 0.35s ease;
}
.mobile-menu.is-open { transform: translateY(0); visibility: visible; }
.mobile-menu .nav-box, .mobile-menu .nav-item { flex: none; }
.mobile-menu [aria-current="page"] { background: var(--c-active); }
.mobile-bar__name { font-size: var(--fs-m); }
/* inner pages on mobile: the side nav moves into the hamburger */
@media (max-width: 899px) {
  .sidebar .snav { display: none; }
}
body.menu-open { overflow: hidden; }

/* ---------- Home: mobile stack ---------- */
.side__video { width: 100%; aspect-ratio: 404 / 421; }

/* Zoomed / cropped video, positioned like the Figma frame.
   --w = video width relative to the box, --fx/--fy = focal point */
.crop { position: relative; overflow: hidden; background: #000 center / cover no-repeat; }
.crop > video {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--w, 100%) !important;
  height: auto !important;
  max-width: none;
  transform: translate(var(--fx, -50%), var(--fy, -50%));
}
/* Pottery video: anchored to the bottom so the hands and writing are never cut */
.crop--bottom > video {
  top: auto !important;
  bottom: 0;
  transform: translateX(-50%) !important;
  aspect-ratio: 720 / 1280;   /* the pottery video is portrait */
}
.side__nav { display: none; }
.project-list { display: none; }
.welcome { padding: 40px; border-bottom: 1px solid var(--c); }

.tiles__row { display: flex; flex-direction: column; }
.tile { display: block; overflow: hidden; }
.tile { min-width: 0; min-height: 0; }
.tile img, .tile video { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tile--missp video { object-position: left center; }

/* Tile hover (Figma prototype): tile fades out, blue label appears */
.tile { position: relative; }
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(252, 248, 255, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tile__label {
  /* Figma: IBM Plex Mono bold italic, centred on each tile */
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  color: var(--blue);
  font-weight: 700;
  font-style: italic;
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tile:hover::after, .tile:focus-visible::after,
.tile:hover .tile__label, .tile:focus-visible .tile__label { opacity: 1; }
@media (max-width: 899px) {
  /* phones have no hover: keep the label visible on a light band */
  .tile__label { opacity: 1; }
  .tile::after { opacity: 1; }
}
.tile--neighborhology { aspect-ratio: 437 / 519; }
.tile--missp          { aspect-ratio: 671 / 519; }
.tile--kabai          { aspect-ratio: 641 / 461; }
.tile--dia            { aspect-ratio: 467 / 461; background: var(--bg-dia); }

/* =========================================================
   INNER PAGES — sidebar (mobile first)
   ========================================================= */
.layout { display: flex; flex-direction: column; }

.sidebar { container-type: inline-size; border-bottom: 1px solid var(--c); }

.snav { display: flex; flex-direction: column; }
.snav a, .snav span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 0 var(--indent);
  border-bottom: 1px solid var(--c);
  background: var(--bg);
  color: var(--c);
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  transition: background-color 0.2s ease;
}
.snav a, .snav span { height: var(--nav-h); flex: none; }
.snav__group   { background: var(--c) !important; color: var(--c-on) !important; }
.snav a.snav__item, .snav span.snav__item { height: auto; min-height: var(--nav-sub-h); padding-top: 4px; padding-bottom: 4px; font-size: var(--fs-s); line-height: 1.3; }
.snav__item[aria-current="page"] { background: var(--c-active) !important; }
.snav a:hover { background: var(--c-active); }

.desc { padding: 32px var(--indent) 40px; max-width: 44em; }
.desc h2 {
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  font-weight: 500;
}
.desc p {
  font-size: var(--fs-s);
  line-height: var(--lh-s);
  font-weight: 400;
  margin-top: 0.4em;
}
.desc p + h2 { margin-top: 1.6em; }
/* text re-flows naturally instead of hard Figma line breaks */
.desc br, .about-text br, .canvas .t-b br, .canvas .t-r br { display: none; }

.content { container-type: inline-size; min-width: 0; }

/* Content building blocks */
.block-img { display: block; width: 100%; height: auto; }
.block-video { position: relative; width: 100%; overflow: hidden; background: transparent; }
.block-video video { width: 100%; height: 100%; object-fit: cover; }

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  background: var(--cta-bg, var(--c));
  color: var(--bg);
  font-family: var(--font-plex);
  font-size: var(--fs-m);
  line-height: var(--lh-m);
  font-weight: 500;
  transition: opacity 0.2s ease;
}
.cta:hover { opacity: 0.9; }

/* Free-form section (absolutely placed on desktop, stacked on mobile) */
.canvas { position: relative; padding: 32px 20px; }
.canvas > * + * { margin-top: 24px; }
.canvas img { width: 100%; height: auto; }
.canvas .t-h { font-size: var(--fs-l); line-height: var(--lh-l); font-weight: 500; letter-spacing: -0.01em; }
.canvas .t-b, .canvas .t-r { font-size: var(--fs-s); line-height: var(--lh-s); font-weight: 400; }
.canvas .t-h + .t-b, .canvas .t-h + .t-r { margin-top: 10px; }
.canvas .label { font-size: var(--fs-m); line-height: var(--lh-m); font-weight: 500; }

/* Miss P black section */
.missp-black { background: #000; color: #fff; font-family: var(--font-plex); }

/* Kabai white section */
.fbx-section { background: var(--white); padding: 32px var(--indent) 40px; }
.fbx-section .label { font-size: var(--fs-m); line-height: var(--lh-m); font-weight: 500; margin-bottom: 16px; }
/* loose, staggered layout: 4 on top, 3 below shifted half a step, alternating heights */
.fbx-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; }
.fbx { grid-column: span 2; }
.fbx:nth-child(5) { grid-column: 2 / span 2; }
.fbx:nth-child(even) { transform: translateY(9%); }
.fbx:nth-child(n+5) { margin-top: -4%; }
@media (max-width: 899px) { .fbx-row { grid-template-columns: repeat(4, 1fr); } .fbx:nth-child(5) { grid-column: span 2; } .fbx:nth-child(7) { grid-column: 2 / span 2; } .fbx:nth-child(n+5) { margin-top: 0; } }
.fbx { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.fbx model-viewer {
  flex: 1 1 auto; width: 100%; aspect-ratio: 1 / 1; height: auto; min-height: 0; display: block;
  background: transparent; border: 0;
  --poster-color: transparent; --progress-bar-color: transparent; cursor: grab;
  clip-path: inset(0 0 2px 0);   /* hide a 1px loading line at the bottom edge */
}
.fbx model-viewer:active { cursor: grabbing; }
.fbx figcaption { margin-top: 8px; font-size: var(--fs-s); }
.kabai-white { background: var(--white); min-height: 240px; }

/* Playground: panels stack — each sticks, the next scrolls over it */
.pg-panel { position: relative; overflow: hidden; background: var(--bg); }
.pg-panel > img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* every item sticks; the next one slides up over it (desktop + mobile) */
.pg-panel { position: sticky; top: var(--stick, 0px); box-shadow: 0 -12px 30px rgba(0,0,0,0.18); }
/* Playground media stack */
.pg-stack { position: relative; }
.pg-stack img { width: 100%; height: auto; }
.pg-video { position: absolute; overflow: hidden; }
.pg-video video { width: 100%; height: 100%; object-fit: cover; }
.pg-video--interceptor { left: calc(78 / 986 * 100%); top: calc(812 / 3485 * 100%); width: calc(848 / 986 * 100%); height: calc(478 / 3485 * 100%); }
.pg-video--stutter     { left: calc(114 / 986 * 100%); top: calc(1421 / 3485 * 100%); width: calc(776 / 986 * 100%); height: calc(435 / 3485 * 100%); }


/* Playground sidebar */
.pg-side__video { width: 100%; aspect-ratio: 524 / 384; border-bottom: 1px solid var(--c); }
.theme-playground .snav a, .theme-playground .snav span { background: var(--white); }
.theme-playground .snav__current { background: var(--c) !important; color: var(--c-on) !important; }

/* About */
.about-text { padding: 28px var(--indent); font-size: var(--fs-s); line-height: var(--lh-s); }
.about-text p + p { margin-top: 1em; }
.about { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px 40px; }
.about-girl { width: 90px; }
.about .ph img { width: 100%; height: auto; }
.snav__current { background: var(--c) !important; color: var(--c-on) !important; }

/* Mobile: comfortable reading sizes */
@media (max-width: 899px) {
  :root { --fs-s: 15px; --fs-m: 17px; --fs-l: 22px; --nav-sub-h: 40px; --nav-h: calc(40px * 1.618); }
  .canvas { aspect-ratio: auto !important; }
  .canvas > * { width: auto !important; }
  .canvas img { width: 100% !important; }
  .cta { aspect-ratio: auto !important; }
}

/* =========================================================
   DESKTOP (>= 900px) — Figma 1512 wide, scaled proportionally
   ========================================================= */
@media (min-width: 900px) {

  /* ---------- Home ---------- */
  .mobile-bar, .mobile-menu { display: none; }

  .home {
    display: flex; height: 100vh; overflow: hidden;
  }


  .side {
    flex: 0 0 calc(404 / 1512 * 100%);   /* Figma home: 404 of 1512 */
    display: grid;
    /* Figma reference: video 288 · rows 103 / 92 / 94 · text area 373 (of 950) */
    grid-template-rows: minmax(0, 288fr) minmax(0, 103fr) minmax(0, 92fr) minmax(0, 94fr) minmax(0, 373fr);
    height: 100%;
    border-right: 1px solid var(--c);
  }
  .side__video { width: 100%; height: 100%; aspect-ratio: auto; min-height: 0; }
  .side__nav { display: contents; }
  .side__nav .nav-box { height: auto; }
  .side__nav .nav-box--first { border-top: 1px solid var(--c); }
  .side__slot { position: relative; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

  /* Project list: hidden until hovered/clicked, then grows open ("smart animate")
     and pushes the welcome text down — as in Figma "home open bar". */
  .project-list {
    display: grid;
    --row: max(var(--nav-sub-h), 5.1vh);   /* Figma open bar: ~44 of 856 */
    grid-template-rows: repeat(4, auto);
    flex: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.34, 1.25, 0.64, 1);
  }
  .project-list.is-open { max-height: calc(var(--row) * 6); }
  .project-list .nav-item { height: auto; min-height: var(--row); padding-top: 4px; padding-bottom: 4px; line-height: 1.3; }
  .project-list li {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .project-list.is-open li { opacity: 1; transform: none; }
  .project-list.is-open li:nth-child(2) { transition-delay: 0.05s; }
  .project-list.is-open li:nth-child(3) { transition-delay: 0.1s; }
  .project-list.is-open li:nth-child(4) { transition-delay: 0.15s; }
  .project-list.is-open + .welcome { margin-top: 3vh; }

  .welcome {
    /* Figma reference: left-aligned, same size as the nav, ~63/950 below the nav */
    position: static;
    margin: 6.6vh 16px 0 var(--indent);
    transition: margin-top 0.55s cubic-bezier(0.34, 1.25, 0.64, 1);
    padding: 0; border: 0;
    text-align: left;
    font-size: var(--fs-m);
    line-height: 1.3;
  }
  .project-list li { display: flex; }


  .tiles { flex: 1 1 auto; display: flex; flex-direction: column; height: 100%; }
  .tiles__row { flex-direction: row; min-height: 0; }
  .tiles__row--top    { flex: 519 1 0; }
  .tiles__row--bottom { flex: 461 1 0; }
  .tile { aspect-ratio: auto; height: 100%; }
  .tile--neighborhology { flex: 437 1 0; }
  .tile--missp          { flex: 671 1 0; }
  .tile--kabai          { flex: 641 1 0; }
  .tile--dia            { flex: 467 1 0; }

  /* ---------- Inner pages ---------- */
  /* 1u = 1px of the 1512px Figma frame */
  .layout {
    --u: calc(100vw / 1512);
    flex-direction: row;
    align-items: flex-start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 calc(525 / 1512 * 100%);
    height: 100vh;
    overflow: hidden;           /* nav stays fixed on the left, never scrolls */
    border-bottom: 0;
    border-right: 1px solid var(--c);
  }

  .content { flex: 1 1 0; }

  /* Figma nav: name 143 · projects 87 · items 36 · playground 48 */
  .snav { border-top: 1px solid var(--c); }
  /* rows follow the Figma proportions, but shrink on short screens
     so the whole sidebar always fits without scrolling */


  .desc { padding: min(calc(var(--u) * var(--pt, 42)), 3vh) calc(var(--u) * 20) 8px var(--indent); }
  .desc p + h2 { margin-top: min(1.6em, 2vh); }
  .desc { max-width: none; }

  .cta { min-height: 0; }

  /* Free-form canvas: children placed with design coordinates */
  .canvas { padding: 0; }
  .canvas > * + * { margin-top: 0; }
  .canvas > * { position: absolute; }

  .kabai-white { min-height: 0; }

  /* Playground sidebar: video 384 · rows 178 / 232 / 178 */
  .theme-playground .snav { border-top: 0; }
  /* video fills the column above the nav, like Home */
  .theme-playground .sidebar { display: flex; flex-direction: column; }
  .theme-playground .pg-side__video { aspect-ratio: auto; flex: 0 1 calc(var(--u) * 384); min-height: 72px; }
  .theme-playground .snav { flex: none; border-bottom: 1px solid var(--c); }
  .theme-playground .snav a:last-child, .theme-playground .snav span:last-child { border-bottom: 0; }

  /* About: same sidebar as Playground (video, nav, text);
     photos scroll and stick near the top, stacking (Figma prototype).
     Content = 2580 design px tall. */
  .theme-about .sidebar { display: flex; flex-direction: column; }
  /* Figma: video 420px tall (of 1512); shrinks on short screens so the text always fits */
  .theme-about .pg-side__video { aspect-ratio: auto; flex: 0 1 calc(var(--u) * 420); min-height: 72px; }
  .theme-about .snav, .theme-about .about-text { flex: none; }
  .theme-about .about-text { padding: min(calc(var(--u) * 40), 3vh) 20px 16px var(--indent); }
  .about { display: block; position: relative; padding: 0;
    /* tall enough for the last (baby) photo to scroll all the way up and stick at the top too */
    height: max(calc(var(--u) * 3020), calc(var(--u) * 2273 + 100vh)); }
  .about-girl { position: absolute; left: calc(var(--u) * 32); top: calc(var(--u) * 77); width: calc(var(--u) * 121); }
  .about .ph {
    position: absolute;
    top: calc(var(--u) * var(--top));
    bottom: 0;
    left: calc(var(--u) * var(--left));
    width: calc(var(--u) * var(--w));
  }
  .about .ph img { position: sticky; top: calc(var(--u) * 10); width: 100%; }
}

/* ---------- Playground layers (Figma: each image is its own layer) ----------
   Positions are Figma px inside the 987px-wide content column; --pu scales them.
   Three sections (flowers, dog, frame of photos): each one stops when its bottom
   reaches the bottom of the screen, and the next section slides up over it. */
.pg-layers { position: relative; container-type: inline-size; --pg-top: var(--mobile-bar-h); }
.pg-layers > * { --pu: calc(100cqw / 987); }
.pg-group { background: var(--bg); position: relative; height: calc(var(--gh) * var(--pu)); overflow-x: clip; }  /* scrolls normally, like the Figma prototype */
.pg-group:first-child { overflow: clip; }
.pgl { position: absolute; left: calc(var(--x) * var(--pu)); top: calc(var(--y) * var(--pu)); width: calc(var(--w) * var(--pu)); height: calc(var(--h) * var(--pu)); }
.pgl__in { display: block; width: 100%; height: 100%; max-width: none; }
img.pgl__in { object-fit: cover; }
.pgl__video { overflow: hidden; }
.pgl__video video { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .pg-layers { --pg-top: 0px; } }

/* DIA: micro animations play on top of the page image, in their Figma spots */
.dia-anim { position: relative; }
.dia-anim > img { display: block; width: 100%; height: auto; }
.dia-anim__v { position: absolute; object-fit: cover; display: block; }

/* ---------- One nav for every page (desktop) ----------
   Golden ratio: the left column is 1 : 1.618 to the content (38.2% of the width),
   and the pottery video above the nav is 38.2% of the screen height.
   Every tab has the same height on every page. */
@media (min-width: 900px) {
  :root { --side-w: calc(100% / 2.618); --vid-h: calc(100vh / 2.618); }
  .side, .sidebar { flex: 0 0 var(--side-w) !important; }
  .side { display: flex !important; flex-direction: column; }
  .side__video { flex: 0 0 var(--vid-h) !important; height: var(--vid-h) !important; }
  .side__nav .nav-box { height: var(--nav-h) !important; flex: none; }
  .side__slot { flex: 1 1 0; }
  .theme-playground .pg-side__video, .theme-about .pg-side__video { flex: 0 0 var(--vid-h) !important; height: var(--vid-h); min-height: 0; }
  .snav a, .snav span { height: var(--nav-h); }
  .snav a.snav__item, .snav span.snav__item { height: var(--nav-sub-h); min-height: 0; padding-top: 0; padding-bottom: 0; }
  .project-list { --row: var(--nav-sub-h); }
  .project-list .nav-item { height: var(--nav-sub-h); min-height: 0; padding-top: 0; padding-bottom: 0; }
}

/* Playground (Figma): the three tabs share all the space under the video */
@media (min-width: 900px) {
  .theme-playground .snav { flex: 1 1 auto; display: flex; flex-direction: column; border-bottom: 0; }
  .theme-playground .snav > a, .theme-playground .snav > span { flex: 1 1 0; height: auto; min-height: var(--nav-h); }
  .theme-playground .snav > :last-child { border-bottom: 0; }
}
