/* HiLooks — design system */

:root {
  /* Default = HOMEOWNER palette: cream paper, deep moss, warm amber */
  --bg:        #F4EFE6;   /* warm cream */
  --bg-1:      #EDE6D8;   /* slightly deeper paper */
  --bg-2:      #FFFCF6;   /* card surface */
  --bg-3:      #E5DCC8;
  --line:      rgba(36,46,38,0.10);
  --line-2:    rgba(36,46,38,0.18);
  --line-3:    rgba(36,46,38,0.30);

  --fg:        #1B2620;   /* deep ink/forest, never pure black */
  --fg-2:      rgba(27,38,32,0.78);
  --fg-3:      rgba(27,38,32,0.58);
  --fg-4:      rgba(27,38,32,0.42);

  --accent:    #2F5D43;   /* deep moss — calm, considered */
  --accent-2:  #3F7656;
  --accent-soft: rgba(47,93,67,0.10);
  --accent-glow: rgba(47,93,67,0.30);

  --warm:      #C97A3A;   /* hearth amber — the human accent */
  --warm-soft: rgba(201,122,58,0.12);

  --warn:      #B8651E;
  --danger:    #B23A2A;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans:  "Geist", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 40px;

  --container: 1280px;
  --gutter: 32px;

  --tx-1: 11px;
  --tx-2: 13px;
  --tx-3: 15px;
  --tx-4: 18px;
  --tx-h: clamp(44px, 5.2vw, 76px);
  --tx-d: clamp(56px, 7vw, 104px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html { scroll-behavior: smooth; }
body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(47,93,67,0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(201,122,58,0.06), transparent 60%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

h1,h2,h3,h4 { margin: 0; font-weight: 400; letter-spacing: -0.025em; }
p { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.mono  { font-family: var(--mono); font-feature-settings: "zero" on; }

/* === Type scale === */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--tx-1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

.h1-display {
  font-family: var(--serif);
  font-size: var(--tx-d);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 400;
}
.h2-display {
  font-family: var(--serif);
  font-size: var(--tx-h);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 400;
}

.lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 56ch;
  letter-spacing: -0.005em;
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg-2);
}
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-accent {
  background: var(--accent);
  color: #FFFCF6;
}
.btn-accent:hover { background: var(--accent-2); }
.btn-warm {
  background: var(--warm);
  color: #FFFCF6;
}
.btn-warm:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--fg); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 15px; }

.arrow { transition: transform 240ms ease; display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

/* === Card / surface === */
.surface {
  background: linear-gradient(180deg, rgba(255,253,248,0.7), rgba(255,253,248,0.35));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.surface-2 {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 20px 60px rgba(27,38,32,0.06);
}
.glass {
  background: rgba(255,253,248,0.55);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--line-2);
}

/* === Chip === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  background: rgba(255,253,248,0.7);
  border: 1px solid var(--line);
}
.chip .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: led 2s ease-out infinite;
}
@keyframes led {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

/* === Tab toggle === */
.tab-group {
  display: inline-flex;
  padding: 4px;
  background: rgba(27,38,32,0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab-group button {
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 500;
  transition: all 220ms ease;
}
.tab-group button.active {
  background: var(--fg);
  color: var(--bg-2);
}

/* === Header === */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,239,230,0.75);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.header-row1 {
  height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
}
.header-row1 .nav-links-desktop { justify-self: end; }
.header-row1 .mode-tabs-desktop { justify-self: end; }
.header-row1 .header-cta { justify-self: end; }
.header-row2 { display: none; }
.nav-burger { display: none; }
/* Backwards-compat for any stray .header-inner reference */
.header-inner { display: contents; }
.nav-links {
  display: flex; gap: 24px;
  font-size: 13px;
  color: var(--fg-3);
}
.nav-links a {
  transition: color 200ms;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--fg); }

/* === Logo === */
.logo {
  display: inline-flex; align-items: baseline; gap: 10px;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.logo-mark {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  align-self: center;
  position: relative;
  transition: transform 600ms cubic-bezier(0.22,1,0.36,1);
}
.logo:hover .logo-mark { transform: translateY(-1px) rotate(-2deg); }
.logo-mark svg { width: 100%; height: 100%; display: block; }

/* Photo variant — transparent PNG (background cut). Pinned dimensions
   to match the natural aspect ratio (~1.54:1) so the global
   img { max-width: 100% } rule doesn't blow it out. */
.logo-mark-photo {
  width: 68px !important;
  height: 44px !important;
  overflow: visible;
  filter: drop-shadow(0 4px 8px rgba(27,38,32,0.15));
}
.logo-mark-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  max-width: none;
  filter: saturate(1.04) contrast(1.02);
}

/* Photo on homeowner, SVG on engineer — !important to win against
   the .logo-mark-photo size rules above. */
.logo-mark-svg { display: none !important; }
body.eng-mode .logo-mark-photo { display: none !important; }
body.eng-mode .logo-mark-svg { display: inline-grid !important; }
.logo-word {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.025em;
  color: var(--fg);
  line-height: 1;
}
.logo-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  text-transform: uppercase;
  margin-left: 4px;
  align-self: baseline;
  position: relative;
  top: -6px;
}

