/*
  HITL Engineering LLC - one-page pamphlet.
  Tactile / refined-skeuomorphic system per planning/designimplementation.md.

  Shape rule: surfaces use squircle curves (cards 32px outer shell, 26px inner core,
  inputs 22px, icon wells 16px). Every interactive button is a full pill.
*/

/* ---------- Tokens ---------- */
:root {
  /* The site is dark throughout. Each colour is still light-dark(light, dark),
     resolved per element from its color-scheme, so a surface can opt into
     the light palette (the metal business card does, for dark ink). */
  color-scheme: dark;

  --bg: light-dark(#eceef0, #0d0d0f);
  --bg-deep: light-dark(#e2e5e8, #08080a);
  --surface: light-dark(#fafbfb, #1e2125);
  --surface-sunk: light-dark(#e4e7ea, #111316);
  --text: light-dark(#16181b, #eceef0);
  --text-muted: light-dark(#555b63, #a0a6ae);
  --line: light-dark(rgb(22 24 27 / 0.08), rgb(236 238 240 / 0.08));

  --accent: light-dark(#c2410c, #f07a36);
  --accent-hi: light-dark(#d4561f, #f58d50);
  --accent-ink: light-dark(#fff8f3, #1c0f06);
  --accent-soft: light-dark(rgb(194 65 12 / 0.07), rgb(240 122 54 / 0.09));
  --pencil: light-dark(#8a9099, #6f7680);

  /* Dual-source lighting: light from top-left, shade to bottom-right. */
  --hl: light-dark(rgb(255 255 255 / 0.95), rgb(255 255 255 / 0.06));
  --shade: light-dark(rgb(52 62 76 / 0.16), rgb(0 0 0 / 0.5));
  --shade-soft: light-dark(rgb(52 62 76 / 0.08), rgb(0 0 0 / 0.3));
  --shade-ink: light-dark(rgb(40 48 60), rgb(0 0 0));

  --glass: light-dark(rgb(250 251 251 / 0.72), rgb(30 33 37 / 0.7));
  --glass-edge: light-dark(rgb(255 255 255 / 0.7), rgb(255 255 255 / 0.07));

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font-sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --gutter: 16px;
  --section-y: 72px;
}

@media (min-width: 640px) {
  :root { --gutter: 24px; --section-y: 96px; }
}
@media (min-width: 1024px) {
  :root { --gutter: 32px; --section-y: 128px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Paper grain: fixed, non-interactive layer so it never repaints on scroll. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
svg { display: block; }

a, button { touch-action: manipulation; }
button, .btn, .chip {
  -webkit-user-select: none;
  user-select: none;
}

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

.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}

/* Squircle corners where supported; round-rect fallback everywhere else. */
@supports (corner-shape: squircle) {
  .sq { corner-shape: squircle; }
}

/* ---------- Hand-drawn strokes ---------- */
.scribble {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.scribble__line {
  position: absolute;
  left: -2%;
  bottom: -0.32em;
  width: 104%;
  height: 0.5em;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.scribble__line path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.scribble__line path + path { stroke-width: 1.6; opacity: 0.7; }

.divider {
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.55;
}
.divider path { vector-effect: non-scaling-stroke; }
.divider--inner { width: 100%; margin-block: 32px; opacity: 0.45; }

/* ---------- Hero ----------
   A night sky: an engraved black hole (hero-sky.js) behind
   the copy and card. The hero itself is not a stacking context, so the sky
   sits under the loop line while the content sits over it (see "The loop"). */
.hero {
  color-scheme: dark;
  position: relative;
  /* Stacked layouts keep the foot of the hero open for the black hole
     (hero-sky.js centres it in this space). */
  padding-block: calc(env(safe-area-inset-top, 0px) + 56px) var(--hole-room, 200px);
  color: var(--text);
}
.hero__sky {
  --sky: #060302;
  --fade: 120px;
  position: absolute;
  /* Runs on under the divider, then dissolves into the page. */
  inset: 0 0 calc(var(--fade) * -1) 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--sky);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--fade)), transparent);
}
.hero__sky canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* Shade behind the copy so the text never competes with the disk. */
.hero__sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(6 3 2 / 0.25), transparent 30%, transparent 60%, rgb(6 3 2 / 0.7) calc(100% - var(--fade)));
}
@media (max-width: 959.98px) {
  .hero__sky::after {
    background: linear-gradient(to bottom, rgb(6 3 2 / 0.7), rgb(6 3 2 / 0.55) 40%, transparent 70%, rgb(6 3 2 / 0.2) calc(100% - var(--fade)));
  }
}
@media (min-width: 960px) {
  .hero__sky::after {
    background:
      radial-gradient(42% 60% at 22% 50%, rgb(6 3 2 / 0.72), transparent),
      linear-gradient(to bottom, rgb(6 3 2 / 0.25), transparent 30%, transparent 60%, rgb(6 3 2 / 0.7) calc(100% - var(--fade)));
  }
}
.hero > .container {
  position: relative;
  z-index: 3;
}

.hero__grid {
  display: grid;
  gap: 56px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text-muted);
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--hl),
    0 1px 1px var(--shade-soft),
    3px 4px 10px -2px var(--shade-soft),
    -3px -3px 8px var(--hl);
}
/* The initials spell out what HITL stands for. */
.badge b {
  color: var(--accent);
  font-weight: 800;
}

.hero__copy { container-type: inline-size; }

.hero__title {
  margin-top: 24px;
  /* Capped so the expanded "Human In The Loop" (about 8.2em wide) always fits
     on its own line; the lines below never reflow when it opens. */
  font-size: min(clamp(2.5rem, 10.5vw, 4.5rem), 11.6cqi);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.hero__title-rest { display: block; }

/* HITL -> Human In The Loop. Each initial grows its word via a 0fr -> 1fr grid
   track: a layout animation, but confined to one line box that never changes height. */
.acro {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}
.acro:focus-visible { outline-offset: 6px; }
.acro__word { display: inline-flex; }
.acro__cap {
  text-decoration: underline dotted;
  text-decoration-thickness: 0.045em;
  text-underline-offset: 0.12em;
  text-decoration-color: color-mix(in srgb, var(--accent) 65%, transparent);
  transition:
    color 300ms var(--ease-out),
    text-decoration-color 300ms var(--ease-out);
}
.acro__rest {
  display: inline-grid;
  grid-template-columns: 0fr;
  transition: grid-template-columns 650ms var(--ease-in-out);
}
.acro__rest > span {
  min-width: 0;
  overflow: hidden;
  white-space: pre;
  /* Room for the descender in "Loop" inside the clipped box. */
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}
.acro.is-open .acro__rest { grid-template-columns: 1fr; }
.acro.is-open .acro__rest > span { opacity: 1; transition-delay: 120ms; }
.acro.is-open .acro__cap {
  color: var(--accent);
  text-decoration-color: transparent;
}
.acro__word:nth-child(2) .acro__rest { transition-delay: 50ms; }
.acro__word:nth-child(3) .acro__rest { transition-delay: 100ms; }
.acro__word:nth-child(4) .acro__rest { transition-delay: 150ms; }

.hero__lede {
  margin-top: 20px;
  max-width: 30ch;
  font-size: clamp(1.1875rem, 4.6vw, 1.5rem);
  line-height: 1.45;
  color: var(--text-muted);
  text-wrap: pretty;
}
.hero__lede .scribble { color: var(--text); }

.hero__actions { margin-top: 36px; }

/* Business-card object: two stacked cards with real physical offset. */
.hero__visual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.bizcard-stack {
  /* Where the light sits on the metal (main.js eases these toward the pointer). */
  --metal-x: 50%;
  --metal-y: 50%;
  --metal-turn: 0deg;
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1.66;
}
.bizcard {
  position: absolute;
  inset: 0;
  border-radius: 22px;
}
.bizcard--back {
  display: none;
  transform: translate(22px, 18px) rotate(5deg);
}
/* The card underneath is the same plate, in shadow. */
.bizcard--back.metal { filter: brightness(0.42) saturate(0.8); }
.bizcard__rules {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.35;
}
.flip {
  --base-rot: 0deg;
  position: absolute;
  inset: 0;
  perspective: 1100px;
  transform: rotate(var(--base-rot));
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.flip.is-dragging { cursor: grabbing; }
.flip__inner {
  --rx: 0deg;
  --ry: 0deg;
  --turn: 0deg;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--turn)));
  transition: transform 500ms var(--ease-out);
}
.flip.is-flipped .flip__inner { --turn: 180deg; }
.flip.is-turning .flip__inner { transition: transform 700ms var(--ease-in-out); }

.face {
  /* Ink on the bright metal: the light palette, whatever the page theme. */
  color-scheme: light;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(18px, 5.5vw, 28px);
  color: var(--text);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ---------- Brushed metal plate ----------
   Port of the 21st.dev "metallic-business-card" finish: a conic sheen that
   turns with the light, a vignette that slides away from it, specular
   turbulence for grain (#metal-grain in index.html), then the metal colour
   blended over the lot so the shading keeps its hue. */
.metal {
  --metal: #dddde0;
  --metal-ink: oklch(0.16 0 240);
  --metal-ink-sub: oklch(0.32 0 240);
  --metal-glow-1: rgb(255 255 255 / 0.46);
  --metal-glow-2: rgb(245 245 255 / 0.22);
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse 160% 120% at var(--metal-x) var(--metal-y), transparent 0%, #000 100%),
    conic-gradient(
      from var(--metal-turn) at 50% 50%,
      rgb(0 0 0 / 0.6) -120deg,
      rgb(255 255 255 / 0.4) 9deg,
      rgb(0 0 0 / 0.4) 60deg,
      rgb(0 0 0 / 0.06) 107deg,
      rgb(0 0 0 / 0.3) 131deg,
      rgb(0 0 0 / 0) 188deg,
      rgb(0 0 0 / 0.6) 240deg,
      rgb(255 255 255 / 0.4) 367deg
    ),
    var(--metal);
  box-shadow:
    0 30px 60px -24px rgb(0 0 0 / 0.7),
    0 10px 50px rgb(0 0 0 / 0.25),
    inset -1px -1px 2px rgb(0 0 0 / 0.3),
    inset 1px 1px 2px rgb(255 255 255 / 0.3);
}
.metal::before,
.metal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.metal::before {
  z-index: 1;
  filter: url(#metal-grain);
  opacity: 0.25;
}
.metal::after {
  z-index: 2;
  background: var(--metal);
  mix-blend-mode: color;
}
.face.metal > :not(.metal__panel) {
  position: relative;
  z-index: 3;
}
.metal > .bizcard__rules { z-index: 3; }
/* An etched inner panel, a hairline in from the edge. */
.metal > .metal__panel {
  position: absolute;
  inset: 10px;
  z-index: 3;
  border-radius: 14px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.08), rgb(255 255 255 / 0.02)),
    radial-gradient(80% 40% at 50% 0%, rgb(255 255 255 / 0.06), transparent 60%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}
.face.metal {
  --text: var(--metal-ink);
  --text-muted: var(--metal-ink-sub);
  text-shadow:
    0 1px 0 rgb(255 255 255 / 0.3),
    0 8px 22px var(--metal-glow-1),
    0 2px 10px var(--metal-glow-2);
}
.face.metal .mark,
.face.metal .chip { text-shadow: none; }
/* Controls on the plate: light pills pressed into the metal, without the
   page's soft white halo, which glows on a mid-tone surface. */
.face.metal .chip,
.flip .flip__btn {
  color-scheme: light;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    inset 0 0 0 1px rgb(0 0 0 / 0.08),
    0 2px 6px -2px rgb(0 0 0 / 0.35);
}
.face--back { transform: rotateY(180deg); }

.flip__btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 var(--hl),
    inset 0 0 0 1px var(--line),
    2px 3px 8px -3px var(--shade),
    -2px -2px 6px var(--hl);
  transition: transform 140ms var(--ease-out);
}
.flip__btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 700ms var(--ease-in-out);
}
.flip.is-flipped .flip__btn svg { transform: rotate(180deg); }
.flip__btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .flip__btn:hover { color: var(--accent); }
}

.mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    inset 0 -2px 0 rgb(0 0 0 / 0.12),
    0 6px 14px -6px var(--accent);
}
.bizcard__name {
  font-size: clamp(1.1875rem, 5vw, 1.4375rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.bizcard__role {
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.bizcard__email {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 3.3vw, 0.875rem);
  color: var(--text-muted);
  letter-spacing: -0.01em;
}
.bizcard__kicker {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.bizcard__phrase {
  font-size: clamp(1.5rem, 7vw, 2rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.bizcard__phrase b { color: var(--accent); font-weight: 800; }
.bizcard__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  width: 100%;
}

/* The smallest phones get a slightly taller card so the role stays on one
   line above the email. */
@media (max-width: 359.98px) {
  .bizcard-stack { aspect-ratio: 1.45; }
  .bizcard__role { font-size: 0.8125rem; }
}

.annotation {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 22px;
  padding-left: 12px;
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
  transform: rotate(-2deg);
}
.annotation__arrow {
  width: 42px;
  height: 28px;
  margin-bottom: 8px;
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 768px) {
  .bizcard--back { display: block; }
  .flip { --base-rot: -3deg; }
  .hero__visual { padding: 0 28px 0 0; }
  .annotation { margin-top: 40px; }
}

@media (min-width: 960px) {
  .hero {
    display: flex;
    align-items: center;
    min-height: min(100svh, 880px);
    padding-block: 96px;
  }
  .hero__grid {
    grid-template-columns: 1.35fr 1fr;
    gap: 48px;
  }
  .hero__visual { align-items: flex-end; }
}

/* ---------- Tactile button ("bendy") ---------- */
.btn {
  --dx: 0;
  --dy: 0;
  --px: 50%;
  --py: 30%;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 6px 6px 6px 24px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--accent-ink);
  cursor: pointer;
  background:
    radial-gradient(120px 60px at var(--px) var(--py), rgb(255 255 255 / 0.22), transparent 70%),
    linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    inset 0 -2px 0 rgb(0 0 0 / 0.14),
    0 1px 2px var(--shade-soft),
    calc(var(--dx) * -4px) calc(10px + var(--dy) * -4px) 22px -10px var(--accent),
    -4px -4px 12px var(--hl);
  transform:
    perspective(500px)
    translate3d(calc(var(--dx) * 3px), calc(var(--dy) * 2px), 0)
    rotateX(calc(var(--dy) * -7deg))
    rotateY(calc(var(--dx) * 7deg));
  transition:
    transform 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}
.btn__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.18);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    inset 0 -1px 2px rgb(0 0 0 / 0.12);
  transition: transform 200ms var(--ease-out);
}
.btn__icon svg { width: 18px; height: 18px; fill: currentColor; }

.btn:active {
  transform: perspective(500px) translate3d(0, 1px, 0) scale(0.97);
  box-shadow:
    inset 0 2px 6px rgb(0 0 0 / 0.28),
    inset 0 -1px 0 rgb(255 255 255 / 0.12),
    0 0 0 var(--accent),
    -2px -2px 6px var(--hl);
  transition-duration: 100ms;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__icon { transform: translate(2px, -1px) scale(1.05); }
}

/* ---------- Section headings ---------- */
.section-title {
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

/* ---------- What I do (asymmetric bento, glass cores) ---------- */
.services {
  position: relative;
  padding-block: var(--section-y);
}

.bento {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 16px;
  margin-top: 48px;
}
.bento__backdrop {
  /* Pencil loops sitting "under" the glass so the blur has something to show. */
  position: absolute;
  inset: -4% -2%;
  width: 104%;
  height: 108%;
  z-index: -1;
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  opacity: 0.16;
  pointer-events: none;
}

/* Double-bezel: outer tray + inner plate with concentric radius. */
.shell {
  position: relative;
  padding: 6px;
  border-radius: 32px;
  background: var(--surface-sunk);
  background: rgb(from var(--surface-sunk) r g b / 0.55);
  box-shadow:
    inset 0 0 0 1px var(--line),
    8px 10px 28px -12px var(--shade),
    -8px -8px 24px -10px var(--hl);
}
.core {
  position: relative;
  height: 100%;
  padding: 28px 24px;
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 0 var(--glass-edge),
    inset 0 0 0 1px var(--glass-edge),
    0 1px 2px var(--shade-soft);
}
@media (prefers-reduced-transparency: reduce) {
  .core {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.core--tint {
  background:
    linear-gradient(150deg, var(--accent-soft), transparent 60%),
    var(--glass);
}
.core--grid {
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 1.4px) 0 0 / 14px 14px,
    var(--glass);
  background:
    radial-gradient(circle at 1px 1px, rgb(from var(--pencil) r g b / 0.28) 1px, transparent 1.4px) 0 0 / 14px 14px,
    var(--glass);
}
.core--lead {
  display: grid;
  gap: 28px;
}

.well {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--accent);
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--hl),
    3px 4px 10px -3px var(--shade),
    -3px -3px 8px var(--hl);
}
.well svg { width: 26px; height: 26px; fill: currentColor; }

.item__title {
  margin-top: 24px;
  font-size: 1.3125rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.item__text {
  margin-top: 8px;
  max-width: 40ch;
  color: var(--text-muted);
}

/* Live responsive demo: a real mini layout inside a container that resizes. */
.seg {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-sunk);
  box-shadow:
    inset 2px 3px 6px -1px var(--shade-soft),
    inset -2px -2px 6px -1px var(--hl),
    inset 0 0 0 1px var(--line);
}
.seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--hl),
    2px 3px 8px -3px var(--shade),
    0 0 0 1px var(--line);
  transition: transform 380ms var(--ease-in-out);
}
.seg[data-active="phone"] .seg__thumb { transform: translateX(100%); }
.seg__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}
.seg__btn svg { width: 18px; height: 18px; fill: currentColor; }
.seg__btn[aria-pressed="true"] { color: var(--text); }

