/* AskMoritz — public site
   Ink on paper. Editorial. The Berenberg hues survive only as accents.
   Mirrors the app's design tokens (BrandColor / BrandType). */

:root {
  /* Neutral core */
  --ink: #17191b;
  --ink-lift: #2b2e31;
  --ink-soft: #6e7579;
  --surface: #f8f8f6;
  --paper: #ffffff;
  --mist: #c8cccd;
  --mist-soft: #eff0ee;
  --hairline: rgba(200, 204, 205, 0.55);

  /* Accents — small doses only */
  --cyan: #29adcf;
  --teal: #1a6e82;
  --orange: #ff5229;

  /* Verdict semantics */
  --upheld: #1f9d6b;
  --overturned: #ff5229;
  --remanded: #e0982a;

  --maxw: 46rem;
  --radius-card: 22px;
  --radius-chip: 10px;

  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Fraunces", "Newsreader", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Masthead --------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.1rem, 4vw, 2.2rem);
  background: rgba(248, 248, 246, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.crest-svg {
  width: 30px;
  height: 30px;
  display: block;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.masthead nav {
  display: flex;
  gap: clamp(0.8rem, 3vw, 1.6rem);
  font-family: var(--ui);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}

.masthead nav a:hover {
  color: var(--ink);
}

/* ---- Layout ----------------------------------------------------------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.4rem, 7vw, 4.5rem) clamp(1.1rem, 5vw, 1.8rem) 1rem;
}

.eyebrow {
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}

.eyebrow.pick {
  color: var(--orange);
}

h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.3rem, 7vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 0.8rem;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 2.6rem 0 0.7rem;
}

h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  margin: 1.6rem 0 0.4rem;
}

p {
  margin: 0 0 1.1rem;
}

.lede {
  font-size: 1.28rem;
  line-height: 1.55;
  color: var(--ink);
}

.muted {
  color: var(--ink-soft);
}

a {
  color: var(--teal);
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(26, 110, 130, 0.35);
}

a:hover {
  text-decoration-color: currentColor;
}

ul,
ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}

li {
  margin: 0.35rem 0;
}

strong {
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.4rem 0;
}

.small {
  font-family: var(--ui);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* ---- Pulse divider ---------------------------------------------------- */

.pulse {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 26px;
  margin: 1.8rem 0 0;
  color: var(--mist);
}

.pulse .spike {
  color: var(--orange);
}

/* ---- Hero ------------------------------------------------------------- */

.hero {
  padding-bottom: 0.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 0;
  font-family: var(--ui);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-chip);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, var(--ink-lift), var(--ink));
  color: var(--surface);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline);
}

/* ---- Cards / feature grid -------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1.6rem 0;
}

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1.3rem 1.4rem;
  box-shadow: 0 1px 2px rgba(23, 25, 27, 0.05);
}

.card h3 {
  margin-top: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
}

.card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

/* ---- Table of contents (legal pages) --------------------------------- */

.toc {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.4rem;
  margin: 1.8rem 0;
  font-family: var(--ui);
  font-size: 0.9rem;
}

.toc strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 1.6rem;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
}

.toc a:hover {
  color: var(--teal);
}

/* ---- FAQ -------------------------------------------------------------- */

details {
  border-bottom: 1px solid var(--hairline);
  padding: 0.35rem 0;
}

details summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 1.3rem;
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details .answer {
  padding: 0 0 0.9rem;
}

/* ---- Callout ---------------------------------------------------------- */

.note {
  border-left: 2px solid var(--mist);
  padding: 0.2rem 0 0.2rem 1.1rem;
  margin: 1.4rem 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ---- Footer ----------------------------------------------------------- */

footer {
  max-width: var(--maxw);
  margin: 2rem auto 0;
  padding: 2rem clamp(1.1rem, 5vw, 1.8rem) 3rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--ui);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

footer .foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 1rem;
}

footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

footer a:hover {
  color: var(--ink);
}

footer .disclaimer {
  margin-top: 0.8rem;
  line-height: 1.55;
}

.updated {
  font-family: var(--ui);
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* ---- 404 -------------------------------------------------------------- */

.center {
  text-align: center;
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stamp {
  font-family: var(--display);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--overturned);
  border: 2px solid var(--overturned);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  transform: rotate(-4deg);
  display: inline-block;
  margin-bottom: 1.4rem;
  opacity: 0.9;
}

/* ---- Focus / a11y ----------------------------------------------------- */

a:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 540px) {
  .toc ol {
    columns: 1;
  }
}
