/* ==========================================================================
   RockPaperChip
   The page moves through the three materials in the logo:
   Rock (stone, dark)  ->  Paper (cream)  ->  Chip (navy and teal)
   Shape language: corners are cut at an angle, like the P and the C.
   ========================================================================== */

:root {
  /* Colour, sampled from the logo */
  --ink: #14161a;
  --ink-2: #1a1c20;
  --ink-3: #23262c;
  --edge: #34383f;
  --bone: #ebe8e1;
  --muted: #a9a69d;
  --rock: #98938a;
  --paper: #f1efe8;
  --paper-fold: #b9b3a5;
  --paper-ink: #14161a;
  --paper-muted: #55524a;
  --chip: #1e3a56;
  --chip-2: #2b5278;
  --chip-deep: #101f30;
  --teal: #2de0c8;

  /* Type */
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Layout */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 8vw, 8rem);
  --cut: 14px;
  --header-h: 68px;
}

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

html {
  background: var(--ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--bone);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.9rem); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.5vw, 3.25rem); line-height: 1.08; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; line-height: 1.25; font-weight: 600; }
p { text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gutter), 1180px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--teal); color: var(--ink); padding: .6rem 1rem; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Angled corners: top-left and bottom-right, as on the logo's P and C */
.cut {
  clip-path: polygon(
    var(--cut) 0, 100% 0,
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%,
    0 100%, 0 var(--cut)
  );
}
/* Clipped elements hide outside outlines, so focus rings sit inside */
.cut:focus-visible { outline-offset: -5px; }

/* ---------- Buttons ---------- */
.btn {
  --cut: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.1rem; padding: .7rem 1.6rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  text-decoration: none; border: 0; cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--teal); color: var(--ink); }
