/* SketchyQuester — field notebook / blueprint theme */

:root {
  --paper: #f3eee2;
  --paper-2: #e9e2d1;
  --ink: #1d2833;
  --ink-soft: #4a5866;
  --grid: rgba(43, 93, 138, 0.09);
  --blue: #2b5d8a;
  --blue-dark: #1d4366;
  --trail: #c4612a;
  --trail-dark: #9e4a1d;
  --forest: #4b6a3b;
  --line: rgba(29, 40, 51, 0.18);
  --card: #fbf8f1;
  --shadow: 0 1px 0 rgba(29, 40, 51, 0.08), 0 8px 24px -12px rgba(29, 40, 51, 0.25);
  --radius: 6px;
  --max: 1120px;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

img { max-width: 100%; display: block; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--trail); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.mono, .label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label { color: var(--ink-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 238, 226, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1.5px solid var(--ink);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; }
.brand:hover { color: var(--ink); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: var(--radius);
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--trail); }
.site-nav a.nav-cta {
  background: var(--ink);
  color: var(--paper);
}
.site-nav a.nav-cta:hover { background: var(--trail); color: #fff; }

@media (max-width: 859px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1.5px solid var(--ink);
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul { padding: 8px 16px 16px; }
}
@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav ul { display: flex; gap: 4px; align-items: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 20px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--trail); border-color: var(--trail); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
@media (min-width: 860px) { .hero { padding: 88px 0 64px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }
.hero .kicker { color: var(--trail); margin-bottom: 14px; display: block; }
.hero h1 .split-a { color: var(--blue); }
.hero h1 .split-b { color: var(--forest); }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hero-art {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 14px;
}
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art .caption { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; margin-top: 10px; color: var(--ink-soft); }

/* ---------- Page header ---------- */
.page-head { padding: 48px 0 24px; border-bottom: 1.5px dashed var(--line); margin-bottom: 40px; }
.page-head .label { display: block; margin-bottom: 10px; }
.page-head.builds .label { color: var(--blue); }
.page-head.quests .label { color: var(--forest); }
.page-head.shop .label { color: var(--trail); }
.page-head p { color: var(--ink-soft); max-width: 40em; font-size: 1.1rem; margin: 0; }

/* ---------- Sections ---------- */
section.block { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.section-head h2 { margin: 0; }

/* Two-sided "split" explainer */
.split {
  display: grid;
  gap: 20px;
}
@media (min-width: 760px) { .split { grid-template-columns: 1fr 1fr; } }
.split-card {
  position: relative;
  padding: 28px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.split-card .label { display: block; margin-bottom: 8px; }
.split-card.builds .label { color: var(--blue); }
.split-card.quests .label { color: var(--forest); }
.split-card p { color: var(--ink-soft); }
.split-card .bg {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 180px;
  opacity: 0.14;
  pointer-events: none;
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }
.card .thumb { aspect-ratio: 4 / 3; border-bottom: 1.5px solid var(--ink); position: relative; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card .meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--trail); }
.card p { color: var(--ink-soft); font-size: 0.97rem; }
.card .links { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 0.9rem; }
.card .links .label { margin-right: 6px; }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.tag.build { color: var(--blue); }
.tag.quest { color: var(--forest); }
.tag.shop { color: var(--trail); }
.tag.plain { color: var(--ink-soft); }

/* Placeholder "sketch" thumbnails */
.ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.ph.build {
  background-color: var(--blue);
  background-image:
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 16px 16px;
}
.ph.quest {
  background-color: var(--forest);
  background-image: url("../img/topo.svg");
  background-size: cover;
}
.ph.shop {
  background-color: var(--trail);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.08) 0 10px, transparent 10px 20px);
}
.ph svg { width: 42%; max-width: 120px; height: auto; opacity: 0.9; }
.ph span { display: block; margin-top: 10px; }

/* ---------- Filter chips ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Shop ---------- */
.price { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.status { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--trail-dark); }
.notice {
  border: 1.5px dashed var(--trail);
  background: rgba(196, 97, 42, 0.07);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
  color: var(--ink);
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1fr 1.3fr; align-items: start; } }
.portrait { aspect-ratio: 4 / 5; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.spec-sheet {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  margin-top: 28px;
  overflow: hidden;
}
.spec-sheet .row { display: grid; grid-template-columns: 140px 1fr; border-top: 1px solid var(--line); }
.spec-sheet .row:first-child { border-top: 0; }
.spec-sheet .row > * { padding: 10px 14px; }
.spec-sheet dt { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); border-right: 1px solid var(--line); margin: 0; }
.spec-sheet dd { margin: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1.3fr 1fr; } }
form.sheet {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 24px;
}
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field textarea { min-height: 150px; resize: vertical; }
.form-note { font-size: 0.9rem; color: var(--ink-soft); margin-top: 12px; }
.hp { position: absolute; left: -9999px; }

/* ---------- CTA band ---------- */
.cta-band {
  margin: 40px 0 0;
  padding: 40px 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  display: grid;
  gap: 20px;
  align-items: center;
}
@media (min-width: 760px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; color: rgba(243, 238, 226, 0.75); }
.cta-band .btn { background: var(--trail); border-color: var(--trail); color: #fff; }
.cta-band .btn:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 64px;
  border-top: 1.5px solid var(--ink);
  padding: 32px 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--trail); }

/* ---------- Build log ---------- */
.story {
  border: 1.5px solid var(--ink);
  border-left: 6px solid var(--trail);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 40px;
  max-width: 760px;
}
.story .label { color: var(--trail-dark); display: block; margin-bottom: 6px; }
.story p { font-size: 1.05rem; color: var(--ink); }
.story p:last-child { margin-bottom: 0; }

.log-hero { display: grid; gap: 28px; margin-bottom: 40px; }
@media (min-width: 860px) { .log-hero { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.stages {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  counter-reset: stage;
}
.stages li {
  counter-increment: stage;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 10px 12px;
  font-size: 0.92rem;
}
.stages li::before {
  content: "Stage " counter(stage, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.stages li .st {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
  color: var(--ink-soft);
}
.stages li.done { border-color: var(--forest); background: rgba(75, 106, 59, 0.1); }
.stages li.done .st { color: var(--forest); }
.stages li.active { border-color: var(--trail); border-width: 2px; background: rgba(196, 97, 42, 0.08); }
.stages li.active .st { color: var(--trail-dark); }

.log { position: relative; margin: 0 0 48px; padding-left: 28px; }
.log::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: repeating-linear-gradient(var(--ink) 0 6px, transparent 6px 12px); opacity: 0.35; }
.entry { position: relative; margin-bottom: 28px; }
.entry::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--trail);
  border: 2px solid var(--ink);
}
.entry .sheet-card {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.entry .meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.entry h3 { margin-bottom: 8px; }
.entry p { color: var(--ink-soft); }
.entry ul { color: var(--ink-soft); margin: 0 0 1em; padding-left: 1.2em; }
.entry .photos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 12px 0; }
.entry .photos img, .entry .photos .ph { aspect-ratio: 4 / 3; object-fit: cover; border: 1.5px solid var(--ink); border-radius: var(--radius); }

table.parts { width: 100%; border-collapse: collapse; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; font-size: 0.95rem; }
table.parts th, table.parts td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.parts th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); border-top: 0; background: var(--paper-2); }
table.parts td.num, table.parts th.num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
table.parts tfoot td { font-weight: 700; border-top: 1.5px solid var(--ink); }
.table-wrap { overflow-x: auto; margin-bottom: 48px; }

.hidden { display: none !important; }
