/* ============================================================================
   ABHISHEKET.COM — "First Class" design system
   Author: Abhishek E T · Web & Email Developer, Bengaluru
   Concept: postal / airmail. The craft is mail — the site wears the metaphor.
   Fonts:  Archivo (display, variable) · Atkinson Hyperlegible (body)
           IBM Plex Mono (mail-header labels, code)
   Themes: light "Day Post" (default) · dark "Night Post" via [data-theme]
   ============================================================================ */

/* ---------- Tokens ---------- */
:root {
  --paper:        #FAF8F2;
  --paper-2:      #F1EDE3;
  --card:         #FFFFFF;
  --ink:          #172142;
  --ink-2:        #4C5470;
  --ink-3:        #7A819A;
  --navy:         #24409A;
  --navy-soft:    #E7ECFA;
  --red:          #D6402B;
  --red-text:     #B93A26;
  --red-soft:     #FBE9E5;
  --line:         rgba(23, 33, 66, 0.14);
  --line-soft:    rgba(23, 33, 66, 0.08);
  --shadow:       0 1px 2px rgba(23,33,66,.05), 0 12px 32px -12px rgba(23,33,66,.18);
  --shadow-lift:  0 2px 4px rgba(23,33,66,.06), 0 24px 48px -16px rgba(23,33,66,.28);
  --focus:        #24409A;

  --glass:        rgba(255, 255, 255, 0.52);
  --glass-2:      rgba(255, 255, 255, 0.78);
  --glass-brd:    rgba(255, 255, 255, 0.78);
  --glass-hi:     rgba(255, 255, 255, 0.65);
  --blur:         18px;

  --font-display: "Archivo", "Arial Black", sans-serif;
  --font-body:    "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", "Courier New", monospace;

  --radius:    14px;
  --radius-sm: 9px;
  --container: 1080px;
  --header-h:  72px;
}

