/* ============================================================
   Paper Plane — Legal Pages Stylesheet
   Shared by privacy-policy / terms / support / data-deletion
   ============================================================ */

:root {
  --bg: #F9F6F5;
  --paper: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --ink-muted: #757575;
  --accent: #FF6B35;
  --accent-hover: #E55A2B;
  --accent-soft: #FFE5DA;
  --line: #ECE6E0;
  --line-soft: #F4EFEA;
  --warning-bg: #FFF8E1;
  --warning-border: #FFC83D;
  --info-bg: #E8F4FD;
  --info-border: #4A90E2;
  --success-bg: #E6F7EC;
  --success-border: #34A853;
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 26, 26, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Header ─────────────────────────────────── */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0.875rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

.brand-mark {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/></svg>") center/contain no-repeat;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-switch a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch a.active,
.lang-switch a:hover,
.lang-switch a:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Container ───────────────────────────────── */
main {
  max-width: 760px;
  margin: 2rem auto 4rem;
  padding: 0 1.25rem;
}

article.legal {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 2.75rem 2.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line-soft);
}

@media (max-width: 600px) {
  main { margin: 1rem auto 2rem; }
  article.legal { padding: 1.5rem 1.125rem; border-radius: 10px; }
}

/* ── Typography ──────────────────────────────── */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

@media (max-width: 600px) { h1 { font-size: 1.625rem; } }

.meta {
  color: var(--ink-muted);
  font-size: 0.875rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.75rem;
}

.meta strong { color: var(--ink-soft); font-weight: 600; }

h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
  scroll-margin-top: 5rem;
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}

.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--ink);
}

p {
  margin-bottom: 0.875rem;
  color: var(--ink-soft);
}

ul, ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0 1rem;
  color: var(--ink-soft);
}

li { margin-bottom: 0.375rem; }
li::marker { color: var(--accent); font-weight: 700; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }

strong { color: var(--ink); font-weight: 700; }
code {
  font-family: ui-monospace, SFMono-Regular, "Menlo", monospace;
  font-size: 0.9em;
  background: var(--line-soft);
  padding: 0.1rem 0.375rem;
  border-radius: 4px;
  color: var(--ink);
}

/* ── Tables ──────────────────────────────────── */
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.925rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.legal th, .legal td {
  padding: 0.75rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal th {
  background: #FAF7F4;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.legal tr:last-child td { border-bottom: none; }

@media (max-width: 600px) {
  .legal table { font-size: 0.85rem; }
  .legal th, .legal td { padding: 0.625rem 0.5rem; }
}

/* ── Callouts ────────────────────────────────── */
.callout {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-border);
  padding: 1rem 1.125rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  font-size: 0.925rem;
}

.callout p:last-child { margin-bottom: 0; }
.callout strong { color: #6D4F00; }

.callout.info {
  background: var(--info-bg);
  border-left-color: var(--info-border);
}
.callout.info strong { color: #1A4D7A; }

.callout.success {
  background: var(--success-bg);
  border-left-color: var(--success-border);
}
.callout.success strong { color: #1B5E20; }

/* ── TOC ─────────────────────────────────────── */
.toc {
  background: #FAF7F4;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.125rem 1.375rem;
  margin: 1rem 0 2rem;
  font-size: 0.92rem;
}

.toc-title {
  font-weight: 800;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

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

.toc li { margin-bottom: 0.25rem; break-inside: avoid; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

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

/* ── Cards (index, support) ──────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: block;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.375rem;
  color: var(--ink);
}

.card-desc {
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

/* ── FAQ accordion (support page) ────────────── */
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  transition: border-color 0.15s ease;
}

.faq details[open] { border-color: var(--accent); }

.faq summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2rem;
  color: var(--ink);
  outline: none;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 800;
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after { content: "−"; }

.faq details > *:not(summary) { margin-top: 0.625rem; }

/* ── Buttons (CTA on support / data deletion) ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, transform 0.15s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--line-soft);
  color: var(--ink);
  border-color: var(--ink-muted);
}

/* ── Email template block ────────────────────── */
.email-template {
  background: var(--line-soft);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.125rem;
  border-radius: 0 6px 6px 0;
  font-family: ui-monospace, SFMono-Regular, "Menlo", monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--ink-soft);
  margin: 1rem 0;
}

/* ── Footer ──────────────────────────────────── */
footer.site-footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

footer.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

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

footer.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Hero (index page) ───────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1.25rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 { font-size: 2.5rem; }
.hero p { font-size: 1.0625rem; color: var(--ink-muted); }

@media (max-width: 600px) {
  .hero { padding: 2rem 1rem 1rem; }
  .hero h1 { font-size: 1.875rem; }
}

/* ── Accessibility ───────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ───────────────────────────────────── */
@media print {
  .site-header, footer.site-footer, .lang-switch { display: none; }
  body { background: white; color: black; }
  article.legal { box-shadow: none; padding: 0; border: none; }
  a { color: black; text-decoration: underline; }
}
