/* ==========================================================================
   Tidesman — tidesman.dev
   Shared design system: a warm lantern glowing over a calm teal-to-navy tide.
   Static CSS, no build step. Works with JS disabled.
   ========================================================================== */

/* ---- Fonts ---------------------------------------------------------------
   Self-hosted pairing (recommended): "Geist" (UI/body) + "Geist Mono" (code).
   Declared via local() so the site works today with a system fallback and
   picks up the woff2 files the moment they are dropped into /fonts.
   To fully self-host, add the woff2 files and uncomment the url() lines. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: local("Geist"), url("/fonts/Geist-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: local("Geist Mono"), url("/fonts/GeistMono-Variable.woff2") format("woff2");
}

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Surfaces — deep nautical night */
  --navy-950: #061a2c;
  --navy-900: #08243b;
  --navy-850: #0b2c47;
  --navy-800: #103e63;   /* brand deep navy */
  --navy-700: #164e78;

  /* Teal mid-tones */
  --teal-600: #187e9e;
  --teal-500: #1baac0;

  /* Amber — the "lit" color */
  --amber-400: #ff9f3c;
  --amber-300: #ffbf6b;
  --amber-200: #ffdd92;
  --glow:      #ffd98a;

  /* Danger (destructive tools) — a warm coral that sits with the amber */
  --coral: #f0755a;

  /* Sponsor (GitHub Sponsors heart) */
  --sponsor: #db61a2;

  /* Text */
  --text:        #dcebf0;
  --text-strong: #ffffff;
  --text-muted:  #9db6c8;
  --text-faint:  #708aa0;

  /* Lines & fills */
  --line:        rgba(155, 200, 220, 0.14);
  --line-strong: rgba(155, 200, 220, 0.26);
  --surface:     rgba(255, 255, 255, 0.024);
  --surface-2:   rgba(255, 255, 255, 0.045);

  /* Type */
  --font-sans: "Geist", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", "SF Mono", ui-monospace, "JetBrains Mono", "Fira Code", Menlo, monospace;

  /* Rhythm */
  --container: 1120px;
  --container-narrow: 800px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 9px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--navy-950);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv01", "ss01";
  overflow-x: hidden;
}

/* Global ambient background: a lantern glow bleeding from the top over tide */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 191, 107, 0.16), rgba(255, 191, 107, 0) 42%),
    radial-gradient(100% 60% at 50% 0%, rgba(27, 170, 192, 0.14), rgba(27, 170, 192, 0) 55%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 60%, #04121f 100%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--teal-500); text-decoration: none; }
a:hover { color: var(--amber-200); }

/* Visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--amber-300);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(255, 159, 60, 0.32); color: #fff; }

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--amber-400); color: #06202f;
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  z-index: 100; transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---- Type scale --------------------------------------------------------- */
h1, h2, h3, h4 {
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.22rem; letter-spacing: -0.015em; }
p  { text-wrap: pretty; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-300);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: linear-gradient(90deg, var(--amber-400), transparent);
}

