/* ==========================================================================
   Harvest Moon: Echoes of Teradea — guide site skin
   Palette + motifs sampled from the game's own art (see DESIGN-BRIEF.md).
   Day-world parchment panels sitting inside the night-mist Forest of Echoes.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("assets/fonts/nunito-sans-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --mist-1: #0f1e19;
  --mist-2: #1b1330;
  --panel: #1a1030;
  --panel-2: #241a41;
  --paper: #f0dfb8;
  --paper-2: #e6cf9e;
  --ink: #2a1c33;
  --ink-soft: #4a3a52;
  --leaf: #7fae3a;
  --leaf-dark: #4f7a22;
  --clay: #c06a41;
  --clay-dark: #9c4f2c;
  --mist: #b58cf5;
  --mist-soft: #d4bdfb;
  --wisp: #86e6b8;
  --sun: #e9c488;
  --maxw: 1240px;
  --line: 3px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 18% -6%, rgba(181, 140, 245, .20), transparent 62%),
    radial-gradient(900px 420px at 88% 4%, rgba(134, 230, 184, .10), transparent 60%),
    linear-gradient(180deg, var(--mist-1) 0%, #16202c 38%, var(--mist-2) 100%);
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--clay-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--clay); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border: var(--line) solid var(--ink);
}
.skip:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- HUD ribbon */
.ribbon {
  background: linear-gradient(180deg, #120a24, #1d1338);
  border-bottom: var(--line) solid #0a0616;
  box-shadow: 0 4px 0 rgba(181, 140, 245, .28);
  color: var(--mist-soft);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ribbon .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding-top: 9px; padding-bottom: 9px;
}
.ribbon .wrap::before {
  content: "";
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--wisp);
  box-shadow: 0 0 10px 2px rgba(134, 230, 184, .85);
  flex: 0 0 auto;
}
.ribbon b { color: var(--sun); font-weight: 800; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, #1c1236, #150c2b);
  border-bottom: var(--line) solid #07040f;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
}
.bar { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-weight: 900; font-size: 19px; line-height: 1.15;
  color: var(--paper); text-decoration: none; letter-spacing: -.01em;
  flex: 1 1 auto; min-width: 0;
}
.brand img {
  width: 40px; height: 40px; flex: 0 0 40px;
  border: 2px solid var(--mist); border-radius: 12px;
  background: var(--paper); box-shadow: 3px 3px 0 rgba(0, 0, 0, .5);
}
.brand:hover { color: #fff; }

.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav > ul {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  list-style: none; padding: 0; margin: 0;
}
.nav > ul > li { position: relative; }
.nav > ul > li > a {
  display: block; padding: 9px 13px; border-radius: 10px;
  font-size: 14.5px; font-weight: 700; letter-spacing: .02em;
  color: #efe2ff; text-decoration: none; border: 2px solid transparent;
}
.nav > ul > li > a:hover { background: rgba(181, 140, 245, .16); border-color: var(--mist); color: #fff; }
.nav > ul > li.active > a { background: rgba(134, 230, 184, .16); border-color: var(--wisp); color: #fff; }

.nav li.has-kids > a::after {
  content: " ▾";
  font-size: 11px; color: var(--wisp); margin-left: 2px;
  display: inline-block; transition: transform .18s ease;
}
.nav li.has-kids:hover > a::after,
.nav li.has-kids:has(:focus-visible) > a::after { transform: rotate(180deg); }

/* dropdown: panel sits flush under the parent, plus a transparent hover bridge
   so the pointer never crosses a dead gap (fleet blood-rule). */
.nav .kids {
  display: none; position: absolute; left: 0; top: 100%; z-index: 39;
  min-width: 240px; list-style: none; padding: 8px; margin: 0;
  background: #201640; border: var(--line) solid var(--mist);
  border-radius: 12px; box-shadow: 6px 6px 0 rgba(0, 0, 0, .55);
}
.nav .has-kids:hover .kids,
.nav .has-kids:has(:focus-visible) .kids { display: block; }
.nav .kids li a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #e8dcff; text-decoration: none;
}
.nav .kids li a:hover { background: var(--mist); color: #180f30; }
.nav .has-kids::after {
  content: ""; display: none; position: absolute; left: 0; top: 100%;
  width: 260px; height: 10px;
}
.nav .has-kids:hover::after,
.nav .has-kids:has(:focus-visible)::after { display: block; }

.nav a.cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--clay); color: #fff7ec; border: var(--line) solid #2b1206;
  box-shadow: var(--shadow-sm); font-weight: 800; font-size: 14.5px; text-decoration: none;
}
.nav a.cta:hover { background: #d9764a; color: #fff; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  background:
    linear-gradient(100deg, rgba(11, 20, 17, .86) 0%, rgba(16, 20, 34, .52) 48%, rgba(26, 14, 48, .18) 100%),
    var(--hero, none) center 32% / cover no-repeat,
    linear-gradient(180deg, #16202c, var(--mist-2));
  border-bottom: var(--line) solid #07040f;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 56px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'><path d='M0 60 C 90 8 180 42 300 22 C 430 0 520 44 660 26 C 800 8 900 46 1030 24 C 1110 11 1160 30 1200 18 L1200 60 Z' fill='%23f0dfb8' fill-opacity='0.16'/></svg>") center bottom / 100% 56px no-repeat;
  pointer-events: none;
}
.hero-in { position: relative; z-index: 2; padding: 52px 20px 62px; max-width: var(--maxw); margin: 0 auto; }
.eyebrow {
  display: inline-block; margin: 0 0 16px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(134, 230, 184, .16); border: 2px solid var(--wisp);
  color: #dcffee; font-size: 12.5px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(40px, 7.2vw, 82px); line-height: .96; letter-spacing: -.025em;
  color: #fff8ec;
  text-shadow: 4px 4px 0 rgba(10, 5, 24, .92), 0 0 44px rgba(181, 140, 245, .45);
  max-width: 15ch;
}
.hero h1 .hl { color: var(--sun); }
.hero .lead {
  margin: 0 0 26px; max-width: 62ch;
  font-size: 18.5px; line-height: 1.6; color: #efe6ff;
  text-shadow: 0 2px 8px rgba(6, 3, 16, .8);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 12px;
  background: var(--leaf); color: #12210a; border: var(--line) solid #16240b;
  box-shadow: 5px 5px 0 rgba(6, 3, 16, .8);
  font-weight: 800; font-size: 15.5px; text-decoration: none;
}
.btn:hover { background: #95c94a; color: #12210a; transform: translate(-1px, -1px); }
.btn.ghost {
  background: rgba(240, 223, 184, .1); color: #fff8ec; border-color: var(--paper);
  box-shadow: 5px 5px 0 rgba(6, 3, 16, .8);
}
.btn.ghost:hover { background: rgba(240, 223, 184, .22); color: #fff; }

/* ---------------------------------------------------------------- facts strip */
.facts-strip { background: linear-gradient(180deg, #241a41, #1c1334); border-bottom: var(--line) solid #07040f; }
.facts {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-top: 16px; padding-bottom: 16px;
}
.fact {
  flex: 1 1 190px; min-width: 0;
  background: var(--paper); border: var(--line) solid var(--ink);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 10px 13px;
}
.fact-k {
  display: block; font-size: 11.5px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: var(--clay-dark);
}
.fact-v { display: block; font-family: var(--serif); font-weight: 700; font-size: 16.5px; line-height: 1.3; color: var(--ink); }

/* ---------------------------------------------------------------- sections & grids */
.home-body, .home-lead { }
.section-head { margin: 38px 0 16px; }
.overline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: var(--mist-soft);
}
.overline::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--wisp); box-shadow: 0 0 9px 2px rgba(134, 230, 184, .8);
}
.section-head h2 {
  margin: 8px 0 0;
  font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.06; letter-spacing: -.015em;
  color: #fff4dd;
  text-shadow: 3px 3px 0 rgba(8, 4, 18, .85);
}
.count-pill {
  display: inline-block; margin-left: 10px; vertical-align: middle;
  min-width: 34px; padding: 3px 10px; border-radius: 999px;
  background: var(--clay); color: #fff6ec; border: 2px solid #2b1206;
  font-family: var(--sans); font-size: 13px; font-weight: 800;
  box-shadow: 3px 3px 0 rgba(8, 4, 18, .7);
}

.grid { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 8px; }
.grid[data-n="1"] > .card { flex: 1 1 100%; }
.grid[data-n="2"] > .card { flex: 1 1 calc(50% - 9px); }
.grid[data-n="3"] > .card { flex: 1 1 calc(33.333% - 12px); }
.grid[data-n="4"] > .card { flex: 1 1 calc(25% - 14px); }

.card {
  flex: 1 1 260px; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--paper); border: var(--line) solid var(--ink);
  border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); color: var(--ink); }
.card .thumb { position: relative; display: block; border-bottom: var(--line) solid var(--ink); background: var(--paper-2); }
.card .thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card .card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; }
.card h3 {
  margin: 0; font-family: var(--serif); font-weight: 900;
  font-size: 19px; line-height: 1.18; letter-spacing: -.01em; color: var(--ink);
}
.card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.card .go { margin-top: auto; font-weight: 800; font-size: 14px; color: var(--clay-dark); }
.card .stamp { font-size: 11.5px; font-weight: 700; color: #7a6a52; letter-spacing: .04em; }
.card.sm h3 { font-size: 16.5px; }
.card.sm .thumb img { aspect-ratio: 16 / 9; }
.pill-tag {
  position: absolute; left: 9px; bottom: 9px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ink); color: var(--sun); border: 2px solid #120b1c;
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  transform: rotate(-2.5deg);
}
.grid-title { }
.ad-slot { }

