/* ============================================================
   GRAIN ROT Guide — Standard Website Theme
   Top-nav layout, page-hero bands, game artwork, dark ember palette.
   ============================================================ */

:root {
  --bg: #131009;
  --bg-2: #1a150d;
  --panel: #201a11;
  --panel-2: #292115;
  --line: #3d3120;
  --line-soft: #2c2417;
  --text: #efe4cf;
  --muted: #b6a686;
  --faint: #8b7c60;
  --ember: #ff7a2f;
  --ember-deep: #d14f12;
  --amber: #ffb347;
  --gold: #e8c15a;
  --rot: #9bc53d;
  --blood: #e5484d;
  --radius: 12px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(255, 122, 47, 0.07), transparent 60%),
    radial-gradient(800px 380px at 5% -10%, rgba(209, 79, 18, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.66;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--ember); }
img { max-width: 100%; height: auto; }

/* ============ Header / Top Navigation ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 15, 9, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-logo { width: 38px; height: 38px; display: block; }
.brand-text {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  line-height: 1.05;
  display: flex;
  flex-direction: column;
}
.brand-text em {
  font-style: normal;
  font-size: 0.62rem;
  color: var(--ember);
  letter-spacing: 0.34em;
  font-weight: 700;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nav-burger {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.main-nav { margin-left: auto; }
.main-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.main-nav li { position: relative; }
.main-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
}
.main-nav > ul > li > a:hover {
  color: var(--amber);
  background: rgba(255, 122, 47, 0.1);
}
.main-nav li.current > a {
  color: var(--amber);
  background: rgba(255, 122, 47, 0.14);
}
.has-sub > a::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}

.sub {
  list-style: none;
  margin: 0;
  padding: 0.45rem;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.has-sub:hover .sub,
.has-sub:focus-within .sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sub li a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}
.sub li a:hover {
  background: rgba(255, 122, 47, 0.12);
  color: var(--amber);
}
.sub li a.active {
  color: var(--amber);
  font-weight: 700;
  background: rgba(255, 122, 47, 0.1);
  border-left: 3px solid var(--ember);
}

/* ============ Page Hero (subpages) ============ */

.page-hero {
  background:
    radial-gradient(700px 260px at 90% 0%, rgba(255, 122, 47, 0.14), transparent 65%),
    linear-gradient(160deg, #251c10 0%, #16110a 75%);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(19, 16, 9, 0.7));
  pointer-events: none;
}
.ph-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem 1.25rem 2.1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr);
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.ph-art img {
  display: block;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--faint);
  margin-bottom: 0.8rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb .sep { margin: 0 0.4rem; color: var(--line); }
.breadcrumb .current { color: var(--amber); }

.page-hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 0.7rem;
  color: #fff;
}
.page-hero h1 .kw { color: var(--ember); text-shadow: 0 0 18px rgba(255, 122, 47, 0.45); }

.lede {
  color: var(--muted);
  font-size: 1.03rem;
  margin: 0 0 0.9rem;
  max-width: 44rem;
}

.updated {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--faint);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  background: rgba(26, 21, 13, 0.7);
}

/* ============ Home Hero ============ */

.home-hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(170deg, #281d0f 0%, #171208 70%);
  overflow: hidden;
}
.hh-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.2rem 1.25rem 2.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 2.4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hh-eyebrow {
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.home-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  margin: 0.4rem 0 0.8rem;
  line-height: 1.1;
  color: #fff;
}
.home-hero h1 .kw { color: var(--ember); text-shadow: 0 0 24px rgba(255, 122, 47, 0.5); }
.home-hero .hh-sub { color: var(--muted); font-size: 1.06rem; max-width: 36rem; }
.hh-art img {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
}
.hh-cta { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.3rem; }
.btn {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid var(--ember);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  color: #fff;
}
.btn-ghost { color: var(--amber); background: rgba(255, 122, 47, 0.08); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(209, 79, 18, 0.35); color: #fff; }
.btn-ghost:hover { color: var(--amber); }

.fact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
  margin-top: 1.6rem;
}
.fact {
  background: rgba(20, 15, 9, 0.66);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 0.55rem 0.8rem;
}
.fact .k { display: block; font-size: 0.66rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.12em; }
.fact .v { display: block; font-weight: 700; color: var(--text); font-size: 0.94rem; }

/* ============ Main content ============ */

.page-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.2rem 1.25rem 3rem;
}
.page-main.wide { max-width: var(--maxw); }

.article h2 {
  font-size: 1.4rem;
  color: var(--amber);
  margin: 2.3rem 0 0.8rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--ember);
  line-height: 1.3;
}
.article h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 1.7rem 0 0.5rem;
}
.article h3 .tick { color: var(--ember); margin-right: 0.35rem; }
.article p { margin: 0.75rem 0; }
.article ul, .article ol { margin: 0.65rem 0; padding-left: 1.4rem; }
.article li { margin: 0.4rem 0; }
.article li > ul { margin: 0.25rem 0; }
.article strong { color: #fff; }
.article em { color: var(--gold); font-style: normal; }

/* ============ Tables ============ */

.table-wrap { overflow-x: auto; margin: 1.1rem 0; border-radius: 10px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
}
th, td {
  text-align: left;
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  background: var(--panel-2);
  color: var(--amber);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 179, 71, 0.05); }

