:root {
  --bg: #faf6ec;
  --paper: #ffffff;
  --paper-2: #fbf8ee;
  --ink: #1a2421;
  --ink-soft: #3f4e47;
  --muted: #6c7a73;
  --line: #e2dccd;
  --line-2: #efe9d8;
  --forest: #244e36;
  --forest-deep: #173225;
  --forest-soft: #e1ecdf;
  --slate: #44546a;
  --slate-soft: #e6eaf0;
  --amber: #d99a3b;
  --amber-soft: #fbecc8;
  --easy: #3b8a4e;
  --moderate: #c97a16;
  --hard: #b94a2c;
  --expert: #7a1f1f;
  --serif: 'Roboto Slab', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 2px rgba(23, 50, 37, .04), 0 1px 1px rgba(23, 50, 37, .03);
  --shadow-md: 0 6px 18px rgba(23, 50, 37, .08), 0 2px 4px rgba(23, 50, 37, .04);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(36, 78, 54, .35); transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--forest-deep); text-decoration-color: var(--forest); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); letter-spacing: -0.015em; color: var(--ink); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.skip-link { position: absolute; top: -40px; left: 0; background: var(--forest); color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { top: 0; }

/* Header */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(6px);
  background: rgba(255, 255, 255, .92);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; }
