/* ==========================================================================
   Tempo — gridded specimen system
   ========================================================================== */

:root {
  /* colour: neutrals */
  --paper: #ffffff;
  --surface: #f5f7fa;
  --grid: #e6ebf2;
  --grid-strong: #d3dbe8;
  --ink: #111216;
  --ink-2: #4a4f5c;
  --ink-3: #6b7180;

  /* colour: the one accent (the style composer swaps --accent-base) */
  --accent-base: #0a3cff;
  --accent-night: #5b7cff;
  --accent: var(--accent-base);
  --accent-deep: color-mix(in oklab, var(--accent) 78%, black);
  --accent-wash: color-mix(in oklab, var(--accent) 7%, var(--paper));
  --accent-soft: color-mix(in oklab, var(--accent) 30%, var(--paper));
  --accent-dash: color-mix(in srgb, var(--accent) 50%, transparent);
  --on-accent: #ffffff;
  --on-accent-2: color-mix(in oklab, var(--accent) 8%, white);
  --on-accent-3: color-mix(in oklab, var(--accent) 15%, white);
  --on-accent-line: color-mix(in srgb, var(--on-accent) 55%, transparent);

  /* colour: code editor */
  --code-bg: #0e0f12;
  --code-line: #262a33;
  --code-ink: #e6e8ee;
  --code-dim: #8a90a0;
  --code-key: color-mix(in oklab, var(--accent-base) 45%, white);
  --code-str: color-mix(in oklab, var(--accent-base) 22%, white);

  /* type */
  --f-display: "Chakra Petch", "Archivo", system-ui, sans-serif;
  --f-text: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --d-weight: 600;
  --d-wdth: 100;
  --d-track: -0.01em;
  --d-scale: 1;

  /* shape */
  --radius: 0px;
  --radius-btn: 0px;
  --corner: round;
  --cell-r: 0px;

  /* space */
  --cell: 24px;
  --gutter: clamp(16px, 2.5vw, 40px);
  --head-h: 64px;
  --section-y: clamp(80px, 10vw, 152px);

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
  interpolate-size: allow-keywords;
}

/* ---------- composer: mode ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0e11;
  --surface: #15171c;
  --grid: #1a1d23;
  --grid-strong: #2a2e37;
  --ink: #eef0f4;
  --ink-2: #aab0bd;
  --ink-3: #8a90a0;
  --accent: var(--accent-night, #5b7cff);
  --on-accent: #0d0e11;
  --on-accent-2: color-mix(in oklab, var(--accent) 22%, #0d0e11);
  --on-accent-3: color-mix(in oklab, var(--accent) 32%, #0d0e11);
  --code-bg: #15171c;
}

/* ---------- composer: headline typeface ---------- */
html[data-font="grotesk"] { --f-display: "Archivo", system-ui, sans-serif; --d-weight: 800; --d-wdth: 125; --d-track: -0.02em; --d-scale: 0.84; }
html[data-font="code"] { --f-display: "JetBrains Mono", ui-monospace, monospace; --d-weight: 700; --d-track: -0.045em; --d-scale: 0.86; }
html[data-font="serif"] { --f-display: "Bodoni Moda", "Times New Roman", serif; --d-weight: 700; --d-track: -0.015em; --d-scale: 1.02; }

/* ---------- composer: corners ---------- */
html[data-corner="cut"] { --radius: 12px; --radius-btn: 12px; --corner: bevel; }
html[data-corner="round"] { --radius: 16px; --radius-btn: 999px; --cell-r: 0.3px; }
@supports not (corner-shape: bevel) {
  html[data-corner="cut"] { --radius: 3px; --radius-btn: 3px; }
}

/* ---------- composer: grid density ---------- */
html[data-density="fine"] { --cell: 16px; }
html[data-density="large"] { --cell: 40px; }

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--head-h) + 16px);
  scrollbar-color: var(--accent) var(--surface);
  scrollbar-width: thin;
}
html.motion { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
html[data-grid="off"] body { background-image: none; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; color: var(--grid-strong); }

/* ---------- shared type ---------- */
.h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: calc(clamp(2.25rem, 5vw, 4.75rem) * var(--d-scale));
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.sec-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.sec-head .h2 { grid-column: 1 / span 7; }
.sec-lead {
  grid-column: 8 / -1;
  max-width: 46ch;
  color: var(--ink-2);
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  min-width: 248px;
  min-height: 56px;
  padding: 0 14px 0 20px;
  border: 1px solid var(--accent);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--f-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--solid { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }
.btn--line { --btn-bg: var(--paper); }
.btn--paper { --btn-bg: var(--paper); --btn-fg: var(--accent); border-color: var(--paper); }
.btn--sm { min-width: 0; min-height: 40px; gap: 20px; padding: 0 10px 0 14px; font-size: 13px; }

.slash {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  transition: transform 220ms var(--ease-out);
}
.btn--sm .slash { width: 16px; height: 16px; }

@media (hover: hover) and (pointer: fine) {
  .btn--solid:hover { --btn-bg: var(--accent-deep); }
  .btn--line:hover { --btn-bg: var(--accent-wash); }
  .btn--paper:hover { --btn-bg: var(--accent-wash); }
  .btn:hover .slash { transform: rotate(-45deg); }
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--head-h);
  background: var(--paper);
  border-bottom: 1px solid var(--accent);
}
.head-row {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; color: var(--ink); justify-self: start; padding-block: 8px; }
.logo { height: 22px; width: auto; }
.logo-slash { fill: var(--accent); }

.nav-list { display: flex; gap: clamp(14px, 2.2vw, 40px); }
.nav-list a {
  display: inline-block;
  padding: 8px 2px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left bottom 4px / 0 1px;
  transition: background-size 220ms var(--ease-out);
}
.nav-list a:hover { background-size: 100% 1px; }
@media (min-width: 901px) {
  .nav-list a { position: relative; isolation: isolate; padding-inline: 10px; transition: background-size 220ms var(--ease-out), color 180ms ease; }
  .nav-list a::before {
    content: "";
    position: absolute;
    inset: 2px 0;
    z-index: -1;
    background: var(--accent);
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    opacity: 0;
    transform: scaleX(0.92);
    transition: opacity 180ms ease, transform 220ms var(--ease-out);
  }
  .nav-list a[aria-current="true"] { color: var(--on-accent); background-size: 0 1px; }
  .nav-list a[aria-current="true"]::before { opacity: 1; transform: none; }
}
.nav-cta-mobile { display: none; }

.head-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }

.grid-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px dashed var(--accent-dash);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}
.grid-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.grid-toggle[aria-pressed="true"] { border-style: solid; border-color: var(--accent); color: var(--accent); }
.grid-toggle:active { transform: scale(0.97); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  background: var(--paper);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.menu-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.menu-toggle path { transition: transform 200ms var(--ease-out); transform-origin: center; transform-box: fill-box; }
.menu-toggle[aria-expanded="true"] .m1 { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .m2 { transform: translateY(-4px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; }
.hero-mark { padding-top: clamp(24px, 4.5vh, 56px); }

.wordmark {
  width: 100%;
  height: auto;
  max-height: max(140px, calc(100svh - var(--head-h) - 440px));
  color: var(--grid-strong);
  overflow: visible;
  cursor: crosshair;
  touch-action: manipulation;
}
.wordmark--stack { display: none; }
.wm-cells { fill: var(--ink); }
.wm-slash { fill: var(--accent); }
.wm-user rect { fill: var(--accent); }
.wm-cross { opacity: 0; pointer-events: none; }
.wm-cross.is-on { opacity: 1; }
.wm-cross-h,
.wm-cross-v { fill: var(--accent); opacity: 0.07; }
.wm-cursor { fill: none; stroke: var(--accent); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
html[data-grid="off"] .wm-grid { display: none; }

html.motion .wm-l > * {
  transform-box: fill-box;
  transform-origin: center;
  animation: cell-in 420ms var(--ease-out) both;
  animation-delay: var(--d);
}
html.motion .wm-slash {
  animation: slash-in 640ms var(--ease-in-out) 1.15s both;
}
@keyframes cell-in {
  from { opacity: 0; transform: scale(0.35); }
}
@keyframes slash-in {
  from { clip-path: inset(100% 0 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.hero-split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: clamp(20px, 3vh, 36px);
  padding-top: clamp(24px, 3.5vh, 40px);
  border-top: 1px solid var(--accent);
}
.hero-copy { grid-column: 1 / span 7; align-self: start; }
.hero-title {
  max-width: 21ch;
  font-size: clamp(1.75rem, 2.75vw, 2.875rem);
  font-weight: 500;
  font-variation-settings: "wdth" 96;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-sub {
  max-width: 54ch;
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 17px;
}
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }

.hero-module {
  grid-column: 9 / -1;
  align-self: start;
  border: 1px solid var(--accent);
  background: var(--paper);
}
.module-title {
  padding: 12px 18px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.build-list li + li { border-top: 1px solid var(--grid-strong); }
.build-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  align-items: center;
  padding: 12px 18px;
  text-decoration: none;
  transition: background-color 160ms ease;
}
.bl-name {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}
.bl-desc { grid-column: 1; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .build-list a:hover { background: var(--accent-wash); }
  .build-list a:hover .arrow { transform: translate(2px, -2px); }
}

.readout {
  margin-top: clamp(28px, 4vh, 48px);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  background: var(--paper);
}
.readout-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ro-cell output {
  display: inline-block;
  min-width: 11ch;
  margin-left: 6px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ro-hint { flex: 1; font-size: 14px; letter-spacing: 0; text-transform: none; }
.ro-reset {
  padding: 4px 10px;
  border: 1px solid var(--accent);
  background: var(--paper);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 160ms var(--ease-out);
}
.ro-reset:active { transform: scale(0.97); }

/* ---------- sections ---------- */
.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--accent);
}
.ribbon + .section { border-top: 0; }

/* ---------- same grid ---------- */
.sg-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: end;
}
.sg-head .h2 { grid-column: 1 / span 7; font-size: calc(clamp(2rem, 4.2vw, 4rem) * var(--d-scale)); }
.sg-text { grid-column: 9 / -1; display: grid; gap: 12px; color: var(--ink-2); max-width: 46ch; }

.compare {
  position: relative;
  margin-top: clamp(40px, 5vw, 72px);
  height: clamp(440px, 40vw, 580px);
  border: 1px solid var(--accent);
  background: var(--surface);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.cmp-layer { position: absolute; inset: 0; }
.cmp-code {
  display: grid;
  place-items: center;
  background-color: var(--code-bg);
}
.code-cols {
  display: grid;
  grid-template-columns: auto auto;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: 64px 40px;
}
.code {
  margin: 0;
  font-family: var(--f-code);
  font-size: 14px;
  line-height: 1.75;
  color: var(--code-ink);
  white-space: pre;
}
.t-k { color: var(--code-key); font-weight: 500; }
.t-a { color: var(--code-ink); }
.t-s { color: var(--code-str); }
.t-p { color: var(--code-dim); }

.cmp-design {
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}
html[data-grid="off"] .cmp-design { background-image: none; }
.cmp-design::before {
  content: "";
  position: absolute;
  inset: 0 40px;
  background: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--accent) 7%, transparent) 0 calc((100% - 11 * 16px) / 12),
    transparent calc((100% - 11 * 16px) / 12) calc((100% - 11 * 16px) / 12 + 16px)
  );
  pointer-events: none;
}

.cmp-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  background: var(--paper);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cmp-tag--right { left: auto; right: 16px; }

.spec-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(304px, 70%);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--accent);
  background: var(--paper);
  outline: 1px dashed var(--accent-dash);
  outline-offset: 10px;
}
.spec-img {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background-color: var(--surface);
  background-image: radial-gradient(var(--grid-strong) 1px, transparent 1.4px);
  background-size: 12px 12px;
}
.spec-img svg { width: 48%; fill: var(--ink); }
.spec-img svg .b { fill: var(--accent); }
.spec-body { position: relative; display: grid; gap: 4px; }
.spec-name { font-family: var(--f-display); font-size: 24px; font-weight: 600; text-transform: uppercase; line-height: 1.1; }
.spec-meta { color: var(--ink-2); font-size: 14px; }
.spec-btn {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.dim {
  position: absolute;
  padding: 1px 5px;
  border: 1px solid var(--accent);
  background: var(--paper);
  color: var(--accent);
  font-family: var(--f-code);
  font-size: 11px;
  line-height: 1.4;
}
.dim--pad { left: -24px; top: -24px; transform: translate(-50%, -50%); }
.dim--gap { right: -24px; top: 54px; transform: translateX(50%); }

.cmp-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 44px;
  margin-left: -22px;
  z-index: 2;
  display: grid;
  place-items: center;
  cursor: ew-resize;
  touch-action: none;
  outline: none;
  will-change: transform;
}
.cmp-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--accent);
}
.cmp-grip {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--on-accent);
  transition: transform 160ms var(--ease-out);
}
.cmp-grip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.cmp-handle:active .cmp-grip,
.cmp-handle.is-dragging .cmp-grip { transform: scale(0.94); }
.cmp-handle:focus-visible .cmp-grip { outline: 2px solid var(--accent); outline-offset: 3px; }
.cmp-caption { position: absolute; left: 16px; bottom: 14px; z-index: 1; max-width: calc(100% - 32px); color: var(--ink-2); font-size: 14px; }

/* ---------- projects ---------- */
.pj-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}
.pj--7 { grid-column: span 7; }
.pj--5 { grid-column: span 5; }
.pj--4 { grid-column: span 4; }