[data-theme="dark"] {
  --paper:        #0F1630;
  --paper-2:      #161F42;
  --card:         #1A2450;
  --ink:          #EDEAE0;
  --ink-2:        #B4B9CC;
  --ink-3:        #848CA8;
  --navy:         #8FA3E8;
  --navy-soft:    #23306226;
  --red:          #F0604A;
  --red-text:     #F0604A;
  --red-soft:     rgba(240, 96, 74, 0.14);
  --line:         rgba(237, 234, 224, 0.16);
  --line-soft:    rgba(237, 234, 224, 0.08);
  --shadow:       0 1px 2px rgba(0,0,0,.3), 0 12px 32px -12px rgba(0,0,0,.5);
  --shadow-lift:  0 2px 4px rgba(0,0,0,.35), 0 24px 48px -16px rgba(0,0,0,.6);
  --focus:        #8FA3E8;

  --glass:        rgba(30, 41, 92, 0.42);
  --glass-2:      rgba(34, 46, 100, 0.60);
  --glass-brd:    rgba(255, 255, 255, 0.10);
  --glass-hi:     rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .theme-invert { filter: invert(1) hue-rotate(180deg); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 30px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
/* Ambient colour field — the vivid "liquid" the sheet floats on (reference-matched) */
body::before {
  content: ""; position: fixed; inset: -14%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(42% 55% at 4% 28%,  rgba(255, 94, 58, .82),  transparent 58%),
    radial-gradient(40% 48% at 22% 4%,  rgba(255, 170, 64, .70), transparent 55%),
    radial-gradient(58% 64% at 78% 18%, rgba(124, 58, 237, .80), transparent 62%),
    radial-gradient(46% 52% at 96% 62%, rgba(217, 70, 200, .75), transparent 58%),
    radial-gradient(40% 46% at 82% 96%, rgba(34, 197, 130, .72), transparent 56%),
    radial-gradient(44% 50% at 30% 92%, rgba(236, 72, 153, .60), transparent 60%),
    linear-gradient(118deg, #b9a5f2, #9f7ae8 42%, #b48ae5 68%, #9fb2ef);
  animation: mesh-drift 26s ease-in-out infinite alternate;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(42% 55% at 4% 28%,  rgba(255, 94, 58, .38),  transparent 58%),
    radial-gradient(58% 64% at 78% 18%, rgba(139, 92, 246, .48), transparent 62%),
    radial-gradient(46% 52% at 96% 62%, rgba(217, 70, 200, .36), transparent 58%),
    radial-gradient(40% 46% at 82% 96%, rgba(34, 197, 130, .30), transparent 56%),
    radial-gradient(44% 50% at 30% 92%, rgba(236, 72, 153, .26), transparent 60%),
    linear-gradient(118deg, #171233, #241543 42%, #1a1338 68%, #121a36);
}
@keyframes mesh-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); filter: hue-rotate(0deg) saturate(1); }
  100% { transform: translate3d(1.6%, -1.6%, 0) scale(1.06); filter: hue-rotate(16deg) saturate(1.12); }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

/* ---------- The Sheet: one rounded glass frame around the whole page ---------- */
:root { --sheet-m: clamp(10px, 1.8vw, 22px); }
.glass-sheet {
  position: relative; z-index: 1;
  margin: 12px var(--sheet-m) var(--sheet-m);
  padding-top: calc(var(--header-h) + 30px);
  background: rgba(255, 255, 255, .40);
  -webkit-backdrop-filter: blur(34px) saturate(1.75);
  backdrop-filter: blur(34px) saturate(1.75);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 32px;
  box-shadow: 0 40px 110px -38px rgba(35, 20, 80, .55), inset 0 1px 0 rgba(255,255,255,.8);
  overflow: clip;
}
[data-theme="dark"] .glass-sheet {
  background: rgba(17, 22, 52, .55);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 40px 110px -38px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255,255,255,.1);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-sheet { background: color-mix(in srgb, var(--paper) 92%, transparent); }
}

/* Neutralised: the sheet replaces per-section veils and the hero sub-panel */
.band-glass { background: transparent; border-block: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hero-panel { background: transparent; border: 0; box-shadow: none; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
[data-theme="dark"] .hero-panel { background: transparent; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red-text); }
::selection { background: var(--navy); color: #fff; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.4rem); font-weight: 800; font-variation-settings: "wdth" 118; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 750; font-variation-settings: "wdth" 112; }
h3 { font-size: 1.25rem; font-weight: 700; font-variation-settings: "wdth" 106; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 58ch; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section-tight { padding: clamp(48px, 7vw, 80px) 0; }

/* Mail-header eyebrow */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .08em; text-transform: none; color: var(--red-text);
  margin: 0 0 18px; padding: 6px 12px;
  border: 1px dashed var(--line); border-radius: 6px; background: var(--card);
}
.eyebrow::before { content: "▸"; color: var(--navy); }

/* Airmail striped rule */
.airmail {
  height: 10px; border: 0; margin: 0;
  background: repeating-linear-gradient(-45deg,
    var(--red) 0 14px, transparent 14px 28px,
    var(--navy) 28px 42px, transparent 42px 56px);
  opacity: .85;
}
.airmail-thin { height: 6px; }

/* Perforation edge (stamp tear line) */
.perf { position: relative; }
.perf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background-image: radial-gradient(circle, var(--line) 1.3px, transparent 1.6px);
  background-size: 14px 2px; background-repeat: repeat-x;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 650; font-size: 1rem;
  font-variation-settings: "wdth" 108;
  padding: 14px 26px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 14px 30px -12px rgba(23,33,66,.5); }
.btn-primary:hover { background: var(--red); color: #fff; box-shadow: var(--shadow-lift); transform: translateY(-2px); }
[data-theme="dark"] .btn-primary { background: var(--paper-2); color: var(--ink); border-color: var(--glass-brd); }
[data-theme="dark"] .btn-primary:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); transform: translateY(-2px); }
.btn-sm { height: 42px; padding: 0 18px; font-size: .88rem; }

/* ---------- Header ---------- */
.site-head {
  position: fixed; top: 24px; left: calc(var(--sheet-m) + 14px); right: calc(var(--sheet-m) + 14px); z-index: 100;
  height: var(--header-h); border-radius: 20px;
  border: 1px solid var(--glass-brd);
  box-shadow: 0 18px 40px -20px rgba(23,33,66,.35), inset 0 1px 0 var(--glass-hi);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .3s ease;
}
.site-head .container { height: 100%; max-width: none; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 20px; }
.head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.head-cta { display: inline-flex; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 2px solid var(--red); color: var(--red-text);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  transform: rotate(-8deg); position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 1px dashed var(--red); opacity: .55;
}
.brand-name { font-family: var(--font-display); font-weight: 750; font-size: 1rem; line-height: 1.15; font-variation-settings: "wdth" 110; white-space: nowrap; }
.brand-name small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: .6rem; color: var(--ink-3); letter-spacing: .1em; white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  white-space: nowrap;
  font-family: var(--font-body); font-weight: 700; font-size: .9rem;
  color: var(--ink-2); text-decoration: none; padding: 9px 13px; border-radius: 8px;
  transition: color .15s ease, background-color .15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--paper-2); }
.nav-link[aria-current="true"], .nav-link.is-active { color: var(--red-text); }
.nav-cta { margin-left: 6px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; flex: none; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
  display: inline-grid; place-items: center; font-size: 1rem;
  transition: border-color .15s ease, transform .15s ease;
}
.icon-btn:hover { border-color: var(--navy); transform: translateY(-1px); }

