/* Deku's Wisdom — base stylesheet.
 *
 * Palette is lifted straight from the mascot art so the site and the character
 * read as one object: honey wood browns, cream paper, one sage-green accent
 * (the sprout) carrying every link and interactive state.
 */

:root {
  --cream: #f5f0e1;
  --cream-deep: #ece4d0;
  --paper: #fffdf7;
  --ink: #2f2418;
  --ink-soft: #5d4c38;
  --ink-faint: #8a765c;
  --wood: #b6822f;
  --wood-deep: #4a3220;
  --sprout: #5f8a52;
  --sprout-deep: #3f6136;
  --rule: #ded3ba;

  --measure: 68ch;
  --shell: 1080px;
  --radius: 10px;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--sprout-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--cream);
  padding: 0.6rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; }

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

/* ---------- shell ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 40px; height: 40px; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }

.site-nav { display: flex; gap: 1.25rem; font-family: var(--sans); font-size: 0.95rem; }

main { max-width: var(--shell); margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.prose { max-width: var(--measure); }
.prose.center { margin-inline: auto; text-align: center; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.35rem + 2.2vw, 2.7rem); margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.65rem); margin: 2.2rem 0 0.7rem; }

.standfirst { font-size: 1.15rem; color: var(--ink-soft); }
.meta, .source-note, .count { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-faint); }

.section { margin-top: 2.6rem; }

/* ---------- breadcrumbs ---------- */

.breadcrumbs {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.breadcrumbs a { color: var(--ink-soft); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1rem;
}
.hero h1 { margin-top: 0; }
.hero-copy p { max-width: 46ch; color: var(--ink-soft); }
.hero-art { border-radius: var(--radius); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }

.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--sprout-deep);
  color: var(--paper);
  text-decoration: none;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.button-quiet:hover { background: var(--cream-deep); color: var(--ink); }

/* ---------- quotes ---------- */

.quote-list { display: grid; gap: 1.4rem; margin-top: 1.4rem; }

.quote-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}

.quote-card blockquote { margin: 0; }
.quote-card blockquote p {
  margin: 0 0 0.7rem;
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);
  line-height: 1.4;
  color: var(--ink);
}
.quote-card cite { font-style: normal; font-family: var(--sans); font-size: 0.9rem; }
.quote-card footer { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: baseline; }

.commentary {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}
.commentary p { margin: 0; }

.theme-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}
.theme-chips a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--ink-soft);
  text-decoration: none;
}
.theme-chips a:hover { background: var(--sprout); color: var(--paper); }

.spoiler-shield summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.spoiler-shield[open] summary { margin-bottom: 1rem; }

/* ---------- definition card (meaning pages) ---------- */

.definition-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--sprout);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.6rem 0;
  display: grid;
  gap: 0.9rem;
}
.definition-card > div { display: grid; gap: 0.15rem; }
.definition-card dt {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.definition-card dd { margin: 0; }
.romaji { color: var(--ink-faint); }

.body-copy p { max-width: var(--measure); }

.character-intro {
  border-left: 3px solid var(--sprout);
  padding-left: 1rem;
  margin: 1.2rem 0 1.6rem;
  color: var(--ink-soft);
}

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 0.8rem 0;
}
.faq summary { cursor: pointer; font-weight: 700; }

/* ---------- lists & cards ---------- */

.link-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.link-list.columns { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card-grid {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card-grid a {
  display: grid;
  gap: 0.3rem;
  height: 100%;
  padding: 1.1rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
}
.card-grid a:hover { border-color: var(--sprout); }
.card-kanji { font-size: 1.6rem; color: var(--wood); }
.card-title { font-weight: 700; }
.card-blurb { font-size: 0.9rem; color: var(--ink-soft); }

.art-404 { margin: 0 auto; }

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

.site-footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-family: var(--sans);
}
.footer-mark { opacity: 0.55; }
.footer-nav { display: flex; gap: 1.1rem; justify-content: center; margin: 0.6rem 0 1rem; font-size: 0.9rem; }
.disclaimer {
  max-width: 62ch;
  margin: 0 auto;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-faint);
}
.copyright { font-size: 0.78rem; color: var(--ink-faint); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  main { padding: 1.4rem 1rem 2.4rem; }
  .site-header { padding: 0.9rem 1rem; }
  .quote-card { padding: 1.1rem 1.1rem; }
  .link-list.columns { grid-template-columns: 1fr; }
}

.spoiler-notice {
  background: var(--cream-deep);
  border-left: 3px solid var(--wood);
  padding: 0.7rem 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.body-copy table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
.body-copy th, .body-copy td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--rule); }

/* Series run facts — anime vs manga dates plus alternate titles. */
.run-facts {
  display: grid;
  gap: 0.55rem;
  margin: 1.3rem 0 1.8rem;
  padding: 1rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.92rem;
}
.run-facts > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.6rem; }
.run-facts dt { color: var(--ink-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; padding-top: 0.15rem; }
.run-facts dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 480px) { .run-facts > div { grid-template-columns: 1fr; gap: 0.1rem; } }

/* Pinterest save link. A plain anchor rather than their JS widget, so no
   third-party script loads for the sake of a button. */
.pin-save { margin: 0.9rem 0 0; }
.pin-link {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.pin-link:hover { color: var(--sprout-deep); border-bottom-color: var(--sprout); }

/* Affiliate block. Deliberately below the quotes: the commentary is the product,
   the link is a convenience, and the ordering should say so. */
.buy-block { border-top: 1px solid var(--rule); padding-top: 1.4rem; }
.buy-block p { color: var(--ink-soft); max-width: var(--measure); }
.affiliate-disclosure {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-faint);
  max-width: var(--measure);
}

/* 404. A page that only apologises wastes the visit, so it carries routes back in. */
.not-found .art-404 { margin: 0 auto 0.5rem; }
.not-found-links {
  list-style: none;
  padding: 0;
  margin: 1.8rem auto;
  max-width: 34rem;
  display: grid;
  gap: 0.9rem;
  text-align: left;
}
.not-found-links li {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
}
.not-found-links a { font-weight: 700; }
.not-found-links span {
  display: block;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 0.15rem;
}
.not-found .quote-list { text-align: left; }
