/* ─── Google Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Design tokens (freedomCarb palette: warm paper + herb green) ──── */
:root {
  color-scheme: light;
  --bg:            #F6F5F0;
  --surface:       #FDFCF9;
  --surface-2:     #EFEEE7;
  --ink:           #1B1F1B;
  --muted:         #7B8177;
  --border:        rgba(27,31,27,.10);
  --border-strong: rgba(27,31,27,.22);
  --accent:        #3F6B4F;
  --accent-dark:   #2E4F3A;
  --on-accent:     #F3F7F3;
  --white:         #FFFFFF;
  --shadow:        0 24px 70px rgba(27,31,27,.10);
}

/* ─── Reset & base ────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
}

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; }

/* ─── Typography ──────────────────────────────────────────────────── */
h1, h2, h3, p, ol { margin-top: 0; }

h1, h2, h3 { font-family: 'Fraunces', serif; }

h1 {
  max-width: 12ch;
  margin-bottom: 24px;
  font-size: clamp(3rem, 6.5vw, 5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover,
.button.primary:focus-visible { opacity: .88; }

.button:hover,
.button:focus-visible { transform: translateY(-1px); }

/* ─── Site header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(246,245,240,.88);
  padding: 0 32px;
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
}

.brand span { white-space: nowrap; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 500;
}

.nav-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--ink); }

/* ─── Language dropdown ───────────────────────────────────────────── */
.language-dropdown { position: relative; }

.language-dropdown > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0 12px;
  min-height: 34px;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.language-dropdown > summary::-webkit-details-marker { display: none; }
.language-dropdown > summary::marker { content: none; }

.language-dropdown[open] > summary { background: var(--surface-2); }

.dropdown-arrow { font-size: 0.7rem; opacity: 0.6; }

.language-dropdown ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 130px;
  box-shadow: 0 8px 32px rgba(27,31,27,.12);
}

.language-dropdown ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
}

.language-dropdown ul li a:hover,
.language-dropdown ul li a:focus-visible {
  background: var(--surface-2);
  color: var(--ink);
}

.language-dropdown ul li a.active { color: var(--accent); font-weight: 600; }

/* ─── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 0 32px;
  font-size: 0.9rem;
}

.site-footer span {
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-weight: 600;
}

.site-footer a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

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

/* ─── Legal pages ─────────────────────────────────────────────────── */
.legal-page {
  width: min(900px, calc(100% - 64px));
  margin: 0 auto;
  padding: 78px 0;
}

.legal-hero {
  border-bottom: 1px solid var(--border);
  padding-bottom: 34px;
}

.legal-hero h1 {
  max-width: none;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 3.4rem;
}

.legal-hero p { max-width: 64ch; color: var(--muted); font-size: 1.1rem; }

.legal-content { display: grid; gap: 34px; padding-top: 40px; }

.legal-section { border-bottom: 1px solid var(--border); padding-bottom: 30px; }

.legal-section h2 { margin-bottom: 16px; font-size: 1.5rem; }

.legal-section p,
.legal-section li,
.legal-updated { color: var(--muted); font-size: 1rem; }

.legal-section ul { margin: 0; padding-left: 1.25rem; }

.legal-section li + li { margin-top: 10px; }

.legal-section a { color: var(--accent-dark); font-weight: 700; }

.legal-updated { margin-bottom: 0; font-weight: 700; }

/* ─── Support pages ───────────────────────────────────────────────── */
.support-page {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: 78px 0;
}

.support-hero {
  border-bottom: 1px solid var(--border);
  padding-bottom: 54px;
}

.support-hero h1 { max-width: none; color: var(--ink); font-size: 3.6rem; }

.support-hero p { max-width: 62ch; color: var(--muted); font-size: 1.12rem; }

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.support-section { padding: 56px 0; border-bottom: 1px solid var(--border); }

.support-section:last-child { border-bottom: none; }

.support-section h2 { max-width: 760px; margin-bottom: 24px; }

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.support-card,
.support-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 22px;
}

.support-card h3,
.support-panel h3 { margin-bottom: 10px; }

.support-card p,
.support-panel p,
.support-panel li { color: var(--muted); }

.support-card p,
.support-panel p { margin-bottom: 0; }

.support-panel { display: grid; gap: 20px; }

.support-panel ul,
.support-panel ol { margin: 0; padding-left: 1.25rem; }

.support-panel li + li { margin-top: 10px; }

.support-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.support-note { margin-top: 18px; color: var(--muted); font-size: 0.95rem; }

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-header {
    position: relative;
    z-index: 100;
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .support-page,
  .legal-page { width: min(100% - 32px, 660px); padding: 52px 0; }

  h1 { font-size: 2.6rem; }
  h2 { font-size: 1.6rem; }

  .support-grid,
  .support-columns { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .support-actions,
  .support-actions .button { width: 100%; }
}