/* === Hero glow === */
.hero-glow {
  position: absolute;
  inset: -40% 0 auto 0;
  height: 80vh;
  background:
    radial-gradient(ellipse 50% 60% at 50% 40%, rgba(47,93,67,0.18), transparent 60%),
    radial-gradient(ellipse 30% 40% at 70% 30%, rgba(201,122,58,0.12), transparent 60%);
  pointer-events: none;
  filter: blur(40px);
}

/* === Grid lines bg === */
.grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(27,38,32,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27,38,32,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms cubic-bezier(0.22,1,0.36,1), transform 700ms cubic-bezier(0.22,1,0.36,1);
}
.reveal.in { opacity: 1; transform: none; }

/* Scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform-origin: left;
  z-index: 200;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Section spacing */
.section { padding: 120px 0; position: relative; }
.section-sm { padding: 80px 0; }
.section-lg { padding: 160px 0; }

/* Divider */
.divider { height: 1px; background: var(--line); }

/* Selection */
::selection { background: var(--accent); color: var(--bg); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

/* === ENGINEER mode override (cockpit / dark) === */
body.eng-mode {
  --bg:        #07090A;
  --bg-1:      #0B0E10;
  --bg-2:      #11151A;
  --bg-3:      #181D24;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);
  --line-3:    rgba(255,255,255,0.22);

  --fg:        #F5F7F8;
  --fg-2:      rgba(245,247,248,0.78);
  --fg-3:      rgba(245,247,248,0.55);
  --fg-4:      rgba(245,247,248,0.38);

  --accent:    #4ADE80;
  --accent-2:  #22C55E;
  --accent-soft: rgba(74,222,128,0.12);
  --accent-glow: rgba(74,222,128,0.55);

  --warn:      #F5A524;
  --danger:    #F75555;
}
body.eng-mode {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74,222,128,0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(74,222,128,0.04), transparent 50%);
}
body.eng-mode .surface {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
}
body.eng-mode .surface-2 {
  background: var(--bg-2);
  box-shadow: none;
}
body.eng-mode .chip {
  background: rgba(255,255,255,0.04);
}
body.eng-mode .tab-group {
  background: rgba(255,255,255,0.04);
}
body.eng-mode .tab-group button.active {
  background: var(--fg);
  color: var(--bg);
}
body.eng-mode .header {
  background: rgba(7,9,10,0.65);
}
body.eng-mode .grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
}
body.eng-mode .hero-glow {
  background:
    radial-gradient(ellipse 50% 60% at 50% 40%, rgba(74,222,128,0.25), transparent 60%),
    radial-gradient(ellipse 30% 40% at 70% 30%, rgba(74,222,128,0.12), transparent 60%);
}
body.eng-mode .btn-primary { color: var(--bg); }
body.eng-mode .btn-accent { color: var(--bg); }

/* Utilities */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; align-items: center; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.grid { display: grid; }

/* Numbered tile (Huly style features) */
.feat-tile {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
  position: relative;
  overflow: hidden;
  transition: border-color 300ms ease, transform 300ms ease;
}
.feat-tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feat-tile .feat-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fg-4);
}

/* Pulse ring */
.pulse-ring {
  position: absolute;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: pulsering 3s linear infinite;
}
@keyframes pulsering {
  0% { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Fan blades */
.fan { transform-origin: 50% 50%; animation: spinfan 1.5s linear infinite; }
@keyframes spinfan { to { transform: rotate(360deg); } }

/* Light theme override (engineer console actually stays dark — but homeowner has subtle warm wash) */
.warm-grain::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Marquee */
.marquee { overflow: hidden; }
.marquee-track {
  display: flex; gap: 64px;
  animation: marq 50s linear infinite;
  white-space: nowrap;
  padding-right: 64px;
}
@keyframes marq { to { transform: translateX(-50%); } }

/* === Tabular figures — opt-in via .tnum or .mono === */
.tnum, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" on, "zero" on; }

/* === Refined surfaces === */

/* Vellum: premium paper card. Used on hero feature surfaces. */
.vellum {
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 25% 10%, rgba(255,253,248,0.95), rgba(245,238,222,0.7) 70%),
    radial-gradient(ellipse 60% 50% at 90% 90%, rgba(201,122,58,0.05), transparent 60%),
    var(--bg-2);
  border: 1px solid rgba(36,46,38,0.10);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 1px 2px rgba(255,255,255,0.5),
    0 24px 60px -20px rgba(27,38,32,0.18),
    0 60px 120px -40px rgba(27,38,32,0.12);
  overflow: hidden;
}
.vellum::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
}
body.eng-mode .vellum {
  background:
    radial-gradient(ellipse 70% 50% at 25% 10%, rgba(255,255,255,0.04), rgba(255,255,255,0.005) 70%),
    radial-gradient(ellipse 60% 50% at 90% 90%, rgba(74,222,128,0.04), transparent 60%),
    var(--bg-2);
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 24px 80px -20px rgba(0,0,0,0.55),
    0 60px 120px -40px rgba(74,222,128,0.04);
}