.stage {
  position: relative;
  display: grid;
  place-items: end center;
  height: 250px;
  padding-bottom: 16px;
}
.device {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 196px;
  padding: 8px;
  border-radius: 14px;
  overflow: hidden;
  container: mini / inline-size;
  background: var(--surface-sunk);
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--pencil) 55%, transparent),
    0 18px 30px -18px var(--shade);
  transition:
    width 600ms var(--ease-in-out),
    height 600ms var(--ease-in-out),
    border-radius 600ms var(--ease-in-out),
    padding 600ms var(--ease-in-out);
}
.device::before {
  /* Phone speaker slot. */
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pencil) 55%, transparent);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}
.device[data-device="phone"] {
  width: 124px;
  height: 230px;
  padding: 16px 7px 10px;
  border-radius: 24px;
}
.device[data-device="phone"]::before { opacity: 1; transition-delay: 300ms; }
.device__deck {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: min(100%, 420px);
  height: 10px;
  border-radius: 3px 3px 12px 12px;
  background: var(--surface-sunk);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pencil) 55%, transparent);
  transform: translateX(-50%);
  transition:
    opacity 300ms var(--ease-out),
    transform 600ms var(--ease-in-out);
}
.device[data-device="phone"] + .device__deck {
  opacity: 0;
  transform: translateX(-50%) scaleX(0.3);
}

.mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.mini span { display: block; }
.mini__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}
.mini__logo {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--accent);
}
.mini .mini__links { display: flex; gap: 6px; }
.mini__links span {
  width: 22px;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
}
.mini .mini__burger { display: none; flex-direction: column; gap: 3px; }
.mini__burger span {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-muted) 70%, transparent);
}
.mini__hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
}
.mini__copy { display: grid; gap: 6px; }
.mini__h1,
.mini__h2 {
  height: 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 75%, transparent);
}
.mini__h1 { width: 92%; }
.mini__h2 { width: 58%; }
.mini__p {
  width: 80%;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text-muted) 40%, transparent);
}
.mini__cta {
  width: 44px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.mini__art {
  align-self: stretch;
  min-height: 50px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent) 0 2px, transparent 2px 7px),
    color-mix(in srgb, var(--accent) 10%, var(--surface-sunk));
}
.mini__tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
}
.mini__tiles span {
  min-height: 30px;
  border-radius: 8px;
  background: var(--surface);
}
@container mini (max-width: 200px) {
  .mini .mini__links { display: none; }
  .mini .mini__burger { display: flex; }
  .mini__hero { grid-template-columns: 1fr; padding: 8px; }
  .mini__art { order: -1; min-height: 38px; }
  .mini__tiles { grid-template-columns: 1fr; }
}

