/* =============================================================
   Sea of Sorrow — site stylesheet
   Palette and motifs sampled from Hollow Knight: Silksong and the
   Sea of Sorrow key art: deep-ink sea, salt ivory paper, Hornet
   crimson, old gold. Deliberately no light-mode fallback — the
   game is always dark, so the site is too.
   ============================================================= */

:root {
  --abyss: #05151a;
  --deep: #0a2024;
  --panel: #0d2a2e;
  --panel-2: #103136;
  --ivory: #e8e0cd;
  --ivory-dim: #c9c0a8;
  --crimson: #c8324a;
  --crimson-deep: #8d2036;
  --sea: #2e6f6a;
  --gold: #c9a227;
  --ink: #10201e;
  --muted: #8fa6a4;
  --display: "Marcellus", "EB Garamond", Georgia, "Times New Roman", serif;
  --font: "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1140px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--abyss); scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--abyss);
  background-image:
    linear-gradient(rgba(46, 111, 106, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 111, 106, 0.10) 1px, transparent 1px),
    radial-gradient(900px 420px at 12% -6%, rgba(46, 111, 106, 0.16), transparent 70%),
    radial-gradient(720px 380px at 92% 4%, rgba(200, 50, 74, 0.10), transparent 72%);
  background-size: 56px 56px, 56px 56px, 100% 100%, 100% 100%;
  color: var(--ivory);
  font: 17px/1.72 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ivory); text-decoration-color: rgba(201, 162, 39, 0.55); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
a:focus-visible { outline: 2px dashed var(--gold); outline-offset: 3px; }

.wrap { width: min(100% - 40px, var(--wrap)); margin: 0 auto; }

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

/* ---------------------------------------------------------- ribbon */
.ribbon {
  background: var(--crimson-deep);
  border-bottom: 1px solid rgba(5, 21, 26, 0.6);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #f3e6d2;
}
.ribbon .wrap { padding: 7px 0; }

/* ---------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background:
    repeating-linear-gradient(115deg, rgba(232, 224, 205, 0.035) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #082026 0%, #06191d 100%);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
.bar { display: flex; align-items: center; gap: 20px; min-height: 68px; padding: 9px 0; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: 0 1 auto; min-width: 0; }
.brand img {
  width: 34px; height: 34px; border-radius: 3px;
  border: 1px solid rgba(201, 162, 39, 0.6);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}
.brand span {
  font-family: var(--display);
  font-size: 0.86rem;
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: var(--ivory);
  max-width: 15.5em;
}

/* ---------------------------------------------------------- nav */
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav > ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.nav > ul > li { position: relative; }
.nav > ul > li > a {
  display: block; padding: 9px 11px;
  font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  text-decoration: none; color: var(--ivory-dim);
  border-bottom: 2px solid transparent;
}
.nav > ul > li > a:hover,
.nav > ul > li.active > a { color: var(--ivory); border-bottom-color: var(--crimson); }
.nav li.has-kids > a::after { content: " ▾"; color: var(--gold); font-size: 0.72em; }

/* the panel sits flush at top:100%; this bridge keeps the pointer alive
   while the cursor crosses the seam between parent and panel. */
.nav li.has-kids::before {
  content: ""; position: absolute; left: 0; right: 0; top: 100%;
  height: 14px; background: transparent;
}
.nav .kids{
  list-style: none; margin: 0; padding: 7px 0;
  position: absolute; left: -10px; top: 100%; z-index: 50;
  min-width: 248px;
  background: var(--ivory);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 160ms ease 220ms, transform 160ms ease 220ms, visibility 0s linear 380ms;
}
.nav li.has-kids:hover .kids,
.nav li.has-kids:focus-within .kids {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition-delay: 0s, 0s, 0s;
}
.nav .kids li a {
  display: block; padding: 7px 16px 7px 18px;
  color: var(--ink); text-decoration: none;
  font-size: 0.82rem; letter-spacing: 0.02em;
  border-left: 3px solid transparent;
}
.nav .kids li a:hover { background: rgba(200, 50, 74, 0.10); border-left-color: var(--crimson); color: var(--crimson-deep); }
.nav .cta {
  display: inline-block; padding: 9px 15px;
  border: 1px solid var(--gold); color: var(--gold);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}
.nav .cta:hover { background: var(--gold); color: var(--ink); }