/* === Editorial chapter divider === */
.chapter {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 56px 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-4);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.chapter::before,
.chapter::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.chapter-no { color: var(--accent); }

/* === Pull quote — magazine moment between sections === */
.pull-quote {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-style: italic;
  color: var(--fg);
  text-align: center;
  max-width: 22ch;
  margin: 0 auto;
  padding: 80px 0;
  position: relative;
}
.pull-quote em { color: var(--accent); font-style: italic; }
.pull-quote::before,
.pull-quote::after {
  content: "";
  display: block;
  width: 28px; height: 1px;
  margin: 24px auto;
  background: var(--line-2);
}

/* === Drop cap === */
.drop-cap::first-letter {
  font-family: var(--serif);
  font-size: 4em;
  line-height: 0.85;
  float: left;
  padding: 4px 14px 0 0;
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

/* === Refined button states === */
.btn {
  position: relative;
  letter-spacing: -0.005em;
}
.btn-primary, .btn-accent, .btn-warm {
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 8px 24px -12px rgba(27,38,32,0.4);
}
.btn-primary:hover, .btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 14px 36px -12px rgba(47,93,67,0.45);
}
.btn-ghost:hover { transform: translateY(-1px); }
body.eng-mode .btn-primary, body.eng-mode .btn-accent {
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 24px -12px rgba(0,0,0,0.55);
}
body.eng-mode .btn-accent:hover {
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 14px 36px -12px rgba(74,222,128,0.5);
}

/* === Lift utility for cards === */
.lift {
  transition: transform 320ms cubic-bezier(0.22,1,0.36,1), box-shadow 320ms ease, border-color 320ms ease;
}
.lift:hover { transform: translateY(-3px); }

/* === Refined feat-tile (depth + grain) === */
.feat-tile {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)),
    var(--bg-2);
}
body.eng-mode .feat-tile {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0));
}
.feat-tile:hover {
  box-shadow: 0 24px 60px -20px rgba(27,38,32,0.12);
}
body.eng-mode .feat-tile:hover {
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.5);
}

/* === Subtle float for hero ornaments === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float-soft { animation: float 6s ease-in-out infinite; }

/* === Accreditation strip — gentle wash on hover === */
.accred-name { transition: color 200ms ease, letter-spacing 200ms ease; }
.accred-name:hover { color: var(--accent); }

/* === Marker bar (numeric counter motif) === */
.marker-bar {
  display: inline-block;
  width: 40px; height: 2px;
  background: var(--accent);
  margin-bottom: 16px;
}

/* === Text balance for headlines === */
.h1-display, .h2-display { text-wrap: balance; }
.lead { text-wrap: pretty; }

