/* ==========================================================================
   Money Mayhem — Design System
   Display: Space Grotesk | Body: Inter | Ledger/numbers: IBM Plex Mono
   Palette: near-black ink, warm cream paper, logo orange, expense red
   Signature motif: perforated "receipt/ledger" card edges + board-tile corners
   ========================================================================== */

:root {
  --ink: #1A1A1A;          /* near-black — matches logo outline linework */
  --ink-soft: #2E2E2E;
  --paper: #FFF8EC;        /* warm cream background */
  --paper-card: #FFFFFF;   /* lifted card surface */
  --cash: #F8941F;         /* logo orange — brand accent (kept var name for compatibility) */
  --cash-deep: #C1590A;    /* deeper orange — used for text/links on light backgrounds */
  --gold: #F8941F;         /* logo orange — primary brand color */
  --risk: #E8483A;         /* expense / risk accent */
  --line: rgba(26, 26, 26, 0.14);
  --line-strong: rgba(26, 26, 26, 0.28);
  --shadow: 0 18px 40px -22px rgba(26, 26, 26, 0.45);
  --radius: 18px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0 0 1em; }
a { color: inherit; }

.ledger, .stat, .price {
  font-family: 'IBM Plex Mono', monospace;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cash-deep);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 2px;
  transform: rotate(45deg);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: 'Inter', sans-serif;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-primary:hover { box-shadow: 6px 6px 0 var(--ink); transform: translate(-2px, -2px); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
}
.btn-secondary:hover { background: rgba(18,43,34,0.06); }
.btn-dark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--gold);
}
.btn-dark:hover { box-shadow: 6px 6px 0 var(--gold); transform: translate(-2px, -2px); }
.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 18px;
  z-index: 50;
  max-width: calc(var(--max) + 32px);
  margin: 18px auto 0;
  padding: 0 16px;
}
.site-header .nav {
  background: rgba(255, 248, 236, 0.92);
  backdrop-filter: blur(8px);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 10px 24px;
  box-shadow: var(--shadow);
}
.brand-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand svg { width: 34px; height: 34px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  position: relative;
  padding: 4px 2px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -3px;
  height: 3px;
  background: var(--gold);
  transition: right 0.2s ease;
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { right: 0; }
.nav-links a[aria-current="page"] { color: var(--cash-deep); }
.nav-cta { display: none; order: 1; }
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  border-radius: 12px;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  order: 2;
}
.nav-toggle-bars {
  position: relative;
  width: 18px; height: 13px;
  display: inline-block;
}
.nav-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 5.5px; }
.nav-toggle-bars span:nth-child(3) { top: 11px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { top: 5.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { top: 5.5px; transform: rotate(-45deg); }
@media (max-width: 860px) {
  .nav-links {
    position: absolute;
    top: calc(100% + 8px); left: 0; right: 0;
    background: var(--paper-card);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 24px 20px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 0; width: 100%; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0 28px;
  margin-top: 100px;
}
.site-footer .brand { color: var(--paper); }
.site-footer .brand-logo {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 4px 8px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(242,241,222,0.2);
}
.footer-links { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--paper); opacity: 0.85; font-size: 0.92rem; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.hero { padding: 64px 0 88px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.stat-row { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 28px; }
.stat-row .stat { font-size: 1.6rem; font-weight: 700; color: var(--cash-deep); }
.stat-row .stat span { display: block; font-family: 'Inter', sans-serif; font-size: 0.8rem; font-weight: 500; color: var(--ink); opacity: 0.7; }

.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--paper-card);
}

/* ---------- Cards (ledger / receipt motif) ---------- */
.card {
  background: var(--paper-card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-grid {
  display: grid;
  gap: 22px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.receipt {
  position: relative;
  background: var(--paper-card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 24px 22px;
  box-shadow: var(--shadow);
}
.receipt::before, .receipt::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  background-image: radial-gradient(circle, var(--paper) 5px, transparent 5.5px);
  background-size: 20px 20px;
  background-position: 0 0;
}
.receipt::before { top: -7px; }
.receipt::after { bottom: -7px; transform: rotate(180deg); }
.receipt blockquote {
  margin: 0 0 10px;
  font-style: italic;
  font-size: 1.02rem;
}
.receipt cite {
  display: block;
  font-style: normal;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  opacity: 0.7;
}

.tile-num {
  width: 40px; height: 40px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  background: var(--gold);
  margin-bottom: 14px;
  transform: rotate(-4deg);
}

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.divider {
  border: none;
  border-top: 2px dashed var(--line-strong);
  margin: 0;
}

.placeholder-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, var(--paper-card), var(--paper-card) 12px, #E9E7CE 12px, #E9E7CE 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--ink);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.placeholder-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.placeholder-img.square { aspect-ratio: 1/1; }
.placeholder-img.wide { aspect-ratio: 16/9; }

.callout {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 44px;
}
.callout h2, .callout h3 { color: var(--paper); }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background: var(--paper-card);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}
.field-hint { font-size: 0.82rem; opacity: 0.65; margin-top: 6px; }
.chip-suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip-suggest button {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  border: 2px solid var(--ink);
  background: var(--paper-card);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}
.chip-suggest button:hover { background: var(--gold); }

.qty-stepper { display: flex; align-items: center; gap: 12px; }
.qty-stepper button {
  width: 40px; height: 40px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-card);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.qty-stepper input {
  width: 60px;
  text-align: center;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hidden-block { display: none !important; }
.address-manual { display: grid; }
.order-summary { position: sticky; top: 100px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.95rem; }
.summary-line.total { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 14px; font-weight: 700; font-size: 1.1rem; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(18,43,34,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--paper-card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  max-width: 440px;
  width: 100%;
  padding: 34px;
  box-shadow: var(--shadow);
  text-align: center;
}
.modal .ref { font-family: 'IBM Plex Mono', monospace; background: var(--paper); border: 2px dashed var(--line-strong); border-radius: 10px; padding: 8px; margin: 16px 0; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.gallery-grid .placeholder-img { aspect-ratio: 1/1; cursor: pointer; }
.gallery-more {
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

/* ---------- Socials ---------- */
.social-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--ink);
}
.social-icon {
  width: 52px; height: 52px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  flex-shrink: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink);
  padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Mobile polish
   ========================================================================== */
@media (max-width: 900px) {
  .order-summary { position: static; }
  .hero-grid { gap: 32px; }
}

@media (max-width: 700px) {
  section { padding: 52px 0; }
  .section-tight { padding: 40px 0; }
  .hero { padding: 28px 0 44px; }
  h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .card { padding: 22px; }
  .receipt { padding: 20px 18px; }
  .callout { padding: 30px 24px; }
  .section-head { margin-bottom: 30px; }
  .stat-row { gap: 22px; }
  .stat-row .stat { font-size: 1.35rem; }
  .site-footer { margin-top: 64px; padding: 44px 0 24px; }
  .footer-top { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-links { gap: 10px 22px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .modal { padding: 26px 22px; }
}

@media (max-width: 460px) {
  .wrap { padding: 0 18px; }
  .site-header { top: 12px; padding: 0 12px; }
  .site-header .nav { padding: 8px 10px 8px 16px; }
  .brand { gap: 8px; }
  .brand-logo { height: 54px; }
  .nav-cta { padding: 10px 16px; font-size: 0.9rem; }
  .nav-toggle { width: 42px; height: 42px; }
  .eyebrow { font-size: 0.7rem; }
  .btn { padding: 13px 20px; font-size: 0.92rem; }
  .qty-stepper button { width: 36px; height: 36px; }
  .qty-stepper input { width: 52px; }
  .price { font-size: 1.8rem !important; }
}

/* Comfortable tap targets everywhere on touch devices */
@media (pointer: coarse) {
  .btn, .qty-stepper button, .chip-suggest button, .nav-toggle { min-height: 44px; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; }
}
