:root {
  --felt: #0d2818;
  --felt-2: #143525;
  --gold: #c9a227;
  --gold-ink: #3d2f0a;
  --cream: #f7f1e6;
  --cream-2: #efe6d4;
  --ink: #12110f;
  --muted: #5a5348;
  --rose: #8b2942;
  --rose-soft: #f6e8ec;
  --line: rgba(18, 17, 15, 0.12);
  --ok: #2f6b54;
  --radius: 4px;
  --shell: min(1120px, calc(100% - 2.25rem));
  --display: "Archivo Black", "Arial Black", sans-serif;
  --sans: "Libre Franklin", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.app {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 85% -8%, rgba(201, 162, 39, 0.12), transparent 55%),
    radial-gradient(700px 360px at 0% 20%, rgba(13, 40, 24, 0.06), transparent 50%),
    linear-gradient(180deg, #f3ebdc 0%, var(--cream) 32%, #faf6ee 100%);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: #6b4810; text-underline-offset: 0.14em; }
a:hover { color: var(--felt); }
h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.08;
  margin: 0 0 0.45rem;
  letter-spacing: 0.01em;
  font-weight: 400;
}
p { margin: 0 0 1rem; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold-ink);
  margin: 0 0 .35rem;
}
.lead { font-size: 1.08rem; color: var(--muted); max-width: 40rem; margin-bottom: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; margin: .15rem 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: .68rem 1.05rem;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .03em;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: inherit;
}
.btn-primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn-primary:hover { filter: brightness(1.06); color: var(--gold-ink); }
.btn-ghost { background: transparent; border-color: rgba(247, 241, 230, .45); color: var(--cream); }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.btn-steel { background: var(--felt); color: var(--cream); border-color: var(--felt); }
.btn-steel:hover { background: var(--felt-2); color: var(--cream); }
.btn-rose { background: var(--rose); color: #fff; border-color: var(--rose); }
.btn-rose:hover { filter: brightness(1.05); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.15rem 0 0; }

/* Felt header — not cream sticky Occassional, not Gabapentin rail, not Hangar stripe */
.top {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201, 162, 39, 0.14), transparent 45%),
    linear-gradient(180deg, #102c1c 0%, var(--felt) 55%, #0a1f13 100%);
  color: var(--cream);
  border-bottom: 3px solid var(--gold);
  box-shadow: inset 0 -1px 0 rgba(201, 162, 39, 0.35);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .95rem 0 .75rem;
}
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark img { height: 42px; width: auto; }
.menu-btn {
  display: none;
  margin-left: auto;
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(247, 241, 230, .35);
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .45rem .7rem;
  cursor: pointer;
  border-radius: var(--radius);
}
.top-search {
  margin-left: auto;
  display: flex;
  gap: .35rem;
}
.top-search input {
  width: min(240px, 36vw);
  border: 1px solid rgba(247, 241, 230, .25);
  background: rgba(0, 0, 0, .28);
  color: var(--cream);
  padding: .45rem .6rem;
  font: inherit;
  border-radius: var(--radius);
}
.top-search button {
  border: 0;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .45rem .7rem;
  cursor: pointer;
  border-radius: var(--radius);
}
.bay {
  background: rgba(0, 0, 0, .22);
  border-top: 1px solid rgba(201, 162, 39, .22);
}
.bay-inner {
  display: flex;
  flex-wrap: nowrap;
  gap: .15rem .95rem;
  padding: .55rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.bay a {
  flex: 0 0 auto;
  color: #d8cfc0;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .82rem;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.bay a:hover, .bay a.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.mast {
  position: relative;
  color: #fff;
  min-height: min(74vh, 640px);
  display: grid;
  align-items: end;
  background: #07140e;
  overflow: hidden;
}
.mast-photo {
  position: absolute;
  inset: 0;
  margin: 0;
}
.mast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
}
.mast::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 20, 14, .15) 0%, rgba(7, 20, 14, .55) 45%, rgba(7, 20, 14, .88) 100%);
  pointer-events: none;
}
.mast-inner {
  position: relative;
  z-index: 1;
  padding: 3.6rem 0 2.9rem;
  max-width: 42rem;
}
.mast-domain {
  font-family: var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .4rem;
  font-weight: 700;
  font-size: .82rem;
}
.mast h1 {
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .5);
}
.mast .lead { color: #f0e8d8; }

.section { padding: 2.4rem 0; }
.section-tight { padding: 1.4rem 0; }
.page-intro { padding: 2rem 0 0.6rem; }
.page-intro h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
.band-head { margin-bottom: 1.1rem; }
.band-head p { color: var(--muted); margin: 0; max-width: 40rem; }

.bound {
  border: 1px solid rgba(139, 41, 66, .28);
  background: var(--rose-soft);
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
}
.bound-label {
  font-family: var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 800;
  font-size: .78rem;
  margin: 0 0 .35rem;
}
.bound-body { margin: 0; color: #4a2832; }
.disclaimer {
  border: 1px dashed rgba(13, 40, 24, .25);
  background: rgba(13, 40, 24, .04);
  padding: .85rem 1rem;
  border-radius: var(--radius);
  font-size: .95rem;
  color: var(--muted);
}

.bay-cards {
  list-style: none;
  margin: 0;
  padding: 0 0 .4rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: .9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.bay-card {
  display: grid;
  grid-template-rows: 148px auto;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.bay-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 162, 39, .55);
  box-shadow: 0 10px 24px rgba(13, 40, 24, .1);
  color: inherit;
}
.bay-card img {
  width: 100%;
  height: 148px;
  object-fit: cover;
}
.bay-card-body { padding: .9rem .95rem 1.05rem; }
.bay-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: .02em;
  margin-bottom: .3rem;
}
.bay-card em {
  font-style: normal;
  color: var(--muted);
  font-size: .94rem;
}

.hero-band {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.6rem 0 0.4rem;
}
.hero-band img {
  width: 100%;
  height: min(280px, 40vw);
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.list-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .7rem;
}
.list-cards a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .8rem;
  align-items: start;
  text-decoration: none;
  color: inherit;
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: .9rem 1rem;
  border-radius: var(--radius);
}
.list-cards a:hover {
  border-color: rgba(201, 162, 39, .55);
  color: inherit;
}
.list-num {
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.15rem;
  min-width: 1.6rem;
}
.list-cards strong {
  display: block;
  font-family: var(--display);
  letter-spacing: .01em;
  font-size: 1.12rem;
}
.list-cards em { font-style: normal; color: var(--muted); }
.list-go {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--felt);
  font-weight: 700;
  font-size: .78rem;
}