.lead { font-size: clamp(1.06rem, 1.7vw, 1.28rem); color: var(--text-muted); max-width: 60ch; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
/* Inline code in prose may hold long paths — let it wrap instead of overflowing */
:not(pre) > code { overflow-wrap: anywhere; }

/* ---- Layout ------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(64px, 9vw, 116px); }
.section-narrow { max-width: var(--container-narrow); }
.divider { height: 1px; background: var(--line); border: 0; }

.section-head { max-width: 62ch; margin-bottom: 48px; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head p { margin-top: 14px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-weight: 550; font-size: 1rem;
  padding: 13px 22px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.24s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap; line-height: 1;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(180deg, var(--amber-200), var(--amber-400));
  color: #4a2205;
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 8px 26px -8px rgba(255, 159, 60, 0.6);
}
.btn-primary:hover { color: #4a2205; transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 14px 34px -8px rgba(255, 159, 60, 0.72); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-strong);
  border-color: var(--line-strong);
  backdrop-filter: blur(6px);
}
.btn-secondary:hover { color: var(--text-strong); border-color: var(--teal-500); background: rgba(27, 170, 192, 0.1); transform: translateY(-2px); }
.btn-ghost { padding-inline: 4px; color: var(--text); }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }

/* ---- Site header / nav -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s;
}
.site-header.scrolled {
  background: rgba(8, 30, 49, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
}
.nav {
  display: flex; align-items: center; gap: 20px;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text-strong); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--text-strong); }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 3px 8px rgba(255, 159, 60, 0.35)); }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; padding: 0; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; padding: 8px 12px; border-radius: 8px; transition: color 0.18s, background 0.18s; }
.nav-links a:hover { color: var(--text-strong); background: var(--surface-2); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-menu { display: flex; align-items: center; gap: 20px; }
.nav-toggle { display: none; }

/* ---- Hero --------------------------------------------------------------- */
.hero { position: relative; text-align: center; padding-block: clamp(56px, 9vw, 104px) clamp(40px, 6vw, 72px); }
.hero-lantern { position: relative; width: 128px; height: 128px; margin: 0 auto 30px; }
.hero-lantern img { width: 100%; height: 100%; border-radius: 28px; box-shadow: 0 20px 60px -18px rgba(255, 159, 60, 0.5), 0 8px 30px -10px rgba(0,0,0,0.6); }
.hero-lantern::after {
  content: ""; position: absolute; inset: -40% -40% -55%;
  background: radial-gradient(closest-side, rgba(255, 217, 138, 0.28), transparent 72%);
  z-index: -1; pointer-events: none;
}
.hero h1 { margin-bottom: 22px; }
.hero .tagline { font-size: clamp(1.12rem, 2.1vw, 1.42rem); color: var(--text); max-width: 40ch; margin: 0 auto 14px; font-weight: 450; }
.hero .subtag { color: var(--text-muted); max-width: 54ch; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-meta { margin-top: 30px; display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; color: var(--text-faint); font-size: 0.86rem; font-family: var(--font-mono); }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal-500); }

/* Wave divider under hero */
.wave { display: block; width: 100%; height: 70px; color: var(--teal-600); opacity: 0.5; }

/* ---- Cards / surfaces --------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
  transition: border-color 0.22s, background 0.22s, transform 0.22s var(--ease);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.96rem; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Access mode cards */
.mode { display: flex; flex-direction: column; gap: 14px; }
.mode-tag { font-family: var(--font-mono); font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; align-self: flex-start; border: 1px solid var(--line-strong); color: var(--text); white-space: nowrap; }
.mode.is-default { border-color: rgba(27, 170, 192, 0.4); background: linear-gradient(180deg, rgba(27,170,192,0.08), transparent); }
.mode.is-default .mode-tag { border-color: var(--teal-500); color: var(--teal-500); }
.mode .default-flag { position: absolute; top: 18px; right: 18px; font-size: 0.72rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal-500); }
.mode ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.mode li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.93rem; color: var(--text); }
.mode li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line-strong); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231baac0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.5 2.5 5-5.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }

