/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  padding-bottom: var(--tabbar-h);
}
body.modal-open { overflow: hidden; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
[hidden] { display: none !important; }
main { display: block; outline: none; }
main:focus-visible { outline: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); line-height: 1.15; }
p { text-wrap: pretty; }

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

::selection { background: var(--coral-500); color: var(--coral-ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 300;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--text); color: var(--ink-900); font-weight: 600;
}
.skip-link:focus { top: 12px; }
.muted { color: var(--text-muted); }

.icon { width: 20px; height: 20px; flex: none; }
.icon--flip { transform: scaleX(-1); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea-300);
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.eyebrow--pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgb(6 20 24 / 0.5);
  backdrop-filter: blur(8px);
  color: var(--sea-200);
  letter-spacing: 0.08em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sea-400); box-shadow: 0 0 0 4px rgb(111 220 191 / 0.18); }

/* ---------- Buttons ---------- */
.button {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, box-shadow var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.button .icon { width: 18px; height: 18px; }
.button:active { transform: translateY(1px) scale(0.985); }
.button--primary {
  --btn-bg: var(--coral-500);
  --btn-fg: var(--coral-ink);
  background: linear-gradient(180deg, var(--coral-400), var(--coral-500) 55%, var(--coral-600));
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 -2px 0 rgb(0 0 0 / 0.12) inset, var(--shadow-glow);
}
.button--primary:hover { box-shadow: 0 1px 0 rgb(255 255 255 / 0.4) inset, 0 -2px 0 rgb(0 0 0 / 0.12) inset, 0 16px 40px -8px var(--glow); filter: saturate(1.08) brightness(1.04); }
.button--ghost {
  --btn-bg: rgb(196 246 230 / 0.05);
  border-color: var(--line-strong);
  backdrop-filter: blur(10px);
}
.button--ghost:hover { --btn-bg: rgb(196 246 230 / 0.1); border-color: rgb(196 246 230 / 0.35); }
.button--text { --btn-bg: transparent; padding: 0 12px; color: var(--sea-200); }
.button--text:hover { color: var(--text); background: rgb(196 246 230 / 0.06); }
.button--sm { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); }
.button--lg { min-height: 56px; padding: 0 28px; font-size: var(--fs-lg); }
.button--block { width: 100%; }
input[type="submit"].button { cursor: pointer; }

.icon-button {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(196 246 230 / 0.04);
  color: var(--text-soft);
  text-decoration: none;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-med) var(--ease-out);
}
.icon-button:hover { background: rgb(196 246 230 / 0.1); color: var(--text); border-color: var(--line-strong); }
.icon-button:disabled { opacity: 0.35; cursor: default; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--sea-200); font-weight: 600; font-size: var(--fs-sm);
  text-decoration: none; white-space: nowrap;
}
.link-arrow .icon { width: 16px; height: 16px; transition: transform var(--t-med) var(--ease-out); }
.link-arrow:hover { color: var(--text); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ---------- Chips, segmented, toggle ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li:empty { display: none; }
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em;
  color: var(--sea-200);
  background: rgb(196 246 230 / 0.04);
}

.chip-group { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.chip-group::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-soft);
  transition: all var(--t-fast) ease;
}
.chip:hover span { color: var(--text); border-color: rgb(196 246 230 / 0.35); }
.chip input:checked + span { background: var(--text); color: var(--ink-900); border-color: var(--text); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }

.segmented {
  display: inline-flex; gap: 2px; padding: 4px; margin: 0; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: rgb(4 13 16 / 0.6);
}
.segmented > button, .segmented label span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: transparent;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  transition: background-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.segmented label { position: relative; }
.segmented label input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented > button[aria-selected="true"], .segmented label input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.segmented label input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: var(--text-soft); cursor: pointer; position: relative; min-height: 44px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__track { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background var(--t-fast); }
.toggle__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform var(--t-med) var(--ease-spring), background var(--t-fast); }
.toggle input:checked + .toggle__track { background: var(--coral-500); border-color: var(--coral-400); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); background: var(--coral-ink); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- Forms ---------- */
.stack-form { display: grid; gap: 10px; }
.stack-form label, .select-field span { font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--ink-950);
  color: var(--text);
  font-size: 16px; /* prevents iOS zoom */
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, select:hover, textarea:hover { border-color: rgb(196 246 230 / 0.32); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea-400); box-shadow: 0 0 0 4px rgb(111 220 191 / 0.16); }
select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239cecd5' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
textarea { min-height: 140px; resize: vertical; }
input[type="date"] { color-scheme: dark; }
.check-label { display: flex; gap: 12px; align-items: flex-start; font-weight: 400 !important; color: var(--text-soft); line-height: 1.5; }
.check-label input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--coral-500); }
.check-label a { color: var(--sea-200); }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-columns > div { display: grid; gap: 10px; }
.form-errors { padding: 12px 14px; border-radius: var(--r-md); background: rgb(255 106 77 / 0.1); border: 1px solid rgb(255 106 77 / 0.4); color: var(--coral-300); font-size: var(--fs-sm); }
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.honeypot { position: absolute; left: -9999px; }
small { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- Panels & layout primitives ---------- */
.panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgb(196 246 230 / 0.035), transparent 60%), var(--surface);
  box-shadow: var(--shadow-2);
}
.section {
  width: min(100% - 2 * var(--gutter), var(--content));
  margin: 0 auto;
  padding-block: clamp(36px, 4.5vw, 64px);
}
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(20px, 3vw, 32px); }
.section__head h2 { margin-top: 8px; }
.section__head--tight { margin-bottom: 8px; align-items: center; }
.section__sub { margin-top: 10px; color: var(--text-muted); max-width: 52ch; }

/* ---------- Entrance animation (enabled by JS; no-JS shows everything) ---------- */
.fx-ready [data-reveal] { opacity: 0; transform: translateY(18px); }
.fx-ready [data-reveal].is-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .fx-ready [data-reveal] { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .form-columns { grid-template-columns: 1fr; }
  .section__head { flex-wrap: wrap; align-items: flex-start; }
}
