/* ==========================================================================
   CoreReserve — global styles
   Mobile-first. Background #101013, accent #FACB19.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #101013;
  --surface: #17171c;
  --raised: #1e1e25;
  --border: #2c2c35;
  --text: #f2f2f5;
  --muted: #8e8e9c;
  --accent: #FACB19;
  --on-accent: #101013;
  --hdr-h: 64px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  background: #101013;
  color: var(--text);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.025em; }
p { margin: 0; }

/* ---------- Wrapper ---------- */
.rack {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 16, 19, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.hdr-in {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--hdr-h);
}

.mark img { height: 30px; width: auto; }

.nav {
  display: none;
  position: absolute;
  top: var(--hdr-h);
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 0 16px;
}

.nav.open { display: block; }

.nav-in {
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

.nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 0;
}

.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.here { color: var(--accent); }

.hdr-right { display: flex; align-items: center; gap: 10px; }

.burger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 17px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons (filled accent, pill) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 30px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(250, 203, 25, 0.2);
}

.btn svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.btn-sm { padding: 9px 16px; font-size: 13px; gap: 7px; }
.btn-sm svg { width: 14px; height: 14px; }

/* ---------- Shared type ---------- */
.tag {
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.8px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.3rem, 6.2vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.04;
}

h1 em { color: var(--accent); font-style: normal; }

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ---------- Hero (tall typographic opener, no image) ---------- */
.open {
  position: relative;
  padding: 60px 0 56px;
  overflow: hidden;
}

/* blueprint shelf lines behind the opener */
.open::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: 68px 100%;
  opacity: 0.4;
  pointer-events: none;
}

.open-in { position: relative; max-width: 780px; }

.rule {
  width: 52px;
  height: 3px;
  margin-bottom: 22px;
  background: var(--accent);
}

.open .tag { margin-bottom: 16px; }

.open h1 { margin-bottom: 24px; }

.pitch {
  max-width: 36em;
  color: var(--muted);
  font-size: 1.08rem;
}

.open-cta { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

.open-cta small { color: var(--muted); font-size: 13px; }

.shelves {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.shelves span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.shelves span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Showcase image band ---------- */
.show { padding: 0 0 20px; }

.show-box {
  position: relative;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.show-box img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
}

.show-chip {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  background: rgba(16, 16, 19, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.show-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Content sections ---------- */
.sec { padding: 68px 0; }

.sec-head { max-width: 640px; margin-bottom: 40px; }
.sec-head h2 { margin-top: 14px; }
.sec-head p { margin-top: 16px; color: var(--muted); }

.lined {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Numbered feature list ---------- */
.steps { display: grid; gap: 2px; }

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.steps .step:last-child { border-bottom: 1px solid var(--border); }

.step-n {
  color: var(--border);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.step:hover .step-n { color: var(--accent); }

.step h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 700;
}

.step p { color: var(--muted); max-width: 40em; }

/* ---------- App peek (CSS mock panels) ---------- */
.peek { display: grid; gap: 16px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.panel-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.panel-top b { color: var(--accent); }

/* Running-low rows */
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.item + .item { margin-top: 9px; }
.item.low { border-color: var(--accent); }

.item-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.item-cat { color: var(--muted); font-size: 12px; }

.item-qty {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-qty i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.item.low .item-qty { color: var(--accent); }

.swipe {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Category chart (horizontal bars) */
.bars { display: grid; gap: 14px; }

.bar-row { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 12px; }

.bar-row span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.bar-track {
  height: 10px;
  background: var(--raised);
  border-radius: 999px;
  overflow: hidden;
}

.bar-track i {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--border);
  border-radius: 999px;
}

.bar-row.top .bar-track i { background: var(--accent); }

.bar-row b {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Trust: three stat columns ---------- */
.facts { display: grid; gap: 28px; }

.fact { padding-top: 22px; border-top: 2px solid var(--accent); }

.fact b {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.fact strong { display: block; margin: 6px 0 8px; font-size: 15px; font-weight: 700; }
.fact span { color: var(--muted); font-size: 14px; }

/* ---------- Closing CTA ---------- */
.close-sec { padding: 68px 0 84px; }

.close-box {
  padding: 46px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.close-box img {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  border-radius: 20px;
}

.close-box p {
  max-width: 30em;
  margin: 14px auto 28px;
  color: var(--muted);
}

/* ---------- Secondary page intro ---------- */
.lede { padding: 52px 0 38px; border-bottom: 1px solid var(--border); }
.lede h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
.lede .tag { margin-bottom: 16px; }
.lede p { max-width: 42em; margin-top: 18px; color: var(--muted); }
.lede .stamp { margin-top: 12px; font-size: 13px; }

/* ---------- Document sheets (support / privacy / terms) ---------- */
.doc { padding: 40px 0 80px; }

.doc-tag {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.doc-grid + .doc-tag,
.doc-col + .doc-tag { padding-top: 42px; }

.doc-grid { display: grid; gap: 14px; }
.doc-col { display: grid; gap: 14px; max-width: 800px; }

.sheet {
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sheet h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.sheet h2 .num {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sheet p { color: var(--muted); }
.sheet p + p { margin-top: 10px; }

.sheet ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.sheet li + li { margin-top: 6px; }

.sheet.lead-sheet { border-top: 3px solid var(--accent); }

.shout {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 1.18rem;
  font-weight: 700;
  word-break: break-word;
}

.shout.calm { color: var(--text); }

.doc-foot { margin-top: 26px; color: var(--muted); font-size: 13px; }

/* ---------- Footer ---------- */
.ftr { padding: 34px 0; border-top: 1px solid var(--border); }

.ftr-in { display: flex; flex-direction: column; gap: 20px; }

.ftr-mark img { height: 24px; width: auto; }

.ftr-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.ftr-nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.ftr-nav a:hover { color: var(--text); text-decoration: none; }

.ftr-meta { color: var(--muted); font-size: 13px; }
.ftr-meta a { color: var(--muted); }

/* ==========================================================================
   Desktop layers
   ========================================================================== */

@media (min-width: 760px) {
  .nav {
    display: block;
    position: static;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .nav-in { flex-direction: row; gap: 26px; padding: 0; }
  .nav a { padding: 6px 0; font-size: 14px; }

  .hdr-right { margin-left: 22px; }
  .burger { display: none; }

  .doc-grid { grid-template-columns: 1fr 1fr; }

  .facts { grid-template-columns: repeat(3, 1fr); gap: 32px; }

  .ftr-in {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .ftr-meta { width: 100%; }
}

@media (min-width: 900px) {
  .open { padding: 96px 0 76px; }
  .open::before { background-size: 84px 100%; }

  .show-box img { aspect-ratio: 21 / 9; object-position: 50% 34%; }

  .sec { padding: 96px 0; }

  .step { grid-template-columns: 76px 1fr; gap: 28px; padding: 32px 0; }
  .step-n { font-size: 3.2rem; }

  .peek { grid-template-columns: 1.12fr 1fr; gap: 20px; align-items: start; }

  .panel { padding: 24px; }

  .close-box { padding: 64px 40px; }
}