.brand-name { font-family: var(--serif); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand:hover .brand-name { color: var(--forest); }

.search { display: flex; gap: 8px; flex: 1; max-width: 480px; }
.search input[type=search] {
  flex: 1; min-width: 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.search input[type=search]:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
.search button {
  background: var(--forest); color: #fff; border: 0; padding: 10px 18px;
  border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; letter-spacing: -.005em;
  transition: background .15s;
}
.search button:hover { background: var(--forest-deep); }
.search.big { max-width: 720px; margin: 22px 0; }
.search.big input[type=search] { padding: 16px 18px; font-size: 17px; }
.search.big button { padding: 16px 24px; font-size: 16px; }

.subnav { background: var(--paper-2); border-bottom: 1px solid var(--line-2); }
.subnav-inner { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 11px 24px; font-size: 14px; }
.subnav a { color: var(--ink-soft); text-decoration: none; display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.subnav a:hover { color: var(--forest-deep); }
.subnav-divider { width: 1px; height: 16px; background: var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-easy { background: var(--easy); }
.dot-mod { background: var(--moderate); }
.dot-hard { background: var(--hard); }
.dot-exp { background: var(--expert); }

.main { padding: 32px 24px 56px; }

/* Hero */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 32px;
  margin-bottom: 32px; box-shadow: var(--shadow-md); overflow: hidden;
}
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); line-height: 1.04; margin: 0 0 14px; letter-spacing: -0.025em; font-weight: 800; }
.hero h1 .accent { color: var(--forest); }
.hero .lead { font-size: 18px; color: var(--ink-soft); margin: 0 0 16px; max-width: 56ch; }
.hero-meta { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.hero-image { position: relative; }
.hero-image img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; box-shadow: var(--shadow-md); }
.hero-image::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: 12px;
  background: linear-gradient(180deg, transparent 50%, rgba(23, 50, 37, .35) 100%);
}
.hero-badge {
  position: absolute; left: 24px; bottom: 24px; color: #fff;
  background: rgba(23, 50, 37, .82); padding: 8px 14px; border-radius: 6px;
  font-size: 13px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Sections */
.section-title { font-family: var(--serif); font-size: 26px; margin: 32px 0 16px; letter-spacing: -0.015em; font-weight: 700; }
.section-title::before { content: ""; display: inline-block; width: 22px; height: 3px; background: var(--amber); margin-right: 10px; vertical-align: middle; border-radius: 2px; }
.grid { margin-bottom: 32px; }

/* Cards */
.cards { display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .12s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: var(--forest); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { margin: 0 0 6px; font-size: 17px; font-family: var(--serif); font-weight: 700; }
.muted { color: var(--muted); font-size: 13.5px; }

.diff-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.diff-card .big-num { font-family: var(--serif); font-size: 36px; line-height: 1; font-weight: 800; color: var(--ink); margin-top: 4px; }

/* Difficulty pills */
.diff-pill {
  display: inline-block; color: #fff; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  font-family: var(--sans);
}
.diff-easy { background: var(--easy); }
.diff-moderate { background: var(--moderate); }
.diff-hard { background: var(--hard); }
.diff-expert { background: var(--expert); }

/* State cloud */
.state-cloud { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0; }
.state-cloud a {
  background: var(--paper); border: 1px solid var(--line); padding: 8px 12px; border-radius: 6px;
  text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.state-cloud a:hover { border-color: var(--forest); background: var(--forest-soft); color: var(--forest-deep); }

/* Alpha strip */
.alpha-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.alpha-strip a {
  display: inline-block; padding: 7px 11px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 6px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px;
}
.alpha-strip a.current, .alpha-strip a:hover { background: var(--forest); color: #fff; border-color: var(--forest); }

/* Trail page */
.breadcrumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.page-header { margin: 0 0 26px; }
.page-header h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 38px); margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 800; }
.kicker { color: var(--slate); font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px; }
.kicker a { color: var(--slate); text-decoration: none; }
.kicker a:hover { color: var(--forest); }

.trail-header h1 { font-family: var(--serif); font-size: clamp(32px, 5vw, 44px); margin: 0 0 10px; letter-spacing: -0.025em; font-weight: 800; }
.trail-sub { color: var(--ink-soft); margin: 0 0 20px; font-size: 16.5px; max-width: 70ch; }
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 28px; box-shadow: var(--shadow-sm);
}
.stat { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.stat-num { font-family: var(--serif); font-size: 22px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.trail-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; }
.prose { font-size: 17px; max-width: 70ch; line-height: 1.72; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose .prose-h { font-family: var(--serif); font-size: 22px; margin: 32px 0 12px; font-weight: 700; letter-spacing: -.015em; }
.prose .prose-h:first-child { margin-top: 0; }
.prose a { color: var(--forest); }
.inline-resource { color: var(--slate); font-style: italic; font-size: 14.5px; }

.sidebar {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; align-self: start; box-shadow: var(--shadow-sm); position: sticky; top: 96px;
}
.sidebar h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 18px; font-weight: 700; }
.sidebar dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0 0 18px; }
.sidebar dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.sidebar dd { margin: 0; font-size: 14.5px; }

/* Table */
.trail-table {
  width: 100%; border-collapse: collapse; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.trail-table th, .trail-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.trail-table th { background: var(--paper-2); font-weight: 600; color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.trail-table tr:last-child td { border-bottom: 0; }
.trail-table tbody tr:hover { background: var(--paper-2); }

.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.result-list li:last-child { border-bottom: 0; }

.about-strip { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 26px; margin: 32px 0 12px; box-shadow: var(--shadow-sm); }
.more { font-weight: 600; }

/* Resources strip (PBN slot host) */
.resources-strip {
  background: var(--slate-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 56px;
}
.resources-strip h2 {
  font-family: var(--serif); font-size: 22px; margin: 0 0 6px;
  font-weight: 700; color: var(--ink);
}
.resources-strip h2::before { content: ""; display: inline-block; width: 22px; height: 3px; background: var(--amber); margin-right: 10px; vertical-align: middle; border-radius: 2px; }
.resources-list {
  list-style: none; padding: 0; margin: 18px 0 0;
  columns: 2; column-gap: 36px;
}
.resources-list li { break-inside: avoid; padding: 8px 0; font-size: 14.5px; }
.resources-list a { font-weight: 600; color: var(--forest-deep); }

/* Footer */
.site-footer { background: var(--forest-deep); color: #d3dcd5; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 40px 24px; }
.footer-inner strong { color: #fff; display: block; margin-bottom: 10px; font-family: var(--serif); font-size: 16px; }
.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner ul li { padding: 4px 0; }
.footer-inner a { color: #c5d2c8; text-decoration: none; font-size: 14.5px; }
.footer-inner a:hover { color: #fff; text-decoration: underline; }
.footer-inner p { margin: 0; font-size: 14px; color: #a8b6ac; max-width: 42ch; }
.footer-bottom { border-top: 1px solid #2c3a32; padding: 16px 24px; color: #a8b6ac; font-size: 13px; }

/* Responsive */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .cards.three, .cards.four { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .trail-body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .resources-list { columns: 1; }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .header-inner { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 18px; }
  .subnav-inner { padding: 10px 18px; gap: 12px; font-size: 13px; }
  .subnav-divider { display: none; }
  .cards.three, .cards.four { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 28px 18px; }
  .hero h1 { font-size: 32px; }
  .stat-row { padding: 14px; }
  .stat-num { font-size: 18px; }
  .trail-table th, .trail-table td { padding: 10px 12px; font-size: 13.5px; }
}
