/* ===================================================================
   LUCIDSEAL APP CSS — unified stylesheet aligned to Trust Surface
   Single-file merge replacing app.css + style-polish.css
   =================================================================== */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-2: #ffffff;
  --fg: #0f172a;
  --ink: #172738;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --line: #e2e8f0;
  --ring: #e3e9f2;

  --accent: #0b4f8a;
  --accent-2: #0ea5e9;
  --accent-deep: #083b68;
  --accent-soft: rgba(11, 79, 138, 0.1);
  --accent-soft-2: rgba(14, 165, 233, 0.08);
  --accent-border: rgba(11, 79, 138, 0.22);
  --accent-a12: rgba(11, 79, 138, 0.12);
  --accent-a18: rgba(11, 79, 138, 0.18);
  --accent-a20: rgba(11, 79, 138, 0.2);
  --accent-a25: rgba(11, 79, 138, 0.25);
  --accent-a35: rgba(11, 79, 138, 0.35);
  --overlay: rgba(15, 23, 42, 0.42);

  --success: #17a55d;
  --success-bg: rgba(23, 165, 93, 0.1);
  --success-border: rgba(23, 165, 93, 0.26);

  --danger-1: #f97316;
  --danger-2: #ef4444;
  --warn-1: #f59e0b;
  --warn-2: #fbbf24;
  --strong-1: #0f4c81;
  --strong-2: #172738;
  --lead-1: #10b981;
  --lead-2: #059669;

  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 0 rgba(15, 23, 42, 0.03);
  --shadow: 0 10px 28px rgba(17, 23, 40, 0.06);
  --shadow-lg: 0 18px 42px rgba(15, 23, 42, 0.09);

  --wrap: 1120px;
  --fs-body: 17px;
  --fs-h1: clamp(30px, 4vw, 46px);
  --fs-h2: clamp(21px, 2.5vw, 28px);
  --fs-h3: clamp(17px, 2vw, 20px);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 18% -12%, rgba(11,79,138,0.12) 0%, rgba(11,79,138,0) 62%),
    radial-gradient(900px 500px at 110% 14%, rgba(14,165,233,0.1) 0%, rgba(14,165,233,0) 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 2px;
}
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 120;
  background: #fff;
  color: var(--fg);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-lg);
}

:where(a, button, .btn, .chip, input, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
}
.appbar .wrap,
main.wrap,
footer .wrap,
noscript .wrap {
  width: min(var(--wrap), calc(100vw - 32px));
  margin: 0 auto;
}
main.wrap {
  padding-block: 28px 42px;
}
.section {
  padding-block: clamp(1rem, 2vw, 1.5rem);
}
.section + .section {
  margin-top: var(--space-4);
}
[data-route] { display: none; }
[data-route].active { display: block; }

h1, h2, h3 {
  margin: 0 0 0.85rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
h1, .section-title { font-size: var(--fs-h1); line-height: 1.08; }
h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3, .section-subhead { font-size: var(--fs-h3); line-height: 1.3; }
p, li { color: var(--muted); }
p { margin: 0 0 1rem; }
.lead {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.6;
  color: var(--fg);
}
.section-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--fg);
  margin-bottom: 0.5rem;
}
.small { font-size: 0.95rem; }
.muted { color: var(--muted); }
.meta {
  color: var(--subtle);
  font-size: 0.95rem;
  line-height: 1.7;
}
.center { text-align: center; }
.hstack {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stack > * + * { margin-top: 1rem; }
.divider {
  width: 100%;
  height: 1px;
  margin-top: 1rem;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px) saturate(1.3);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.logo {
  height: 36px;
  width: auto;
}
.nav {
  display: none;
  align-items: center;
  gap: 0.45rem;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
}
.nav a:hover,
.nav a:focus-visible {
  text-decoration: none;
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft), rgba(255,255,255,0));
}
.nav--soft-alt .nav a:hover,
.nav--soft-alt .nav a:focus-visible {
  border-color: var(--accent-border);
}
.burger,
.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.drawer[hidden] { display: none; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  display: grid;
  place-items: start end;
}
.drawer-sheet {
  width: min(88vw, 360px);
  min-height: 100dvh;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255,255,255,0.96);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.drawer-sheet a {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}
.drawer-sheet a:hover { text-decoration: none; border-color: var(--accent-border); }
.drawer-close { align-self: flex-end; }