/* === Refined selection === */
::selection { background: var(--accent); color: #FFFCF6; text-shadow: none; }
body.eng-mode ::selection { background: var(--accent); color: var(--bg); }

/* === Refined scrollbar (engineer mode) === */
body.eng-mode ::-webkit-scrollbar-track { background: var(--bg-1); }
body.eng-mode ::-webkit-scrollbar-thumb { background: var(--line-2); }

/* ==========================================================================
   RESPONSIVE LAYER
   Inline-styled grids dominate this codebase — to avoid rewriting every JSX
   file, we use [style*=] attribute selectors + !important to collapse
   multi-column layouts at narrower viewports. Three breakpoints:
   1080px (small laptop), 900px (tablet), 640px (phone), 420px (tight phone).
   ========================================================================== */

@media (max-width: 1080px) {
  :root { --gutter: 24px; --container: 100%; }
  .section { padding: 96px 0; }
  .section-lg { padding: 120px 0; }
  .h1-display { font-size: clamp(38px, 6.5vw, 76px); }
  .h2-display { font-size: clamp(34px, 5.4vw, 60px); }
}

@media (max-width: 900px) {
  :root { --gutter: 20px; }

  /* Multi-column grids → 2-col */
  [style*="grid-template-columns: repeat(6"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(6"],
  [style*="grid-template-columns:repeat(5"],
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Two-column ratio layouts → stack */
  [style*="grid-template-columns: 1fr 1.4fr"],
  [style*="grid-template-columns: 1fr 1.6fr"],
  [style*="grid-template-columns: 1.6fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: 1.3fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Fixed-width left + body (founder card, portal, etc.) → stack */
  [style*="grid-template-columns: 320px 1fr"],
  [style*="grid-template-columns: 280px 1fr"],
  [style*="grid-template-columns: 240px 1fr"],
  [style*="grid-template-columns: 220px 1fr"],
  [style*="grid-template-columns: 60px repeat"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Funding section: 1fr 64px 1fr (with OR chip) → stack */
  [style*="grid-template-columns: 1fr 64px 1fr"],
  [style*="grid-template-columns: 1fr 80px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Engineer rate card / job board / pay grids — make scrollable */
  [style*="grid-template-columns: 2.6fr"],
  [style*="grid-template-columns: 90px 1.4fr"],
  [style*="grid-template-columns: 90px 1.6fr"],
  [style*="grid-template-columns: 120px 1.4fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  /* Hide table headers on mobile (the cells already self-label) */
  [style*="grid-template-columns: 2.6fr"][style*="font-size: 10px"],
  .mono[style*="grid-template-columns: 90px"] {
    display: none !important;
  }

  /* Header tablet (≤900px): keep two-row layout, show hamburger,
     hide desktop nav + desktop CTA, mode tabs move to row 2. */
  .header-row1 {
    height: 60px !important;
    grid-template-columns: 1fr auto !important;
    gap: 12px !important;
    padding: 0 !important;
  }
  .header-row1 .nav-links-desktop,
  .header-row1 .mode-tabs-desktop,
  .header-row1 .header-cta { display: none !important; }
  .header-row2 {
    display: block !important;
    padding: 8px 0 12px !important;
    border-top: 1px solid var(--line);
  }
  .header-row2 .tab-group {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .header-row2 .tab-group button { flex: 1; max-width: 200px; }

  /* Hamburger button */
  .nav-burger {
    display: inline-grid !important;
    grid-template-rows: repeat(3, 2px);
    align-content: center;
    justify-self: end;
    width: 44px; height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(8px);
    cursor: pointer;
    gap: 5px;
    padding: 0 12px;
  }
  body.eng-mode .nav-burger {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.14);
  }
  .nav-burger > span {
    display: block;
    width: 100%; height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: transform 200ms;
  }
  .nav-burger:hover > span:nth-child(1) { transform: translateY(-1px); }
  .nav-burger:hover > span:nth-child(3) { transform: translateY(1px); }

  /* Section paddings tighter */
  .section { padding: 72px 0 !important; }
  .section-lg { padding: 96px 0 !important; }
  .section-sm { padding: 56px 0 !important; }

  /* Big card padding */
  .vellum { padding: 32px !important; }
  .surface-2[style*="padding: 56px"],
  .surface-2[style*="padding: 64px"] { padding: 32px !important; }
  [style*="padding: 56px"] { padding: 32px !important; }

  /* Big gaps tightened */
  [style*="gap: 80px"],
  [style*="gap: 64px"] { gap: 32px !important; }

  /* Pull-quote scales down */
  .pull-quote { font-size: clamp(24px, 5vw, 40px); padding: 56px 0; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  /* Kill horizontal page scroll regardless of inner overflows */
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Hero postcode pill (homeowner) — stack input + CTA vertically */
  [style*="max-width: 540px"][style*="display: flex"][style*="border-radius: 999px"] {
    flex-direction: column !important;
    border-radius: 16px !important;
    align-items: stretch !important;
    padding: 10px !important;
    gap: 8px !important;
  }
  [style*="max-width: 540px"] > input {
    padding: 12px 16px !important;
  }
  [style*="max-width: 540px"] > .btn {
    width: 100% !important;
    justify-content: center !important;
    height: 48px !important;
  }

  /* Process timeline connector line is vestigial when steps stack — hide */
  .container > div > div[style*="left: 4%"][style*="right: 4%"][style*="height: 1px"] {
    display: none !important;
  }

  /* === Multi-column grids: 4/5/6-col stay at 2x2 not 1-col so dense info
     stays scannable. 3-col + ratio layouts still go to 1-col. === */
  [style*="grid-template-columns: repeat(6"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:repeat("] {
    grid-template-columns: 1fr !important;
  }

  /* Cards stretch to fixed min-height on desktop — kill that on mobile so
     empty trailing space disappears. */
  .feat-tile, .surface, .surface-2, .vellum {
    min-height: 0 !important;
  }
  [style*="min-height: 280"],
  [style*="min-height: 260"],
  [style*="min-height: 240"],
  [style*="min-height: 220"],
  [style*="min-height: 200"] {
    min-height: 0 !important;
  }

  /* Five-currency tiles: trim padding, tighten the meta-line */
  .feat-tile { padding: 22px !important; }

  /* Accreditations strip: was a wrap-flex stacking one-name-per-row.
     Stack to one column: label on top, names as horizontal scroll. */
  .accred-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .accred-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    justify-content: flex-start !important;
    gap: 22px !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Fade right edge to suggest scrollability */
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  }
  .accred-row::-webkit-scrollbar { display: none; }
  .accred-row > .serif {
    flex-shrink: 0;
    font-size: 17px !important;
  }
  .accred-label { letter-spacing: 0.18em !important; opacity: 0.7; }

  /* Header phone (≤640): wordmark slightly smaller for fit, mode tabs
     in row 2, hamburger remains. */
  .header-row1 { height: 56px !important; }
  .tab-group button { height: 40px !important; padding: 0 16px !important; font-size: 13px !important; }
  .logo-word { font-size: 22px !important; }
  .logo-tag { display: none !important; }
  .logo { min-height: 48px; align-items: center; }
  .logo-mark { width: 40px !important; height: 40px !important; }
  .logo-mark-svg { width: 40px !important; height: 40px !important; }
  /* Photo logo on mobile: bigger, explicit dimensions matching aspect 1.54:1 */
  .logo-mark-photo {
    width: 70px !important;
    height: 46px !important;
  }

  /* iOS HIG 44px tap targets — savings-calc pills + similar inline-styled pill
     buttons that lack a className. Targeted by inline padding fingerprint. */
  button[style*="padding: 8px 14px"][style*="border-radius: 999px"],
  button[style*="padding:8px 14px"][style*="border-radius:999px"] {
    padding: 12px 16px !important;
    min-height: 44px !important;
    font-size: 14px !important;
  }
  /* Stories progress dots — keep visual but expand hit area via padding.
     Margin pulls in to preserve layout. */
  button[style*="height: 3px"],
  button[style*="height:3px"] {
    padding: 18px 0 !important;
    margin-top: -16px !important;
    margin-bottom: -16px !important;
    background-clip: content-box !important;
  }
  /* FAQ accordion buttons — they're already 24px-vertical-padded but make
     sure the chevron is also tappable */
  /* (already generously sized; no override needed) */
  /* Comparison-table mobile cards / portal pills already meet target. */
  .logo-tag { display: none; }

  /* Section padding tighter on phone */
  .section { padding: 56px 0 !important; }
  .section-lg { padding: 72px 0 !important; }

  /* The "OR" chip in funding section should be horizontal divider on mobile */
  /* When the parent grid stacks, the OR column becomes a row — its inner
     vertical pillar becomes a horizontal one, which actually reads fine
     as a designed pause. Just tighten its vertical padding. */
  [style*="grid-template-columns: 1fr 64px 1fr"] > div[style*="flex-direction: column"][style*="align-items: center"] {
    padding: 8px 0 !important;
  }
  [style*="grid-template-columns: 1fr 64px 1fr"] > div[style*="flex-direction: column"] > div[style*="background: linear-gradient(180deg"] {
    width: 100% !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, var(--line-2), transparent) !important;
    flex: none !important;
  }

  /* Hero trust bullets — 2 columns, tighter */
  /* (already render acceptably — leaving as-is) */

  /* === Comparison table → stacked option cards on mobile === */
  .cmp-header-row { display: none !important; }
  .cmp-row {
    grid-template-columns: 1fr !important;
    border-bottom: 8px solid transparent !important;
    padding: 4px 0 0 !important;
    gap: 0 !important;
    background: var(--bg-2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 var(--line);
    margin-bottom: 8px;
  }
  .cmp-cell {
    border-right: none !important;
    border-bottom: 1px solid var(--line);
  }
  .cmp-cell:last-child { border-bottom: none; }

  /* The metric (column 0) becomes a small section header */
  .cmp-col-0 {
    font-family: var(--mono) !important;
    font-size: 10.5px !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: var(--fg-3) !important;
    background: rgba(27,38,32,0.04) !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid var(--line) !important;
  }

  /* Each option (cols 1, 2, 3) becomes a row: prefix label + value */
  .cmp-col-1, .cmp-col-2, .cmp-col-3 {
    display: grid !important;
    grid-template-columns: 110px 1fr !important;
    gap: 12px !important;
    align-items: baseline !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
  .cmp-col-1::before, .cmp-col-2::before, .cmp-col-3::before {
    content: attr(data-col);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-4);
  }
  .cmp-col-1 {
    background: rgba(47,93,67,0.06) !important;
    color: var(--fg) !important;
    font-weight: 500 !important;
  }
  .cmp-col-1::before { color: var(--accent) !important; }
  .cmp-col-3 { background: rgba(178,58,42,0.04) !important; }

  /* === Partner Portal sidebar → horizontal pill tab row on mobile === */
  .portal-shell {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }
  .portal-sidebar {
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 12px 14px !important;
    gap: 8px !important;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
            mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
  }
  .portal-sidebar::-webkit-scrollbar { display: none; }

  /* Hide the section labels (WORKSPACE / THIS WEEK), the divider, and
     all "This week" items below the divider. */
  .portal-sidebar > .mono { display: none !important; }
  .portal-sidebar > .divider { display: none !important; }
  .portal-sidebar > .divider ~ * { display: none !important; }

  /* Tabs become rounded pills, horizontal scroll, no full-width */
  .portal-sidebar > button {
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    white-space: nowrap !important;
    color: var(--fg-2) !important;
  }
  /* Override inline rgba bg for active tab to a stronger fill */
  .portal-sidebar > button[style*="rgba(74,222,128,0.1)"] {
    background: var(--accent) !important;
    color: var(--bg) !important;
    border-color: var(--accent) !important;
  }
  /* Drop the small count badge — they crowd the pill on mobile */
  .portal-sidebar > button > span.mono { display: none !important; }

  /* The portal main area gets its own padding adjusted */
  .portal-shell > div[style*="padding: 28px"] {
    padding: 20px 16px !important;
    overflow-x: auto;
  }

  /* === Portal main-panel header: stack heading + action buttons vertically.
     The 'Morning, Ryan' + 'Message HQ / Open today's pack' row was forcing
     the buttons into a flex row that overflowed off the right edge. === */
  .portal-shell .row.between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  .portal-shell .row.between > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .portal-shell .row.between > div:last-child .btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: center !important;
  }

  /* === Process timeline (chapter 07): force 1-col on mobile.
     Override the general repeat(6) → 2-col rule. 6 content-rich step
     cards stacked vertically read better than 3×2 cramped cells. === */
  section#how [style*="grid-template-columns: repeat(6"] {
    grid-template-columns: 1fr !important;
  }

  /* === Drop cap on FounderPromise mobile: 4em was producing ~108px W
     that ate 5+ lines. Reduce to 2.6em for proportional rendering. === */
  .drop-cap::first-letter {
    font-size: 2.6em !important;
    padding-right: 10px !important;
    padding-top: 2px !important;
    line-height: 0.9 !important;
  }

  /* === Rate card labels on mobile: header row is hidden, so prefix each
     pricing cell with its column name via ::before. Cell contents
     left-floats the label and right-aligns the value. === */
  span.mono.tnum[data-rate]::before {
    content: attr(data-rate);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-4);
    margin-right: auto;
    padding-right: 12px;
  }
  span.mono.tnum[data-rate] {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    text-align: right !important;
    padding: 4px 0 !important;
  }

  /* Header: stack to two rows */
  .header-inner {
    grid-template-columns: 1fr !important;
    text-align: center;
  }
  .header-inner > .logo { justify-content: center; }
  .header-inner > .tab-group { justify-self: center; }
  .header-inner > nav.nav-links {
    display: none !important;
  }

  /* Hero adjustments */
  .container { padding-inline: 16px !important; }
  .h1-display { font-size: clamp(32px, 9vw, 48px); }
  .h2-display { font-size: clamp(26px, 8vw, 38px); }
  .lead { font-size: 15.5px; }

  /* Section paddings */
  .section { padding: 56px 0 !important; }
  .section-lg { padding: 72px 0 !important; }

  /* Buttons */
  .btn { padding-inline: 18px; }
  .btn-lg { padding-inline: 22px; height: 48px; font-size: 14px; }

  /* Stat blocks: huge numbers shrink */
  .h1-display + * .serif[style*="fontSize: 56"],
  .serif.tnum[style*="fontSize: 56"] { font-size: 40px !important; }

  /* Cards inside containers don't blow out */
  .surface, .surface-2, .vellum, .feat-tile {
    padding: 24px !important;
  }

  /* Tier ladder cards stack with tighter padding */
  /* Funding section big numbers */
  [style*="font-size: clamp(80px, 10vw, 132px)"] {
    font-size: clamp(56px, 14vw, 88px) !important;
  }

  /* Portal preview — give it horizontal scroll rather than crushing */
  .surface-2[style*="border-radius: 24px"] {
    overflow-x: auto !important;
    border-radius: 16px !important;
  }
  /* Portal aside (sidebar) — full width on top */
  /* (already handled by 240px 1fr → 1fr collapse above) */

  /* Demo ribbon */
  .demo-ribbon { bottom: 8px; left: 8px; padding: 6px 10px; }
  .demo-ribbon__line { display: none; }

  /* Marquee scales */
  .marquee-track { gap: 32px; padding-right: 32px; }

  /* Pull-quote */
  .pull-quote { font-size: clamp(22px, 6vw, 32px); padding: 40px 0; }
  .pull-quote::before, .pull-quote::after { margin: 16px auto; }

  /* Footer 4-col → 1-col */
  footer .container > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  footer .container > div:nth-child(2) {
    flex-direction: column;
    gap: 8px;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .container { padding-inline: 14px !important; }
  .section { padding: 44px 0 !important; }
  .h1-display { font-size: clamp(28px, 10vw, 42px); }
  .h2-display { font-size: clamp(24px, 9vw, 34px); }
  .surface, .surface-2, .vellum, .feat-tile { padding: 18px !important; }
  /* Funding section big numbers tighter still */
  [style*="font-size: clamp(80px, 10vw, 132px)"] {
    font-size: clamp(48px, 16vw, 72px) !important;
  }
  /* Chips wrap and tighten */
  .chip { font-size: 10px; padding: 5px 10px; }
  /* Demo ribbon — icon only */
  .demo-ribbon { font-size: 9px; }
}

/* === Anchor-scroll: leave room for sticky header === */
html { scroll-padding-top: 88px; }
section[id] { scroll-margin-top: 88px; }

/* === NAV DRAWER (mobile hamburger menu) === */
.nav-drawer-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(11,14,16,0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  display: flex; justify-content: flex-end;
  animation: drawer-fade 240ms cubic-bezier(0.22,1,0.36,1);
}
body:not(.eng-mode) .nav-drawer-overlay { background: rgba(27,38,32,0.45); }
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }

.nav-drawer {
  position: relative;
  width: 100%; max-width: 380px;
  background: var(--bg-2);
  display: flex; flex-direction: column;
  padding: 22px 24px 28px;
  animation: drawer-slide 360ms cubic-bezier(0.22,1,0.36,1);
  overflow-y: auto;
}
body:not(.eng-mode) .nav-drawer {
  background:
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(255,253,248,1), rgba(245,238,222,0.85) 70%),
    var(--bg-2);
}
@keyframes drawer-slide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.nav-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px;
}
.nav-drawer-close {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background 200ms, transform 200ms;
}
body:not(.eng-mode) .nav-drawer-close { background: rgba(27,38,32,0.04); }
.nav-drawer-close:hover { background: var(--accent); color: var(--bg); transform: scale(1.05); }

.mode-tabs-drawer {
  width: 100% !important;
  margin-top: 18px;
  display: flex !important;
  justify-content: stretch !important;
}
.mode-tabs-drawer button {
  flex: 1;
  height: 44px !important;
  font-size: 14px !important;
}

.nav-drawer-links {
  display: flex; flex-direction: column;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}
.nav-drawer-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 4px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 200ms, padding-left 220ms cubic-bezier(0.22,1,0.36,1);
}
.nav-drawer-links a:hover {
  color: var(--accent);
  padding-left: 12px;
}
.nav-drawer-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-4);
  transition: transform 220ms, color 220ms;
}
.nav-drawer-links a:hover .nav-drawer-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.nav-drawer-cta {
  margin-top: 28px;
  width: 100%;
  height: 52px !important;
  justify-content: center !important;
  font-size: 15px;
}