/* Demo panels sit at the bottom of their cards, so paired cards line up. */
.core--tint,
.core--grid {
  display: flex;
  flex-direction: column;
}
.core--tint .item__text,
.core--grid .item__text { margin-bottom: 24px; }
.readout,
.booker { margin-top: auto; }

/* Live readout: this visit's real numbers. */
.readout {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface-sunk);
  box-shadow:
    inset 2px 3px 8px -2px var(--shade),
    inset -2px -2px 6px -2px var(--hl),
    inset 0 0 0 1px var(--line);
}
.readout__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.readout__list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}
.readout__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.readout dt {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.readout dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: right;
}
.readout dd[data-metric="load"] { color: var(--accent); }
.skeleton {
  display: inline-block;
  width: 80px;
  height: 0.9em;
  border-radius: 6px;
  vertical-align: middle;
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
}

/* Booking demo. */
.booker {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--hl),
    inset 0 0 0 1px var(--line),
    0 12px 26px -18px var(--shade);
}
.booker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.booker__title { font-size: 0.9375rem; font-weight: 650; }
.tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.booker__group {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}
.booker__legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.opts { display: grid; gap: 6px; }
.opts--days { grid-template-columns: repeat(5, 1fr); }
.opts--times { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 420px) {
  .opts--times { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .opts--times { grid-template-columns: repeat(2, 1fr); }
}
.opt { position: relative; display: block; cursor: pointer; }
.opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.opt__face {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 2px;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--bg);
  box-shadow:
    inset 0 1px 0 var(--hl),
    inset 0 0 0 1px var(--line),
    2px 3px 6px -3px var(--shade);
  transition:
    transform 120ms var(--ease-out),
    color 160ms var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}
