/* jiantu.ai — editorial morning-paper theme */

:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --bg-elevated: #fffdf8;
  --ink: #1f1a14;
  --ink-muted: #5c5348;
  --ink-faint: #8a8074;
  --line: #e4d9c8;
  --line-strong: #d0c2ab;
  --accent: #b85c38;
  --accent-soft: #f0dccf;
  --accent-hover: #9a4a2c;
  --focus: #b85c38;
  --shadow: 0 1px 2px rgba(31, 26, 20, 0.04), 0 8px 24px rgba(31, 26, 20, 0.06);
  --radius: 12px;
  --max: 42rem;
  --header-h: 3.5rem;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1c1915;
    --bg-elevated: #26211b;
    --ink: #f3ebe0;
    --ink-muted: #b8ae9f;
    --ink-faint: #8a8074;
    --line: #3a332a;
    --line-strong: #4d4438;
    --accent: #e8a87c;
    --accent-soft: #3a2a20;
    --accent-hover: #f0c09a;
    --focus: #e8a87c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.28);
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain (CSS only, no image) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(184, 92, 56, 0.06), transparent 42%),
    radial-gradient(ellipse at 88% 8%, rgba(232, 168, 124, 0.05), transparent 40%);
}

@media (prefers-color-scheme: dark) {
  body::before {
    opacity: 0.5;
    background-image:
      radial-gradient(ellipse at 12% 0%, rgba(232, 168, 124, 0.05), transparent 42%),
      radial-gradient(ellipse at 88% 8%, rgba(184, 92, 56, 0.04), transparent 40%);
  }
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

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

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.logo span {
  margin-left: 0.45em;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  gap: 0.25rem;
}

nav a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent-soft);
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
}

.page-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4.5vw, 2.45rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.lead {
  margin: 0 0 2rem;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.section-label {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Feature / nav card */
.card {
  display: block;
  padding: 1.35rem 1.4rem 1.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--line-strong);
  color: inherit;
  transform: translateY(-1px);
}

.card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.975rem;
}

.card__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* Latest episode listening card */
.episode {
  margin: 0 0 1.5rem;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.episode + .episode {
  margin-top: 1rem;
}

.episode__badge {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.episode h2,
.episode h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.episode h3 {
  font-size: 1.2rem;
}

.meta {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.episode audio {
  display: block;
  width: 100%;
  height: 2.5rem;
  margin: 0;
  accent-color: var(--accent);
  border-radius: 8px;
}

.episode__download {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
}

.episode__download a {
  font-weight: 500;
}

/* Stack on homepage */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0.25rem 0;
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 1.25rem 1.25rem 1.75rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

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

@media (min-width: 640px) {
  main {
    padding: 3rem 1.5rem 4rem;
  }

  .episode,
  .card {
    padding: 1.6rem 1.7rem 1.7rem;
  }
}
