/* Tavor Digital, portfolio v2.0
   A dark ground and the work on it. The pictures are drawn by the WebGL canvas; everything you read is DOM.
   Radii: pictures 6px (3px on the small spiral tiles), controls are pills. */

:root {
  color-scheme: dark;
  --ground: #0a0b0d;
  --ground-2: #121419;
  --ink: #eceae4;
  --ink-2: #b4b4af;
  --muted: #7b7d82;
  --line: rgba(236, 234, 228, .12);
  --milk: #f3f2ee;
  --milk-2: #e4e3de;
  --carbon: #0c0c0d;
  --carbon-2: #5d5e61;
  --f-display: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --f-ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --f-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --gutter: clamp(16px, 2.4vw, 34px);
  --top: max(env(safe-area-inset-top, 0px), 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden; overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
::selection { background: rgba(236, 234, 228, .28); color: #fff; }

.skip { position: fixed; left: var(--gutter); top: 8px; z-index: 90; padding: 8px 14px; border-radius: 99px; background: var(--milk); color: var(--carbon); transform: translateY(-160%); transition: transform .3s var(--ease-out); }
.skip:focus { transform: none; }

/* the full screen height (lvh) doesn't change as a phone's address bar slides, so the canvas isn't resized while scrolling */
#gl { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; display: block; z-index: 0; }
.bg-fallback { display: none; position: fixed; inset: 0; z-index: 0;
  background: var(--ground);
}
.no-gl .bg-fallback { display: block; }
.no-gl #gl { display: none; }

/* ---- Top bar ---------------------------------------------------------------- */
.topbar {
  position: fixed; z-index: 30; left: 0; right: 0; top: 0;
  padding: calc(var(--top) + 18px) var(--gutter) 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
/* on the scrolling views the bar sits on a band of the page's own ground, so text passes under it cleanly */
.topbar::before { content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: linear-gradient(var(--bar-bg, var(--ground)) 58%, transparent); }
body[data-view="list"] .topbar::before, body[data-view="project"] .topbar::before { opacity: 1; }
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; padding: 6px 0; }
.brand-word, .menu-brand { font: 500 17px/1 var(--f-display); letter-spacing: -.02em; }
.brand-word em, .menu-brand em { font: italic 400 1.12em/1 var(--f-serif); letter-spacing: 0; }
/* The Tavor Digital mark */
.brand-lockup { display: block; height: 30px; width: auto; flex: none; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.brand-mark-sm { display: none; width: 26px; height: 26px; flex: none; }
.brand:hover .brand-lockup { transform: translateY(-2px); }
.menu-brand { display: block; height: 28px; width: auto; filter: invert(1); }   /* the lockup is white; the panel is light */
.tv-mark { width: 26px; height: 26px; flex: none; color: var(--ink, #eceae4); transition: transform .6s cubic-bezier(.16,1,.3,1); }
.brand:hover .tv-mark { transform: translateY(-2px); }
/* The view switch: two words, the chosen one in full ink with a hairline under it that slides across on a spring */
.switch { position: relative; display: flex; align-items: center; gap: 26px; justify-self: center; transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.switch-opt { position: relative; z-index: 1; padding: 10px 0; font-size: 14px; font-weight: 500; letter-spacing: -.005em; color: var(--muted); transition: color .35s; }
.switch-opt:hover { color: var(--ink-2); }
.switch-opt[aria-pressed="true"] { color: var(--ink); }
.switch-lens { position: absolute; left: 0; bottom: 4px; height: 1.5px; width: 60px; border-radius: 1px; background: var(--ink); }
body:not([data-view="spiral"]):not([data-view="list"]) .switch { opacity: 0; transform: translateY(-8px); pointer-events: none; }

.menu-btn { justify-self: end; height: 40px; padding: 0 20px; border-radius: 99px; background: var(--milk); color: var(--carbon);
  font-size: 14px; font-weight: 500; box-shadow: inset 0 -1px 0 rgba(0,0,0,.12), 0 6px 20px rgba(0,0,0,.35);
  transition: transform .5s var(--spring), background .3s; }
.menu-btn:hover { transform: scale(1.05); }
.menu-btn:active { transform: scale(.93); transition-duration: .12s; }
.menu-btn-label { display: inline-block; }

/* ---- Views ----------------------------------------------------------------- */
.view { position: fixed; inset: 0; z-index: 10; opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease-out), visibility 0s linear .45s; }
.view.is-active { opacity: 1; visibility: visible; transition: opacity .8s var(--ease-out) .1s, visibility 0s; }
.view-list, .view-project { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; }
.view-list::-webkit-scrollbar, .view-project::-webkit-scrollbar { display: none; }

/* Spiral */
.stage { position: absolute; inset: 0; cursor: grab; touch-action: none; outline: none; }
.stage.is-dragging { cursor: grabbing; }
.stage:focus-visible { box-shadow: inset 0 0 0 1px rgba(236,234,228,.25); border-radius: 0; }
.caption { position: absolute; left: 50%; bottom: calc(var(--bottom) + 30px); transform: translateX(-50%); text-align: center; pointer-events: none; width: min(560px, 60vw); }
.caption-roll { display: flex; align-items: baseline; justify-content: center; gap: 12px; overflow: hidden; height: 34px; }
.caption-num { font: 500 11px/1 var(--f-mono); color: var(--muted); transform: translateY(-9px); }
.caption-title { font: 500 30px/34px var(--f-display); letter-spacing: -.03em; }
.caption-roll.is-rolling > * { animation: roll .55s var(--ease-out) both; }
.caption-roll.is-rolling .caption-num { animation-name: roll-num; }
@keyframes roll { from { transform: translateY(100%); opacity: 0; } }
@keyframes roll-num { from { transform: translateY(26px); opacity: 0; } }
.caption-meta { margin: 6px 0 0; display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); }

/* List: an index. One row per project across five columns; hovering a row dims the others and floats its
   cover beside the pointer. On touch each row carries its own thumbnail instead. */
.view-list { --measure: 1440px; padding: calc(var(--top) + 112px) var(--gutter) calc(var(--bottom) + 96px); }
.list-head { max-width: var(--measure); margin: 0 auto clamp(40px, 6vw, 80px); display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.list-head h1 { margin: 0; font: 500 clamp(56px, 10vw, 160px)/.86 var(--f-display); letter-spacing: -.055em; }
.list-head p { margin: 0 0 .5em; color: var(--ink-2); font-size: 15px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.list-count { color: var(--muted); }
.works-cols, .work-link { display: grid; grid-template-columns: 56px minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr) 56px; gap: 0 clamp(16px, 2vw, 32px); align-items: baseline; }
.works-cols { max-width: var(--measure); margin: 0 auto; padding-bottom: 10px; color: var(--muted); }
.works-cols span:last-child, .work-year { text-align: right; }
.works { list-style: none; max-width: var(--measure); margin: 0 auto; padding: 0; border-top: 1px solid var(--line); }
.works li { border-bottom: 1px solid var(--line); }
.work-link { padding: clamp(14px, 1.6vw, 22px) 0; color: var(--ink); transition: opacity .35s var(--ease-out); }
.work-num, .work-year { color: var(--muted); }
.work-thumb { display: none; }
.work-name { font: 500 clamp(28px, 3.4vw, 52px)/1 var(--f-display); letter-spacing: -.035em; transition: transform .5s var(--ease-out); }
.work-disc, .work-med { font-size: 14px; color: var(--ink-2); }
.works.is-hovering .work-link { opacity: .3; }
.works.is-hovering .work-link.is-active { opacity: 1; }
.work-link.is-active .work-name { transform: translateX(10px); }
.work-link.is-selected .work-num { color: var(--ink); }
.list-close { max-width: var(--measure); margin: clamp(56px, 8vw, 110px) auto 0; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--ink-2); font-size: 15px; }
.list-close p { margin: 0; }
.list-cta { padding: 12px 22px; border-radius: 99px; background: var(--milk); color: var(--carbon); font-size: 14px; font-weight: 500; transition: transform .35s var(--ease-out); }
.list-cta:hover { transform: translateY(-2px); }
.css-preview { display: none; }
.no-gl .css-preview { display: block; position: fixed; z-index: 5; width: 280px; aspect-ratio: 1.6; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .3s; background: center / cover; }

/* Project: the opened tile grows into a full-screen cover, the name across its foot in the project's own type.
   Below it, the page in the project's colours: the story beside the facts, then the pictures one at a time
   with their words beside them (or the film), then the next project's cover, full width. One measure. */
.view-project { --measure: 1440px; color: var(--ink); }
.p-cover { position: relative; height: max(340px, 100svh); color: #fff; }   /* a phone on its side still sees the name */
.p-hero { position: absolute; inset: 0; }
.no-gl .p-hero { background: var(--img) center / cover; }
/* on touch the landed cover is a plain picture or video (see domCovers in main.js) */
.p-hero-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease-out); }
.p-hero.is-dom .p-hero-pic { opacity: 1; }
/* the picture darkens toward the top (for the bar) and the foot (for the name) */
.p-cover::before, .p-cover::after { content: ""; position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.p-cover::before { top: 0; height: 28%; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,0)); }
.p-cover::after { bottom: 0; height: 58%; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.66)); }
.p-cover-in { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--top) + 84px) var(--gutter) clamp(24px, 4.5vh, 52px); }
.p-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255,255,255,.86); }
.p-back { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; }
.p-back span { transition: transform .4s var(--ease-out); display: inline-block; }
.p-back:hover span { transform: translateX(-4px); }
.p-cover-foot { display: grid; gap: clamp(14px, 2vh, 22px); }
.p-title { margin: 0; font: var(--title-w, 500) clamp(56px, 11vw, 196px)/.86 var(--f-display); letter-spacing: -.055em; text-wrap: balance; }
.p-title .w { display: inline-block; white-space: nowrap; }
.p-title .ch { display: inline-block; animation: rise .9s var(--ease-out) both; animation-delay: calc(var(--i) * 28ms + 380ms); }
.p-tagline { margin: 0; display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; font-size: 14px; color: rgba(255,255,255,.82);
  animation: fade .8s var(--ease-out) .7s both; }