/* ---------------------------------------------------------------- article */
.article-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 244px;
  gap: 34px; align-items: start;
  padding-top: 26px; padding-bottom: 60px;
}
.article-grid > div { min-width: 0; }
.crumb { font-size: 13.5px; font-weight: 700; color: var(--mist-soft); margin: 0 0 14px; }
.crumb a { color: var(--mist-soft); text-decoration: none; }
.crumb a:hover { color: #fff; text-decoration: underline; }
.crumb .sep { color: var(--mist); }
.crumb .here { color: #fff; }

article {
  background: var(--paper); border: var(--line) solid var(--ink);
  border-radius: 16px; box-shadow: var(--shadow);
  padding: 28px 30px 34px;
}
article > h1 {
  margin: 0 0 14px;
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.03; letter-spacing: -.02em;
  color: var(--ink);
}
article > .art-lead {
  margin: 0 0 6px; font-size: 18px; line-height: 1.58; color: var(--ink-soft);
  border-left: 5px solid var(--clay); padding-left: 14px;
}
/* the generator injects the lead itself; this covers a hand-written intro */
article > p:first-of-type { }
article h2 {
  margin: 40px 0 14px;
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(23px, 2.7vw, 31px); line-height: 1.14; letter-spacing: -.015em;
  color: var(--ink);
  padding-bottom: 8px; border-bottom: 3px solid rgba(181, 140, 245, .5);
}
article h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px;
  border-radius: 50%; background: var(--mist);
  box-shadow: 0 0 0 3px rgba(181, 140, 245, .28); vertical-align: middle;
}
article h3 {
  margin: 28px 0 10px; font-family: var(--serif); font-weight: 700;
  font-size: 20px; line-height: 1.24; color: var(--clay-dark);
}
article p { margin: 0 0 15px; }
article > p, article > h2, article > h3, article > ul, article > ol, article > blockquote, article > .callout { max-width: 78ch; }
article ul, article ol { margin: 0 0 16px; padding-left: 22px; max-width: 78ch; }
article li { margin: 0 0 7px; }
article strong, article b { color: #1c1024; font-weight: 800; }
article code {
  background: rgba(42, 28, 51, .1); padding: 1px 6px; border-radius: 6px;
  font-size: .92em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
article blockquote {
  margin: 0 0 18px; padding: 14px 18px; max-width: 78ch;
  background: var(--paper-2); border-left: 6px solid var(--mist);
  border-radius: 0 12px 12px 0; font-style: italic; color: var(--ink-soft);
}
article img.zoom {
  width: 100%; border: var(--line) solid var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-sm); cursor: zoom-in; background: var(--paper-2);
}
article figure { margin: 0 0 20px; }
article a { color: var(--clay-dark); }

/* tables */
.tbl-wrap {
  max-width: 100%; overflow-x: auto; margin: 0 0 20px;
  border: var(--line) solid var(--ink); border-radius: 12px; background: var(--paper);
}
table { border-collapse: collapse; width: 100%; font-size: 15px; }
thead th {
  background: var(--ink); color: var(--sun);
  text-align: left; padding: 11px 13px; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
tbody td { padding: 10px 13px; border-top: 2px solid rgba(42, 28, 51, .18); vertical-align: top; }
tbody tr:nth-child(even) td { background: rgba(42, 28, 51, .05); }
table strong, table b { color: inherit; }

/* quick answer + callouts */
.quick-answer {
  position: relative; margin: 0 0 24px; padding: 18px 20px 16px;
  background: linear-gradient(180deg, #eef7df, #dfeec6);
  border: var(--line) solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.quick-answer p { margin: 0; max-width: 74ch; font-size: 16.5px; line-height: 1.6; }
.qa-stamp {
  display: inline-block; margin-bottom: 8px; padding: 4px 12px;
  background: var(--leaf); color: #12210a; border: 2px solid #16240b; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.callout {
  margin: 0 0 20px; padding: 16px 18px; max-width: 78ch;
  background: var(--paper-2); border: var(--line) solid var(--ink);
  border-left-width: 9px; border-left-color: var(--mist);
  border-radius: 12px;
}
.callout p:last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--leaf); }
.callout.tip { border-left-color: var(--wisp); }
.callout.danger, .callout.warn {
  border-left-color: var(--clay-dark);
  background-image: repeating-linear-gradient(135deg, rgba(192, 106, 65, .16) 0 12px, rgba(192, 106, 65, 0) 12px 24px);
  border-left-width: 12px;
}

/* ---------------------------------------------------------------- sidebar toc */
.toc {
  position: sticky; top: 86px;
  background: #221741; border: var(--line) solid var(--mist);
  border-radius: 14px; box-shadow: 6px 6px 0 rgba(6, 3, 16, .7);
  padding: 16px 16px 14px;
}
.toc .overline { font-size: 11px; }
.toc-list { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.toc-list a {
  display: block; padding: 6px 9px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  color: #e6daff; text-decoration: none;
}
.toc-list a:hover { background: var(--mist); color: #180f30; }

/* ---------------------------------------------------------------- all guides */
.all-guides { margin-top: 44px; padding-top: 8px; border-top: 3px dashed rgba(42, 28, 51, .3); }
.all-guides .section-head h2 { color: var(--ink); text-shadow: none; }
.all-guides .section-head .overline { color: var(--clay-dark); }
.all-guides .section-head .overline::before { background: var(--wisp); }
.all-guides .grid { margin-top: 14px; }

/* ---------------------------------------------------------------- ads */
.ad-slot { max-width: var(--maxw); margin: 0 auto 26px; padding: 0 20px; }
.ad-inner { min-height: 90px; }
@media (hover: hover) and (pointer: fine) {
  .ad-inner { display: block; }
}

/* ---------------------------------------------------------------- footer */
.foot {
  background: linear-gradient(180deg, #191033, #0c1a16);
  border-top: var(--line) solid #07040f;
  color: #cbbde6; padding: 34px 0 26px; margin-top: 0;
}
.foot .disclaimer { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; max-width: 92ch; color: #b6a9d2; }
.foot-links { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.foot-links a { color: var(--mist-soft); text-decoration: none; }
.foot-links a:hover { color: #fff; text-decoration: underline; }
.foot .muted { margin: 0; font-size: 12.5px; letter-spacing: .05em; color: #8d80ab; }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 3, 16, .95);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img {
  max-width: min(1500px, 96vw); max-height: 92vh; width: auto; height: auto;
  border: 3px solid var(--mist); border-radius: 10px;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; margin: 0 0 22px; }
  thead th { white-space: normal; }
  tbody td { overflow-wrap: anywhere; }
  .grid[data-n="3"] > .card, .grid[data-n="4"] > .card { flex: 1 1 calc(50% - 9px); }
}
@media (max-width: 900px) {
  .bar { align-items: flex-start; padding-top: 9px; padding-bottom: 9px; gap: 10px; }
  .brand { flex: 1 1 100%; font-size: 16.5px; }
  .brand img { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; }
  .nav { flex: 1 1 100%; min-width: 0; }
  .nav > ul { flex: 1 1 100%; min-width: 0; gap: 2px; }
  .nav > ul > li > a { padding: 7px 10px; font-size: 13.5px; }
  .nav a.cta { padding: 8px 13px; font-size: 13.5px; }
  .hero-in { padding: 46px 20px 78px; }
}
@media (max-width: 700px) {
  body { font-size: 16.5px; }
  .hero {
    background:
      linear-gradient(180deg, rgba(11, 20, 17, .78) 0%, rgba(16, 20, 34, .52) 42%, rgba(26, 14, 48, .34) 100%),
      var(--hero, none) center 26% / cover no-repeat,
      linear-gradient(180deg, #16202c, var(--mist-2));
  }
  .hero-in { padding: 28px 20px 50px; }
  .eyebrow { margin-bottom: 10px; padding: 5px 12px; font-size: 11px; letter-spacing: .14em; }
  article { padding: 20px 17px 26px; border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); }
  .article-grid { padding-top: 18px; padding-bottom: 40px; }
  .grid[data-n="2"] > .card, .grid[data-n="3"] > .card, .grid[data-n="4"] > .card { flex: 1 1 100%; }
  .fact { flex: 1 1 100%; }
  /* nav: one horizontal scroller row, never a 300px static stack that pushes the hero off-screen */
  .nav > ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .nav .kids { display: none !important; }
  .nav li.has-kids > a::after { content: ""; }
  .nav .has-kids::after { display: none !important; }
  .hero h1 { font-size: clamp(34px, 10.5vw, 52px); }
  .btn { width: 100%; text-align: center; }
  .hero-cta { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
