/* ---------- tokens (mirror the Figma variables: Portfolio library + glitter.fyi) ---------- */
:root {
  /* colour */
  --navy:  #050158;   /* primitives/coven     → text/primary, surface/inverse */
  --blush: #fceeed;   /* primitives/medea     → surface/default, text/inverse */
  --peri:  #aab4f0;   /* primitives/fleur     → surface/accent, text/accent   */
  --lime:  #eaff61;   /* primitives/cerridwen → text/highlight               */
  --navy-25:  rgba(5, 1, 88, 0.25);
  --blush-25: rgba(252, 238, 237, 0.25);
  --red-1: #f2333b;   /* illustration colours */
  --red-2: #d4174d;
  --red-3: #f2551d;

  /* type: 4:3 scale on 24 px (font-size/*), fluid below 1440 px */
  --fs-2xs: 10.17px;
  --fs-xs:  13.56px;
  --fs-sm:  clamp(16px,  1.256vw, 18.08px);
  --fs-base:clamp(20px,  1.667vw, 24px);
  --fs-lg:  clamp(22px,  2.221vw, 31.98px);
  --fs-xl:  clamp(26px,  2.956vw, 42.56px);
  --fs-2xl: clamp(32px,  3.941vw, 56.75px);
  --fs-3xl: clamp(38px,  5.267vw, 75.84px);
  --fs-4xl: clamp(44px,  7.022vw, 101.12px);
  --fs-5xl: clamp(56px,  9.35vw,  134.64px);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;  /* font/display */
  --mono:    "Space Mono", ui-monospace, Menlo, monospace;                    /* font/mono    */

  --pad: clamp(18px, 3.333vw, 48px);
  --band-y: clamp(96px, 16vh, 180px);
}

/* Bricolage Grotesque (variable: wght, opsz, wdth) + Space Mono — OFL, self-hosted */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/space-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/space-mono-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

@property --hue { syntax: "<number>"; inherits: true; initial-value: 350; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--blush); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--blush);
  color: var(--navy);
  font-family: var(--display);
  font-optical-sizing: auto;          /* opsz follows size — matches Figma's rendering */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
i, em { font-style: normal; }          /* Bricolage has no italic; emphasis is colour only where the design says so */