.article { max-width: 720px; }
.article .sections { display: grid; gap: 1.2rem; }
.article h2 { font-size: 1.4rem; margin-top: .4rem; }
.takeaways, .tips {
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  margin: 1.2rem 0;
  border-radius: var(--radius);
}
.takeaways { border-left: 3px solid var(--gold); }
.tips { border-left: 3px solid var(--felt); }
.takeaways h2, .tips h2 { font-size: 1.15rem; }
.takeaways ul, .tips ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
  border: 1px solid var(--line);
  font-size: .95rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.ref-table th, .ref-table td {
  border-bottom: 1px solid var(--line);
  padding: .75rem .8rem;
  text-align: left;
  vertical-align: top;
}
.ref-table th {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--felt);
  color: var(--cream);
  font-size: .78rem;
}
.ref-cards { display: grid; gap: 1rem; }
.ref-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
}
.ref-card h2 { font-size: 1.35rem; }
.ref-meta { color: var(--muted); margin: 0 0 .6rem; }

.tool-panel, .converter, .journal-tool, .squares-tool, .kit-tool,
.matcher-form, .trip-form, .search-form, .kit-form {
  display: grid;
  gap: .7rem;
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: 1rem 1.15rem;
  margin-bottom: 1.2rem;
  border-radius: var(--radius);
}
label { font-weight: 600; }
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: .55rem .65rem;
  font: inherit;
  border-radius: var(--radius);
}
.converter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.converter-out {
  background: rgba(13, 40, 24, .06);
  border: 1px solid var(--line);
  padding: .85rem 1rem;
  border-radius: var(--radius);
}
.converter-examples {
  display: grid;
  gap: .55rem;
}
.converter-examples button {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.converter-examples button:hover { border-color: var(--gold); }

.kit-group, .trip-group {
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
  border-radius: var(--radius);
}
.kit-group h2, .trip-group h2 { font-size: 1.2rem; }
.kit-item, .trip-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .55rem .7rem;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--line);
}
.kit-item:last-child, .trip-item:last-child { border-bottom: 0; }
.kit-notes textarea, .trip-notes textarea { min-height: 110px; }