.grid {
  display: grid;
  gap: 1rem;
}
.grid.cols-2,
.grid.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel,
.result,
.question,
.callout,
.tile,
.founder-note.letter-block,
.controls {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card,
.panel,
.callout,
.tile,
.founder-note.letter-block,
.controls {
  padding: 1.25rem;
}
.card > * { min-width: 0; }
.card.hero,
.panel.hero {
  padding: clamp(1.5rem, 3vw, 2.4rem);
  background:
    linear-gradient(135deg, rgba(11,79,138,0.08), rgba(255,255,255,0.78) 58%),
    linear-gradient(180deg, rgba(14,165,233,0.05), transparent 60%),
    #fff;
  border-color: var(--accent-border);
}
.card--cta {
  border-left: 4px solid var(--accent);
}
.pre-quiz {
  margin-top: 1rem;
}
.founder-note.letter-block {
  position: relative;
}
.founder-note.letter-block::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(14,165,233,0.22));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.btn,
.btn-ghost,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.18s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-color: var(--accent);
  box-shadow: 0 10px 24px var(--accent-a18);
}
.btn-link {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.03); }
.btn.ghost,
.btn-ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: none;
}
.btn.ghost:hover,
.btn-ghost:hover {
  text-decoration: none;
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft), rgba(255,255,255,0));
}
.cta,
.actions,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
}
.pill.ok {
  background: var(--success-bg);
  color: #0e6b3d;
  border-color: var(--success-border);
}
.badge.band {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, var(--strong-1), var(--strong-2));
}
.badge.is-baseline { background: linear-gradient(180deg, var(--danger-1), var(--danger-2)); }
.badge.is-progressing { background: linear-gradient(180deg, var(--warn-1), var(--warn-2)); }
.badge.is-strong { background: linear-gradient(180deg, var(--strong-1), var(--strong-2)); }
.badge.is-leading { background: linear-gradient(180deg, var(--lead-1), var(--lead-2)); }

.field { display: grid; gap: 0.35rem; }
.label { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.field input[type="search"],
.field select,
.answers label {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--fg);
}
.field input[type="search"],
.field select {
  min-height: 46px;
  padding: 0.75rem 0.9rem;
  appearance: none;
}
.field input[type="search"]:focus,
.field select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px rgba(11,79,138,0.1);
}
.controls .hstack.wrap {
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.chip:hover { border-color: var(--accent-border); }
.chip.is-active {
  border-color: var(--accent-border);
  background: linear-gradient(90deg, var(--accent-soft), rgba(255,255,255,0));
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.resource-list > li::marker { content: none; }
.resource {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.resource .resource-title {
  margin-bottom: 0;
}
.resource .pill {
  margin-left: auto;
}
.resource .actions {
  margin-top: auto;
  padding-top: 0.5rem;
}

.steps {
  margin: 0;
  padding-left: 1.1rem;
}
.steps li + li { margin-top: 0.6rem; }
.answers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.answers label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
}
.answers input { accent-color: var(--accent); }
.question {
  margin: 0 0 1rem;
  padding: 1.15rem 1.2rem;
}
.result {
  margin-top: 1rem;
  padding: 1.4rem;
}
#quiz-form { margin-top: 1rem; }
#quiz-radar {
  width: 100%;
  min-height: 280px;
  height: 280px;
}

.overall-head {
  margin-bottom: 1rem;
}
.overall-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.overall-title meter {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}
.tiles {
  gap: 0.85rem;
}
.tile {
  padding: 1rem;
  min-width: 0;
}
.tile-title { margin-bottom: 0.25rem; }
.tile-meta { margin-bottom: 0.75rem; }
.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ring);
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}
.list-plain {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.list-plain li {
  position: relative;
  padding-left: 1.1rem;
  margin: 0.4rem 0;
}
.list-plain li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.badge-link img {
  display: block;
  margin-top: 0.5rem;
}
.footnote,
.overall-date { margin-top: 0.75rem; }
.callout {
  background: #f6faff;
  border-color: #d9ecff;
}
.callout--info {
  background: linear-gradient(180deg, rgba(11,79,138,0.06), rgba(255,255,255,0.92));
}

.accordion {
  overflow: hidden;
}
.accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  padding: 1rem 1.1rem;
  color: var(--ink);
  font-weight: 700;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion[open] > summary {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11,79,138,0.05), rgba(255,255,255,0));
}
.accordion .content {
  padding: 1rem 1.1rem 1.2rem;
}
.badge-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.badge-links .btn-link {
  display: inline-flex;
  align-items: center;
}

footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
}
.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0 0.9rem;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.foot-links a {
  color: var(--muted);
  font-weight: 600;
}
footer .meta {
  padding-bottom: 2rem;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--accent);
}

@media (min-width: 840px) {
  .nav { display: flex; }
  .burger { display: none; }
}

@media (max-width: 920px) {
  .grid.cols-2,
  .grid.grid-2,
  .resource-list,
  .grid.cols-3,
  .grid.cols-2.share-grid,
  .grid.cols-2.tiles,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .foot-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 839px) {
  .appbar .wrap,
  main.wrap,
  footer .wrap,
  noscript .wrap {
    width: min(var(--wrap), calc(100vw - 24px));
  }
  main.wrap {
    padding-block: 20px 34px;
  }
  .bar { padding: 10px 0; }
  .card,
  .panel,
  .callout,
  .tile,
  .founder-note.letter-block,
  .controls,
  .result,
  .question {
    padding: 1rem;
  }
  .card.hero,
  .panel.hero { padding: 1.25rem; }
  h1, .section-title { font-size: clamp(28px, 8vw, 36px); }
  h2 { font-size: clamp(20px, 6vw, 25px); }
  .lead { font-size: 1.05rem; }
  .logo { height: 32px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .overall-title { line-height: 1.25; }
  .cta,
  .actions,
  .share-actions { flex-direction: column; align-items: stretch; }
  .btn,
  .btn-ghost,
  .chip { width: 100%; }
  .foot-links { width: 100%; }
  #quiz-radar { min-height: 240px; height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