.btn-primary:hover { background: #6ff0de; }
.btn-ghost { background: var(--ink-3); color: var(--bone); }
.btn-ghost:hover { background: #2d3138; }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 2.5rem; padding: .45rem 1.1rem; font-size: .95rem; --cut: 8px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 22, 26, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid #ffffff12;
}
.bar { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; }
.wordmark, .foot-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.w-rock { color: var(--rock); }
.w-paper { color: var(--bone); }
.w-chip { color: var(--teal); }

.nav { display: none; }
.nav a:not(.btn) {
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .98rem;
  padding: .4rem .1rem; border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.nav a:not(.btn):hover { color: var(--bone); }
.nav a[aria-current="true"] { color: var(--bone); border-bottom-color: var(--teal); }

/* Menu toggle without JavaScript: a hidden checkbox and its label */
.nav-check { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; cursor: pointer; margin-right: -8px;
}
.nav-check:focus-visible + .nav-toggle { outline: 2px solid var(--teal); outline-offset: 2px; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 22px; height: 2px; background: var(--bone); border-radius: 1px; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-check:checked + .nav-toggle .nav-toggle-bars { background: transparent; }
.nav-check:checked + .nav-toggle .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-check:checked + .nav-toggle .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

.nav-check:checked ~ .nav {
  display: flex; flex-direction: column; align-items: stretch; gap: .25rem;
  position: absolute; top: 100%; left: 0; right: 0;
  padding: 1rem var(--gutter) 1.5rem; background: var(--ink); border-bottom: 1px solid #ffffff12;
}
.nav-check:checked ~ .nav a:not(.btn) { padding: .8rem 0; font-size: 1.1rem; border-bottom: 1px solid #ffffff10; }
.nav-check:checked ~ .nav .btn { margin-top: .75rem; }

@media (min-width: 52rem) {
  .nav-toggle, .nav-check { display: none; }
  .nav { display: flex; align-items: center; gap: 1.75rem; }
}

/* ==========================================================================
   Hero: the logo is the interactive moment
   ========================================================================== */
.hero { padding-block: clamp(1rem, 2vw, 1.5rem) clamp(2.5rem, 5vw, 4.5rem); background: var(--ink); }
.hero-top { display: grid; gap: .75rem; }
.hero h1 { max-width: 17ch; font-size: clamp(1.8rem, 1rem + 2vw, 2.6rem); line-height: 1.08; letter-spacing: -0.01em; }
.lede { max-width: 50ch; font-size: .95rem; line-height: 1.5; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .85rem; }
.hero .btn { min-height: 2.5rem; padding: .4rem 1.1rem; font-size: .92rem; --cut: 8px; }
@media (min-width: 62rem) {
  .hero-top { grid-template-columns: 1.55fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: end; }
  .hero-side { padding-bottom: .25rem; }
}

.lockup {
  display: grid; grid-template-columns: 375fr 375fr 415fr; gap: clamp(.25rem, 1.5vw, 1.25rem);
  width: min(100%, 1020px, 135vh); margin: clamp(.75rem, 1.5vw, 1.25rem) auto 0;
}
.letter { display: flex; flex-direction: column; text-decoration: none; transition: transform .25s ease; }
.letter:hover, .letter:focus-visible { transform: translateY(-6px); }
.letter:focus-visible { outline-offset: 6px; }
.art { display: block; }
.art img, .art svg { width: 100%; height: auto; }
.art svg { overflow: visible; }

.cap { display: flex; flex-direction: column; gap: .2rem; margin-top: clamp(.5rem, 1.2vw, 1rem); text-align: center; align-items: center; }
.cap-name { font-family: var(--font-display); font-size: clamp(1.05rem, .8rem + 1vw, 1.5rem); font-weight: 700; letter-spacing: .02em; }
.cap-note { font-size: .88rem; line-height: 1.4; color: var(--muted); max-width: 26ch; }
.letter-r .cap-name { color: var(--rock); }
.letter-p .cap-name { color: var(--bone); }
.letter-c .cap-name { color: var(--teal); }
.letter:hover .cap-note { color: var(--bone); }

@media (max-width: 40rem) {
  .lockup { gap: .25rem; }
  .cap-note { font-size: .74rem; line-height: 1.35; }
}

/* C: pins, body and traces light up on hover */
.c-dots circle { transform-box: fill-box; transform-origin: center; transition: transform .25s ease; }
.c-traces { transition: filter .25s ease; }
.letter-c:hover .c-dots circle, .letter-c:focus-visible .c-dots circle { transform: scale(1.3); }
.letter-c:hover .c-traces, .letter-c:focus-visible .c-traces { filter: drop-shadow(0 0 5px rgba(45, 224, 200, .7)); }

/* ==========================================================================
   The intro. About 4.5 seconds, three stories running side by side:
   R   a rock is thrown, lands, and becomes the R. Kannada is carved into it.
   P   a sheet of paper floats in, data is written on it, then it folds into the P.
   C   silica dust packs into a chip, the chip stores letters, the C forms from it.
   Everything below the first block is hidden unless motion is allowed.
   ========================================================================== */
.hero { overflow-x: clip; }
.art-r, .art-p { position: relative; container-type: inline-size; }

/* Kannada carvings, cut off at the edge of the R by using the R itself as a mask */
.carve {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  -webkit-mask: url(/assets/img/letter-r.webp) center / 100% 100% no-repeat;
          mask: url(/assets/img/letter-r.webp) center / 100% 100% no-repeat;
}
.cv {
  position: absolute; white-space: nowrap; line-height: 1.1;
  font-family: "Noto Sans Kannada", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Malayalam", "Nirmala UI", system-ui, sans-serif; font-weight: 700;
  color: #1f1c17; opacity: .5; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.cv1 { left: 26%; top: 8%; font-size: 8.6cqw; }
.cv2 { left: 9%; top: 50%; font-size: 8.4cqw; transform: rotate(-3deg); }
.cv3 { left: 63%; top: 73%; font-size: 7.6cqw; transform: translate(-50%, -50%) rotate(35deg); }
.cv4 { left: 38%; top: 45.5%; font-size: 7.4cqw; font-family: "Chakra Petch", system-ui, sans-serif; letter-spacing: .04em; }
.cv5 { left: 60%; top: 38.5%; font-size: 6.6cqw; transform: rotate(8deg); }
.cv6 { left: 10%; top: 81.5%; font-size: 7cqw; }

/* Layers that only exist during the intro */
.rock-blob, .puffs, .sheet-wrap, .chip, .grains, .glyphs { display: none; }

.rock-blob { position: absolute; left: 15%; top: 25%; width: 70%; height: auto; z-index: 2; }
.puffs { position: absolute; left: 0; right: 0; bottom: 6%; height: 0; z-index: 4; }
.puffs i {
  position: absolute; left: calc(50% - 7cqw); bottom: 0; width: 14cqw; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(207, 200, 184, .7), rgba(154, 148, 134, 0) 70%);
}
.puffs i:nth-child(1) { --px: -34cqw; --py: -3cqw; }
.puffs i:nth-child(2) { --px: -17cqw; --py: -9cqw; }
.puffs i:nth-child(3) { --px: 0cqw;   --py: -12cqw; }
.puffs i:nth-child(4) { --px: 17cqw;  --py: -9cqw; }
.puffs i:nth-child(5) { --px: 34cqw;  --py: -3cqw; }

.sheet-wrap { position: absolute; inset: 0; z-index: 2; perspective: 900px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); }
.sheet {
  position: absolute; inset: 0; transform-origin: 30% 50%;
  background: linear-gradient(160deg, #fbfaf6, #e6e2d6);
  clip-path: polygon(4% 19%, 20.5% 5.3%, 60% 5.3%, 92% 5.3%, 92% 32.6%, 92% 60%, 92% 93.1%, 60% 93.1%, 30.7% 93.1%, 4% 93.1%);
}
.sheet-fold { position: absolute; left: 4%; top: 5.3%; width: 16.5%; height: 13.6%; background: #b9b3a5; clip-path: polygon(0 100%, 100% 0, 100% 100%); }
/* The writing sits in its own layer, so it stays on the P after the paper has folded */
.writing { position: absolute; inset: 0; z-index: 3; perspective: 900px; pointer-events: none; }
.writing-tilt { position: absolute; inset: 0; transform-origin: 30% 50%; }
.ink {
  position: absolute; white-space: nowrap; line-height: 1.15; color: #4d4a42; font-weight: 700; opacity: .5;
  font-family: "Instrument Sans", "Noto Sans Kannada", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Malayalam", "Nirmala UI", system-ui, sans-serif;
}
.ink1 { left: 24%; top: 7.5%; font-size: 9.5cqw; }
.ink2 { left: 6%;  top: 26%;  font-size: 5.8cqw; }
.ink3 { left: 60%; top: 27%;  font-size: 6.5cqw; }
.ink4 { left: 34%; top: 44%;  font-size: 8cqw; }
.ink5 { left: 52%; top: 44%;  font-size: 6.2cqw; }
.ink6 { left: 6%;  top: 40%;  font-size: 6.5cqw; }

.gl {
  font-family: "Noto Sans Kannada", "Nirmala UI", system-ui, sans-serif; font-size: 38px; font-weight: 700;
  fill: #f1efe8; text-anchor: middle; dominant-baseline: central; transform-box: fill-box; transform-origin: center;
}
.g1 { --sx: -165px; --sy: -120px; } .g2 { --sx: 150px; --sy: -135px; }
.g3 { --sx: -185px; --sy: 30px; }   .g4 { --sx: 175px; --sy: 45px; }
.g5 { --sx: -130px; --sy: 165px; }  .g6 { --sx: 140px; --sy: 170px; }
.g7 { --sx: -20px; --sy: -190px; }  .g8 { --sx: 30px; --sy: 185px; }
.chip, .c-body { transform-box: fill-box; transform-origin: center; }

/* Replay button: only useful when there is something to replay */
.replay { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .rock-blob, .puffs, .sheet-wrap, .chip, .grains, .glyphs { display: block; }
  .grains, .glyphs { display: inline; }

  .replay {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .3rem .4rem;
    background: none; border: 0; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer;
    text-decoration: underline; text-decoration-color: #ffffff30; text-underline-offset: 4px;
  }
  .replay:hover { color: var(--bone); text-decoration-color: var(--teal); }
  .replay svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* Restart: the script adds this class for one frame */
  .lockup.is-reset, .lockup.is-reset *, .lockup.is-reset *::before, .lockup.is-reset *::after,
  .lockup.is-skipped, .lockup.is-skipped *, .lockup.is-skipped *::before, .lockup.is-skipped *::after { animation: none !important; }
  .lockup.is-skipped .rock-blob, .lockup.is-skipped .puffs, .lockup.is-skipped .sheet-wrap,
  .lockup.is-skipped .chip, .lockup.is-skipped .grains, .lockup.is-skipped .glyphs { display: none; }

  /* Each letter has its own start time. The next one begins when the previous has finished. */
  .lockup { --r0: 0s; --p0: 2.6s; --c0: 6s; }

  /* ---- 1. R: a rock is thrown, lands and becomes the R, then Kannada is carved into it ---- */
  .lockup { animation: impact .32s calc(var(--r0) + .75s) both; }
  .rock-blob { animation: rock-throw .8s calc(var(--r0) + .1s) both, blob-out .25s calc(var(--r0) + .7s) forwards; }
  .art-r img { animation: r-form .5s calc(var(--r0) + .7s) both; }
  .puffs i { animation: puff .7s calc(var(--r0) + .7s) ease-out both; }
  .cv { animation: chisel .4s steps(9) both; }
  .cv1 { animation-delay: calc(var(--r0) + 1s); }    .cv2 { animation-delay: calc(var(--r0) + 1.22s); }
  .cv4 { animation-delay: calc(var(--r0) + 1.44s); } .cv5 { animation-delay: calc(var(--r0) + 1.66s); }
  .cv3 { animation-delay: calc(var(--r0) + 1.88s); } .cv6 { animation-delay: calc(var(--r0) + 2.1s); }
  .letter-r .cap { animation: fade-in .5s calc(var(--r0) + 2.5s) both; }

  /* ---- 2. P: paper floats in, data is written on it, it folds into the P ---- */
  .sheet-wrap { animation: paper-float 3s var(--p0) ease-in-out both, fade-out .3s calc(var(--p0) + 3.4s) forwards; }
  .sheet { animation: sheet-fold .7s calc(var(--p0) + 2.7s) ease-in-out both, fold-tilt .7s calc(var(--p0) + 2.7s) ease-in-out both; }
  .writing { animation: paper-float 3s var(--p0) ease-in-out both; }
  .writing-tilt { animation: fold-tilt .7s calc(var(--p0) + 2.7s) ease-in-out both; }
  .ink { animation: type .33s steps(10) both; }
  .ink1 { animation-delay: calc(var(--p0) + .7s); }  .ink2 { animation-delay: calc(var(--p0) + .98s); }
  .ink3 { animation-delay: calc(var(--p0) + 1.26s); } .ink4 { animation-delay: calc(var(--p0) + 1.54s); }
  .ink5 { animation-delay: calc(var(--p0) + 1.82s); } .ink6 { animation-delay: calc(var(--p0) + 2.1s); }
  .art-p img { animation: fade-in .4s calc(var(--p0) + 3.2s) both; }
  .letter-p .cap { animation: fade-in .5s calc(var(--p0) + 3.4s) both; }

  /* ---- 3. C: dust packs into a chip, the chip stores letters, the C forms from it ---- */
  .grains circle { animation: grain-in .5s calc(var(--c0) + var(--gd)) ease-out both, grain-out .25s calc(var(--c0) + .85s) forwards; }
  .chip { animation: chip-form .4s calc(var(--c0) + .6s) both, chip-out .5s calc(var(--c0) + 1.8s) ease-in forwards; }
  .cells rect { animation: cell-on .25s calc(var(--c0) + var(--t)) forwards; }
  .cells rect:nth-child(1) { --t: 1.2s; }  .cells rect:nth-child(2) { --t: 1.3s; } .cells rect:nth-child(3) { --t: 1.4s; }
  .cells rect:nth-child(4) { --t: 1.5s; }  .cells rect:nth-child(5) { --t: 1.6s; } .cells rect:nth-child(6) { --t: 1.7s; }
  .cells rect:nth-child(7) { --t: 1.8s; }  .cells rect:nth-child(8) { --t: 1.9s; } .cells rect:nth-child(9) { --t: 1.95s; }
  .gl { animation: glyph-in .4s ease-in both; }
  .g1 { animation-delay: calc(var(--c0) + .8s); }  .g2 { animation-delay: calc(var(--c0) + .88s); }
  .g3 { animation-delay: calc(var(--c0) + .96s); } .g4 { animation-delay: calc(var(--c0) + 1.04s); }
  .g5 { animation-delay: calc(var(--c0) + 1.12s); } .g6 { animation-delay: calc(var(--c0) + 1.2s); }
  .g7 { animation-delay: calc(var(--c0) + 1.28s); } .g8 { animation-delay: calc(var(--c0) + 1.36s); }
  .letter-c .c-body { animation: body-form .6s calc(var(--c0) + 1.8s) ease-out both; }
  .letter-c .pins-left { animation: pin-left .4s calc(var(--c0) + 2.2s) ease-out both; }
  .letter-c .pins-right { animation: pin-right .4s calc(var(--c0) + 2.2s) ease-out both; }
  .letter-c .c-traces path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .45s calc(var(--c0) + 2.3s) ease-out forwards; }
  .letter-c .c-traces path:nth-child(2) { animation-delay: calc(var(--c0) + 2.4s); }
  .letter-c .c-traces path:nth-child(3) { animation-delay: calc(var(--c0) + 2.5s); }
  .letter-c .c-dots circle { animation: dot-on .3s backwards; }
  .letter-c .c-dots circle:nth-child(1) { animation-delay: calc(var(--c0) + 2.8s); }
  .letter-c .c-dots circle:nth-child(2) { animation-delay: calc(var(--c0) + 2.9s); }
  .letter-c .c-dots circle:nth-child(3) { animation-delay: calc(var(--c0) + 3s); }
  .letter-c .c-dots circle:nth-child(4) { animation-delay: calc(var(--c0) + 3.1s); }
  .letter-c .cap { animation: fade-in .5s calc(var(--c0) + 3.4s) both; }
}

@keyframes impact { 0%, 100% { transform: none; } 15% { transform: translate(-4px, 3px); } 30% { transform: translate(4px, -2px); } 45% { transform: translate(-3px, 2px); } 60% { transform: translate(2px, -1px); } }
@keyframes rock-throw {
  0%   { transform: translate(-65vw, -70vh) rotate(-540deg) scale(.5); animation-timing-function: cubic-bezier(.4, 0, 1, 1); }
  55%  { transform: translate(-18vw, -18vh) rotate(-160deg) scale(.9); animation-timing-function: ease-in; }
  70%  { transform: translate(0, 0) rotate(0) scale(1); animation-timing-function: ease-out; }
  80%  { transform: translate(0, -24px); animation-timing-function: ease-in; }
  90%, 100% { transform: translate(0, 0); }
}
@keyframes blob-out { to { opacity: 0; } }
@keyframes r-form { from { opacity: 0; transform: scale(.9); filter: brightness(1.7); } to { opacity: 1; transform: none; filter: none; } }
@keyframes puff { from { transform: translate(0, 0) scale(.2); opacity: .9; } to { transform: translate(var(--px), var(--py)) scale(1.8); opacity: 0; } }
@keyframes chisel { from { clip-path: inset(-40% 100% -40% -6%); } to { clip-path: inset(-40% -6% -40% -6%); } }

@keyframes paper-float {
  0%   { transform: translate(-50px, -130px) rotate(-14deg); opacity: 0; }
  20%  { opacity: 1; }
  35%  { transform: translate(14px, -20px) rotate(5deg); }
  55%  { transform: translate(6px, -4px) rotate(1.5deg); }
  80%  { transform: translate(-5px, 2px) rotate(-1.2deg); }
  100% { transform: none; opacity: 1; }
}
@keyframes type { from { clip-path: inset(-40% 100% -40% -6%); } to { clip-path: inset(-40% -6% -40% -6%); } }
@keyframes sheet-fold {
  from { clip-path: polygon(4% 19%, 20.5% 5.3%, 60% 5.3%, 92% 5.3%, 92% 32.6%, 92% 60%, 92% 93.1%, 60% 93.1%, 30.7% 93.1%, 4% 93.1%); }
  to   { clip-path: polygon(4% 19%, 20.5% 5.3%, 59.2% 5.3%, 84.5% 14.7%, 92% 32.6%, 83.7% 49.9%, 61.3% 58.4%, 30.7% 58.4%, 30.7% 93.1%, 4% 93.1%); }
}
@keyframes fold-tilt { 0%, 100% { transform: rotateY(0); } 45% { transform: rotateY(-32deg); } }
@keyframes fade-out { to { opacity: 0; } }

@keyframes grain-in {
  from { transform: translate(var(--dx), var(--dy)); opacity: 0; }
  25%  { opacity: 1; }
  to   { transform: translate(0, 0); opacity: 1; }
}
@keyframes grain-out { to { opacity: 0; } }
@keyframes chip-form { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes chip-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(2.4); } }
@keyframes cell-on { to { fill: #2de0c8; } }
@keyframes glyph-in {
  0%   { transform: translate(var(--sx), var(--sy)) scale(1); opacity: 0; }
  20%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate(0, 0) scale(.25); opacity: 0; }
}
@keyframes body-form { from { opacity: 0; transform: scale(.45); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pin-left { from { transform: translateX(26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pin-right { from { transform: translateX(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot-on { from { transform: scale(0); } to { transform: scale(1); } }

/* ==========================================================================
   Studio statement
   ========================================================================== */
.studio { background: var(--ink-2); padding-block: clamp(3.5rem, 6vw, 5.5rem); border-block: 1px solid #ffffff0d; }
.studio-grid { display: grid; gap: 2.5rem; }
.statement { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.15rem); line-height: 1.28; max-width: 30ch; }
.statement-sub { margin-top: 1.5rem; max-width: 52ch; color: var(--muted); font-size: 1.1rem; }
.facts { display: grid; align-content: start; }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--edge); }
.facts div:last-child { border-bottom: 1px solid var(--edge); }
.facts dt { color: var(--muted); font-size: .95rem; }
.facts dd { font-weight: 500; }
@media (min-width: 60rem) {
  .studio-grid { grid-template-columns: 1.25fr 1fr; gap: 5rem; align-items: center; }
}

/* ==========================================================================
   Shared section intro
   ========================================================================== */
.section-intro p { margin-top: 1.25rem; max-width: 52ch; font-size: 1.1rem; color: var(--muted); }
.section-intro.wide h2 { max-width: 22ch; }

/* ==========================================================================
   Rock: Products
   ========================================================================== */
.products { background: var(--ink-2); padding-block: var(--section-y); }
.products-grid { display: grid; gap: 3rem; }
@media (min-width: 60rem) {
  .products-grid { grid-template-columns: 1fr 1.35fr; gap: 5rem; align-items: start; }
  .sticky { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.slabs { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .slabs { grid-template-columns: 1fr 1fr; } }

/* Each slab is a faceted stone: two tones split on a diagonal */
.slab {
  --cut: 18px;
  position: relative; isolation: isolate;
  padding: 1.75rem 1.5rem 1.75rem;
  background: linear-gradient(155deg, #2a2c31 0%, #2a2c31 46%, #212328 46%, #212328 100%);
  transition: background-color .2s ease;
}
.slab::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(155deg, #32353b 0%, #32353b 46%, #2a2d33 46%, #2a2d33 100%);
  opacity: 0; transition: opacity .25s ease;
}
.slab:hover::before { opacity: 1; }
.slab .ico { width: 30px; height: 30px; margin-bottom: 1.5rem; fill: none; stroke: var(--rock); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.slab h3 { color: var(--bone); }
.slab p { margin-top: .6rem; color: var(--muted); font-size: 1rem; }

/* ==========================================================================
   Paper: Services
   ========================================================================== */
.services {
  position: relative;
  background: var(--paper); color: var(--paper-ink);
  padding-block: var(--section-y);
}
/* The folded corner from the P: previous section colour above the fold, fold colour below it */
.fold {
  position: absolute; top: 0; left: 0; width: clamp(48px, 7vw, 88px); aspect-ratio: 1;
  background: linear-gradient(135deg, var(--ink-2) 50%, var(--paper-fold) 50%);
}
.services .section-intro p { color: var(--paper-muted); }

.ledger { margin-top: clamp(2.5rem, 5vw, 4rem); border-top: 2px solid var(--paper-ink); }
.ledger li {
  display: grid; gap: .35rem 2rem; padding: 1.35rem 0;
  border-bottom: 1px solid #14161a30;
  transition: background-color .2s ease, padding-left .2s ease;
}
.ledger li:hover { background: #14161a08; padding-left: .75rem; }
.ledger h3 { font-size: 1.3rem; }
.ledger p { color: var(--paper-muted); max-width: 58ch; }
@media (min-width: 48rem) {
  .ledger li { grid-template-columns: minmax(14rem, 1fr) 2fr; align-items: baseline; }
}

.process { margin-top: clamp(3.5rem, 7vw, 6rem); }
.process-title { font-size: 1.5rem; }
.steps { display: grid; gap: 1.75rem; margin-top: 1.75rem; counter-reset: step; }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 66rem) { .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; } }
.steps li { position: relative; padding-top: 1.25rem; border-top: 2px solid var(--chip); }
.step-n {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: .9rem;
  background: var(--chip); color: var(--bone); font-family: var(--font-display); font-weight: 700;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.steps h4 { font-size: 1.2rem; }
.steps p { margin-top: .4rem; color: var(--paper-muted); font-size: 1rem; }

/* ==========================================================================
   Chip: Gen AI and agents
   ========================================================================== */
.ai {
  position: relative; overflow: hidden;
  background: var(--chip-deep);
  background-image: radial-gradient(#2b52781f 1px, transparent 1px);
  background-size: 28px 28px;
  padding-block: var(--section-y);
}
/* Three pins on the left edge, like the chip's legs */
.ai-pins {
  position: absolute; left: 0; top: clamp(5rem, 9vw, 9rem); width: 16px; height: 14px; background: var(--chip-2);
  box-shadow: 0 54px 0 var(--chip-2), 0 108px 0 var(--chip-2);
}
.ai .section-intro p { color: #b3bfcc; }

.ai-caps { display: grid; gap: 2rem 3rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 44rem) { .ai-caps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 70rem) { .ai-caps { grid-template-columns: repeat(4, 1fr); gap: 2rem; } }
.ai-caps > div { padding-top: 1.1rem; border-top: 1px solid #ffffff22; position: relative; }
.ai-caps > div::before { content: ""; position: absolute; top: -2px; left: 0; width: 2.5rem; height: 3px; background: var(--teal); }
.ai-caps p { margin-top: .5rem; color: #b3bfcc; font-size: 1rem; }

.skills-lab { display: grid; gap: 2.5rem; margin-top: clamp(3.5rem, 7vw, 6rem); }
@media (min-width: 62rem) { .skills-lab { grid-template-columns: 1fr 1.1fr; gap: 4rem; align-items: start; } }
.skills-copy h3 { font-size: 1.6rem; }
.skills-copy > p { margin-top: .8rem; color: #b3bfcc; max-width: 50ch; }
.skills-copy .count { margin-top: 1.25rem; font-family: var(--font-mono); font-size: .9rem; color: var(--teal); }

.skill-list { display: grid; gap: .65rem; margin-top: 1rem; }
.skill-item { position: relative; padding-left: 14px; }
/* Three pins on each skill, teal when the skill is loaded */
.skill-item::before {
  content: ""; position: absolute; left: 0; top: calc(50% - 15px); width: 14px; height: 4px;
  background: var(--chip-2); box-shadow: 0 13px 0 var(--chip-2), 0 26px 0 var(--chip-2); transition: background-color .2s ease, box-shadow .2s ease;
}
.skill-item:has(.skill[aria-pressed="true"])::before {
  background: var(--teal); box-shadow: 0 13px 0 var(--teal), 0 26px 0 var(--teal);
}
.skill {
  --cut: 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%;
  padding: .85rem 1.1rem .85rem 1.25rem; text-align: left; cursor: pointer; border: 0;
  background: var(--chip); color: var(--bone); font: inherit;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.skill:hover { background: #254666; }
.skill[aria-pressed="true"] { background: #264a6c; box-shadow: inset 4px 0 0 var(--teal); }
.skill-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.skill-desc { font-size: .9rem; color: #aebccb; }

.run {
  --cut: 20px;
  background: #0a141f; padding: 1.5rem; font-family: var(--font-mono); font-size: .88rem; line-height: 1.55;
  box-shadow: inset 0 0 0 1px #2b527866;
  min-height: 30rem;
}
.run-head { display: flex; align-items: center; gap: .6rem; padding-bottom: 1rem; border-bottom: 1px solid #ffffff1c; color: #b3bfcc; }
.run-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.run-task { margin-top: 1rem; color: var(--bone); }
.run-label { display: block; margin-bottom: .15rem; color: #7f93a8; }
.run-log { display: grid; gap: .9rem; margin-top: 1.25rem; }
.run-log li { padding-left: 1rem; border-left: 2px solid var(--teal); }
.run-log .call { display: block; color: var(--teal); word-break: break-word; }
.run-log .res { display: block; color: var(--bone); }
.run-outcome { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed #ffffff30; color: #d9e2ea; }
.fineprint { margin-top: 1rem; font-size: .85rem; color: #8ea1b4; }

@media (prefers-reduced-motion: no-preference) {
  .run-log li.is-new { animation: log-in .4s ease-out both; }
}
@keyframes log-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { background: var(--ink); padding-block: var(--section-y); border-top: 1px solid var(--teal); }
.contact-grid { display: grid; gap: 3.5rem; }
@media (min-width: 60rem) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; } }
.contact h2 { max-width: 14ch; }
.contact-lede { margin-top: 1.25rem; max-width: 44ch; font-size: 1.1rem; color: var(--muted); }

.contact-list { margin-top: 2.25rem; border-top: 1px solid var(--edge); }
.contact-list li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--edge); }
.c-label { color: var(--muted); }
.c-value { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
.c-value a { width: fit-content; text-decoration: underline; text-decoration-color: #ffffff40; text-underline-offset: 4px; transition: text-decoration-color .15s ease, color .15s ease; }
.c-value a:hover { color: var(--teal); text-decoration-color: var(--teal); }
.c-value address { font-style: normal; }

.form {
  --cut: 22px;
  display: flex; flex-direction: column; padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--ink-3);
}
.form h3 { font-size: 1.5rem; }
.form-note { margin-top: .35rem; margin-bottom: 1.25rem; color: var(--muted); font-size: .95rem; }
.form label { margin-top: 1rem; margin-bottom: .35rem; font-size: .95rem; font-weight: 500; }
.form input, .form select, .form textarea {
  width: 100%; padding: .8rem .9rem; font: inherit; color: var(--bone);
  background: var(--ink); border: 1px solid var(--edge); border-radius: 0;
  transition: border-color .15s ease;
}
.form textarea { resize: vertical; min-height: 7rem; }
.form input:hover, .form select:hover, .form textarea:hover { border-color: #565c66; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.form input[aria-invalid="true"], .form textarea[aria-invalid="true"] { border-color: #ff8a7a; }
.form-error { margin-top: 1rem; color: #ff9d8f; font-size: .95rem; }
.form .btn { margin-top: 1.5rem; align-self: flex-start; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); border-top: 1px solid #ffffff12; padding-block: 2.25rem; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; }
.foot-brand { font-size: 1.15rem; }
.foot-addr, .foot-copy { color: var(--muted); font-size: .92rem; }

/* ==========================================================================
   404 page
   ========================================================================== */
.nf { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1.25rem; }
.nf h1 { max-width: 14ch; }
.nf .lede { margin-top: 0; }