.pj article,
.slot {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--accent);
  background: var(--paper);
}
.pj-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--grid-strong);
}
.pj-no {
  padding: 2px 6px;
  margin-left: -6px;
  color: var(--accent);
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 180ms ease, color 180ms ease;
}
.pj-tag {
  padding: 2px 7px;
  border: 1px dashed var(--ink-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pj-art { flex: 1; display: grid; place-items: center; padding: clamp(16px, 2vw, 28px); }
.illus { width: 100%; height: auto; max-height: 380px; color: var(--grid); }
.illus .c-\# { fill: var(--ink); }
.illus .c-b { fill: var(--accent); }
.illus .c-g { fill: var(--grid-strong); }
.illus .c-d { fill: var(--accent); }
.illus > :not(.illus-grid) {
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 300ms var(--ease-out) var(--d),
    transform 360ms var(--ease-out) var(--d),
    fill 200ms ease;
}
html.motion .illus:not(.is-built) > :not(.illus-grid) { opacity: 0; transform: scale(0.3); }
html[data-grid="off"] .illus-grid { opacity: 0; }

.pj-foot { padding: 14px 18px 18px; border-top: 1px solid var(--grid-strong); }
.pj-name {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 600;
  line-height: 1.05;
  text-transform: uppercase;
}
.pj-meta { margin-top: 4px; color: var(--ink-2); font-size: 15px; }

@media (hover: hover) and (pointer: fine) {
  .pj article:hover .pj-no { background: var(--accent); color: var(--on-accent); }
  .pj article:hover .illus .c-g { fill: var(--accent-soft); }
}

.slot {
  border-style: dashed;
  text-decoration: none;
  background-color: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 30%, transparent) 1px, transparent 1.4px);
  background-size: var(--cell) var(--cell);
  background-position: 12px 12px;
  transition: background-color 180ms ease, transform 160ms var(--ease-out);
}
.slot .pj-top { border-bottom-style: dashed; border-bottom-color: var(--accent-dash); }
.slot-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 260px;
  padding: clamp(20px, 2.5vw, 36px);
}
.slot-title {
  color: var(--accent);
  font-family: var(--f-display);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 600;
  line-height: 0.95;
  text-transform: uppercase;
}
.slot-text { max-width: 36ch; color: var(--ink-2); }
.slot-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.slot-cta .slash { width: 18px; height: 18px; }
.slot:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .slot:hover { background-color: var(--accent-wash); border-style: solid; }
  .slot:hover .slash { transform: rotate(-45deg); }
}

/* ---------- expertise ---------- */
.exp-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
}
.sec-head--side {
  grid-column: 1 / span 4;
  display: block;
  position: sticky;
  top: calc(var(--head-h) + 32px);
  margin: 0;
}
.sec-head--side .sec-lead { margin-top: 20px; }
.svc-list { grid-column: 6 / -1; display: grid; gap: 12px; }

.svc {
  border: 1px dashed var(--accent-dash);
  background: var(--paper);
  transition: border-color 200ms ease;
}
.svc[open] { border-style: solid; border-color: var(--accent); }
.svc summary {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  row-gap: 4px;
  align-items: center;
  padding: clamp(18px, 2vw, 26px) clamp(18px, 2vw, 28px);
  cursor: pointer;
  list-style: none;
}
.svc summary::-webkit-details-marker { display: none; }
.svc-name {
  font-family: var(--f-display);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}
.svc-line { grid-column: 1; color: var(--ink-2); }
.plus {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  transition: transform 240ms var(--ease-out);
}
.svc[open] .plus { transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) {
  .svc:not([open]) summary:hover { background: var(--accent-wash); }
}
.svc::details-content {
  block-size: 0;
  overflow: clip;
  transition:
    block-size 320ms var(--ease-out),
    content-visibility 320ms allow-discrete;
}
.svc[open]::details-content { block-size: auto; }
html:not(.motion) .svc::details-content { transition: none; }
.svc-body { padding: 0 clamp(18px, 2vw, 28px) clamp(20px, 2.4vw, 30px); }
.svc-body p { max-width: 60ch; }
.svc-deliv { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.svc-deliv li {
  padding: 6px 10px;
  border: 1px solid var(--grid-strong);
  background: var(--surface);
  font-size: 14px;
}

/* ---------- audience ---------- */
.aud-table { border-top: 1px solid var(--accent); }
.aud-row {
  display: grid;
  grid-template-columns: 3fr 5fr 4fr;
  gap: var(--gutter);
  padding: clamp(18px, 2vw, 28px) 0;
  border-bottom: 1px solid var(--grid-strong);
  align-items: baseline;
}
.aud-row--head {
  padding: 10px 0;
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.aud-who {
  font-family: var(--f-display);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
}
.aud-what { color: var(--accent); }

/* ---------- method ---------- */
.steps-track {
  position: relative;
  height: 1px;
  background: var(--grid-strong);
}
.steps-progress {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left center;
}
@supports (animation-timeline: view()) {
  html.motion .steps-progress {
    animation: track-grow linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
  }
}
@keyframes track-grow { from { transform: scaleX(0); } }

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
}
.step { position: relative; padding-top: 40px; counter-increment: step; }
.step::before {
  content: counter(step);
  position: absolute;
  top: -16px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.step-name {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-size: clamp(28px, 2.8vw, 40px);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}
.step p { max-width: 34ch; color: var(--ink-2); }

/* ---------- studio ---------- */
.studio-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}
.studio-layout .h2 { grid-column: 1 / span 4; }
.studio-statement {
  grid-column: 5 / -1;
  max-width: 30ch;
  font-size: clamp(1.5rem, 2.7vw, 2.5rem);
  font-weight: 500;
  font-variation-settings: "wdth" 96;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.principles {
  grid-column: 1 / -1;
  margin-top: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--accent);
}
.principles li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: center;
  padding: clamp(18px, 2vw, 26px) 0;
  border-bottom: 1px solid var(--grid-strong);
}
.pr-diagram {
  grid-column: 1 / span 2;
  width: 100%;
  max-width: 156px;
  height: auto;
  color: var(--grid-strong);
}
.pr-diagram .c-ink { fill: var(--ink); }
.pr-diagram .c-b { fill: var(--accent); }
.pr-dash { fill: none; stroke: var(--accent); stroke-width: 0.04; stroke-dasharray: 0.16 0.12; }
.pr-diag { fill: none; stroke: var(--accent); stroke-width: 0.14; }
.pr-arrow { fill: none; stroke: var(--accent); stroke-width: 0.07; }
html[data-grid="off"] .pr-grid { opacity: 0; }
.principles h3 {
  grid-column: 3 / span 4;
  font-family: var(--f-display);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
}
.principles p { grid-column: 7 / -1; color: var(--ink-2); max-width: 52ch; }

/* ---------- contact ---------- */
.contact {
  padding-block: var(--section-y);
  background-color: var(--accent);
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--on-accent) 12%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--on-accent) 12%, transparent) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  color: var(--on-accent);
}
html[data-grid="off"] .contact { background-image: none; }
.contact ::selection { background: var(--paper); color: var(--accent); }
.contact :focus-visible { outline-color: var(--paper); }

