/* assets/style.css — Story of Our DAYs
   Warm paper notebook aesthetic. Reading-first. No JS, no external assets. */

:root {
  /* primitives — warm paper */
  --paper: #f7f2e9;
  --paper-raised: #fbf8f2;
  --ink: #2a2521;
  --ink-soft: #5c5348;
  --ink-mute: #6f6559;
  --rule: #e3d9c9;
  --accent: #8a5a3b;
  --accent-soft: #a97350;
  --highlight: #f0e6d6;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Songti SC", "Songti TC", "Noto Serif CJK SC", "Noto Serif CJK TC",
    "Source Han Serif SC", "Songti TC", "Hiragino Mincho ProN", serif;

  --measure: 40rem;            /* ~68ch for comfortable reading */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --text-sm: 0.875rem;
  --text-base: 1.0625rem;      /* 17px body */
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.9rem;
  --text-3xl: 2.5rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17140f;
    --paper-raised: #1f1b15;
    --ink: #ece3d5;
    --ink-soft: #c3b8a6;
    --ink-mute: #a2977f;
    --rule: #363026;
    --accent: #dcab7f;
    --accent-soft: #e6bd96;
    --highlight: #262017;
  }
}

/* ---------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--highlight) 60%, transparent), transparent 55%),
    radial-gradient(circle at 82% 78%, color-mix(in srgb, var(--highlight) 45%, transparent), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--text-base);
  line-height: 1.75;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 2rem) var(--space-16);
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------------- header */

.site-header {
  text-align: center;
  padding-block: var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-12);
}

.site-title {
  margin: 0;
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, var(--text-3xl));
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.site-tagline {
  margin: var(--space-4) auto 0;
  max-width: 32rem;
  color: var(--ink-soft);
  font-style: italic;
  font-size: var(--text-base);
}

/* ---------------------------------------------------------------- entries */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--rule);
}
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; }

.entry__date {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.entry__title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
}

.entry__title a {
  color: var(--ink);
  text-decoration: none;
}
.entry__title a:hover { color: var(--accent); }

.title-zh {
  font-weight: 400;
  color: var(--ink-soft);
  white-space: nowrap;
}

.entry__excerpt {
  margin: 0;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* ---------------------------------------------------------------- story */

.page--story { max-width: var(--measure); }

.back {
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
}
.back a { text-decoration: none; color: var(--ink-mute); }
.back a:hover { color: var(--accent); }

.story-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--rule);
}

.story-date {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.story-title {
  margin: 0;
  font-size: clamp(1.8rem, 1.3rem + 2.4vw, var(--text-2xl));
  font-weight: 600;
  line-height: 1.2;
}

.story p { margin: 0 0 1.4em; }

.story h2 {
  margin: var(--space-12) 0 var(--space-4);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.story h2:first-of-type { margin-top: var(--space-8); }

.story hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: var(--space-12) auto;
  width: 40%;
}

.story .meta {
  margin-block: 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-mute);
}
.story .meta--tags { letter-spacing: 0.02em; }

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

.site-footer {
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-mute);
}
.site-footer p { margin: 0; }

/* ---------------------------------------------------------------- misc */

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

@media (max-width: 480px) {
  .entry__title { font-size: var(--text-lg); }
  .story p { margin-bottom: 1.25em; }
}
