@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@700&family=M+PLUS+Rounded+1c:wght@400;500;700&display=swap');

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

:root {
  --bg:       #F1F5FA;
  --surface:  #F4F8FC;
  --fg:       #313D4C;
  --muted:    #687686;
  --border:   #D2E9F2;
  --primary:  #4FA3C7;
  --font-display: 'Zen Maru Gothic', sans-serif;
  --font-body:    'M PLUS Rounded 1c', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #1A2230;
    --surface: #243040;
    --fg:      #DCE4EF;
    --muted:   #8A96A6;
    --border:  #2F4060;
    --primary: #4FA3C7;
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Hero (index only) ─── */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg);
}

/* ─── Header (doc pages) ─── */

header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.site-name:hover {
  color: var(--primary);
}

/* ─── Doc layout ─── */

.doc {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.doc-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.doc-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.doc-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lead {
  color: var(--muted);
  font-size: 0.9rem;
}

section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

section h2 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
}

section p,
section ul {
  font-size: 0.875rem;
  color: var(--muted);
}

section ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

section a {
  color: var(--primary);
  text-decoration: none;
}

section a:hover {
  text-decoration: underline;
}

.date {
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ─── Footer ─── */

footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

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

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

/* ─── Responsive ─── */

@media (max-width: 600px) {
  .doc {
    padding: 2rem 1.25rem 3rem;
  }

  header {
    padding: 1rem 1.25rem;
  }
}

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