.contact-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
}
.contact-intro { grid-column: 1 / span 5; }
.contact-intro > p { margin-top: 24px; max-width: 40ch; color: var(--on-accent-2); font-size: 18px; }
.coords { margin-top: clamp(32px, 4vw, 56px); border-top: 1px solid var(--on-accent-line); }
.coords > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--on-accent-line);
  align-items: baseline;
}
.coords dt {
  color: var(--on-accent-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.coords dd { font-size: 17px; }
.coords a { text-decoration: none; }
[data-placeholder] { border-bottom: 1px dashed currentColor; opacity: 0.9; }

.form {
  grid-column: 7 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}
.field { display: grid; gap: 6px; min-width: 0; }
.field--wide,
.chips,
.form-foot,
.field:nth-child(3) { grid-column: 1 / -1; }
.field label,
.field legend {
  color: var(--on-accent-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.opt { margin-left: 6px; color: var(--on-accent-3); font-weight: 500; letter-spacing: 0.04em; text-transform: none; }
.field input,
.field textarea {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--on-accent-line);
  border-radius: 0;
  background: transparent;
  color: var(--on-accent);
  caret-color: var(--on-accent);
  font-size: 18px;
  line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { resize: vertical; min-height: 128px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--on-accent-3); }
.field input:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--on-accent); box-shadow: 0 1px 0 var(--on-accent); }
.field [aria-invalid="true"] { border-bottom: 2px dashed var(--on-accent); box-shadow: none; }
.field-error { color: var(--on-accent); font-size: 14px; font-weight: 600; }

.chips { margin: 0; padding: 0; border: 0; }
.chips legend { margin-bottom: 10px; padding: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block;
  padding: 9px 14px;
  border: 1px dashed var(--on-accent-line);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}
.chip input:checked + span { border-style: solid; border-color: var(--paper); background: var(--paper); color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--paper); outline-offset: 3px; }
.chip:active span { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover input:not(:checked) + span { border-color: var(--paper); }
}

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 4px; }
.form-status { color: var(--on-accent-2); font-size: 15px; max-width: 40ch; }

/* ---------- footer ---------- */
.site-foot { padding: clamp(40px, 5vw, 72px) 0 28px; background: var(--paper); }
.logo--foot { width: 100%; height: auto; color: var(--ink); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  margin-top: clamp(24px, 3vw, 40px);
  padding-top: 18px;
  border-top: 1px solid var(--accent);
  color: var(--ink-2);
  font-size: 14px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .hero-copy { grid-column: 1 / span 7; }
  .hero-module { grid-column: 8 / -1; }
  .sg-text { grid-column: 8 / -1; }
}