.opt__face b { display: block; font-size: 1rem; color: var(--text); }
.opt input:checked + .opt__face {
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    inset 0 -2px 0 rgb(0 0 0 / 0.12);
}
.opt input:checked + .opt__face b { color: inherit; }
.opt input:focus-visible + .opt__face { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt:active .opt__face { transform: scale(0.96); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 var(--hl),
    inset 0 0 0 1px var(--line),
    3px 4px 10px -4px var(--shade),
    -3px -3px 8px -2px var(--hl);
  transition:
    transform 120ms var(--ease-out),
    opacity 200ms var(--ease-out);
}
.pill:disabled { opacity: 0.5; cursor: not-allowed; }
.pill:not(:disabled):active { transform: scale(0.97); }
.pill--quiet { width: auto; margin-top: 10px; }

.booker__done {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin-top: 16px;
}
.booker__done[hidden] { display: none; }
.booker__check {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 6px 14px -6px var(--accent);
}
.booker__check svg { width: 18px; height: 18px; fill: currentColor; }
.booker__summary { font-weight: 650; outline: none; }
.booker__note { font-size: 0.875rem; color: var(--text-muted); }

@media (min-width: 768px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 64px;
  }
  .bento__item--lead { grid-column: 1 / -1; }
  .core { padding: 36px 32px; }
  .core--lead {
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: 40px;
  }
  .stage { height: 270px; }
  .item__title { font-size: 1.4375rem; }
}