.mono { font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.3; letter-spacing: 0.08em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

/* ---------- top bar ---------- */
.top {
  position: absolute; z-index: 10;
  left: var(--pad); right: var(--pad); top: clamp(16px, 3vh, 29px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; text-underline-offset: 4px; }
.top-l { display: flex; }
.top-l a + a::before { content: "/"; display: inline-block; padding: 0 0.75em; }   /* inline-block: the slash isn't underlined on hover */
.top-r { justify-self: end; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  padding: clamp(96px, 17vh, 174px) var(--pad) clamp(96px, 13vh, 128px);
}

.welcome {
  font-weight: 400;
  font-size: var(--fs-5xl);
  line-height: 0.82;
  letter-spacing: -0.02em;
  margin-left: 0.03em;
}
.w-line { display: block; white-space: nowrap; min-height: 0.82em; }
.w-indent { margin-top: 0.04em; padding-left: 0.73em; }
.w-glitter { margin-top: 0.27em; }

/* glitter.fyi: travels the hue wheel at constant OKLCH lightness + chroma */
.w-glitter { animation: hue 14s linear infinite; }
/* the gradient is painted per letter (Safari doesn't repaint a parent's text clip when
   letters appear one by one); main.js sets --gw (word width) and --gx (letter offset)
   so the letters still read as one continuous gradient */
.w-glitter .ch {
  background-image: linear-gradient(100deg,
    oklch(0.83 0.11 var(--hue)),
    oklch(0.83 0.11 calc(var(--hue) + 60)),
    oklch(0.83 0.11 calc(var(--hue) + 120)),
    oklch(0.83 0.11 calc(var(--hue) + 180)),
    oklch(0.83 0.11 calc(var(--hue) + 240)));
  background-size: var(--gw, 5em) 100%;
  background-position: calc(var(--gx, 0px) * -1) 0;
  background-repeat: no-repeat;
  padding: 0.15em 0 0.22em;            /* inline padding: room for ascenders/descenders, no layout change */
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
@keyframes hue { to { --hue: 710; } }

.headline {
  margin: auto auto 0;                /* sits in the lower part of the hero, centred */
  padding-top: clamp(48px, 9vh, 120px);
  font-weight: 400;
  font-size: var(--fs-2xl);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 15.5em;
  text-wrap: balance;
}
.line { display: block; }

.hero-foot {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(20px, 5vh, 50px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline;
  font-size: var(--fs-lg); line-height: 1.15;
}
.hero-foot > :last-child { justify-self: end; }
.hero-foot .mono { padding-top: 0.6em; }

/* typewriter */
.ch { visibility: hidden; }
.ch.on { visibility: visible; }
html:not(.js) .ch { visibility: visible; }
.caret { position: relative; }
.caret::after { content: ""; position: absolute; right: -0.04em; top: 0.06em; width: 0.035em; height: 0.74em; background: var(--navy); animation: blink .9s steps(1) infinite; }
.caret.empty::after { right: auto; left: 0; }
@keyframes blink { 50% { opacity: 0; } }

.js .fade { opacity: 0; transition: opacity 1.2s ease; }
.js .fade.in { opacity: 1; }

/* glitter canvas sits in front of the type */
.glitter { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; display: block; }
/* prototype (?flow=page): the glitter is a pane over the whole page, the page scrolls through it */
.flow-page .glitter { position: fixed; z-index: 20; height: 100vh; height: 100lvh; }
.hint {
  position: absolute; left: 0; right: 0; bottom: clamp(70px, 11vh, 110px); z-index: 3;
  text-align: center; font-size: var(--fs-2xs); color: var(--navy);
  opacity: 0; transition: opacity .8s; pointer-events: none;
}
.hint.on { opacity: .7; }

/* ---------- shared ---------- */
.label {
  font-weight: 700;
  padding-bottom: 14px; margin-bottom: clamp(28px, 5vh, 46px);
  border-bottom: 1px solid var(--navy-25);
}
.band { padding: var(--band-y) var(--pad); }
.band--peri { background: var(--peri); }
.band--navy { background: var(--navy); color: var(--blush); }
.band--navy .label { color: var(--peri); border-color: var(--blush-25); }
.lead { font-size: var(--fs-xl); line-height: 1.1; max-width: 23.4em; }

/* ---------- intro ---------- */
.intro { padding: var(--band-y) var(--pad); max-width: calc(1084px + 2 * var(--pad)); margin: 0 auto; }
.intro-text, .intro-thesis { font-size: var(--fs-xl); line-height: 1.1; }
.intro-thesis { margin-top: 1.1em; }
.reds > span:nth-child(1) { color: var(--red-1); }
.reds > span:nth-child(2) { color: var(--red-2); }
.reds > span:nth-child(3) { color: var(--red-3); }

/* ---------- work (periwinkle) ---------- */
.band-head { margin-bottom: clamp(32px, 5vh, 54px); }
.rows { list-style: none; border-bottom: 1px solid var(--navy-25); }
.rows li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--navy-25);
}
.rows .t { font-size: var(--fs-xl); line-height: 1.1; max-width: 32em; text-wrap: pretty; }   /* no tags any more: rows can run full width */

/* ---------- how I work (navy) ---------- */
.quote { font-size: var(--fs-3xl); line-height: 0.95; letter-spacing: -0.02em; max-width: 17.4em; }
.quote::before { content: "“"; }
.quote::after { content: "”"; }
.quote i { color: var(--lime); }
.principles {
  list-style: none;
  margin-top: clamp(56px, 9vh, 90px);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(24px, 2.5vw, 36px);
}
.principles h3 { font-weight: 400; font-size: var(--fs-base); line-height: 1.2; margin-bottom: 14px; }
.principles p { font-size: var(--fs-sm); line-height: 1.5; }

/* ---------- now (blush) ---------- */
.now { padding: var(--band-y) var(--pad); max-width: calc(1084px + 2 * var(--pad)); margin: 0 auto; }
.project-name { font-size: var(--fs-5xl); line-height: 0.82; letter-spacing: -0.02em; font-weight: 400; margin-bottom: 0.2em; }
.project-text { font-size: var(--fs-lg); line-height: 1.15; max-width: 27.5em; }
.project-link { display: inline-block; margin-top: 26px; text-decoration: underline; text-underline-offset: 3px; }
.project-link:hover { background: var(--lime); }
/* screenshots: grey day at home behind, the sunny place it finds in front */
.project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); column-gap: clamp(32px, 5vw, 80px); align-items: center; }
.project .project-name { grid-column: 1 / -1; }
.project-copy { align-self: start; }
.shots { position: relative; display: block; aspect-ratio: 500 / 470; }
.shot { position: absolute; display: block; height: auto; border-radius: 12px;
        box-shadow: 0 28px 60px rgba(5, 1, 88, 0.22), 0 2px 6px rgba(5, 1, 88, 0.14);
        transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.shot--today { left: 0; top: 0; width: 52%; transform: rotate(-4deg); }
.shot--place { right: 0; top: 24%; width: 56%; transform: rotate(3deg); }
.shots:hover .shot--today { transform: rotate(-6deg) translate(-8px, -6px); }
.shots:hover .shot--place { transform: rotate(1deg) translate(6px, -4px); }

/* ---------- contact (navy) ---------- */
.contact .lead { margin-bottom: 0.2em; }
.cta { font-size: var(--fs-4xl); line-height: 0.92; letter-spacing: -0.02em; max-width: 14em; }
.cta i { color: var(--lime); }
.email { margin-top: 0.9em; font-size: var(--fs-lg); line-height: 1.15; }
.email a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.email a:hover { background: var(--lime); color: var(--navy); }
.foot { display: flex; justify-content: space-between; margin-top: clamp(96px, 16vh, 136px); color: var(--peri);
        padding-bottom: env(safe-area-inset-bottom); }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .principles { grid-template-columns: repeat(3, 1fr); row-gap: 48px; }
}
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --fs-5xl: 17vw; }
  .top { grid-template-columns: 1fr auto; }
  .top-l { display: none; }
  .top-c { justify-self: start; }
  .w-indent { padding-left: 0.3em; }
  .headline { font-size: clamp(30px, 8.6vw, 40px); text-align: left; margin-left: 0; }
  .hero-foot { grid-template-columns: 1fr 1fr; }
  .hero { padding-bottom: 150px; }
  .hero-foot .mono { grid-column: 1 / -1; order: -1; padding: 0 0 14px; }   /* tagline on its own row above Zurich / 2026 */
  .tagline > span { display: block; }   /* one claim per line instead of a ragged wrap */
  .tagline .sep { display: none; }
  .principles { grid-template-columns: 1fr; }
  .project { display: block; }
  .shots { margin: 44px 3% 0; }
  .foot { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret::after, .w-glitter { animation: none; }
  .js .reveal, .js .fade { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 640px) { .hint { bottom: auto; top: 54%; } }

/* ---------- temporary “coming soon” homepage (index.html) ---------- */
.soon { justify-content: center; padding-top: 0; padding-bottom: 0; }
.soon .welcome { margin: 0 auto; text-align: center; }
.soon .w-glitter { margin-top: 0.12em; }
.soon .hero-foot { grid-template-columns: 1fr 1fr; }
.soon .hero-foot > :last-child { justify-self: end; }
html:has(.soon), body:has(.soon) { overflow: hidden; height: 100%; }
.soon .hint { top: auto; bottom: clamp(70px, 11vh, 110px); }
@media (max-width: 640px) { .soon .welcome { font-size: 14.5vw; } }