.nav-drawer-foot {
  margin-top: 20px;
  display: flex; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-4);
  text-transform: uppercase;
}

body.drawer-open { overflow: hidden; }

/* === FLOW MODAL — live prototype flows === */
.flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(11, 14, 16, 0.55);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  animation: flow-fade-in 220ms cubic-bezier(0.22,1,0.36,1);
}
body:not(.eng-mode) .flow-overlay { background: rgba(27, 38, 32, 0.45); }
@keyframes flow-fade-in { from { opacity: 0; } to { opacity: 1; } }

.flow-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 36px 36px 28px;
  box-shadow: 0 40px 100px -10px rgba(0,0,0,0.45), 0 80px 160px -30px rgba(0,0,0,0.25);
  animation: flow-slide-in 320ms cubic-bezier(0.22,1,0.36,1);
}
body:not(.eng-mode) .flow-card {
  background:
    radial-gradient(ellipse 70% 50% at 25% 10%, rgba(255,253,248,0.95), rgba(245,238,222,0.7) 70%),
    var(--bg-2);
  border-color: rgba(36,46,38,0.12);
  box-shadow: 0 30px 80px -10px rgba(27,38,32,0.25);
}
@keyframes flow-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.flow-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--fg-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 200ms, color 200ms, transform 200ms;
}
.flow-close:hover { background: var(--accent); color: var(--bg); transform: scale(1.05); }
body:not(.eng-mode) .flow-close { background: rgba(27,38,32,0.04); }