@media (max-width: 900px) {
  :root { --head-h: 60px; }
  .head-row { grid-template-columns: auto 1fr auto; }
  .menu-toggle { display: inline-flex; }
  .head-cta { display: none; }
  .nav { position: static; }
  .nav-list {
    position: fixed;
    top: var(--head-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--accent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 200ms ease, transform 240ms var(--ease-out), visibility 0s linear 240ms;
  }
  .nav-list.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 200ms ease, transform 240ms var(--ease-out), visibility 0s;
  }
  .nav-list li { border-bottom: 1px solid var(--grid-strong); }
  .nav-list a {
    display: block;
    padding: 16px 0;
    color: var(--ink);
    font-family: var(--f-display);
    font-size: 28px;
    letter-spacing: 0;
    background: none;
  }
  .nav-cta-mobile { display: block; }
  .nav-cta-mobile a { color: var(--accent); }

  .wordmark { max-height: none; }
  .hero-split,
  .sg-head,
  .sec-head,
  .exp-layout,
  .studio-layout,
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-copy,
  .hero-module,
  .sg-head .h2,
  .sg-text,
  .sec-head .h2,
  .sec-lead,
  .sec-head--side,
  .svc-list,
  .studio-layout .h2,
  .studio-statement,
  .contact-intro,
  .form { grid-column: 1 / -1; }
  .hero-module { margin-top: 12px; }
  .sec-head--side { position: static; margin-bottom: 32px; }
  .sec-lead { margin-top: 4px; }

  .pj--7,
  .pj--5,
  .pj--4 { grid-column: span 6; }
  .pj--slot { grid-column: 1 / -1; }

  .steps-track { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .step { border-top: 1px solid var(--accent); }

  .principles li { grid-template-columns: 96px minmax(0, 1fr); row-gap: 8px; }
  .pr-diagram { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
  .principles h3,
  .principles p { grid-column: 2; }

  .form { margin-top: 48px; }

  .code-cols { grid-template-columns: auto; gap: 20px; padding: 64px 24px 72px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .grid-toggle { width: 40px; justify-content: center; padding: 0; }
  .btn { width: 100%; min-width: 0; }
  .pj--7,
  .pj--5,
  .pj--4 { grid-column: 1 / -1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .aud-row--head { display: none; }
  .aud-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .coords > div { grid-template-columns: 96px 1fr; }
  .wordmark--line { display: none; }
  .wordmark--stack { display: block; }

  /* comparison: maquette on top, code below */
  .compare { height: 640px; }
  .cmp-code { place-items: end start; }
  .code--html { display: none; }
  .code-cols { padding: 0 20px 72px; }
  .code { font-size: 13px; }
  .spec-card { top: 25%; padding: 16px; gap: 12px; width: min(250px, 72%); }
  .spec-img { aspect-ratio: 16 / 9; }
  .spec-img svg { width: 30%; }
  .spec-name { font-size: 20px; }
  .spec-btn { margin-top: 8px; padding: 10px 12px; }
  .cmp-design::before { inset: 0 20px; }
  .cmp-tag--right { top: calc(50% + 14px); left: auto; right: 16px; }
  .cmp-handle { top: 0; left: 0; right: 0; bottom: auto; width: auto; height: 44px; margin: -22px 0 0; cursor: ns-resize; }
  .cmp-handle::before { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 1px; }
  .cmp-grip svg { transform: rotate(90deg); }
  .cmp-caption { font-size: 13px; }
  .dim--pad { left: -14px; top: -14px; }
  .dim--gap { right: -12px; }
  .readout-row { flex-wrap: wrap; gap: 4px 16px; padding-block: 10px; }
  .ro-hint { flex-basis: 100%; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
  .btn,
  .grid-toggle,
  .svc,
  .chip span { transition-duration: 160ms !important; transition-property: background-color, color, border-color !important; }
}

/* ==========================================================================
   Style composer, code layer, scroll choreography
   ========================================================================== */

/* ---------- composer reach: every display face ---------- */
.h2,
.bl-name,
.spec-name,
.pj-name,
.pj-no,
.slot-title,
.svc-name,
.aud-who,
.step-name,
.step::before,
.principles h3,
.pv-title {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-variation-settings: "wdth" var(--d-wdth);
  letter-spacing: var(--d-track);
}

/* ---------- composer reach: every frame takes the chosen corner ---------- */
.btn,
.grid-toggle,
.menu-toggle,
.ro-reset,
.cmp-tag,
.cmp-grip,
.spec-btn,
.chip span,
.opt-chip span,
.swatch span,
.pj-tag,
.editor-copy,
.dock-more,
.dock-theme { border-radius: var(--radius-btn); corner-shape: var(--corner); }

.hero-module,
.compare,
.spec-card,
.spec-img,
.pj article,
.slot,
.svc,
.svc-deliv li,
.editor,
.preview,
.dock { border-radius: var(--radius); corner-shape: var(--corner); }

.hero-module,
.pj article,
.svc { overflow: hidden; }
.step::before { border-radius: calc(var(--radius) / 2); corner-shape: var(--corner); }
.dock-sw,
.swatch i { border-radius: calc(var(--radius) / 2); corner-shape: var(--corner); }

.wm-l rect,
.wm-user rect { rx: calc(var(--cell-r) * 0.5); }
.illus rect:not(.illus-grid),
.pr-diagram rect:not(.pr-grid) { rx: calc(var(--cell-r) * 0.6); }

.wordmark { color: var(--grid-strong); }
html[data-theme="dark"] .wm-grid--over { display: none; }

/* ---------- smooth scroll (Lenis) ---------- */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- source annotations: every section shows its tag ---------- */
[data-tag] { position: relative; }
[data-tag]::before,
[data-tag]::after {
  position: absolute;
  right: var(--gutter);
  z-index: 2;
  font-family: var(--f-code);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
[data-tag]::before {
  content: "<section id=\"" attr(data-tag) "\">";
  top: 14px;
  padding: 5px 8px;
  border: 1px solid var(--accent);
  background: var(--paper);
  color: var(--accent);
  border-radius: calc(var(--radius) / 2);
}
[data-tag]::after {
  content: "</section>";
  bottom: 18px;
  color: var(--ink-3);
}
.contact[data-tag]::before { background: var(--accent); border-color: var(--on-accent-line); color: var(--on-accent); }
.contact[data-tag]::after { color: var(--on-accent-3); }

/* ---------- code ribbon ---------- */
.ribbon {
  overflow: hidden;
  border-block: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent-2);
}
.ribbon-track { display: flex; width: max-content; padding-block: 15px; will-change: transform; }
.ribbon-set {
  display: flex;
  flex: none;
  gap: 56px;
  padding-right: 56px;
  font-family: var(--f-code);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
.ribbon-set > span { display: inline-block; }
.ribbon-set > span::after {
  content: "";
  display: inline-block;
  margin-left: 56px;
  vertical-align: -2px;
  width: 14px;
  height: 14px;
  background: linear-gradient(to bottom right, transparent calc(50% - 0.75px), var(--on-accent-3) calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px));
}
.ribbon b { color: var(--on-accent); font-weight: 700; }

/* ---------- editor gutter: the page grid as numbered lines ---------- */
body { position: relative; }
.gutter {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: none;
  width: calc(var(--gutter) - 8px);
  pointer-events: none;
  color: var(--ink-3);
  font-family: var(--f-code);
  font-size: 10px;
  line-height: var(--cell);
  text-align: right;
  white-space: pre;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.gutter-cur {
  position: absolute;
  left: 0;
  right: -4px;
  top: 0;
  height: var(--cell);
  border-right: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  will-change: transform;
}
@media (min-width: 1200px) { .gutter { display: block; } }
html[data-grid="off"] .gutter { display: none; }

/* ---------- headline reveal: words rise from their own cell ---------- */
html.motion [data-split] .w {
  display: inline-block;
  overflow: clip;
  padding-block: 0.24em 0.14em;
  margin-block: -0.24em -0.14em;
  vertical-align: top;
}
html.motion [data-split].is-done .w { overflow: visible; }
html.motion [data-split] .wi {
  display: inline-block;
  transition: transform 820ms var(--ease-reveal);
  transition-delay: calc(var(--li, 0) * 90ms + var(--wi, 0) * 16ms);
}
html.motion [data-split].is-split:not(.is-in) .wi { transform: translateY(112%); }

/* ---------- style composer ---------- */
.styler-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
}
.styler-controls { grid-column: 1 / span 5; display: grid; gap: 26px; }
.styler-out {
  grid-column: 7 / -1;
  position: sticky;
  top: calc(var(--head-h) + 32px);
  display: grid;
  gap: 16px;
}
.ctl { margin: 0; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--grid-strong); min-width: 0; }
.ctl legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch,
.opt-chip { position: relative; cursor: pointer; }
.swatch input,
.opt-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch span,
.opt-chip span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px dashed var(--ink-3);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 160ms var(--ease-out);
}
.swatch i { flex: none; width: 18px; height: 18px; background: var(--sw); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.opt-chip svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.opt-font b { font-size: 20px; font-weight: 600; line-height: 1; }
[data-font-sample="tech"] b { font-family: "Chakra Petch", sans-serif; }
[data-font-sample="grotesk"] b { font-family: "Archivo", sans-serif; font-weight: 800; font-variation-settings: "wdth" 125; }
[data-font-sample="code"] b { font-family: "JetBrains Mono", monospace; font-weight: 700; }
[data-font-sample="serif"] b { font-family: "Bodoni Moda", "Times New Roman", serif; font-weight: 800; font-variation-settings: "opsz" 11; }

.swatch input:checked + span,
.opt-chip input:checked + span { border-style: solid; border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.swatch input:checked + span i { box-shadow: 0 0 0 2px var(--on-accent); }
.swatch input:focus-visible + span,
.opt-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.swatch:active span,
.opt-chip:active span { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .swatch:hover input:not(:checked) + span,
  .opt-chip:hover input:not(:checked) + span { border-color: var(--accent); }
}
.styler-foot { display: flex; flex-wrap: wrap; gap: 12px; }

.editor {
  overflow: hidden;
  border: 1px solid var(--code-bg);
  background: var(--code-bg);
  color: var(--code-ink);
}
html[data-theme="dark"] .editor { border-color: var(--grid-strong); }
.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--code-line);
  color: var(--code-dim);
  font-family: var(--f-code);
  font-size: 13px;
}
.editor-file { display: inline-flex; align-items: center; gap: 10px; }
.editor-file::before { content: ""; width: 8px; height: 8px; background: var(--code-key); }
.editor-copy {
  position: relative;
  min-width: 132px;
  padding: 6px 10px;
  border: 1px solid var(--code-line);
  background: transparent;
  color: var(--code-ink);
  font-family: var(--f-code);
  font-size: 13px;
  transition: border-color 160ms ease, transform 160ms var(--ease-out);
}
.editor-copy:active { transform: scale(0.97); }
.editor-copy span { display: inline-block; transition: filter 200ms ease, opacity 200ms ease; }
.editor-copy.is-swapping span { filter: blur(3px); opacity: 0.4; }
@media (hover: hover) and (pointer: fine) { .editor-copy:hover { border-color: var(--code-key); } }
.editor-code {
  margin: 0;
  padding: 16px 0 18px;
  overflow-x: auto;
  font-family: var(--f-code);
  font-size: 14px;
  line-height: 1.8;
  counter-reset: ln;
  tab-size: 2;
}
.editor-code .ln { display: block; padding-right: 18px; counter-increment: ln; white-space: pre; }
.editor-code .ln::before {
  content: counter(ln);
  display: inline-block;
  width: 4ch;
  margin-right: 18px;
  padding-right: 10px;
  border-right: 1px solid var(--code-line);
  color: var(--code-dim);
  text-align: right;
  opacity: 0.7;
}
.editor-code .ln.is-hot { animation: line-hot 1400ms var(--ease-out); }
@keyframes line-hot {
  from { background: color-mix(in srgb, var(--accent-base) 38%, transparent); }
  to { background: transparent; }
}
.tk-sel { color: var(--code-key); }
.tk-prop { color: var(--code-ink); }
.tk-val { color: var(--code-str); }
.tk-com { color: var(--code-dim); font-style: italic; }
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--code-key);
  animation: caret 900ms steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 18px;
  border: 1px dashed var(--accent-dash);
  background: var(--paper);
}
.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 44px;
  padding: 0 12px 0 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  corner-shape: var(--corner);
}
.pv-btn .slash { width: 16px; height: 16px; }
.pv-chip {
  padding: 8px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-btn);
  corner-shape: var(--corner);
}
.pv-title { margin-left: auto; font-size: 26px; line-height: 1; text-transform: uppercase; }
.styler-note { min-height: 1.5em; color: var(--ink-2); font-size: 14px; }