/* ---- How it works diagram ---------------------------------------------- */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 12px; margin-top: 8px; }
.flow-node { text-align: center; padding: 24px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 10px; justify-content: center; }
.flow-node.is-hub { border-color: rgba(255, 159, 60, 0.5); background: linear-gradient(180deg, rgba(255,159,60,0.1), transparent); box-shadow: 0 0 42px -12px rgba(255, 159, 60, 0.5); }
.flow-node .n-title { font-weight: 600; color: var(--text-strong); }
.flow-node .n-sub { font-size: 0.82rem; color: var(--text-muted); font-family: var(--font-mono); }
.flow-node img { width: 40px; height: 40px; border-radius: 10px; }
.flow-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--teal-500); min-width: 74px; }
.flow-arrow .a-label { font-size: 0.68rem; font-family: var(--font-mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; text-align: center; line-height: 1.3; }
.flow-arrow svg { width: 100%; height: 14px; }
.flow-callout { margin-top: 20px; padding: 16px 20px; border-left: 2px solid var(--amber-400); background: rgba(255, 159, 60, 0.06); border-radius: 0 10px 10px 0; color: var(--text); font-size: 0.96rem; }
.flow-callout strong { color: var(--amber-200); font-weight: 600; }

/* ---- Tools -------------------------------------------------------------- */
.tool-group { margin-top: 30px; }
.tool-group + .tool-group { margin-top: 26px; }
.tool-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tool-group-head h3 { font-family: var(--font-mono); font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.tool-badge { font-family: var(--font-mono); font-size: 0.7rem; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.badge-read { color: var(--teal-500); border: 1px solid rgba(27,170,192,0.4); background: rgba(27,170,192,0.08); }
.badge-write { color: var(--amber-300); border: 1px solid rgba(255,159,60,0.4); background: rgba(255,159,60,0.08); }
.badge-danger { color: var(--coral); border: 1px solid rgba(240,117,90,0.45); background: rgba(240,117,90,0.09); }
.tool-line { flex: 1; height: 1px; background: var(--line); }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tool { padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: border-color 0.2s, transform 0.2s var(--ease); }
.tool:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tool code { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-strong); display: block; margin-bottom: 5px; }
.tool span { font-size: 0.85rem; color: var(--text-muted); }
.tool.accent-read code { color: var(--teal-500); }
.tool.accent-write code { color: var(--amber-300); }
.tool.accent-danger code { color: var(--coral); }

/* ---- Code blocks -------------------------------------------------------- */
.code {
  position: relative;
  background: #05141f;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
}
.code-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.015); }
.code-head .label { font-size: 0.78rem; color: var(--text-faint); font-family: var(--font-mono); }
.code-dots { display: flex; gap: 6px; margin-right: 4px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; opacity: 0.5; }
.code-dots i:nth-child(1){ background: #f0755a; } .code-dots i:nth-child(2){ background: var(--amber-300); } .code-dots i:nth-child(3){ background: var(--teal-500); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 0.9rem; line-height: 1.7; color: var(--text); }
.code pre code { font-family: var(--font-mono); }
.code .cm { color: var(--text-faint); }        /* comment */
.code .pr { color: var(--amber-300); user-select: none; } /* prompt $ */
.code .tk { color: var(--teal-500); }           /* keyword/key */
.code .st { color: #b7d98f; }                   /* string */
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-family: var(--font-sans); font-size: 0.78rem;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--line-strong);
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.copy-btn:hover { color: var(--text-strong); border-color: var(--teal-500); }
.copy-btn.copied { color: var(--teal-500); border-color: var(--teal-500); }
.code .code-head + pre { padding-top: 16px; }
.code:has(.copy-btn) .code-head { padding-right: 84px; }

/* ---- Requirements / trust lists ---------------------------------------- */
.feature-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list .ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--teal-500); }
.feature-list .ico svg { width: 19px; height: 19px; }
.feature-list h3 { font-size: 1rem; margin-bottom: 2px; }
.feature-list p { color: var(--text-muted); font-size: 0.92rem; }

/* ---- Reference table (getting started) --------------------------------- */
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.ref-table th, .ref-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 600; font-family: var(--font-mono); }
.ref-table td code { font-family: var(--font-mono); color: var(--text-strong); font-size: 0.9rem; }
.ref-table tr:last-child td { border-bottom: 0; }
.ref-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); overflow-x: auto; }
.pill { font-family: var(--font-mono); font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.read { color: var(--teal-500); border: 1px solid rgba(27,170,192,0.4); }
.pill.write { color: var(--amber-300); border: 1px solid rgba(255,159,60,0.4); }
.pill.danger { color: var(--coral); border: 1px solid rgba(240,117,90,0.45); }

/* ---- Steps (install) ---------------------------------------------------- */
.step { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.step + .step { margin-top: 30px; }
.step-num { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; color: var(--amber-200); background: rgba(255,159,60,0.08); border: 1px solid rgba(255,159,60,0.3); }
.step-body { min-width: 0; }
.step-body h3 { margin-bottom: 4px; }
.step-body > p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 14px; }

/* Anchor offset for sticky header */
[id] { scroll-margin-top: 88px; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 56px 40px; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 300px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 0.92rem; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-family: var(--font-mono); font-weight: 600; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: 0.94rem; }
.footer-col a:hover { color: var(--text-strong); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-faint); font-size: 0.86rem; }
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--text-strong); }