.nav-toggle { display: none; }
@media (max-width: 1023px) {
  .site-nav {
    position: fixed; inset: calc(var(--header-h) + 20px) 12px auto 12px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid var(--glass-brd); border-radius: 20px;
    padding: 12px 16px 16px; box-shadow: var(--shadow-lift);
    transform: translateY(-150%); transition: transform .28s ease;
  }
  .site-nav.open { transform: translateY(0); }
  .nav-link { padding: 13px 14px; font-size: 1.02rem; }
  .nav-toggle { display: inline-grid; }
  .head-cta { display: none; }
  .site-nav .nav-mobile-cta { display: inline-flex; justify-content: center; margin-top: 6px; height: 46px; }
}
@media (min-width: 1024px) { .nav-mobile-cta { display: none !important; } }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* ---------- Hero: the envelope ---------- */
.hero { padding: clamp(14px, 3vw, 34px) 0 clamp(44px, 6vw, 72px); }
.hero-panel {
  position: relative;
  background: color-mix(in srgb, #ffffff 40%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  backdrop-filter: blur(28px) saturate(1.7);
  border: 1px solid var(--glass-brd); border-radius: 30px;
  box-shadow: 0 34px 90px -32px rgba(23, 33, 66, .5), inset 0 1px 0 var(--glass-hi);
  padding: clamp(26px, 4.5vw, 56px);
}
[data-theme="dark"] .hero-panel { background: rgba(18, 25, 58, .5); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-kicker {
  font-family: var(--font-mono); font-size: .82rem; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 20px; padding: 0; list-style: none;
}
.hero-kicker strong { color: var(--red-text); font-weight: 600; }
.hero h1 .u-red { color: var(--red-text); }
.hero h1 .u-navy { color: var(--navy); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-proof { margin-top: 26px; font-family: var(--font-mono); font-size: .8rem; color: var(--ink-3); }
.hero-proof a { color: inherit; }

/* Envelope illustration — pocket illusion: the letter rises OUT of the
   envelope. Stacking: back(1) < flap-open(1) < letter(3) < front pocket(4)
   < flap-closed(5). The front pocket permanently hides the letter's lower
   half, so it always looks tucked in, never floating. */
.envelope-scene { position: relative; display: grid; place-items: center; padding: clamp(64px, 20%, 110px) 0 14px; }
.envelope { position: relative; width: min(430px, 92%); aspect-ratio: 23/16; perspective: 1200px; cursor: pointer; }

.env-back {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(color-mix(in srgb, var(--paper-2) 82%, var(--ink) 10%), var(--paper-2) 55%);
  border: 1.5px solid var(--line); border-radius: 12px;
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 52%; z-index: 5;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(var(--paper-2), color-mix(in srgb, var(--paper-2) 86%, var(--ink) 14%));
  border-radius: 12px 12px 0 0;
  transform-origin: 50% 0;
  transition: transform .85s cubic-bezier(.65, 0, .3, 1) .35s,
              z-index 0s linear .76s,
              background-color .3s ease .74s,
              opacity .4s ease 1.7s;
}
.envelope.is-open .env-flap {
  transform: rotateX(180deg) scaleY(.62); z-index: 1;
  background: var(--card);
  opacity: 0; /* after standing open for a beat, it folds away behind the card */
}
[data-theme="dark"] .envelope.is-open .env-flap { background: var(--paper-2); }

.env-letter {
  position: absolute; left: 6%; right: 6%; top: 34%; height: 60%; z-index: 3;
  border: 1px solid var(--glass-brd); border-radius: 10px;
  padding: clamp(11px, 4%, 16px) clamp(13px, 4.5%, 18px);
  overflow: hidden;
  transform: translateY(0);
  transition: transform 1.05s cubic-bezier(.18, .9, .24, 1.04) .8s;
  box-shadow: 0 14px 30px -14px rgba(23,33,66,.4), inset 0 1px 0 var(--glass-hi);
  background: var(--card); /* solid: glass over the envelope back looks muddy */
}
[data-theme="dark"] .env-letter { background: var(--card); }
.envelope.is-open .env-letter { transform: translateY(-74%); }

/* mini email mock on the letter */
.lm-top { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; }
.lm-ava { width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--red); color: #fff;
          font: 700 10px/22px var(--font-display); text-align: center; }
.lm-who { font-family: var(--font-mono); font-size: clamp(.56rem, 1.5vw, .68rem); color: var(--ink-3);
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-who b { color: var(--ink); font-weight: 600; }
.lm-sub { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-variation-settings: "wdth" 114;
          font-size: clamp(.92rem, 2.5vw, 1.18rem); color: var(--ink); }
.lm-txt { margin: 0 0 8px; font-size: clamp(.64rem, 1.7vw, .76rem); line-height: 1.4; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-cta { display: inline-block; padding: 6px 13px; border-radius: 999px; background: var(--navy); color: #fff;
          font: 650 clamp(.6rem, 1.6vw, .7rem)/1 var(--font-display); letter-spacing: .02em; }
[data-theme="dark"] .lm-cta { color: #0F1630; }

/* front pocket — carries the address, stamp and postmark */
.env-front {
  position: absolute; left: 0; right: 0; top: 30%; bottom: 0; z-index: 4;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 0 0 12px 12px; overflow: hidden;
}
[data-theme="dark"] .env-front { background: var(--paper-2); }
.env-front::before { /* airmail edge along the opening */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 8px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 10px, transparent 10px 20px, var(--navy) 20px 30px, transparent 30px 40px);
  opacity: .9;
}
.env-front::after { /* subtle fold diagonals */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    linear-gradient(112deg, transparent 49.7%, var(--line-soft) 49.7%, var(--line-soft) 50.3%, transparent 50.3%) left/52% 100% no-repeat,
    linear-gradient(-112deg, transparent 49.7%, var(--line-soft) 49.7%, var(--line-soft) 50.3%, transparent 50.3%) right/52% 100% no-repeat;
}
.env-addr { position: absolute; left: 8%; bottom: 13%; z-index: 2; }
.env-addr span { display: block; height: 6px; border-radius: 4px; background: var(--line); margin-top: 7px; }
.env-addr span:nth-child(1) { width: 108px; background: var(--ink-2); opacity: .75; }
.env-addr span:nth-child(2) { width: 146px; }
.env-addr span:nth-child(3) { width: 86px; }

.stamp {
  position: absolute; right: 5%; top: 13%; z-index: 3;
  width: clamp(50px, 21%, 68px); height: auto; transform: rotate(3deg);
  filter: drop-shadow(0 3px 6px rgba(23,33,66,.25)); overflow: visible;
}
.stamp .stamp-paper { fill: var(--paper); }
[data-theme="dark"] .stamp .stamp-paper { fill: var(--paper-2); }
.stamp .stamp-frame { fill: color-mix(in srgb, var(--navy) 9%, transparent); stroke: var(--navy); stroke-width: 1.4; }
.stamp .stamp-num { fill: var(--navy); font-family: var(--font-display); font-weight: 800; font-size: 21px; }
.stamp .stamp-unit { font-size: 9px; font-weight: 700; }
.stamp .stamp-cap { fill: var(--ink-2); font-family: var(--font-mono); font-size: 5.6px; letter-spacing: 1.4px; }

.postmark {
  position: absolute; right: 20%; top: 8%; z-index: 4;
  width: clamp(72px, 25%, 92px); opacity: .9; transform: rotate(-11deg); pointer-events: none;
}
.postmark circle, .postmark path { stroke: var(--red-text); }
.postmark text { fill: var(--red-text); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 1.8px; }
.postmark .pm-waves path { stroke-width: 1.6; fill: none; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) {
  .env-flap, .env-letter { transition: none; }
}

/* Floating glass tiles + sparkles around the envelope (reference-style) */
.float-tile {
  position: absolute; z-index: 8; width: clamp(46px, 13%, 62px); aspect-ratio: 1;
  display: grid; place-items: center; font-size: clamp(1.15rem, 3vw, 1.5rem);
  border-radius: 16px; background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(12px) saturate(1.7); backdrop-filter: blur(12px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 16px 34px -14px rgba(23, 33, 66, .45), inset 0 1px 0 rgba(255,255,255,.7);
  animation: tile-bob 6s ease-in-out infinite;
}
[data-theme="dark"] .float-tile { background: rgba(32, 42, 92, .55); border-color: rgba(255,255,255,.16); }
.float-tile.mono { font-family: var(--font-mono); font-size: clamp(.72rem, 2vw, .9rem); font-weight: 600; color: var(--navy); letter-spacing: -0.5px; }
.t1 { top: 4%;  left: -3%;  transform: rotate(-9deg); }
.t2 { top: -1%; right: 3%;  transform: rotate(11deg); animation-delay: .9s; }
.t3 { bottom: 20%; left: -7%; transform: rotate(7deg);  animation-delay: 1.7s; }
.t4 { bottom: 32%; right: -5%; transform: rotate(-11deg); animation-delay: 2.5s; }
@keyframes tile-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -9px; }
}
.spark { position: absolute; z-index: 8; color: #fff; text-shadow: 0 2px 10px rgba(23,33,66,.35); font-weight: 800; animation: spark-pulse 3.2s ease-in-out infinite; pointer-events: none; }
.spark.s1 { top: 26%; left: 8%;  font-size: 1.1rem; }
.spark.s2 { top: -4%; right: 22%; font-size: 1.5rem; animation-delay: 1s; }
.spark.s3 { bottom: 4%; right: 26%; font-size: .95rem; animation-delay: 2s; }
@keyframes spark-pulse { 0%,100% { opacity: .5; scale: 1; } 50% { opacity: 1; scale: 1.25; } }
@media (prefers-reduced-motion: reduce) { .float-tile, .spark { animation: none; } }
@media (max-width: 640px) { .t3, .t4, .s3 { display: none; } .t1 { left: 0; } .t2 { right: 0; } }

/* Translucent section bands (replace solid paper sections over the mesh) */
.band-glass {
  background: color-mix(in srgb, var(--paper) 40%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  border-block: 1px solid var(--glass-brd);
}

/* ---------- Marquee credibility strip ---------- */
.strip { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); overflow: hidden;
  background: color-mix(in srgb, var(--paper) 35%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); }
.strip-track { display: flex; gap: 44px; padding: 13px 0; width: max-content; animation: strip-move 30s linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
@keyframes strip-move { to { transform: translateX(-50%); } }
.strip-item { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; }
.strip-item::before { content: "✦"; color: var(--red); }
@media (prefers-reduced-motion: reduce) { .strip-track { animation: none; flex-wrap: wrap; width: auto; padding-left: 24px; } }

/* ---------- Cards & grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 920px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--navy); }
.card h3 { margin-top: 2px; }
.card .mono-tag { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 26px 12px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.stat b { display: block; font-family: var(--font-display); font-weight: 800; font-variation-settings: "wdth" 118; font-size: clamp(2rem, 4.4vw, 2.9rem); color: var(--navy); line-height: 1; }
.stat span { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-2); }

/* ---------- Skills ---------- */
.skill-group h3 { display: flex; align-items: center; gap: 10px; }
.skill-group h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.chip {
  font-family: var(--font-mono); font-size: .8rem; color: var(--ink);
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  transition: border-color .15s ease, transform .15s ease, background-color .15s ease;
}
.chip:hover { border-color: var(--red); transform: translateY(-2px) rotate(-1deg); background: var(--red-soft); }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
@media (max-width: 860px) { .proj-grid { grid-template-columns: 1fr; } }
.proj-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.proj-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: var(--navy); color: var(--ink); }
.proj-media { position: relative; aspect-ratio: 16/9.4; overflow: hidden; background: var(--paper-2); border-bottom: 1px solid var(--line-soft); }
.proj-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.proj-card:hover .proj-media img { transform: scale(1.045); }
.proj-media .proj-abstract { position: absolute; inset: 0; display: grid; place-items: center; }
.proj-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .05em;
  background: var(--ink); color: var(--paper); padding: 6px 11px; border-radius: 6px;
}
[data-theme="dark"] .proj-badge { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.proj-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.proj-body h3 { margin: 0; font-size: 1.32rem; }
.proj-body p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.proj-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 10px; }
.proj-meta .chip { font-size: .7rem; padding: 5px 10px; }
.proj-cta { font-family: var(--font-mono); font-size: .8rem; color: var(--navy); margin-top: 6px; }
.proj-card:hover .proj-cta { color: var(--red-text); }

/* wax seal on featured project */
.seal {
  position: absolute; right: 18px; top: -2px; z-index: 3;
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--red) 78%, #fff), var(--red) 58%, color-mix(in srgb, var(--red) 72%, #000));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: .78rem; letter-spacing: .04em;
  box-shadow: 0 4px 10px rgba(214,64,43,.45); transform: rotate(8deg);
}

/* ---------- Timeline (experience / education) ---------- */
.tl { position: relative; margin: 0; padding: 0 0 0 30px; list-style: none; }
.tl::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: repeating-linear-gradient(var(--line) 0 8px, transparent 8px 15px); }
.tl li { position: relative; padding: 0 0 30px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
  content: ""; position: absolute; left: -27px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--navy);
}
.tl li.tl-now::before { border-color: var(--red); }
.tl .tl-when { font-family: var(--font-mono); font-size: .74rem; color: var(--red-text); }
.tl h3 { margin: 4px 0 2px; font-size: 1.15rem; }
.tl .tl-where { font-weight: 700; color: var(--ink-2); font-size: .94rem; }
.tl p { color: var(--ink-2); font-size: .95rem; margin: 8px 0 0; max-width: 62ch; }

