/* Citatum — shared site styles.
   Palette and typefaces are the app's own: the paper and terracotta come from
   docs/design/citatum-icon.svg, the faces are two of the families bundled in
   pubspec.yaml (Newsreader for quotes and display, Instrument Sans for UI). */

:root {
  --paper: #f7f2e8;
  --surface: #fffdf8;
  --ink: #211d18;
  --muted: #6f6558;
  --faint: #978c7c;
  --rule: #e2d9c8;
  --accent: #b0543c;
  --accent-soft: #f3e3dc;

  --f-display: "Newsreader", Georgia, "Times New Roman", serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 62ch;
  --pad: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15120e;
    --surface: #1d1913;
    --ink: #efe7d9;
    --muted: #a19685;
    --faint: #7d7365;
    --rule: #2e2820;
    --accent: #d8846a;
    --accent-soft: #2c211b;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 58rem;
  margin: 0 auto;
  padding: 0 var(--pad);
}

a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- masthead ---------------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem var(--pad);
  max-width: 58rem;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }

.head-right {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav { display: flex; gap: 1.3rem; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }

/* Two-letter language codes: compact enough to stay on one line on a phone,
   and unambiguous without needing flags (which map to countries, not
   languages). */
.lang-switch { display: flex; gap: .1rem; }

.lang-switch a {
  color: var(--faint);
  text-decoration: none;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  padding: .25rem .4rem;
  border-radius: 2px;
}

.lang-switch a:hover { color: var(--accent); }

.lang-switch a[aria-current="true"] {
  color: var(--ink);
  background: var(--accent-soft);
}

@media (max-width: 30rem) {
  .site-head { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .head-right { justify-content: flex-start; gap: 1rem; }
}

/* ---------------- hero ---------------- */

.hero { padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem); }

.hero-quote {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(2.2rem, 7vw, 4.5rem) clamp(1.5rem, 5vw, 3.5rem);
  text-align: center;
  position: relative;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.hero-quote::before {
  content: "\201C";
  font-family: var(--f-display);
  font-size: clamp(5rem, 14vw, 8rem);
  line-height: 0;
  color: var(--accent);
  opacity: .22;
  position: absolute;
  top: clamp(2.4rem, 7vw, 4rem);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-quote blockquote {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -.015em;
  text-wrap: balance;
  position: relative;
}

.hero-quote cite {
  display: block;
  margin-top: 1.4rem;
  font-family: var(--f-body);
  font-style: normal;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

h1 {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -.022em;
  margin: 0 0 1rem;
  text-wrap: balance;
  max-width: 20ch;
}

.lede {
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 2rem;
}

.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fffdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .8rem 1.5rem;
  border-radius: 3px;
}

.btn:hover { filter: brightness(1.08); }

.cta-note { font-size: .87rem; color: var(--faint); }

/* ---------------- sections ---------------- */

section { padding: clamp(2.5rem, 6vw, 4rem) 0; }

.section-label {
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
  font-weight: 600;
}

h2 {
  font-family: var(--f-display);
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h3 {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 .4rem;
  letter-spacing: -.01em;
}

p { max-width: var(--measure); margin: 0 0 1rem; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.feature { background: var(--surface); padding: 1.5rem 1.4rem; }
.feature p { margin: 0; font-size: .93rem; color: var(--muted); }

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.langs li {
  font-size: .88rem;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: 999px;
  padding: .3rem .85rem;
  color: var(--muted);
}

.divider { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------------- legal pages ---------------- */

.legal { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }

.legal h1 { max-width: none; margin-bottom: .4rem; }

.legal .meta {
  color: var(--faint);
  font-size: .88rem;
  margin: 0 0 2rem;
}

.legal h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}

.legal h3 {
  font-size: 1.05rem;
  margin: 2rem 0 .5rem;
}

.legal p, .legal li { max-width: var(--measure); }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }

/* JS hides the inactive ones; with JS off every language stays readable. */
.lang-pane { display: block; }
.lang-pane[hidden] { display: none; }

/* ---------------- footer ---------------- */

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 2rem var(--pad) 3rem;
  max-width: 58rem;
  margin: 3rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: .88rem;
  color: var(--faint);
}

.site-foot nav { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