.flow-header { margin-bottom: 18px; padding-right: 32px; }
.flow-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.flow-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-top: 10px;
  color: var(--fg);
}
.flow-subtitle {
  font-size: 14px;
  color: var(--fg-3);
  margin-top: 8px;
  line-height: 1.55;
  max-width: 44ch;
}

.flow-progress {
  display: flex; gap: 6px;
  margin: 18px 0 24px;
}
.flow-progress-dot {
  flex: 1; height: 3px;
  background: var(--line);
  border-radius: 999px;
  transition: background 320ms ease;
}
.flow-progress-dot.on { background: var(--accent); }

.flow-body { min-height: 180px; }

.flow-step { display: flex; flex-direction: column; gap: 10px; }
.flow-label {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.flow-helper {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.55;
  max-width: 46ch;
  margin-bottom: 6px;
}

.flow-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  border-radius: 12px;
  outline: none;
  transition: border-color 200ms, background 200ms, box-shadow 200ms;
}
.flow-input::placeholder { color: var(--fg-4); }
.flow-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body:not(.eng-mode) .flow-input { background: rgba(255,253,248,0.65); }

.flow-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--sans);
  line-height: 1.55;
}

.flow-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 480px) {
  .flow-double { grid-template-columns: 1fr; }
}

.flow-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 6px;
}
.flow-pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg-2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}
.flow-pill:hover { border-color: var(--fg-3); color: var(--fg); }
.flow-pill.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 6px 20px -8px var(--accent-glow);
}