/* ---------- Template gallery ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 34px; }
.filter-btn {
  font-family: var(--font-mono); font-size: .82rem; padding: 9px 17px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--ink-2); cursor: pointer; transition: all .16s ease;
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
[data-theme="dark"] .filter-btn[aria-pressed="true"] { background: var(--paper-2); color: var(--ink); border-color: var(--ink-2); }

.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 980px) { .tpl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.tpl-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--navy); }
.tpl-card.is-hidden { display: none; }
.tpl-frame { position: relative; height: 250px; overflow: hidden; background: #eceef1; border-bottom: 1px solid var(--line-soft); }
.tpl-frame iframe { width: 200%; height: 500px; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; }
.tpl-frame::after { content: ""; position: absolute; inset: 0; } /* click shield */
.tpl-kind { position: absolute; z-index: 2; top: 12px; left: 12px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em; padding: 5px 10px; border-radius: 6px; color: #fff; }
.tpl-kind.k-amp { background: var(--navy); }
.tpl-kind.k-static { background: #3c6a54; }
.tpl-kind.k-interactive { background: var(--red); }
.tpl-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tpl-body h3 { margin: 0; font-size: 1.08rem; }
.tpl-body p { margin: 0; font-size: .88rem; color: var(--ink-2); flex: 1; }
.tpl-tags { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-3); }
.tpl-actions { display: flex; gap: 10px; margin-top: 8px; }

.badge-valid {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .68rem; color: #1e7a4f;
  background: rgba(30,122,79,.1); border: 1px solid rgba(30,122,79,.35);
  padding: 4px 9px; border-radius: 6px;
}
[data-theme="dark"] .badge-valid { color: #7fd4a8; background: rgba(127,212,168,.1); border-color: rgba(127,212,168,.3); }

/* ---------- Viewer ---------- */
.viewer-shell { padding-top: 0; }
.viewer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.viewer-title h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 4px; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.viewer-frame-wrap { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(10px, 3vw, 28px); }
.viewer-frame { width: 100%; max-width: 680px; height: min(78vh, 900px); margin: 0 auto; display: block; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lift); }
.viewer-note { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3); margin-top: 14px; }