/* ---------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
  background: linear-gradient(180deg, #08202a 0%, var(--abyss) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--hero) center 38% / cover no-repeat;
  opacity: 0.42; filter: saturate(0.8) contrast(1.02);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(115deg, rgba(232, 224, 205, 0.05) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, rgba(5, 21, 26, 0.35) 0%, rgba(5, 21, 26, 0.86) 100%);
}
.hero-in {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 38px; align-items: center;
  padding: 40px 0 38px;
}
.hero-copy { min-width: 0; }
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 4px 10px;
  border: 1px solid var(--crimson);
  color: var(--gold);
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  transform: rotate(-1.2deg);
  background: rgba(200, 50, 74, 0.08);
}
.hero h1 {
  margin: 0 0 16px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.8rem, 3.1vw, 2.62rem);
  line-height: 1.08; letter-spacing: -0.005em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
.lead { margin: 0 0 18px; font-size: 0.99rem; line-height: 1.6; color: #d8cfb9; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn {
  display: inline-block; padding: 11px 20px;
  background: var(--crimson); color: #fff5ea;
  border: 1px solid #e0556c;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}
.btn:hover { background: #d93d57; color: #fff; }
.btn.ghost { background: transparent; color: var(--ivory); border: 1px solid rgba(232, 224, 205, 0.55); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(201, 162, 39, 0.08); }
.hero-shot { margin: 0; }
.hero-shot img {
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid rgba(201, 162, 39, 0.5);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55);
  background: #041215;
}

/* ---------------------------------------------------------- facts strip */
.facts-strip { background: var(--deep); border-bottom: 1px solid rgba(46, 111, 106, 0.4); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(46, 111, 106, 0.28); }
.fact { background: var(--deep); padding: 15px 16px 14px; display: flex; flex-direction: column; gap: 3px; }
.fact-k { font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sea); }
.fact-v { font-family: var(--display); font-size: 1.02rem; color: var(--ivory); line-height: 1.3; }

/* ---------------------------------------------------------- section heads */
.section-head { margin: 44px 0 18px; }
.section-head h2 {
  margin: 6px 0 0; font-family: var(--display); font-weight: 400;
  font-size: 1.62rem; letter-spacing: 0.005em;
  display: flex; align-items: baseline; gap: 12px;
}
.overline {
  display: inline-block;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.55);
  padding: 3px 9px;
  transform: rotate(-1.2deg);
}
.count-pill {
  font-family: var(--font); font-size: 0.66rem; font-weight: 700;
  color: var(--abyss); background: var(--gold);
  border-radius: 999px; padding: 2px 8px; letter-spacing: 0.06em;
}

/* ---------------------------------------------------------- cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 24px; margin: 0 0 12px; }
.card {
  display: flex; flex-direction: column;
  background: var(--ivory); color: var(--ink);
  border: 2px solid var(--ink);
  border-top: 4px solid var(--crimson);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.6);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 rgba(200, 50, 74, 0.45); color: var(--ink); }
.thumb {
  position: relative; display: block;
  aspect-ratio: 16 / 9; overflow: hidden;
  background: #061a1e;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pill-tag {
  position: absolute; right: 10px; top: 10px;
  background: var(--crimson); color: #fff4ea;
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid rgba(5, 21, 26, 0.5);
  transform: rotate(-2deg);
}
.card-body { border-top: 2px solid var(--ink); padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-body h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.1rem; line-height: 1.25; color: var(--ink); }
.card-body p { margin: 0; font-size: 0.86rem; line-height: 1.55; color: #3a4a45; }
.go { margin-top: auto; padding-top: 8px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--crimson-deep); }
.stamp { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: #6d7a72; }
.grid-title { margin-bottom: 0; }
.card.sm { flex: 1 1 200px; }

/* ---------------------------------------------------------- article */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 46px; align-items: start; padding: 34px 0 56px; }
.crumb { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.crumb a { color: var(--sea); text-decoration: none; }
.crumb a:hover { color: var(--gold); }
.crumb .sep { color: rgba(201, 162, 39, 0.5); padding: 0 3px; }
.crumb .here { color: var(--ivory-dim); }

article h1 {
  margin: 0 0 20px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.72rem, 3.1vw, 2.5rem);
  line-height: 1.1;
}
article h2 {
  margin: 42px 0 14px; padding-top: 13px;
  border-top: 2px solid var(--crimson);
  position: relative;
  font-family: var(--display); font-weight: 400;
  font-size: 1.42rem; line-height: 1.24;
}
article h2::after {
  content: ""; display: block; position: absolute;
  left: 0; right: 0; top: 4px; height: 1px;
  background: rgba(46, 111, 106, 0.85);
}
article h3 { margin: 28px 0 10px; font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--gold); }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 18px; padding-left: 22px; }
article li { margin: 0 0 8px; }
article li::marker { color: var(--crimson); }
article strong { color: #f4ecdb; }
article code { font-size: 0.88em; padding: 1px 5px; background: rgba(46, 111, 106, 0.22); border: 1px solid rgba(46, 111, 106, 0.4); color: #d9f2ee; }
article blockquote {
  margin: 22px 0; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--crimson);
  color: #ddd3bd; font-style: italic;
  font-family: var(--display); font-size: 1.04rem;
}
article img.zoom {
  width: 100%; height: auto; margin: 24px 0 6px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  cursor: zoom-in; background: #041215;
}
article img.zoom.open { cursor: zoom-out; border-color: var(--gold); }

.tbl-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid rgba(46, 111, 106, 0.55); }
.tbl-wrap table { min-width: 0; }
article table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
article th {
  background: var(--panel-2); color: var(--gold);
  text-align: left; padding: 9px 12px;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  border-bottom: 1px solid rgba(201, 162, 39, 0.4);
  white-space: nowrap;
}
article td { padding: 8px 12px; border-bottom: 1px solid rgba(46, 111, 106, 0.28); vertical-align: top; }
article tbody tr:nth-child(even) { background: rgba(46, 111, 106, 0.07); }
article tbody tr:hover { background: rgba(200, 50, 74, 0.07); }
article table strong, article table b { color: inherit; }