.flow-funding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width: 480px) { .flow-funding-grid { grid-template-columns: 1fr; } }
.flow-funding-card {
  text-align: left;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 220ms ease;
  font-family: var(--sans);
}
body:not(.eng-mode) .flow-funding-card { background: rgba(255,253,248,0.5); }
.flow-funding-card:hover { border-color: var(--fg-3); transform: translateY(-1px); }
.flow-funding-card.active {
  border-color: var(--accent);
  background: rgba(74,222,128,0.08);
  box-shadow: 0 12px 32px -10px rgba(74,222,128,0.25);
}
body:not(.eng-mode) .flow-funding-card.active {
  background: rgba(47,93,67,0.06);
  box-shadow: 0 12px 32px -10px rgba(47,93,67,0.25);
}
.flow-funding-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--fg-4);
}
.flow-funding-card.accent .flow-funding-tag { color: var(--accent); }
.flow-funding-num {
  font-family: var(--serif);
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.flow-funding-card.accent .flow-funding-num { color: var(--accent); }
.flow-funding-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
}
.flow-funding-desc {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.5;
  margin-top: 4px;
}

.flow-actions {
  display: flex; gap: 10px;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.flow-actions .btn { height: 44px; }

.flow-step-indicator {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-4);
  letter-spacing: 0.12em;
  text-align: center;
}