/* ---------- quick-style dock ---------- */
.dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 7px 7px 14px;
  border: 1px solid var(--accent);
  background: var(--paper);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--ink) 40%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(100% + 28px));
  transition:
    transform 420ms var(--ease-out),
    opacity 220ms ease,
    visibility 0s linear 420ms;
}
.dock.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    transform 420ms var(--ease-out),
    opacity 220ms ease,
    visibility 0s;
}
.dock-label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dock-swatches { display: flex; gap: 6px; }
.dock-sw {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  background: var(--sw);
  transition: transform 160ms var(--ease-out);
}
.dock-sw:active { transform: scale(0.9); }
.dock-sw[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.dock-theme {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--grid-strong);
  background: var(--paper);
  color: var(--ink);
  transition: transform 160ms var(--ease-out);
}
.dock-theme:active { transform: scale(0.94); }
.dock-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.dock-theme .i-sun,
html[data-theme="dark"] .dock-theme .i-moon { display: none; }
html[data-theme="dark"] .dock-theme .i-sun { display: block; }
.dock-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px 0 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.dock-more:active { transform: scale(0.97); }
.dock-more .slash { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .dock-sw:hover { transform: translateY(-2px); }
  .dock-more:hover { background: var(--accent-deep); }
}

/* ---------- projects: pinned horizontal track (desktop, motion) ---------- */
.pj-progress { display: none; }
.projects.is-pinned { padding-block: 0; }
.projects.is-pinned .pj-sticky {
  position: sticky;
  top: var(--head-h);
  height: calc(100svh - var(--head-h));
  overflow: hidden;
  clip-path: inset(0 0 0 calc(var(--gutter) - 2px));
}
.projects.is-pinned .pj-sticky > .wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-block: clamp(32px, 5vh, 56px) clamp(24px, 4vh, 40px);
}
.projects.is-pinned .sec-head { margin-bottom: clamp(20px, 3vh, 36px); }
.projects.is-pinned .pj-progress {
  grid-column: 8 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--accent);
  font-family: var(--f-code);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pj-bar { position: relative; flex: 1; height: 1px; background: var(--grid-strong); }
.pj-bar span { position: absolute; inset: 0; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.projects.is-pinned .pj-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  width: max-content;
  will-change: transform;
}
.projects.is-pinned .pj { flex: none; height: 100%; }
.projects.is-pinned .pj--7 { width: min(46vw, 780px); }
.projects.is-pinned .pj--5 { width: min(36vw, 600px); }
.projects.is-pinned .pj--4 { width: min(32vw, 540px); }
.projects.is-pinned .pj-art { min-height: 0; }
.projects.is-pinned .illus { width: 100%; height: 100%; max-height: none; }

/* ---------- contact plane opens from a frame ---------- */
html.motion .contact { will-change: clip-path; }

/* ---------- theme / style changes: view transition wipe ---------- */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
::view-transition { pointer-events: none; }

/* ---------- composer responsive ---------- */
@media (max-width: 900px) {
  .styler-grid { grid-template-columns: minmax(0, 1fr); }
  .styler-controls,
  .styler-out { grid-column: 1 / -1; }
  .styler-out { position: static; margin-top: 16px; }
  [data-tag]::after { display: none; }
}
@media (max-width: 640px) {
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-code { font-size: 13px; }
  .pv-title { margin-left: 0; }
  [data-tag]::before { font-size: 11px; }
  .dock-sw { width: 22px; height: 22px; }
  .ribbon-set { font-size: 13px; gap: 40px; padding-right: 40px; }
  .ribbon-set > span::after { margin-left: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .editor-code .ln.is-hot { animation: none; background: color-mix(in srgb, var(--accent-base) 22%, transparent); }
}

html.split-pending [data-split] { visibility: hidden; }

/* ---------- outcomes in plain language ---------- */
.out-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--grid-strong);
}
.out-grid li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 22px;
  row-gap: 8px;
  align-content: start;
  padding: clamp(22px, 2.4vw, 34px) clamp(18px, 2vw, 28px);
  border-right: 1px solid var(--grid-strong);
  border-bottom: 1px solid var(--grid-strong);
  background: var(--paper);
  transition: background-color 200ms ease;
}
.out-glyph { grid-row: 1 / span 2; width: 72px; height: 72px; color: var(--grid-strong); }
.out-glyph .c-ink { fill: var(--ink); }
.out-glyph .c-b { fill: var(--accent); }
.out-grid h3 {
  font-family: var(--f-display);
  font-weight: var(--d-weight);
  font-variation-settings: "wdth" var(--d-wdth);
  letter-spacing: var(--d-track);
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.1;
  text-transform: uppercase;
}
.out-grid p { color: var(--ink-2); max-width: 40ch; }
.out-cta { margin-top: clamp(28px, 3vw, 44px); }
@media (hover: hover) and (pointer: fine) {
  .out-grid li:hover { background: var(--accent-wash); }
}
@media (max-width: 1100px) { .out-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .out-grid { grid-template-columns: minmax(0, 1fr); }
  .out-grid li { grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; }
  .out-glyph { width: 44px; height: 44px; }
}