.tier {
  display: inline-block;
  min-width: 1.7rem;
  text-align: center;
  font-weight: 800;
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
  color: #14110c;
}
.tier-s { background: linear-gradient(135deg, #ff7a2f, #e5484d); color: #fff; }
.tier-a { background: var(--amber); }
.tier-b { background: #9bc53d; }
.tier-c { background: #8a7c63; color: #14110c; }

/* ============ Callout boxes ============ */

.box {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ember);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  margin: 1.2rem 0;
}
.box .box-title {
  display: block;
  color: var(--ember);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box.warn { border-left-color: var(--blood); }
.box.warn .box-title { color: var(--blood); }
.box.tip { border-left-color: var(--rot); }
.box.tip .box-title { color: var(--rot); }
.box.gold { border-left-color: var(--gold); }
.box.gold .box-title { color: var(--gold); }

/* ============ Cards ============ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
  margin: 1.1rem 0;
}
.card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--text);
}
.card:hover {
  border-color: var(--ember);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
.card .card-kicker {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.card .card-title {
  display: block;
  color: var(--amber);
  font-weight: 700;
  margin: 0.18rem 0 0.32rem;
}
.card .card-desc {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ============ Figure rows (icon galleries) ============ */

.fig-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1.4rem 0;
  padding: 1.2rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.fig-row .fig { text-align: center; width: 108px; }
.fig-row .fig img {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 0.45rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}
.fig-row .fig figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.fig-row .fig-arrow {
  align-self: center;
  color: var(--ember);
  font-size: 1.3rem;
  font-weight: 800;
}

/* ============ Real screenshots ============ */

figure.shot {
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
figure.shot img {
  display: block;
  width: 100%;
  transition: transform 0.3s ease;
}
figure.shot:hover img { transform: scale(1.02); }
figure.shot figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}
figure.shot figcaption::before { content: "📷 "; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0;
}
.gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery figure:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.gallery figure img { display: block; width: 100%; }
.gallery figure figcaption {
  padding: 0.5rem 0.8rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}

/* ============ FAQ ============ */

.faq-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg-2);
  margin: 0.65rem 0;
  padding: 0.85rem 1.15rem;
}
.faq-item h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--amber); }
.faq-item p { margin: 0.25rem 0; color: var(--muted); font-size: 0.93rem; }

/* ============ Related links ============ */

.related {
  margin-top: 2rem;
  background: linear-gradient(160deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
}
.related .related-title {
  color: var(--ember);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
}
.related li { margin: 0; font-size: 0.92rem; }
.related li a::before { content: "› "; color: var(--ember); }

/* ============ Footer ============ */

.site-footer {
  border-top: 1px solid var(--line);
  background: #100d07;
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.4rem 1.25rem 1.4rem;
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 1.6rem;
}
.f-col h4 {
  color: var(--amber);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.f-col ul { list-style: none; margin: 0; padding: 0; }
.f-col li { margin: 0.28rem 0; }
.f-col li a { color: var(--muted); font-size: 0.85rem; }
.f-col li a:hover { color: var(--amber); }
.f-brand .brand { margin-bottom: 0.7rem; }
.f-brand p { color: var(--faint); font-size: 0.8rem; margin: 0.35rem 0; max-width: 30rem; }
.footer-bar {
  border-top: 1px solid var(--line-soft);
  padding: 1rem 1.25rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
}

/* ============ Ember particles ============ */

.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.embers i {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ember);
  opacity: 0;
  animation: rise 7s linear infinite;
}
.embers i:nth-child(1) { left: 12%; animation-delay: 0s; }
.embers i:nth-child(2) { left: 28%; animation-delay: 1.8s; width: 3px; height: 3px; }
.embers i:nth-child(3) { left: 47%; animation-delay: 3.4s; }
.embers i:nth-child(4) { left: 63%; animation-delay: 0.9s; width: 5px; height: 5px; }
.embers i:nth-child(5) { left: 81%; animation-delay: 2.6s; width: 3px; height: 3px; }
.embers i:nth-child(6) { left: 92%; animation-delay: 4.5s; }
@keyframes rise {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 0.85; }
  100% { transform: translateY(-300px) translateX(30px) scale(0.4); opacity: 0; }
}

/* ============ Responsive ============ */

@media (max-width: 1020px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .f-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .ph-inner, .hh-inner { grid-template-columns: 1fr; gap: 1.4rem; }
  .ph-art img { margin: 0 auto; max-width: 340px; }

  .nav-burger { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: rgba(20, 15, 9, 0.98);
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 0.6rem 1.25rem 1.2rem;
  }
  .nav-toggle:checked ~ .main-nav { display: block; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .main-nav > ul > li > a { padding: 0.6rem 0.7rem; font-size: 1rem; }
  .has-sub > a::after { display: none; }
  .sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin: 0.1rem 0 0.5rem 0.8rem;
    padding: 0 0 0 0.7rem;
    background: transparent;
    min-width: 0;
  }
}
