@font-face {
  font-family: "Outfit";
  src: url("/fonts/Outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #0b1f3a;
  --navy-2: #153056;
  --ink: #0e1c2f;
  --muted: #5c6b7e;
  --teal: #0f766e;
  --teal-2: #115e59;
  --gold: #0f766e;
  --paper: #f4f7fb;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-strong: #d5dde8;
  --ok: #0f766e;
  --ok-bg: #e7f5f2;
  --calm: #115e59;
  --calm-bg: #e7f5f2;
  --warn: #8a5a00;
  --warn-bg: #fff6e4;
  --risk: #b42318;
  --risk-bg: #fdecec;
  --unknown: #526070;
  --unknown-bg: #f1f4f8;
  --shadow: 0 1px 2px rgb(14 28 47 / 0.05), 0 16px 40px rgb(14 28 47 / 0.06);
  --serif: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  --sans: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 16px;
  --header: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background: #f4f7fb;
  font-size: 16px;
  line-height: 1.5;
}
body.portal-open { background: #f4f7fb; }
a { color: var(--teal); text-underline-offset: 3px; }
button, [role="button"], .button, summary { cursor: pointer; }
img, svg { max-width: 100%; }
code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: #f1f4f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.1em 0.4em;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--navy);
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header);
  margin: 0 -8px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}
