:root {
  --bg: #f7f4ea;
  --ink: #17140f;
  --muted: #746d60;
  --line: #ded5c3;
  --panel: #fffdf7;
  --accent: #2f6bff;
  --paper: #eee4d0;
  --green: #2dbf75;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(23, 20, 15, .045) 1px, transparent 1px) 0 0 / 68px 68px,
    linear-gradient(rgba(23, 20, 15, .035) 1px, transparent 1px) 0 0 / 68px 68px;
}
a { color: inherit; text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 6vw;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 234, .92);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.brand small, nav a, button { color: var(--muted); font-size: 12px; font-weight: 850; }
nav { display: flex; gap: 8px; }
nav a, .topbar button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 13px;
}
nav a:hover { border-color: var(--line); background: var(--panel); color: var(--ink); }
.topbar button { justify-self: end; background: var(--ink); color: #fff; cursor: pointer; }

main { position: relative; z-index: 1; }
.hero, .section, .routes, .builder {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  padding: 70px 0;
}
.hero {
  min-height: 630px;
  display: grid;
  grid-template-columns: 1fr .94fr;
  gap: 46px;
  align-items: center;
}
.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font: 900 12px "Courier New", monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: 0; }
h1 { max-width: 760px; font-size: clamp(52px, 7.4vw, 92px); line-height: .92; }
h2 { font-size: clamp(34px, 4.4vw, 62px); line-height: .98; }
p { color: #463f35; line-height: 1.62; }
.copy p:not(.kicker) { max-width: 660px; font-size: 17px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.actions a, .panel button {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 13px 17px;
  background: var(--panel);
  font-weight: 850;
}
.actions .primary, .panel button { background: var(--accent); color: #fff; }

.book, .card, .routePanel, .panel, .docs article {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, .92);
  box-shadow: 0 20px 65px rgba(45, 35, 20, .07);
}
.bookHead {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  font: 850 12px "Courier New", monospace;
}
.bookHead strong { color: var(--green); }
.miniTable { padding: 16px; min-height: 310px; display: grid; align-content: center; gap: 0; }
.miniTable div {
  display: grid;
  grid-template-columns: 1fr 1fr 70px;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font: 850 13px "Courier New", monospace;
}
.miniTable b { color: var(--muted); font-size: 11px; }
.miniTable em { color: var(--green); font-style: normal; font-weight: 900; }
.bookStats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.bookStats div { display: grid; gap: 8px; padding: 16px; border-right: 1px solid var(--line); }
.bookStats span, .receipt span { color: var(--muted); font: 850 11px "Courier New", monospace; text-transform: uppercase; }
.bookStats strong { font: 900 24px "Courier New", monospace; }

.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--panel); }
.ticker div { display: flex; width: max-content; animation: tape 22s linear infinite; }
.ticker span { padding: 14px 30px; border-right: 1px solid var(--line); font: 900 12px "Courier New", monospace; }
@keyframes tape { to { transform: translateX(-45%); } }

.sectionHead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
}
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
}
#search { max-width: 340px; }
.grid, .docs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { min-height: 190px; display: grid; gap: 12px; padding: 16px; }
.card:hover { border-color: var(--accent); }
.top { display: flex; justify-content: space-between; color: var(--muted); font: 850 11px "Courier New", monospace; }
.card h3 { margin: 0; font-size: 21px; }
.card p { margin: 0; font-size: 13px; }
.card strong { align-self: end; font: 900 24px "Courier New", monospace; }
.bar { height: 8px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--accent) var(--w), var(--paper) 0); }

.routes, .builder { display: grid; grid-template-columns: .82fr 1.18fr; gap: 40px; align-items: start; }
.routePanel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px; }
.routePanel button {
  min-height: 52px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}
.routePanel button.active { background: var(--ink); color: #fff; }
.routeScore {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 210px;
  background: linear-gradient(135deg, #fff, var(--paper));
  border: 1px solid var(--line);
}
.routeScore span { font: 900 14px "Courier New", monospace; color: var(--muted); text-transform: uppercase; }
.routeScore strong { font: 900 82px "Courier New", monospace; }
.panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 18px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
label:nth-child(3), .panel button, .receipt { grid-column: 1 / -1; }
.panel button { cursor: pointer; border-radius: 2px; }
.receipt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.receipt strong { font: 900 18px "Courier New", monospace; }
.docs article { min-height: 210px; padding: 18px; }
.docs span { color: var(--accent); font: 900 12px "Courier New", monospace; }
.docs h3 { margin: 34px 0 8px; }

@media (max-width: 920px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  nav { display: none; }
  .hero, .routes, .builder { grid-template-columns: 1fr; }
  .grid, .docs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  h1 { font-size: 44px; }
  .hero { min-height: auto; }
  .sectionHead { display: grid; align-items: stretch; }
  #search { max-width: none; }
  .grid, .docs, .panel, .bookStats, .routePanel { grid-template-columns: 1fr; }
  .routeScore { grid-column: auto; }
}