.squares-board {
  display: grid;
  grid-template-columns: auto repeat(10, minmax(28px, 1fr));
  gap: 2px;
  overflow-x: auto;
  font-size: .72rem;
}
.squares-board .axis,
.squares-board .cell {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 2px;
}
.squares-board .axis {
  background: var(--felt);
  color: var(--cream);
  font-weight: 700;
  min-width: 36px;
}
.squares-board .cell input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  padding: .2rem;
  font-size: .68rem;
}
.squares-board .cell.is-winner {
  outline: 2px solid var(--gold);
  background: #fff8e6;
}
.squares-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.journal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.journal-form .span-2 { grid-column: 1 / -1; }
.journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .65rem;
}
.journal-list li {
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: .85rem 1rem;
  border-radius: var(--radius);
}
.journal-list .meta { color: var(--muted); font-size: .9rem; margin: 0 0 .35rem; }

.notice {
  background: #e8f3ec;
  border: 1px solid rgba(47, 107, 84, .25);
  color: #214a3a;
  padding: .75rem .9rem;
  border-radius: var(--radius);
}
.verdict {
  display: inline-block;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  padding: .22rem .55rem;
  background: var(--gold-ink);
  color: var(--cream);
  font-size: .78rem;
  border-radius: 2px;
}
.verdict.mixed { background: #5c5348; }
.verdict.mostly_false { background: var(--rose); }
.verdict.context { background: var(--ok); }

.start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.panel {
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
}
.panel-accent {
  border-color: rgba(201, 162, 39, .45);
  background: #fff8ea;
}
.start-list { margin: .4rem 0 0; padding-left: 1.1rem; }
.start-list li { margin: .35rem 0; }

.ad-slot { margin: 1rem auto; }
.footer {
  margin-top: 2rem;
  background: var(--felt);
  color: #d8cfc0;
  padding: 2.1rem 0 1.2rem;
  border-top: 3px solid var(--gold);
}
.footer a {
  color: #f0e0c4;
  text-decoration: none;
  display: block;
  margin: .25rem 0;
}
.footer a:hover { color: var(--gold); }
.footer h2 {
  color: var(--gold);
  font-size: .95rem;
  margin-bottom: .5rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 1.2rem;
}
.footer-note { color: #9a8f80; font-size: .9rem; }
.footer-copy {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(247, 241, 230, .12);
  font-size: .88rem;
  color: #9a8f80;
}
.footer-copy a { display: inline; color: var(--gold); }

.glossary-grid {
  columns: 2;
  column-gap: 1.2rem;
}
.glossary-item {
  break-inside: avoid;
  background: #fffdf8;
  border: 1px solid var(--line);
  padding: .8rem .9rem;
  margin: 0 0 .7rem;
  border-radius: var(--radius);
}
.glossary-item strong {
  display: block;
  font-family: var(--display);
  letter-spacing: .01em;
  font-size: 1.08rem;
}

.toast {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--felt);
  color: var(--cream);
  padding: .7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

@media (max-width: 900px) {
  .hero-band,
  .start-grid,
  .footer-grid,
  .converter-grid,
  .journal-form,
  .squares-meta { grid-template-columns: 1fr; }
  .glossary-grid { columns: 1; }
  .menu-btn { display: none; }
  .top-search { display: none; }
  .bay-cards { grid-auto-columns: minmax(78%, 1fr); }
  /* Horizontal bay nav stays visible and scrolls on mobile */
}

@media print {
  .top, .footer, .ad-slot, .menu-btn, .actions .btn-ghost, .toast { display: none !important; }
  body.app { background: #fff; }
  .bound { break-inside: avoid; }
  .kit-tool, .squares-tool, .journal-tool { border: 0; }
}