/* Sponsor button (footer) */
.sponsor-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; font-size: 0.9rem; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-strong); margin-top: 16px; transition: border-color 0.18s, color 0.18s, transform 0.16s var(--ease); }
.sponsor-btn:hover { color: var(--text-strong); border-color: var(--sponsor); transform: translateY(-1px); }
.sponsor-btn .heart { width: 15px; height: 15px; color: var(--sponsor); flex: none; }

/* ---- CTA band ----------------------------------------------------------- */
.cta-band { text-align: center; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(40px, 6vw, 72px) 28px; background: radial-gradient(120% 140% at 50% 0%, rgba(255,159,60,0.12), transparent 60%), var(--surface); position: relative; overflow: hidden; }
.cta-band h2 { margin-bottom: 14px; }
.cta-band p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 28px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Legal / prose (EULA) ---------------------------------------------- */
.prose { max-width: var(--container-narrow); }
.prose h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: 10px; }
.prose .updated { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.85rem; margin-bottom: 34px; }
.prose .intro { color: var(--text); font-size: 1.02rem; margin-bottom: 10px; }
.prose h2 { font-size: 1.1rem; margin: 32px 0 8px; color: var(--text-strong); }
.prose p { color: var(--text-muted); margin-bottom: 14px; font-size: 0.97rem; }
.prose a { color: var(--teal-500); }
.prose a:hover { color: var(--amber-200); }

/* ---- Utilities ---------------------------------------------------------- */
.stack-sm > * + * { margin-top: 10px; }
.text-center { text-align: center; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-10 { margin-top: 40px; }

/* ==========================================================================
   Progressive enhancement: with JS, collapse nav into a toggle on mobile.
   Without JS (no .js on <html>) the links stay visible and usable.
   ========================================================================== */
@media (max-width: 860px) {
  .nav-links { gap: 2px; }
  .nav-cta .btn span.hide-sm { display: none; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { min-height: 48px; }
  .flow-arrow svg { transform: rotate(90deg); width: 14px; height: 30px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav { position: relative; flex-wrap: wrap; }
  .nav-toggle {
    display: inline-grid; place-items: center;
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--line-strong);
    color: var(--text-strong); cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .nav-toggle .ic-close { display: none; }

  /* No-JS fallback: the menu wraps to a full-width second row, always visible */
  .nav-menu {
    order: 4; flex-basis: 100%;
    flex-direction: row; flex-wrap: wrap; justify-content: center;
    gap: 6px; padding-top: 6px;
  }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .nav-links a { padding: 8px 10px; }

  /* JS present: collapse the menu into a dropdown panel toggled by the button */
  html.js .nav-menu {
    position: absolute; left: 0; right: 0; top: calc(100% + 1px);
    order: 0; flex-basis: auto;
    display: none; flex-direction: column; align-items: stretch;
    gap: 4px; padding: 14px 8px 18px;
    background: rgba(8, 30, 49, 0.97);
    backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--line); border-radius: 0 0 14px 14px;
    box-shadow: 0 24px 40px -20px rgba(0,0,0,0.7);
  }
  html.js .nav[data-open="true"] .nav-menu { display: flex; }
  html.js .nav[data-open="true"] .nav-toggle .ic-open { display: none; }
  html.js .nav[data-open="true"] .nav-toggle .ic-close { display: block; }
  html.js .nav-menu .nav-links { flex-direction: column; align-items: stretch; }
  html.js .nav-menu .nav-links a { padding: 11px 12px; }

  .footer-grid { flex-direction: column; gap: 32px; }
  .step { grid-template-columns: 1fr; gap: 12px; }
  .tool-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