.p-watch { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px 0 16px; border-radius: 99px;
  background: #fff; color: #0c0c0d; font-size: 14px; font-weight: 500; transition: transform .4s var(--spring); }
.p-watch:hover { transform: scale(1.05); }
.p-watch-dot { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.p-page { padding: 0 var(--gutter); }
.p-intro { max-width: var(--measure); margin: clamp(72px, 10vw, 150px) auto 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px 28px; }
.p-lede { grid-column: 1 / span 7; margin: 0; font: 400 clamp(30px, 3.6vw, 58px)/1.08 var(--f-display); letter-spacing: -.03em; text-wrap: balance; }
.p-aside { grid-column: 9 / -1; display: grid; gap: 28px; align-content: start; padding-top: .4em; }
.p-body { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.p-meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 18px; border-top: 1px solid var(--line); }
.p-meta dt, .p-meta dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.p-meta dt { color: var(--muted); }
.p-meta dd { color: var(--ink); }
.p-links { display: flex; flex-wrap: wrap; gap: 10px; }
/* the live site: the one solid button on the page */
.p-live { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 14px; font-weight: 600; white-space: nowrap; transition: transform .3s var(--ease-out); }
.p-live:hover { transform: translateY(-2px); }
.p-link { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink); transition: background-color .25s, border-color .25s, color .25s; }
.p-link:hover { background: var(--ink); color: var(--ground); border-color: var(--ink); }

/* the pictures, one at a time: wide, then left with its words on the right, then right with its words on the left */
.p-pics { max-width: var(--measure); margin: clamp(88px, 11vw, 170px) auto 0; display: grid; gap: clamp(64px, 9vw, 150px); }
.p-shot { margin: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px 28px; align-items: end; }
.p-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--ground-2); }
.p-shot figcaption { display: grid; gap: 8px; align-content: end; max-width: 42ch; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.p-shot figcaption .mono { color: var(--muted); }
.p-shot figcaption b { font: 500 clamp(20px, 1.8vw, 26px)/1.2 var(--f-display); letter-spacing: -.02em; color: var(--ink); }
.p-shot.is-wide img { grid-column: 1 / -1; }
.p-shot.is-wide figcaption { grid-column: 1 / span 5; }
.p-shot.is-left img { grid-column: 1 / span 8; }
.p-shot.is-left figcaption { grid-column: 9 / -1; }
.p-shot.is-right img { grid-column: 5 / -1; grid-row: 1; }
.p-shot.is-right figcaption { grid-column: 1 / span 4; grid-row: 1; }

.p-film { max-width: var(--measure); margin: clamp(88px, 11vw, 170px) auto 0; }
.p-film-frame video { display: block; width: 100%; height: auto; border-radius: 6px; background: #000; }
.p-film.is-tall .p-film-frame { width: min(100%, 420px); margin: 0 auto; }
.p-film-cap { margin: 14px 0 0; display: flex; gap: 14px; align-items: baseline; font-size: 14px; color: var(--ink-2); }
.p-film.is-tall .p-film-cap { justify-content: center; }
.p-film-cap .mono { color: var(--muted); }

.p-sec { max-width: var(--measure); margin: clamp(88px, 11vw, 170px) auto 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.p-h { grid-column: 1 / span 3; margin: 0; font: 400 13px/1.3 var(--f-mono); color: var(--muted); letter-spacing: .02em; }
.p-made { grid-column: 4 / -1; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(20px, 3vw, 48px); counter-reset: made; }
.p-made li { counter-increment: made; padding: 16px 0 18px; border-bottom: 1px solid var(--line); font: 400 clamp(18px, 1.7vw, 24px)/1.25 var(--f-display); letter-spacing: -.015em; display: grid; grid-template-columns: 34px 1fr; gap: 6px; }
.p-made li::before { content: counter(made, decimal-leading-zero); font: 12px/2.4 var(--f-mono); color: var(--muted); letter-spacing: 0; }
.p-brand { grid-column: 4 / -1; display: grid; gap: clamp(22px, 3vw, 40px); }
.p-swatches { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.p-swatches i { display: block; aspect-ratio: 1.5; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; }
.p-swatches b { display: block; font: 500 14px/1.3 var(--f-ui); }
.p-swatches span { display: block; margin-top: 2px; font: 11px/1.3 var(--f-mono); color: var(--muted); text-transform: uppercase; }
.p-fonts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.p-fonts li { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 6px; }
.p-fonts b { display: block; font: 500 clamp(20px, 2vw, 28px)/1.1 var(--f-display); letter-spacing: -.02em; }
.p-fonts span { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* next project: its cover, full width, the name across its foot; open it and the panel grows into the next cover */
.p-next { position: relative; display: block; height: clamp(360px, 72svh, 760px); margin-top: clamp(100px, 14vw, 220px); color: #fff; }
.p-next-card { position: absolute; inset: 0; }
.no-gl .p-next-card, .dom-covers .p-next-card { background: var(--img) center / cover; }
.p-next::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(rgba(0,0,0,.1) 30%, rgba(0,0,0,.62)); transition: opacity .5s; }
.p-next:hover::after { opacity: .8; }
.p-next-in { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(24px, 4.5vh, 52px); z-index: 2; display: grid; gap: 10px; }
.p-next-label { font-size: 13px; color: rgba(255,255,255,.78); }
.p-next-title { font: 500 clamp(52px, 9vw, 160px)/.88 var(--f-display); letter-spacing: -.055em; transition: transform .6s var(--ease-out); }
.p-next:hover .p-next-title { transform: translateX(14px); }
.p-next-meta { font-size: 14px; color: rgba(255,255,255,.82); }

/* sections rise into place as they scroll in */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); }
.reveal.is-in, .reduced .reveal { opacity: 1; transform: none; }

/* the bar: white on the cover, the room's own colours past it */
body.room-light .brand-lockup, body.room-light .brand-mark-sm { filter: invert(1); }
body.room-light .menu-btn { background: #242722; color: #e5e7e3; }
body.over-cover .topbar::before { opacity: 0; }
body.room-light.over-cover .brand-lockup, body.room-light.over-cover .brand-mark-sm { filter: none; }
body.room-light.over-cover .menu-btn { background: var(--milk); color: var(--carbon); }
@keyframes rise { from { transform: translateY(.6em); opacity: 0; } }


/* Shared by the list and the menu */
.eyebrow { font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 26px; display: flex; gap: 12px; align-items: center; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.mail-row { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.copy-btn { height: 30px; padding: 0 13px; border-radius: 99px; font-size: 12px; box-shadow: inset 0 0 0 1px currentColor; opacity: .7; transition: opacity .2s, transform .4s var(--spring); }
.copy-btn:hover { opacity: 1; }
.copy-btn:active { transform: scale(.92); }

/* Socials: circular chips shared by menu and contact */
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.social { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font: 500 13px var(--f-mono); transition: transform .5s var(--spring); }
.social:hover { transform: scale(1.1) rotate(-6deg); }
.social[aria-disabled="true"] { cursor: default; opacity: .45; }

/* ---- Cursor ---------------------------------------------------------------- */
.cursor-tag { position: fixed; z-index: 70; left: 0; top: 0; pointer-events: none; padding: 6px 12px; border-radius: 99px; background: var(--milk); color: var(--carbon);
  font: 500 12px var(--f-ui); opacity: 0; transform: translate(-100px, -100px) scale(.6); transition: opacity .25s, scale .35s var(--spring); scale: .6; }
.cursor-tag.is-on { opacity: 1; scale: 1; }

/* ---- Menu -------------------------------------------------------------------- */
.menu { position: fixed; inset: 0; z-index: 50; }
.menu-panel { position: absolute; inset: calc(var(--top) + 10px) 10px calc(var(--bottom) + 10px); border-radius: 8px; color: var(--carbon); background: var(--milk);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  display: grid; grid-template-rows: auto 1fr auto; padding: 22px clamp(20px, 3vw, 44px) clamp(20px, 3vw, 36px); overflow: hidden; }
.menu-top { position: relative; display: flex; justify-content: space-between; align-items: center; }
.menu-close { height: 40px; padding: 0 20px; border-radius: 99px; background: var(--carbon); color: var(--milk); font-size: 14px; font-weight: 500; transition: transform .5s var(--spring); }
.menu-close:hover { transform: scale(1.05); }
.menu-nav { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.menu-nav a { display: inline-flex; align-items: flex-start; gap: 10px; font: 500 clamp(64px, 12.5vw, 200px)/.88 var(--f-display); letter-spacing: -.06em; }
.menu-nav .mask { display: block; overflow: hidden; padding: 0 .04em .06em 0; }
.menu-nav .word { display: inline-block; transition: transform .6s var(--ease-out); }
.menu-nav a:hover .word { transform: translateX(.06em) skewX(-6deg); }
.menu-nav a[aria-current="page"] .word { font-style: italic; }
.menu-count { font-size: 14px; margin-top: .5em; color: var(--carbon-2); letter-spacing: 0; }
.menu-foot { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.menu-label { display: block; color: var(--carbon-2); margin-bottom: 8px; }
.menu-mail .mail-text { font: 500 clamp(18px, 1.8vw, 24px)/1.2 var(--f-display); letter-spacing: -.01em; user-select: all; }
.menu-studio { font: 500 clamp(18px, 1.8vw, 24px)/1.2 var(--f-display); letter-spacing: -.01em; }
.menu-studio:hover { text-decoration: underline; text-underline-offset: 4px; }
.menu-socials .social { background: var(--carbon); color: var(--milk); }


/* ---- Intro: the loader bar swells into a capsule window onto the spiral; scrolling opens it (src/intro.js) ---- */
.intro { position: fixed; inset: 0; z-index: 60; background: transparent; overscroll-behavior: none; touch-action: none; }
.intro > * { position: absolute; left: 0; top: 0; }
.intro-bar { display: block; background: var(--line); overflow: hidden; cursor: default; }
.intro-bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.intro.is-swelling .intro-bar { background: transparent; }
.intro.is-waiting .intro-bar { cursor: pointer; }
.intro-num { left: 50%; top: calc(50% - 46px); transform: translateX(-50%); color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.intro-left { font: 500 clamp(22px, 3.8vw, 55px)/1 var(--f-display); letter-spacing: -.04em; white-space: nowrap; opacity: 0; }
.intro-right { height: clamp(21px, 3.4vw, 50px); width: auto; opacity: 0; }
.intro.is-done { opacity: 0; transition: opacity .8s var(--ease-out); pointer-events: none; }
/* the greetings: one column of bold words rolling up the middle (positions, opacity and blur set by intro.js) */
.intro .intro-words { inset: 0; pointer-events: none; font: 700 64px/1.1 var(--f-display); letter-spacing: -.035em; color: #f5f5f5; }
.intro-words p { position: absolute; left: 50%; top: 50%; margin: 0; white-space: nowrap; opacity: 0; transform: translate(-50%, -50%); }
.intro-words span, .intro-title span { display: inline-block; }
/* the name Hello turns into: "Tavor" in full ink, "Digital" in grey, as in the mark */
.intro .intro-title { left: 50%; top: 50%; margin: 0; white-space: nowrap; opacity: 0; transform: translate(-50%, -50%); pointer-events: none;
  font: 700 clamp(44px, 8vw, 128px)/1 var(--f-display); letter-spacing: -.045em; color: #f5f5f5; }
.intro-title .dim { color: rgba(245, 245, 245, .55); }
.intro-title span span { opacity: 0; }
/* while the intro holds the screen, the site's own chrome waits; it fades in as the window opens fully */
.topbar, .caption { transition: opacity .7s var(--ease-out); }
body.in-intro .topbar, body.in-intro .caption { opacity: 0; pointer-events: none; }
body.in-intro.in-intro-ui .topbar, body.in-intro.in-intro-ui .caption { opacity: 1; }

.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; z-index: 99; }

/* ---- The light page: once the intro is over, the spiral and the list sit on milk (the canvas eases its ground
   to match, see main.js); the project pages keep their rooms' own colours ---- */
body.is-light {
  color-scheme: light;
  --ground: #f3f2ee; --ground-2: #e6e5e0;
  --ink: #0c0c0d; --ink-2: #45464a; --muted: #808186; --line: rgba(12, 12, 13, .12);
}
body.is-light .brand-lockup, body.is-light .brand-mark-sm { filter: invert(1); }
body.is-light .menu-btn { background: var(--carbon); color: var(--milk); box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
body.is-light .list-cta { background: var(--carbon); color: var(--milk); }
body.is-light .cursor-tag { background: var(--carbon); color: var(--milk); }
body.is-light ::selection { background: rgba(12, 12, 13, .16); color: var(--carbon); }
/* the menu opens dark over the light page */
body.is-light .menu-panel { background: #111214; color: var(--milk); box-shadow: 0 30px 80px rgba(0, 0, 0, .28); }
body.is-light .menu-brand { filter: none; }
body.is-light .menu-close, body.is-light .menu-socials .social { background: var(--milk); color: var(--carbon); }
body.is-light .menu-label, body.is-light .menu-count { color: #8d8e92; }
.topbar .brand-lockup, .topbar .brand-mark-sm, .menu-btn, .switch-opt { transition: filter .5s, background .5s, color .5s, transform .5s var(--spring); }

/* ---- Responsive ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .p-lede, .p-aside, .p-h, .p-made, .p-brand { grid-column: 1 / -1; }
  .p-aside { padding-top: 0; }
  .p-shot.is-wide img, .p-shot.is-left img, .p-shot.is-right img { grid-column: 1 / -1; grid-row: 1; }
  .p-shot.is-wide figcaption, .p-shot.is-left figcaption, .p-shot.is-right figcaption { grid-column: 1 / -1; grid-row: 2; }
  .works-cols, .work-link { grid-template-columns: 44px minmax(0, 1.6fr) minmax(0, 1fr) 48px; }
  .works-cols span:nth-child(4), .work-med { display: none; }
}
@media (max-width: 640px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .brand-lockup { display: none; }
  .brand-mark-sm { display: block; }
  .menu-btn { height: 38px; padding: 0 16px; }
  .caption { bottom: calc(var(--bottom) + 28px); width: calc(100vw - 32px); }
  .caption-title { font-size: 24px; }
  .view-list { padding-top: calc(var(--top) + 96px); }
  .p-made { grid-template-columns: 1fr; }
  .p-watch { margin-left: 0; }
  .p-cover { height: max(480px, 88svh); }   /* the page below peeks in, so it reads as a cover, not the whole page */
  .menu-foot { flex-direction: column; align-items: flex-start; }
  .social { width: 50px; height: 50px; }
}
/* A short screen (a phone on its side): shrink the menu's words so the links and the email stay inside the panel */
@media (max-height: 560px) {
  .menu-nav a { font-size: clamp(40px, 15vh, 84px); }
  .menu-panel { padding-top: 14px; padding-bottom: 14px; }
}
/* Touch, or a narrow screen: every row shows its own cover beside the name. */
@media (hover: none), (max-width: 640px) {
  .works-cols { display: none; }
  .work-link { grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-areas: "thumb name year" "thumb disc disc"; align-items: center; gap: 4px 16px; }
  .work-thumb { display: block; grid-area: thumb; aspect-ratio: 1.6; border-radius: 4px; overflow: hidden; background: var(--ground-2); }
  .work-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .work-name { grid-area: name; font-size: clamp(24px, 6.4vw, 34px); }
  .work-disc { grid-area: disc; font-size: 13px; }
  .work-year { grid-area: year; }
  .work-num, .work-med { display: none; }
}
/* Touch: every control is hit across at least 44px. The pills keep their look; an invisible layer carries the rest. */
@media (pointer: coarse) {
  .brand, .switch-opt, .menu-btn, .list-cta, .copy-btn { position: relative; }
  .brand::after, .switch-opt::after, .menu-btn::after, .list-cta::after, .copy-btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