.topbar.is-stuck { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    radial-gradient(12px 12px at 78% 78%, var(--teal-2), transparent 70%),
    linear-gradient(145deg, #163552, var(--navy));
  display: grid;
  place-items: center;
  color: #f6f1e6;
  font-family: var(--sans);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.brand strong { font-family: var(--sans); font-size: 16px; letter-spacing: 0.04em; font-weight: 700; }
.brand em { display: block; font-style: normal; letter-spacing: 0.02em; font-size: 11px; color: var(--muted); font-family: var(--sans); font-weight: 500; }

.nav-desktop { display: flex; gap: 6px; align-items: center; }
.nav-desktop a, .menu-panel a, .menu-panel button {
  color: var(--navy);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 560;
}
.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
}
.nav-link:hover, .nav-link.is-active { background: rgba(11, 31, 51, 0.06); color: var(--navy); }
.nav-link.is-active { color: var(--teal); }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.button.primary { background: var(--navy); color: #f5f8fc; box-shadow: none; }
.button.primary:hover { transform: none; background: var(--navy-2); }
.button.secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.button.secondary:hover { background: var(--navy); color: white; }
.button.ghost { background: white; color: var(--navy); border-color: var(--line-strong); }
.button.ghost:hover { border-color: var(--navy); }
.button.danger { background: white; color: var(--risk); border-color: #f0c2ce; }
.button.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .modes label:focus-within {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.menu { position: relative; }
.menu > button {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: white;
  font: inherit;
  font-weight: 650;
  padding: 0 14px;
  color: var(--navy);
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
}
.menu-panel a, .menu-panel button, .menu-panel form button {
  display: flex;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 10px;
  font: inherit;
  color: var(--navy);
}
.menu-panel a:hover, .menu-panel button:hover { background: #eef2f6; }
[x-cloak] { display: none !important; }

.banner, .demo-note, .flash, .notice {
  border-radius: 16px;
  padding: 12px 14px;
  margin: 12px 0;
}
.banner, .demo-note { background: #fff7e8; border: 1px solid #efd7a4; color: #6a4a10; }
.flash { background: var(--ok-bg); border: 1px solid #b7e4cf; color: var(--ok); }
.notice { background: #ffffff; border: 1px solid var(--line); color: var(--muted); }
.banner form, .flash form { display: inline; }

main { padding-bottom: 24px; }
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 36px; padding: 28px 0 8px; align-items: center; }
.kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 750;
  margin: 0 0 8px;
}
h1, h2, h3 { font-family: var(--sans); line-height: 1.2; font-weight: 650; color: var(--navy); letter-spacing: -0.02em; }
h1 { font-size: clamp(32px, 4vw, 44px); margin: 0 0 12px; }
.hero h1 { font-size: clamp(36px, 5vw, 52px); letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3vw, 34px); margin: 28px 0 12px; }
h3 { font-size: 22px; margin: 0 0 6px; }
.lede { font-size: 18.5px; color: var(--muted); max-width: 46ch; margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; color: var(--muted); }
.error { color: var(--risk); font-size: 14px; }

.hero-card, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card { padding: 18px; }
.card { padding: 18px 18px 16px; }
.card.flat { box-shadow: none; }
.card.link { display: block; text-decoration: none; color: inherit; transition: transform 160ms ease, border-color 160ms ease; }
.card.link:hover { transform: translateY(-2px); border-color: rgba(12, 116, 108, 0.35); }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.grid-3, .grid-2, .grid-4 { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.stack { display: grid; gap: 12px; }
.section { padding: 8px 0 22px; }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.trust span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,252,248,0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--navy);
}
.trust svg { width: 16px; height: 16px; color: var(--teal); }

.status, .seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 13px;
  line-height: 1;
  border: 1px solid transparent;
}
.status::before, .pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 16%, transparent);
}
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.calm { background: var(--calm-bg); color: var(--calm); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.risk { background: var(--risk-bg); color: var(--risk); }
.status.unknown, .status.wait { background: var(--unknown-bg); color: var(--unknown); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--unknown-bg);
  color: var(--unknown);
  border: 1px dashed #c5ccd6;
}
.pill.tested { background: var(--ok-bg); color: var(--ok); border-style: solid; border-color: transparent; }
.pill::before { box-shadow: none; }

.result-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,252,248,0.4), rgba(255,252,248,0.9)),
    var(--wash, #f7f4ee);
  margin-top: 8px;
}
.result-hero.tone-ok { --wash: #eef8f3; }
.result-hero.tone-calm { --wash: #eef7f6; }
.result-hero.tone-warn { --wash: #fff8ea; }
.result-hero.tone-risk { --wash: #fff1f4; }
.result-hero.tone-unknown, .result-hero.tone-wait { --wash: #f4f6f8; }
.result-hero h1 { margin-bottom: 6px; }
.explain { font-size: 18px; max-width: 62ch; }

.score-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring, var(--teal)) calc(var(--p, 0) * 1%), #e3e8f0 0);
  box-shadow: inset 0 0 0 1px rgba(11,31,51,0.05);
}
.score-ring span {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 28px;
  color: var(--navy);
}
.score-wrap { display: grid; justify-items: center; gap: 8px; align-content: center; }
.score-caption { margin: 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
.metric { font-family: var(--serif); font-size: 34px; margin: 4px 0 0; color: var(--navy); }
.metric-label { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,252,248,0.9);
  border: 1px solid var(--line);
}
.check p { margin: 6px 0 0; }
.class-pip {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--navy);
  color: white;
}
.class-pip.A { background: #0b1f33; }
.class-pip.B { background: #1d4e89; }
.class-pip.C { background: #8a5a00; }
.class-pip.D { background: #5c6b7c; }

label { display: block; font-size: 13.5px; font-weight: 680; margin-bottom: 6px; color: var(--navy); }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #c4baa8; }
.field { margin-bottom: 14px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 560; }
.checkline input { width: 18px; min-height: 18px; margin-top: 3px; accent-color: var(--teal); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; accent-color: var(--teal); }
.searchbar { display: flex; gap: 10px; align-items: center; }
.searchbar input { flex: 1; }

.modes { display: flex; flex-wrap: wrap; gap: 8px; }
.modes label {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 14px;
  background: white;
  font-weight: 650;
  min-height: 44px;
}
.modes input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  min-height: 0;
}
.modes label:has(input:checked) { background: var(--navy); color: white; border-color: var(--navy); }

.portal { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px; padding: 8px 0 40px; align-items: start; }
.side {
  position: sticky;
  top: 84px;
  padding: 12px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.side a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--navy);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
}
.side a:hover { background: rgba(255,255,255,0.7); }
.side a.active, .side a[aria-current="page"] { background: var(--navy); color: white; }
.side .kicker { padding: 4px 10px 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 750; }
tbody tr:hover { background: rgba(12, 116, 108, 0.04); }
.table-card { padding: 6px 8px 8px; }

.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(88px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 10px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #49b2a8); }
.bar.risk > span { background: linear-gradient(90deg, #c24563, var(--risk)); }
.bar.warn > span { background: linear-gradient(90deg, #e0a23a, #c4841a); }
.bar.ok > span { background: linear-gradient(90deg, #1d9a68, var(--ok)); }
.bar.unknown > span { background: #8b97a8; }

.split { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-no {
  font-family: var(--sans);
  color: var(--gold);
  font-size: 22px;
}
.auth-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 28px; align-items: center; padding-top: 18px; }
.auth-card { padding: 22px; max-width: 480px; }
.demo-list { display: grid; gap: 8px; }
.demo-list button { width: 100%; justify-content: space-between; }

.pager { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.pager-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--navy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.pager-btn.is-disabled { opacity: 0.45; }
.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--navy); font-family: var(--serif); font-size: 22px; margin-bottom: 6px; }

.tabbar {
  position: sticky;
  bottom: 0;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  background: #ffffff;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 25;
}
.tabbar a {
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 4px 10px;
  display: grid;
  justify-items: center;
  gap: 3px;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar a.is-active { color: var(--teal); }
footer.site { padding: 32px 0 96px; color: var(--muted); font-size: 13.5px; }
footer.site a { color: var(--navy); }

.icon { width: 18px; height: 18px; flex: none; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero, .grid-3, .grid-2, .grid-4, .portal, .auth-grid, .steps, .result-hero { grid-template-columns: 1fr; }
  .nav-desktop { display: none; }
  .tabbar { display: grid; }
  .side {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 8px;
  }
  .side .kicker { display: none; }
  .side a { white-space: nowrap; }
  .hero h1 { font-size: 34px; }
  .score-ring { justify-self: start; }
  footer.site { padding-bottom: 108px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
