:root {
  --bg: #faf7f2;
  --bg-2: #f4efe6;
  --text: #2a2a2a;
  --muted: #7a7f87;
  --line: #e7e1d6;
  --accent: #6aa6a1;
  --accent-2: #cfe8df;
  --danger: #d86969;

  --radius: 16px;
  --container: 960px;
  --measure: 58ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: #ffffff;
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* remove paper grain for a cleaner look */
body::before { content: none; display: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.brand {
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: inherit; font-weight: 700; }

.links { display: none; gap: 14px; }
.links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color .2s ease, background-color .2s ease;
}
.links a:hover { color: var(--text); background: #eef1f4; }
.links a.active { color: var(--text); background: color-mix(in oklab, var(--accent) 12%, #ffffff 88%); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 25%, #dde6e2) inset; }

@media (min-width: 900px) { .links { display: flex; } }

/* HERO */
.hero { padding: 48px 0 12px; }
.hero-wrap {
  display: grid;
  gap: 28px;
}
@media (min-width: 900px) {
  .hero-wrap { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
}

.chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f5f4;
  color: #5f6b66;
  font-weight: 600;
  letter-spacing: .2px;
}

h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  margin: 10px 0 14px;
}

h1 span { color: inherit; }

.subtitle { color: var(--muted); font-size: clamp(16px, 2.2vw, 18px); margin: 0 0 22px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.card {
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 14px 16px;
}
.card strong { display:block; font-weight: 800; font-size: 20px; }
.card small { color: var(--muted); }
.card.danger { border-color: #efcccc; background: #ffffff; }

.hero-visual { display: grid; place-items: center; }
.hero-visual .photo {
  width: min(88vw, 420px);
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: none;
  background-color: #ffffff;
}

.orb {
  width: min(88vw, 420px);
  aspect-ratio: 1/1;
  padding: 22px;
  border-radius: 50%;
  background:
    radial-gradient(120px 120px at 30% 30%, color-mix(in oklab, var(--accent) 18%, transparent), transparent),
    radial-gradient(200px 120px at 80% 70%, color-mix(in oklab, var(--accent-2) 20%, transparent), transparent),
    linear-gradient(180deg, #ffffffcc, #faf6efcc);
  border: 1px solid #e5e0d6;
  box-shadow: 0 24px 80px rgba(20, 24, 28, .08), 0 0 0 1px rgba(168, 240, 207, .10) inset;
  animation: float 12s ease-in-out infinite;
}

.orb svg { width: 100%; height: 100%; display: block; }

@keyframes float { 0%, 100% { transform: translateY(0px) } 50% { transform: translateY(8px) } }

/* SECTIONS */
.section { padding: 84px 0; border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.section.alt { background: none; }

h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.2;
  margin: 0 0 12px;
}

p { margin: 0 0 14px; }

/* Narrower reading width for text columns */
.section .container > p { max-width: var(--measure); }
.section .container > ul.list { max-width: var(--measure); }
.grid-2 > div:first-child { max-width: var(--measure); }

.grid-2 { display: grid; gap: 24px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr .7fr; gap: 36px; } }

.aside { display: grid; gap: 12px; align-content: start; }
.aside-card {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.aside-card.danger { border-color: #efcccc; background: #ffffff; }
.aside-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.aside-card p { margin: 0; }

.note { color: var(--muted); font-style: italic; }

.figure { margin: 14px 0 0; }
.figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: none;
  background-color: #ffffff;
}
.figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: .92rem;
}

/* Blockquote */
.diary blockquote {
  margin: 0;
  padding: 20px 22px;
  border-left: 3px solid var(--accent);
  background: #ffffff;
  border-radius: 10px;
}
.diary blockquote p { margin: 0 0 12px; }
.diary blockquote footer { color: var(--muted); }

/* List */
.list { padding-left: 18px; }
.list li { margin: 6px 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 60px; }
.footer p { margin: 6px 0; }
.footer .muted { color: var(--muted); }

/* Wiki Index */
.wiki-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.wiki-index .card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 16px 18px;
  transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease;
}
.wiki-index .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(22,24,26,.10), 0 1px 0 rgba(255,255,255,.65) inset;
}

/* Table of Contents */
.toc { padding: 16px 18px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 6px 0; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc a.active { font-weight: 600; color: var(--accent); }

/* Accessibility and motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb { animation: none; }
}