/* ---------- dock: a collapsed pill that opens on demand ---------- */
.dock { padding: 6px; gap: 0; }
.dock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  transition: transform 160ms var(--ease-out);
}
.dock-toggle:active { transform: scale(0.96); }
.dock-dot { width: 18px; height: 18px; background: var(--accent); border-radius: calc(var(--radius) / 2); corner-shape: var(--corner); }
.dock-chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 220ms var(--ease-out); }
.dock-toggle[aria-expanded="true"] .dock-chev { transform: rotate(180deg); }
.dock-panel { display: flex; align-items: center; gap: 12px; padding: 0 2px 0 8px; border-left: 1px solid var(--grid-strong); }
.dock-panel[hidden] { display: none; }
html.motion .dock-panel {
  transform-origin: left center;
  transition: opacity 200ms ease, transform 240ms var(--ease-out), filter 200ms ease;
  @starting-style { opacity: 0; transform: translateX(-8px); filter: blur(2px); }
}
@media (max-width: 640px) {
  .dock { left: auto; right: 12px; bottom: 12px; max-width: calc(100vw - 24px); justify-content: flex-start; padding: 5px; }
  .dock.is-open { left: 12px; }
  .dock.is-open .dock-label { display: none; }
  .dock-panel { gap: 8px; flex-wrap: wrap; }
  .dock-more { display: none; }
  .dock-panel { flex-wrap: nowrap; border-left: 0; padding-left: 0; }
  .dock.is-open .dock-toggle { padding: 0 6px; }
  .dock.is-open .dock-dot { display: none; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .grid-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .grid-toggle { width: 40px; justify-content: center; padding: 0; }
}

/* ---------- real project screenshots ---------- */
.pj-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pj-tags li {
  padding: 3px 8px;
  border: 1px solid var(--grid-strong);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  corner-shape: var(--corner);
}
.pj-top { gap: 12px; }
.pj-art {
  min-height: 280px;
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}
html[data-grid="off"] .pj-art { background-image: none; }
.pj-shot {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper);
  border-radius: calc(var(--radius) / 2);
  corner-shape: var(--corner);
}
.pj-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pj-shot--desktop { width: 100%; aspect-ratio: 16 / 10; padding-top: 18px; }
.pj-shot--desktop::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 18px;
  border-bottom: 1px solid var(--ink);
  background:
    linear-gradient(var(--ink), var(--ink)) 10px 6px / 6px 6px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 20px 6px / 6px 6px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 30px 6px / 6px 6px no-repeat,
    var(--paper);
}
.pj-shot--mobile { height: min(440px, 62vh); aspect-ratio: 390 / 844; border-width: 6px; }

html.motion .pj-shot {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 900ms var(--ease-in-out);
}
html.motion .pj-shot.is-built { clip-path: inset(0 0 0 0); }
html.motion .pj-shot img { transform: scale(1.08); transition: transform 1400ms var(--ease-out); }
html.motion .pj-shot.is-built img { transform: none; }
@media (hover: hover) and (pointer: fine) {
  html.motion .pj article:hover .pj-shot.is-built img { transform: scale(1.03); transition-duration: 600ms; }
}

.projects.is-pinned .pj-art { padding: clamp(14px, 1.6vw, 24px); }
.projects.is-pinned .pj-shot--desktop { width: 100%; height: 100%; aspect-ratio: auto; }
.projects.is-pinned .pj-shot--mobile { height: 100%; }
@media (max-width: 640px) {
  .pj-shot--mobile { height: 420px; }
  .pj-tags li:nth-child(n + 3) { display: none; }
}
.pj-top { flex-wrap: wrap; row-gap: 8px; }
.pj-tags { flex: 1 1 0; min-width: 0; }
.pj--4 .pj-tags li:nth-child(n + 3) { display: none; }

/* ==========================================================================
   Boot loader: an editor that writes the site's real start-up steps
   ========================================================================== */
.loader { display: none; }
html.loading .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(20px, 4vw, 56px);
  background-color: var(--code-bg);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  color: var(--code-ink);
  cursor: pointer;
}
html.loading { overflow: hidden; }
.loader-editor { width: min(780px, 100%); border: 1px solid var(--code-line); background: var(--code-bg); }
.loader-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--code-line);
  color: var(--code-dim);
  font-family: var(--f-code);
  font-size: 13px;
}
.loader-file { display: inline-flex; align-items: center; gap: 10px; }
.loader-file::before { content: ""; width: 8px; height: 8px; background: var(--code-key); }
.loader-code { min-height: calc(7 * 1.8em + 34px); font-size: 15px; }
.loader-code .tk-ok { color: var(--code-key); }
.loader-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.logo--loader { width: clamp(150px, 26vw, 380px); height: auto; color: var(--code-ink); }
.logo--loader .logo-slash { fill: var(--code-key); }
.loader-count {
  font-family: var(--f-code);
  font-size: clamp(56px, 11vw, 150px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.loader-count::after { content: "%"; font-size: 0.32em; margin-left: 0.15em; color: var(--code-dim); }
.loader-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--code-line); }
.loader-progress span { position: absolute; inset: 0; background: var(--code-key); transform-origin: left center; transform: scaleX(0); }
.loader.is-out { clip-path: inset(0 0 100% 0); transition: clip-path 720ms var(--ease-in-out); }
html.loading:not(.boot-reveal) .wm-l > *,
html.loading:not(.boot-reveal) .wm-slash { animation-play-state: paused; }
@media (max-width: 640px) {
  .loader-skip { display: none; }
  .loader-code { font-size: 12.5px; }
}

/* ==========================================================================
   Dock hint: tells first-time visitors the site is theirs to restyle
   ========================================================================== */
.dock-hint {
  position: absolute;
  right: -1px;
  bottom: calc(100% + 14px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(320px, calc(100vw - 24px));
  padding: 14px 12px 14px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  line-height: 1.45;
  border-radius: var(--radius);
  corner-shape: var(--corner);
  transform-origin: bottom right;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--ink) 40%, transparent);
}
.dock-hint[hidden] { display: none; }
.dock-hint::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  transform: rotate(45deg);
}
.dock-hint strong { display: block; margin-bottom: 2px; font-weight: 700; }
.dock-hint-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--on-accent-line);
  background: transparent;
  color: var(--on-accent);
  border-radius: var(--radius-btn);
  corner-shape: var(--corner);
  transition: transform 160ms var(--ease-out);
}
.dock-hint-close:active { transform: scale(0.94); }
.dock-hint-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
html.motion .dock-hint {
  transition: opacity 240ms ease, transform 320ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(8px) scale(0.96); }
}
html.motion .dock.is-calling .dock-dot { animation: dock-call 1300ms var(--ease-out) 3; }
@keyframes dock-call {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); }
}
@media (max-width: 640px) {
  .dock-hint { right: -1px; }
}

/* ==========================================================================
   Blocks that move: staggered entrance + living cell glyphs
   ========================================================================== */
html.motion .out-grid li,
html.motion .principles li {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 600ms ease,
    transform 800ms var(--ease-reveal),
    background-color 200ms ease;
  transition-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), 0ms;
}
html.motion .out-grid.is-in li,
html.motion .principles.is-in li { opacity: 1; transform: none; }
.out-grid li:nth-child(2), .principles li:nth-child(2) { --i: 1; }
.out-grid li:nth-child(3), .principles li:nth-child(3) { --i: 2; }
.out-grid li:nth-child(4) { --i: 3; }
.out-grid li:nth-child(5) { --i: 4; }
.out-grid li:nth-child(6) { --i: 5; }

.og { transform-box: fill-box; transform-origin: center; }
html.motion :is(.out-glyph, .pr-diagram) :is(.og, rect, path) { animation-play-state: paused; }
html.motion :is(.out-glyph, .pr-diagram).is-live :is(.og, rect, path) { animation-play-state: running; }