/* ---------- Case studies ---------- */
.case-hero { padding: clamp(18px, 3.5vw, 40px) 0 clamp(36px, 5vw, 56px); }
.case-hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 20ch; }
.crumbs { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-3); margin: 0 0 22px; }
.crumbs a { color: var(--ink-2); }
.docket {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  background: var(--card); margin: clamp(26px, 4vw, 40px) 0;
}
@media (max-width: 760px) { .docket { grid-template-columns: repeat(2, 1fr); } }
.docket > div { padding: 18px 20px; border-right: 1px dashed var(--line); }
.docket > div:last-child { border-right: 0; }
@media (max-width: 760px) { .docket > div:nth-child(2n) { border-right: 0; } .docket > div:nth-child(-n+2) { border-bottom: 1px dashed var(--line); } }
.docket dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .07em; color: var(--red-text); margin: 0 0 5px; }
.docket dd { margin: 0; font-weight: 700; font-size: .95rem; }

.case-body { max-width: 760px; }
.case-body h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 2.2em 0 .6em; padding-top: .9em; border-top: 1.5px solid var(--line); position: relative; }
.case-body h2::before { content: attr(data-no); position: absolute; top: -1px; left: 0; transform: translateY(-52%); background: var(--paper); padding-right: 14px; font-family: var(--font-mono); font-size: .74rem; font-weight: 500; color: var(--red-text); letter-spacing: .08em; }
.case-body ul { padding-left: 22px; }
.case-body li { margin-bottom: .55em; color: var(--ink-2); }
.case-body li strong, .case-body p strong { color: var(--ink); }
.case-callout { border-left: 4px solid var(--navy); background: var(--navy-soft); border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 1.4em 0; font-size: .95rem; }
[data-theme="dark"] .case-callout { background: rgba(143,163,232,.1); }
.case-figure { margin: 1.8em 0; }
.case-figure img { border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.case-figure figcaption { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-3); margin-top: 10px; }
code, .code-inline { font-family: var(--font-mono); font-size: .84em; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 5px; padding: 2px 6px; }
[data-theme="dark"] code { background: rgba(237,234,224,.08); }

