/* Ledger & Line Digital Goods (DigitalShopBox template) — design system.
   Deliberately generic/brandless: a digital-download template meant to be
   resold to any buyer with any product niche (templates, spreadsheets,
   printables, presets). Visual identity leans "ledger paper" — warm cream
   paper, ruled-line texture, a stamped-ink accent color, serif display type
   for an editorial/bookkeeping feel — distinct from a generic e-commerce
   look, but not tied to any one real brand's aesthetic. Mobile-first (390px
   primary). */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #191712;
  --ink-soft: #4a4438;
  --paper: #faf7ef;
  --paper-dim: #f1ead9;
  --card: #ffffff;
  --line: #e2d9c3;
  --accent: #1f6f5c;
  --accent-dark: #165444;
  --accent-light: #2f9880;
  --amber: #c98a2e;
  --amber-dark: #a8701f;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 16px rgba(25, 23, 18, 0.08);
  --shadow-lg: 0 14px 36px rgba(25, 23, 18, 0.16);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

/* ── Divider ──────────────────────────────────────────────────────────── */
.line-divider { height: 6px; background: var(--accent); }
.line-divider.amber { background: var(--amber); }
.line-divider.ink { background: var(--ink); }

/* ── Ledger wash (hero background) ───────────────────────────────────── */
.ledger-wash {
  background-color: var(--ink);
  background-image:
    radial-gradient(circle at 12% 15%, rgba(31,111,92,.4) 0, transparent 45%),
    radial-gradient(circle at 88% 80%, rgba(201,138,46,.22) 0, transparent 50%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 34px);
}

/* ── Header / Nav ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--ink);
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 50;
}
.nav { display: flex; align-items: center; justify-content: space-between; max-width: var(--container); margin: 0 auto; padding: 12px 20px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1rem; font-family: var(--font-display);
}
.nav-links { display: none; gap: 22px; align-items: center; }
.nav-links a { color: #fff; font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--accent-light); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.cart-link { position: relative; color: #fff; display: flex; align-items: center; }
.cart-badge {
  position: absolute; top: -8px; right: -10px; background: var(--amber); color: #fff;
  font-size: .68rem; font-weight: 800; border-radius: 999px; min-width: 18px; height: 18px;
  display: none; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-toggle { display: inline-flex; background: none; border: none; color: #fff; cursor: pointer; }
.mobile-menu { display: none; flex-direction: column; gap: 2px; background: var(--ink); padding: 8px 20px 16px; }
.mobile-menu.open { display: flex; }
.mobile-menu a { color: #fff; padding: 10px 0; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.1); }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer; min-height: 46px;
  font-family: var(--font-body); text-decoration: none; transition: transform .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent-dark); }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary { background: transparent; color: #fff; border-color: #fff; }
.btn-outline-dark { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; }
.hero-actions, .hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 20px; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero { color: #fff; position: relative; overflow: hidden; padding: 64px 0 72px; }
.hero .container { position: relative; z-index: 2; display: grid; gap: 32px; align-items: center; }
.hero-eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--accent-light); font-weight: 700; }
.hero h1 { color: #fff; }
.hero p.lede { color: rgba(255,255,255,.78); font-size: 1.1rem; max-width: 52ch; }
.hero-art { display: flex; justify-content: center; }

@media (min-width: 900px) {
  .hero .container { grid-template-columns: 1.1fr .9fr; }
}

/* ── Cards / Product grid ─────────────────────────────────────────────── */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.product-card .thumb {
  aspect-ratio: 1 / 1; background: linear-gradient(135deg, var(--ink), #2c2a20); display: flex;
  align-items: center; justify-content: center; position: relative;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-badge {
  position: absolute; top: 8px; left: 8px; background: var(--amber); color: #fff;
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 999px;
}
.product-card .info { padding: 14px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { font-size: 1rem; margin-bottom: 4px; color: var(--ink); }
.product-card .price { font-weight: 800; color: var(--accent-dark); margin-top: auto; font-size: 1.05rem; }
.product-card .cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 700; margin-bottom: 6px; }

.category-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.category-tabs button {
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 9px 18px;
  font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--ink);
}
.category-tabs button.active { background: var(--accent); border-color: var(--accent-dark); color: #fff; }

/* ── Cards generic ────────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--line); }

/* ── Forms ────────────────────────────────────────────────────────────── */
label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 8px; border: 2px solid var(--line);
  background: var(--paper); font-size: 16px; font-family: var(--font-body); margin-bottom: 14px; color: var(--ink);
}
textarea { min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-note { font-size: .85rem; color: var(--ink-soft); }

/* ── Alerts / notices ─────────────────────────────────────────────────── */
.notice {
  border-radius: var(--radius); padding: 16px 18px; font-size: .92rem; margin: 0 0 20px;
  border: 2px solid var(--line); background: var(--paper-dim); color: var(--ink);
}
.notice.warm { background: #fbeed8; border-color: var(--amber); }
.notice strong { color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 48px 0 24px; margin-top: 60px; border-top: 6px solid var(--accent); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; margin-bottom: 28px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h4 { color: var(--accent-light); font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: rgba(255,255,255,.7); }
.footer-grid a:hover { color: var(--accent-light); }
.footer-brand { font-family: var(--font-display); font-weight: 800; color: #fff; font-size: 1.15rem; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: .8rem; color: rgba(255,255,255,.6); }

/* ── Cart drawer ──────────────────────────────────────────────────────── */
#cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100vw);
  background: var(--card); box-shadow: -8px 0 30px rgba(0,0,0,.25); z-index: 100;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
}
#cart-drawer.open { transform: translateX(0); }
#cart-overlay { position: fixed; inset: 0; background: rgba(25,23,18,.5); z-index: 99; display: none; }
#cart-overlay.open { display: block; }
.cart-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 2px solid var(--line); }
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 14px 20px; }
.cart-drawer-foot { padding: 16px 20px; border-top: 2px solid var(--line); }
.cart-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; background: var(--ink); }
.cart-row .meta { flex: 1; }
.cart-row .qty-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-row .qty-row button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.cart-row .remove { background: none; border: none; color: var(--amber-dark); font-size: .78rem; cursor: pointer; padding: 0; text-decoration: underline; }

/* ── Downloads list (order confirmation) ─────────────────────────────── */
.download-list { list-style: none; margin: 0 0 20px; padding: 0; }
.download-list li { margin-bottom: 10px; }
.download-list a {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; font-weight: 700; color: var(--accent-dark);
}
.download-list a:hover { border-color: var(--accent); text-decoration: none; }
.download-list a::before { content: "↓"; font-weight: 900; }

/* ── Utility ──────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.small { font-size: .85rem; }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; background: var(--ink); color: #fff;
}
.badge.gold { background: var(--amber); color: #fff; }
.two-col { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