.callout { margin: 22px 0; padding: 15px 17px; border: 1px solid rgba(201, 162, 39, 0.45); background: rgba(13, 42, 46, 0.85); border-left: 3px solid var(--gold); }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--crimson); background: rgba(141, 32, 54, 0.16); }
.callout.note {
  background: var(--ivory); color: var(--ink);
  border: 2px solid var(--ink); border-left: 5px solid var(--crimson);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.5);
}
.callout.note strong { color: var(--crimson-deep); }
.callout.note a { color: var(--crimson-deep); }

.quick-answer {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 0 0 26px; padding: 15px 17px;
  background: var(--ivory); color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}
.quick-answer p { margin: 0; font-size: 0.95rem; line-height: 1.6; }
.qa-stamp {
  flex: 0 0 auto; margin-top: 2px; white-space: nowrap;
  font-size: 0.56rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ivory); background: var(--crimson);
  padding: 4px 8px; transform: rotate(-1.6deg);
}

.toc { position: sticky; top: 92px; border-left: 1px solid rgba(46, 111, 106, 0.5); padding-left: 16px; }
.toc .overline { margin-bottom: 12px; transform: none; }
.toc-list { display: flex; flex-direction: column; gap: 8px; }
.toc-list a { font-size: 0.78rem; line-height: 1.4; color: var(--ivory-dim); text-decoration: none; border-bottom: 1px solid transparent; }
.toc-list a:hover { color: var(--gold); border-bottom-color: rgba(201, 162, 39, 0.4); }

.more-guides { margin: 48px 0 0; padding-top: 18px; border-top: 2px solid rgba(46, 111, 106, 0.6); }
.more-guides h2 { margin: 0 0 10px; padding: 0; border: 0; font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--gold); }
.more-guides h2::after { display: none; }
.linklist { margin: 0; font-size: 0.84rem; line-height: 2; }
.linklist a { color: var(--ivory-dim); text-decoration: none; border-bottom: 1px dotted rgba(201, 162, 39, 0.5); }
.linklist a:hover { color: var(--gold); }

/* ---------------------------------------------------------- footer */
.foot {
  margin-top: 20px;
  border-top: 1px solid rgba(201, 162, 39, 0.4);
  background:
    repeating-linear-gradient(115deg, rgba(232, 224, 205, 0.03) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #07191d 0%, #030c0f 100%);
  padding: 30px 0 34px;
  font-size: 0.8rem; color: var(--muted);
}
.disclaimer { margin: 0 0 12px; max-width: 76ch; line-height: 1.6; }
.foot-links { margin: 0 0 10px; letter-spacing: 0.06em; }
.foot-links a { color: var(--ivory-dim); text-decoration: none; }
.foot-links a:hover { color: var(--gold); }
.muted { margin: 0; color: #6b807e; font-size: 0.74rem; letter-spacing: 0.06em; }

/* ---------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(3, 12, 15, 0.94);
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(1500px, 96vw); max-height: 92vh; width: auto; height: auto;
  border: 1px solid rgba(201, 162, 39, 0.6);
  box-shadow: 0 0 0 6px rgba(5, 21, 26, 0.9);
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .brand span { max-width: 11em; font-size: 0.8rem; }
}

@media (max-width: 820px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 0 26px; }
  .hero-shot { order: -1; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .bar { flex-wrap: wrap; gap: 6px 14px; padding: 10px 0; }
  .brand { flex: 1 1 auto; }
  .brand span { max-width: none; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  .nav > ul { flex-wrap: nowrap; gap: 2px; }
  .nav > ul > li > a { padding: 8px 9px; font-size: 0.7rem; white-space: nowrap; }
  .nav .kids { left: 0; min-width: 220px; }
  .nav .cta { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 28px, var(--wrap)); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .facts { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .lead { font-size: 0.94rem; margin-bottom: 14px; }
  .hero-cta { gap: 9px; }
  .btn { padding: 10px 15px; font-size: 0.72rem; }
  .quick-answer { flex-direction: column; gap: 8px; }
  .brand span { font-size: 0.72rem; line-height: 1.15; }
  .brand img { width: 28px; height: 28px; }
  .lightbox { padding: 10px; }
}