.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: clamp(48px, 7vw, 72px); }
@media (max-width: 640px) { .case-nav { grid-template-columns: 1fr; } }
.case-nav a { display: block; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.case-nav a:hover { border-color: var(--navy); transform: translateY(-3px); }
.case-nav .dir { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3); display: block; margin-bottom: 5px; }
.case-nav .to-next { text-align: right; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 60px); align-items: start; }
@media (max-width: 1023px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-line { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); font-size: .98rem; }
.contact-line .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; flex: none; }
.contact-line a { color: var(--ink); font-weight: 700; text-decoration: none; }
.contact-line a:hover { color: var(--red-text); }
.contact-line .cl-label { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-3); display: block; }

.form-card { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-lift); position: relative; }
.form-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; border-radius: var(--radius) var(--radius) 0 0; background: repeating-linear-gradient(-45deg, var(--red) 0 12px, transparent 12px 24px, var(--navy) 24px 36px, transparent 36px 48px); }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-mono); font-size: .74rem; color: var(--ink-2); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 18%, transparent); }
.field textarea { min-height: 140px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 14px 0 0; padding: 13px 16px; border-radius: 10px; font-size: .92rem; display: none; }
.form-status.ok { display: block; background: rgba(30,122,79,.12); border: 1px solid rgba(30,122,79,.4); color: #1e7a4f; }
.form-status.err { display: block; background: var(--red-soft); border: 1px solid var(--red); color: var(--red-text); }
[data-theme="dark"] .form-status.ok { color: #7fd4a8; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1.5px solid var(--ink); padding: 44px 0 40px; margin-top: clamp(60px, 9vw, 100px); }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.foot-note { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-3); margin-top: 26px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { font-size: .92rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--red-text); }

/* ---------- Left icon rail (reference sidebar) ---------- */
.side-rail {
  position: fixed; z-index: 90; left: calc(var(--sheet-m) + 18px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; padding: 12px 9px;
  background: rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7);
  border: 1px solid var(--glass-brd); border-radius: 999px;
  box-shadow: 0 20px 44px -20px rgba(35, 20, 80, .5), inset 0 1px 0 var(--glass-hi);
}
[data-theme="dark"] .side-rail { background: rgba(20, 27, 62, .5); }
.rail-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-2); background: transparent; border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .5); transform: scale(1.06); }
[data-theme="dark"] .rail-btn:hover { background: rgba(255, 255, 255, .12); }
.rail-btn[aria-current="true"], .rail-btn.is-active {
  background: #ffffff; color: var(--red);
  box-shadow: 0 10px 24px -10px rgba(35, 20, 80, .55);
}
[data-theme="dark"] .rail-btn[aria-current="true"], [data-theme="dark"] .rail-btn.is-active { background: var(--paper-2); }
@media (max-width: 1259px) { .side-rail { display: none; } }

/* ---------- Hero email capture (reference input + dark pill) ---------- */
.mini-capture { display: flex; max-width: 430px; margin-top: 28px; padding: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .5); border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: blur(12px) saturate(1.6); backdrop-filter: blur(12px) saturate(1.6);
  box-shadow: 0 16px 36px -18px rgba(35, 20, 80, .45), inset 0 1px 0 var(--glass-hi); }
[data-theme="dark"] .mini-capture { background: rgba(15, 22, 48, .5); }
.mini-capture input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 16px;
  font: 400 .95rem var(--font-body); color: var(--ink); outline: none; }