/* === CONFIRM screen === */
.flow-confirm {
  text-align: center;
  padding: 12px 0 0;
}
.flow-confirm-tick {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  color: var(--accent);
  animation: flow-tick-pop 480ms cubic-bezier(0.22,1,0.36,1);
}
@keyframes flow-tick-pop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}
.flow-confirm-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--fg);
}
.flow-confirm-ref {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-top: 14px;
  padding: 8px 14px;
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
}
.flow-confirm-body {
  font-size: 14.5px;
  color: var(--fg-2);
  line-height: 1.6;
  margin: 18px auto 0;
  max-width: 44ch;
}
.flow-confirm-meta {
  margin: 24px auto 0;
  text-align: left;
  display: grid; gap: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
body:not(.eng-mode) .flow-confirm-meta { background: rgba(27,38,32,0.03); }
.flow-confirm-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.flow-confirm-row:last-child { border-bottom: none; }
.flow-confirm-row > span:first-child { color: var(--fg-3); }
.flow-confirm-row > span:last-child { color: var(--fg); text-align: right; }

.flow-confirm-next {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 14px;
  text-align: left;
}
.flow-confirm-next-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
}
.flow-confirm-next ol {
  margin: 0; padding-left: 20px;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.6;
}
.flow-confirm-next ol li { margin-bottom: 6px; }

/* When a flow is open, freeze body scroll */
body.flow-open { overflow: hidden; }

/* Mobile flow card */
@media (max-width: 640px) {
  .flow-overlay { padding: 0; align-items: flex-end; }
  .flow-card {
    max-width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 20px 20px 0 0;
    padding: 28px 22px 24px;
  }
  .flow-confirm-row { grid-template-columns: 110px 1fr; padding: 10px 12px; }
}

/* === Toast feedback for inert demo CTAs === */
.toast-feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 400;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: 0 16px 48px -8px rgba(27,38,32,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.22,1,0.36,1), transform 320ms cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: normal;
}
.toast-feedback.in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
body.eng-mode .toast-feedback {
  background: var(--accent);
  color: var(--bg);
}
@media (max-width: 640px) {
  .toast-feedback { bottom: 80px; padding: 12px 18px; font-size: 12.5px; }
}

/* === Demo ribbon (Anvul ownership disclosure on demo build) === */
.demo-ribbon {
  position: fixed;
  bottom: 14px; left: 14px;
  z-index: 300;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-2);
  box-shadow: 0 8px 30px rgba(27, 38, 32, 0.12);
  user-select: none;
  transition: transform 200ms ease, opacity 200ms ease;
}
.demo-ribbon:hover { transform: translateY(-1px); }
.demo-ribbon strong { color: var(--accent); font-weight: 600; }
.demo-ribbon__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 12px rgba(201, 122, 58, 0.55);
  animation: led 2s ease-out infinite;
}
body.eng-mode .demo-ribbon {
  background: rgba(11, 14, 16, 0.85);
  color: var(--fg-2);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
body.eng-mode .demo-ribbon strong { color: var(--accent); }
@media (max-width: 640px) {
  .demo-ribbon__line { display: none; }
  .demo-ribbon { padding: 8px 10px; }
}