/* search: the magnifier sweeps */
html.motion .out-glyph--search .og { animation: g-scan 4.8s var(--ease-in-out) infinite; }
@keyframes g-scan {
  0%, 52%, 100% { transform: none; }
  64% { transform: translate(-0.4px, 0.15px); }
  80% { transform: translate(0.4px, -0.15px); }
}
/* phone: it rings */
html.motion .out-glyph--phone .og { animation: g-ring 4.2s linear infinite; }
html.motion .out-glyph--phone .c-b { animation: g-blink 4.2s steps(1) infinite; }
@keyframes g-ring {
  0%, 66%, 100% { transform: none; }
  69% { transform: rotate(-9deg); }
  72% { transform: rotate(9deg); }
  75% { transform: rotate(-7deg); }
  78% { transform: rotate(7deg); }
  81% { transform: rotate(-3deg); }
  84% { transform: none; }
}
@keyframes g-blink {
  0%, 66%, 72%, 78%, 100% { opacity: 1; }
  69%, 75%, 81% { opacity: 0.15; }
}
/* agenda: the booked date hops from day to day */
html.motion .out-glyph--agenda .c-b { animation: g-date 5.2s steps(1) infinite; }
@keyframes g-date {
  0% { transform: none; }
  25% { transform: translate(-2px, 0); }
  50% { transform: translate(-2px, -2px); }
  75% { transform: translate(0, -2px); }
}
/* cart: it rolls */
html.motion .out-glyph--cart .og { animation: g-roll 4.6s var(--ease-in-out) infinite; }
@keyframes g-roll {
  0%, 55%, 100% { transform: none; }
  72% { transform: translateX(0.6px); }
  86% { transform: translateX(-0.2px); }
}
/* trust: reviews light up one after another */
html.motion .out-glyph--trust .c-ink { animation: g-twinkle 3.6s ease-in-out infinite; }
html.motion .out-glyph--trust .c-ink:nth-child(2n) { animation-delay: 0.45s; }
html.motion .out-glyph--trust .c-ink:nth-child(3n) { animation-delay: 0.9s; }
html.motion .out-glyph--trust .c-b { animation: g-pulse 3.6s ease-in-out infinite; }
@keyframes g-twinkle {
  0%, 60%, 100% { opacity: 1; }
  75% { opacity: 0.2; }
}
@keyframes g-pulse {
  0%, 100% { transform: none; }
  50% { transform: scale(1.25); }
}
.out-glyph--trust .c-b { transform-box: fill-box; transform-origin: center; }
/* edit: the pencil writes */
html.motion .out-glyph--edit .og { animation: g-write 4.4s var(--ease-in-out) infinite; }
@keyframes g-write {
  0%, 50%, 100% { transform: none; }
  62% { transform: translate(-0.3px, 0.3px); }
  74% { transform: translate(0.2px, 0.35px); }
  86% { transform: translate(-0.1px, 0.15px); }
}

/* principles: structure fills its grid, the blank page draws its line, good sense moves on purpose */
html.motion .pr-diagram--structure .c-b { animation: g-slot 5.4s steps(1) infinite; }
@keyframes g-slot {
  0% { transform: none; }
  33% { transform: translateX(1px); }
  50% { transform: translateX(2px); }
  83% { transform: translateX(1px); }
}
html.motion .pr-diagram--blank .pr-diag { stroke-dasharray: 6; animation: g-draw 4.4s var(--ease-in-out) infinite; }
@keyframes g-draw {
  0% { stroke-dashoffset: 6; }
  40%, 78% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -6; }
}
html.motion .pr-diagram--sense .pr-arrow { animation: g-nudge 3.8s var(--ease-in-out) infinite; }
html.motion .pr-diagram--sense .c-b { animation: g-pulse 3.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes g-nudge {
  0%, 50%, 100% { transform: none; }
  70% { transform: translateX(0.35px); }
}

/* ---------- style demo: captions + guided cursor ---------- */
.dock-hint { flex-direction: column; gap: 10px; }
.dock-hint-text { font-weight: 600; min-height: 2.9em; }
.dock-hint-foot { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.dock-hint-steps { display: flex; gap: 6px; }
.dock-hint-steps i { width: 18px; height: 6px; background: var(--on-accent-line); transition: background-color 240ms ease; }
.dock-hint-steps i.is-on { background: var(--on-accent); }
.dock-hint-close {
  width: auto;
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.demo-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 30px;
  height: 30px;
  pointer-events: none;
  opacity: 0;
  transition: transform 640ms var(--ease-in-out), opacity 240ms ease;
}
.demo-cursor.is-shown { opacity: 1; }
.demo-cursor svg {
  width: 100%;
  height: 100%;
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 6px color-mix(in srgb, var(--ink) 30%, transparent));
  transform-origin: 4px 3px;
  transition: transform 160ms var(--ease-out);
}
.demo-cursor.is-pressing svg { transform: scale(0.8); }
.is-demo-pressed { transform: scale(0.92) !important; }
.dock.is-demo { z-index: 59; }
@media (max-width: 640px) {
  .dock-hint { width: min(300px, calc(100vw - 24px)); }
}

/* ==========================================================================
   Custom cursor: a crop-mark viewfinder that lives on the page grid
   ========================================================================== */
.cur { display: none; }
html.has-cursor .cur {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: block;
  pointer-events: none;
  transition: opacity 160ms ease;
}
html.has-cursor,
html.has-cursor * { cursor: none !important; }
html.has-cursor :is(input, textarea, select, [contenteditable="true"]) { cursor: text !important; }
.cur.is-hidden { opacity: 0; }
.cur > * { position: absolute; top: 0; left: 0; will-change: transform; }
.cur-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--paper);
}
.cur-c {
  width: 9px;
  height: 9px;
  border: 0 solid var(--ink-3);
  transition: border-color 160ms ease;
}
.cur-c--tl { border-top-width: 1.5px; border-left-width: 1.5px; }
.cur-c--tr { border-top-width: 1.5px; border-right-width: 1.5px; }
.cur-c--bl { border-bottom-width: 1.5px; border-left-width: 1.5px; }
.cur-c--br { border-bottom-width: 1.5px; border-right-width: 1.5px; }
.cur-label {
  padding: 2px 6px;
  border: 1px solid var(--grid-strong);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--f-code);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.cur.is-hot .cur-c { border-color: var(--accent); }
.cur.is-hot .cur-label { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.cur.is-native .cur-c,
.cur.is-native .cur-label,
.cur.is-native .cur-dot { opacity: 0; }
.cur.is-quiet .cur-label { opacity: 0; }

/* ---------- contact: entry to the funnel ---------- */
.contact-entry { grid-column: 7 / -1; display: grid; gap: 22px; align-content: start; }
.entry-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; counter-reset: entry; }
.entry-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--on-accent-line);
  color: var(--on-accent);
  font-size: 15px;
  counter-increment: entry;
  border-radius: var(--radius);
  corner-shape: var(--corner);
}
.entry-steps li::before {
  content: counter(entry);
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  background: var(--on-accent);
  color: var(--accent);
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.entry-steps li:last-child { border-style: solid; border-color: var(--on-accent); }
.entry-cta { justify-self: start; }
.entry-note { color: var(--on-accent-2); font-size: 15px; }
@media (max-width: 900px) { .contact-entry { grid-column: 1 / -1; margin-top: 40px; } }
@media (max-width: 640px) { .entry-steps { grid-template-columns: minmax(0, 1fr); } }