.mini-capture input::placeholder { color: var(--ink-3); }
.mini-capture .btn { padding: 12px 22px; font-size: .9rem; white-space: nowrap; }
.hero-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; }
.hero-links a { font-family: var(--font-mono); font-size: .82rem; color: var(--ink-2); text-decoration: none; }
.hero-links a:hover { color: var(--red-text); }
.hero-links a::before { content: "→ "; color: var(--red); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; } .reveal-d2 { transition-delay: .16s; } .reveal-d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 300; display: none; }
.palette.open { display: block; }
.palette-scrim { position: absolute; inset: 0; background: rgba(15,22,48,.55); backdrop-filter: blur(3px); }
.palette-box {
  position: relative; max-width: 560px; margin: 12vh auto 0; background: var(--card);
  border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lift); overflow: hidden;
}
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 1.05rem var(--font-body); padding: 18px 20px; outline: none; }
.palette-list { max-height: 46vh; overflow: auto; margin: 0; padding: 8px; list-style: none; }
.palette-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; }
.palette-list a:hover, .palette-list li.sel a { background: var(--navy-soft); color: var(--navy); }
.palette-list .k { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3); font-weight: 400; }
.palette-hint { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-3); padding: 10px 16px; border-top: 1px solid var(--line-soft); }

/* ---------- Utility ---------- */
.section-head { max-width: 640px; margin-bottom: clamp(30px, 5vw, 46px); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.center .section-head, .center .eyebrow { margin-left: auto; margin-right: auto; }
.hide { display: none !important; }


/* ---------- Liquid glass surfaces ---------- */
.card, .proj-card, .tpl-card, .stat, .docket, .form-card, .palette-box,
.viewer-frame-wrap, .eyebrow, .icon-btn, .filter-btn, .btn-ghost, .env-letter,
.tl li::before, .contact-line .ico {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
  backdrop-filter: blur(var(--blur)) saturate(1.6);
  border-color: var(--glass-brd);
}
.card, .proj-card, .tpl-card, .stat, .docket, .form-card, .palette-box, .viewer-frame-wrap {
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.stat { border-style: solid; border-width: 1px; }
.docket, .form-card, .palette-box { border-width: 1px; border-style: solid; }
.case-callout {
  background: color-mix(in srgb, var(--navy) 9%, var(--glass));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5);
  backdrop-filter: blur(var(--blur)) saturate(1.5);
}
[data-theme="dark"] .case-callout { background: color-mix(in srgb, var(--navy) 14%, var(--glass)); }
.field input, .field textarea {
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 14px;
}
[data-theme="dark"] .field input, [data-theme="dark"] .field textarea { background: rgba(15, 22, 48, .45); }
.site-head {
  background: rgba(255, 255, 255, .38);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  backdrop-filter: blur(24px) saturate(1.7);
  border-bottom-color: var(--glass-brd);
}
[data-theme="dark"] .site-head { background: rgba(20, 27, 62, .55); }
.search-pill {
  display: inline-flex; align-items: center; gap: 9px; min-width: 168px; height: 42px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--glass-brd); white-space: nowrap; flex: none;
  background: rgba(255, 255, 255, .45); color: var(--ink-3); cursor: pointer;
  font: 400 .86rem var(--font-body); transition: border-color .15s ease, transform .15s ease;
}
[data-theme="dark"] .search-pill { background: rgba(15, 22, 48, .45); }
.search-pill:hover { border-color: var(--navy); transform: translateY(-1px); }
.search-pill .k { margin-left: auto; font-family: var(--font-mono); font-size: .68rem; color: var(--ink-3); }
@media (max-width: 1259px) { .search-pill { display: none; } }
.palette-scrim { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .proj-card, .tpl-card, .stat, .docket, .form-card, .palette-box,
  .viewer-frame-wrap, .icon-btn, .filter-btn, .env-letter { background: var(--card); }
  .eyebrow, .btn-ghost { background: var(--paper-2); }
  .site-head { background: var(--paper); }
}

/* Glass refinements: keep functional borders readable over glass */
.eyebrow { border-color: var(--line); }
.icon-btn, .filter-btn, .btn-ghost { border-color: var(--line); }
.btn-ghost:hover, .icon-btn:hover, .filter-btn:hover { border-color: var(--navy); }
.docket, .palette-box, .form-card { border-color: var(--line); }
.tl li::before { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--navy); }
.tl li.tl-now::before { border-color: var(--red); }

/* ---------- UX: scroll progress (airmail ribbon) ---------- */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: repeating-linear-gradient(-45deg, var(--red) 0 10px, var(--paper) 10px 14px, var(--navy) 14px 24px, var(--paper) 24px 28px);
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* ---------- UX: back to top ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6); backdrop-filter: blur(var(--blur)) saturate(1.6);
  box-shadow: var(--shadow); font-size: 1.1rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, border-color .15s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--navy); }

/* ---------- UX: nav link underline ---------- */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px;
  border-radius: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.nav-link:hover::after, .nav-link[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- UX: glare sweep on media cards ---------- */
.proj-card .proj-media::after, .tpl-card .tpl-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.30) 50%, transparent 60%);
  transform: translateX(-130%); transition: transform .7s ease;
}
.proj-card:hover .proj-media::after, .tpl-card:hover .tpl-frame::before { transform: translateX(130%); }
@media (prefers-reduced-motion: reduce) {
  .proj-card .proj-media::after, .tpl-card .tpl-frame::before { display: none; }
}