@media (min-width: 1024px) {
  .core--lead { padding: 44px 48px; }
}

/* ---------- The loop ---------- */
.page { position: relative; }
/* Under the sections and the loop: drawn once per layout by page-sky.js,
   which sets its top and height to span from the hero down. */
.page-sky {
  --sky-ink: #c9d0e2;
  --sky-band: var(--accent);
  --sky-strength: 0.5;
  --sky-floor: 0.12;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}
.page-sky[data-ready] { opacity: 1; }
@media (max-width: 767.98px) {
  /* The margins are a gutter wide here; let a little more show through. */
  .page-sky { --sky-floor: 0.22; }
}
.page > section,
.page > .divider {
  position: relative;
  z-index: 1;
}
/* The loop rides above the sections below the hero; main.js masks it to
   40% where the person passes "behind" a card. In the hero it runs over the
   sky (z-index 1) but under the copy and business card (z-index 3), as the
   line winds around it. */
.page > .hero { z-index: auto; }
.loop {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.loop,
.loop__svg {
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.loop__svg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.loop__ghost {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1.5 8;
  opacity: 0.35;
}
.loop__ink {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  opacity: 0.75;
}
.loop__dot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 0 0 5px var(--accent-soft),
    0 6px 14px -4px var(--accent);
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
.loop__dot svg { width: 16px; height: 16px; fill: currentColor; }
.loop.is-live .loop__dot { opacity: 1; }

/* ---------- Contact ---------- */
.contact {
  padding-block: var(--section-y);
}
.shell--contact {
  max-width: 680px;
  margin-inline: auto;
}
.core--contact {
  padding: 32px 22px 28px;
  background: var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
@media (min-width: 640px) {
  .core--contact { padding: 48px 48px 44px; }
}

.contact__lede {
  margin-top: 12px;
  max-width: 44ch;
  color: var(--text-muted);
}

.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 28px;
}
.email-link {
  font-family: var(--font-mono);
  /* Small enough at 320px for the whole address to sit on one line. */
  font-size: clamp(0.875rem, 4.2vw, 1.375rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .email-link:hover { color: var(--accent); }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px 6px 12px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--hl),
    inset 0 0 0 1px var(--line),
    2px 3px 8px -3px var(--shade),
    -2px -2px 6px var(--hl);
  transition:
    transform 120ms var(--ease-out),
    box-shadow 120ms var(--ease-out);
}
.chip:active {
  transform: translateY(1px) scale(0.97);
  box-shadow:
    inset 2px 2px 5px var(--shade-soft),
    inset -2px -2px 5px var(--hl),
    inset 0 0 0 1px var(--line);
}
.chip__icon { width: 16px; height: 16px; fill: currentColor; }
.chip__icon--done { display: none; }
.chip.is-done { color: var(--accent); }
.chip.is-done .chip__icon--copy { display: none; }
.chip.is-done .chip__icon--done { display: block; }

.composer {
  display: grid;
  gap: 8px;
}
.field__label {
  font-weight: 620;
}
.field {
  width: 100%;
  min-height: 140px;
  padding: 16px 18px;
  border: 0;
  border-radius: 22px;
  font: inherit;
  font-size: 1.0625rem; /* 17px keeps iOS from zooming on focus */
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-sunk);
  resize: vertical;
  box-shadow:
    inset 3px 4px 10px -2px var(--shade),
    inset -3px -3px 8px -2px var(--hl),
    inset 0 0 0 1px var(--line);
  transition: box-shadow 160ms var(--ease-out);
}
.field:focus-visible {
  outline: none;
  box-shadow:
    inset 3px 4px 10px -2px var(--shade),
    inset -3px -3px 8px -2px var(--hl),
    inset 0 0 0 2px var(--accent);
}
.field__help {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.composer .btn {
  justify-self: start;
  margin-top: 16px;
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 8px calc(48px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.footer__line {
  max-width: 48ch;
  margin-inline: auto;
  text-wrap: balance;
}
.footer__copy {
  margin-top: 8px;
  opacity: 0.8;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Hero enters once on load, staggered, in document order. */
  .rise {
    animation: rise 800ms var(--ease-out) both;
  }
  .hero__copy .rise:nth-child(2) { animation-delay: 70ms; }
  .hero__copy .rise:nth-child(3) { animation-delay: 140ms; }
  .hero__copy .rise:nth-child(4) { animation-delay: 210ms; }
  .hero__visual.rise { animation-delay: 260ms; animation-duration: 1000ms; }

  .hero__lede .scribble__line path {
    stroke-dashoffset: 1;
    animation: draw 900ms var(--ease-out) 600ms forwards;
  }
  .hero__lede .scribble__line path + path { animation-delay: 800ms; }

  /* Scroll reveals: only elements below the fold at load get .is-pending (see main.js). */
  .reveal {
    transition:
      opacity 700ms var(--ease-out),
      transform 700ms var(--ease-out);
  }
  .reveal.is-pending {
    opacity: 0;
    transform: translateY(16px);
  }
  .bento .reveal:nth-of-type(2) { transition-delay: 70ms; }
  .bento .reveal:nth-of-type(3) { transition-delay: 140ms; }

  .reveal .scribble__line path,
  .divider path {
    transition: stroke-dashoffset 1100ms var(--ease-out) 200ms;
  }
  .reveal.is-pending .scribble__line path,
  .divider.is-pending path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }
  .divider path { stroke-dasharray: 1; stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* Fewer, gentler: keep opacity fades, drop movement. */
  .rise { animation: fade 400ms ease both; }
  .reveal { transition: opacity 400ms ease; }
  .reveal.is-pending { opacity: 0; }
  .flip__inner, .flip.is-turning .flip__inner { transition: none; }
  .acro__rest, .device, .device__deck, .seg__thumb { transition: none; }
  .btn, .chip { transition: none; }
}

/* ---------- Scroll parallax ----------
   CSS scroll-driven animations: compositor-driven, no scroll listeners.
   Uses the individual `translate` / `rotate` properties so it composes with
   the existing `transform` entrance, tilt, and reveal motion instead of
   fighting it. Unsupported browsers and reduced-motion users get a static page. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero { view-timeline: --hero block; }

    .hero__copy,
    .flip,
    .bizcard--back,
    .bento__backdrop {
      animation-timing-function: linear;
      animation-fill-mode: both;
    }

    /* Hero: copy sinks and fades, cards separate. */
    .flip {
      animation-name: px-card-front-sm;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }

    /* Service cards: pencil loops sit deeper than the glass above them. */
    .bento__backdrop {
      animation-name: px-drift;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

    @media (min-width: 768px) {
      .bizcard--back {
        animation-name: px-card-back;
        animation-timeline: --hero;
        animation-range: exit 0% exit 100%;
      }
    }

    @media (min-width: 960px) {
      .hero__copy {
        animation-name: px-copy;
        animation-timeline: --hero;
        animation-range: exit 0% exit 100%;
      }
      .flip { animation-name: px-card-front; }
    }
  }
}

@keyframes px-copy {
  to { translate: 0 90px; opacity: 0.2; }
}
@keyframes px-card-front {
  to { translate: 0 -150px; rotate: -2.5deg; }
}
@keyframes px-card-front-sm {
  to { translate: 0 -36px; }
}
@keyframes px-card-back {
  to { translate: 0 -50px; rotate: 2deg; }
}
@keyframes px-drift {
  from { translate: 0 -70px; }
  to { translate: 0 70px; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes fade {
  from { opacity: 0; }
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