/* ---------- UX: message character counter ---------- */
.char-count { display: block; text-align: right; margin-top: 6px; font-family: var(--font-mono); font-size: .68rem; color: var(--ink-3); }
.char-count.warn { color: var(--red-text); }

/* ---------- discreet owner link ---------- */
.owner-link { color: inherit; text-decoration: none; opacity: .75; }
.owner-link:hover { color: var(--red-text); opacity: 1; }


/* ---------- Hero entrance choreography ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes sceneIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.hero-grid > div:first-child > * { animation: riseIn .65s cubic-bezier(.2, .7, .3, 1) both; }
.hero-grid > div:first-child > *:nth-child(1) { animation-delay: .05s; }
.hero-grid > div:first-child > *:nth-child(2) { animation-delay: .14s; }
.hero-grid > div:first-child > *:nth-child(3) { animation-delay: .24s; }
.hero-grid > div:first-child > *:nth-child(4) { animation-delay: .34s; }
.hero-grid > div:first-child > *:nth-child(5) { animation-delay: .44s; }
.envelope-scene { animation: sceneIn .8s cubic-bezier(.2, .7, .3, 1) .15s both; }

/* ---------- Social icons ---------- */
.socials { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.social-btn {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: inline-grid; place-items: center;
  color: var(--ink-2); border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); backdrop-filter: blur(var(--blur)) saturate(1.5);
  transition: transform .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.social-btn svg { width: 19px; height: 19px; display: block; }
.social-btn:hover, .social-btn:focus-visible {
  color: var(--hov, var(--navy)); border-color: currentColor;
  transform: translateY(-3px) rotate(-4deg); box-shadow: var(--shadow);
}
.contact-line .ico svg { width: 18px; height: 18px; color: var(--ink-2); display: block; }
.contact-line:hover .ico svg { color: var(--red-text); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .social-btn { background: var(--card); } }


/* env-letter must stay solid — glass over the envelope interior reads muddy */
.env-letter { background: var(--card) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }


/* Hero social row (uses the existing .social-btn component) */
.social-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* Footer over the mesh */
.site-foot {
  background: color-mix(in srgb, var(--paper) 45%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
}

@media (min-width: 1260px) { .icon-btn[data-open-palette] { display: none; } }
@media (max-width: 1023px) { .icon-btn[data-open-palette] { display: none; } }


/* ============================================================
   MOBILE HARDENING — kill horizontal blow-outs, fit the bar
   ============================================================ */

/* 1) Grid/flex blow-out guard: children may shrink below content size */
.hero-grid > *, .grid-2 > *, .grid-3 > *, .proj-grid > *, .tpl-grid > *,
.contact-grid > *, .stats > *, .docket > div, .foot-grid > *, .case-nav > a { min-width: 0; }
h1, h2, h3, .lede, .eyebrow, .hero-proof, .hero-kicker li, .docket dd, code { overflow-wrap: break-word; }
.eyebrow { flex-wrap: wrap; max-width: 100%; }
body { overflow-x: clip; }

/* 2) The bar on small screens: brand slims down, controls tighten, menu always reachable */
@media (max-width: 760px) {
  .brand-name small { display: none; }
  .brand-name { font-size: .95rem; }
  .site-head .container { padding: 0 10px 0 14px; gap: 10px; }
  .head-actions { gap: 6px; }
}
@media (max-width: 420px) {
  .icon-btn { width: 40px; height: 40px; }
  .brand-mark { width: 36px; height: 36px; font-size: .95rem; }
}

/* 3) Type + spacing scale for phones */
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  h1 { font-size: clamp(1.95rem, 10.5vw, 2.6rem); }
  .case-hero h1 { font-size: clamp(1.7rem, 8.5vw, 2.2rem); }
  h2 { font-size: clamp(1.5rem, 7.5vw, 1.9rem); }
  .lede { font-size: 1.02rem; }
  .hero-kicker { font-size: .74rem; gap: 4px 14px; }
  .hero-proof { font-size: .74rem; }
  .hero-links { gap: 6px 16px; }
  .hero-links a { font-size: .78rem; }
  .glass-sheet { border-radius: 22px; }
  .section { padding: clamp(52px, 12vw, 72px) 0; }
  .tl { padding-left: 26px; }
  .stats { gap: 12px; }
  .stat { padding: 20px 8px; }
}

/* 4) Hero capture: stays a pill, never overflows */
@media (max-width: 560px) {
  .mini-capture { max-width: 100%; padding: 5px; }
  .mini-capture input { padding: 10px 12px; font-size: .9rem; }
  .mini-capture .btn { padding: 0 16px; height: 42px; font-size: .84rem; }
}
@media (max-width: 340px) {
  .mini-capture { flex-direction: column; border-radius: 22px; gap: 6px; }
  .mini-capture .btn { width: 100%; }
}

/* 5) Envelope scene breathing room on phones */
@media (max-width: 560px) {
  .envelope-scene { padding-top: clamp(44px, 16%, 70px); }
  .float-tile { width: 44px; font-size: 1.05rem; border-radius: 13px; }
  .spark.s2 { right: 8%; }
}

/* 6) Footer + strip on phones */
@media (max-width: 560px) {
  .foot-grid { flex-direction: column; gap: 18px; }
  .strip-item { font-size: .72rem; }
}
