/* ============================================================
   LitCoins — color system + base styles
   Redesign per Claude Design handoff "LitCoins.html".
   Light mode is the default. Dark mode via [data-theme="dark"].
   ============================================================ */

:root {
  /* Brand ink — kept from the original site theme color (#1b1020) */
  --ink:        #1b1020;
  --ink-soft:   #3a2a3e;
  --muted:      #6c5b6e;
  --muted-2:    #8a7c8c;

  /* Plum accent family — everything derives from --accent */
  --accent:        #6e2c5e;   /* primary plum */
  --accent-strong: color-mix(in oklab, var(--accent) 74%, #000);
  --accent-bright: color-mix(in oklab, var(--accent) 66%, #fff);
  --accent-tint:   color-mix(in oklab, var(--accent) 11%, var(--surface));

  /* Literary gold — used only for the coin & tiny flourishes */
  --gold:      #c8a55c;
  --gold-deep: #a98438;
  --gold-soft: #e7d4a6;

  /* Surfaces (light) */
  --bg:        #faf6f1;   /* warm paper */
  --bg-2:      #f3ece4;   /* recessed warm */
  --surface:   #ffffff;
  --surface-2: #fbf7f3;
  --line:      #ece2e6;
  --line-soft: #f2ebee;

  --text:      var(--ink);
  --text-2:    var(--muted);
  --on-accent: #fff6fb;

  --good:      #2e9e6b;
  --bad:       #c0392b;

  --shadow-sm: 0 1px 2px rgba(27,16,32,.05), 0 1px 1px rgba(27,16,32,.04);
  --shadow-md: 0 4px 14px -6px rgba(27,16,32,.14), 0 2px 6px -4px rgba(27,16,32,.10);
  --shadow-lg: 0 24px 60px -28px rgba(27,16,32,.28), 0 8px 24px -16px rgba(27,16,32,.14);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --maxw: 1140px;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --ink:        #f4e9f0;
  --ink-soft:   #e3d2dd;
  --muted:      #b29bb1;
  --muted-2:    #8d7990;

  --accent:        #c06aa9;
  --accent-strong: color-mix(in oklab, var(--accent) 72%, #fff);
  --accent-bright: color-mix(in oklab, var(--accent) 60%, #fff);
  --accent-tint:   color-mix(in oklab, var(--accent) 24%, var(--bg));

  --gold:      #d8b76a;
  --gold-deep: #c8a55c;
  --gold-soft: #6a5630;

  --bg:        #150b18;
  --bg-2:      #1c1020;
  --surface:   #211326;
  --surface-2: #281831;
  --line:      #38253e;
  --line-soft: #2c1c32;

  --text:      var(--ink);
  --text-2:    var(--muted);
  --on-accent: #1a0f1d;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 6px 18px -8px rgba(0,0,0,.55);
  --shadow-lg: 0 30px 70px -30px rgba(0,0,0,.7), 0 10px 30px -18px rgba(0,0,0,.5);
}

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

body {
  margin: 0;
  font-family: var(--sans);
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 17px;
  line-height: 1.55;
  transition: background-color .4s ease, color .4s ease;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--on-accent); }

.hidden { display: none !important; }

/* ---- Layout helpers ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; }
.eyebrow {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1.5px;
  background: var(--accent);
  opacity: .55;
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15.5px;
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-strong); box-shadow: var(--shadow-md); }
[data-theme="dark"] .btn-primary:hover { background: var(--accent-bright); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-soft {
  background: var(--accent-tint);
  color: var(--accent);
}
.btn-soft:hover { background: var(--accent); color: var(--on-accent); }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
}
.input {
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  width: 100%;
}
.input::placeholder { color: var(--muted-2); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
  background: var(--surface);
}
textarea.input { resize: vertical; font-family: var(--sans); }

/* ---- Utility ---- */
.divider { height: 1px; background: var(--line); border: none; margin: 0; }
.wrap-divider { max-width: var(--maxw); margin: 0 auto; width: calc(100% - 56px); }
.theme-switching, .theme-switching * { transition: none !important; }
.mono-num { font-variant-numeric: tabular-nums; }
.fade-in { opacity: 1; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-name { font-family: var(--sans); font-weight: 500; font-size: 18px; letter-spacing: -.01em; }
.brand-name strong { font-weight: 800; }
.main-nav { display: flex; gap: 26px; margin-left: 8px; }
.main-nav a {
  font-size: 15px; font-weight: 500; color: var(--text-2);
  position: relative; padding: 4px 0; transition: color .18s ease;
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--accent); transition: width .22s ease;
}
.main-nav a:hover::after { width: 100%; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: border-color .18s ease, color .18s ease, transform .2s ease, background .2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: rotate(-12deg); }
.auth-slot { display: inline-flex; align-items: center; gap: 10px; }
.auth-slot .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.auth-slot .who { font-size: 14px; color: var(--text-2); max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* coin sizing helper (SVG injected by app.js) */
.coin { display: block; line-height: 0; }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; padding: 64px 0 88px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(40px 40px at 12% 22%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 70%),
    radial-gradient(60px 60px at 88% 70%, color-mix(in oklab, var(--gold) 7%, transparent), transparent 70%);
  pointer-events: none; opacity: .8;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px; position: relative; z-index: 3; }
.hero-title { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; margin: 22px 0 0; }
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 18.5px; color: var(--text-2); max-width: 30em; margin: 22px 0 0; line-height: 1.6; }
.ulink { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.ulink:hover { text-decoration-color: var(--accent); }
.hero-cta { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-rate { display: flex; align-items: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.rate-pill {
  font-weight: 700; font-size: 15px; color: var(--accent);
  background: var(--accent-tint); padding: 8px 14px; border-radius: 999px;
}
.rate-note { font-size: 14px; color: var(--muted-2); }

/* hero art */
.hero-art { position: relative; height: 420px; z-index: 3; }
.coin-stack { position: absolute; inset: 0; display: grid; place-items: center; }
.coin-float { position: absolute; }
.coin-a { animation: bob 6s ease-in-out infinite; }
.coin-c { bottom: 10%; left: 8%; animation: bob 7s ease-in-out infinite 1.2s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16px) rotate(4deg); } }

/* ============================================================
   Section scaffolding
   ============================================================ */
.section-alt { background: var(--bg-2); }
.section-title { font-size: clamp(30px, 4vw, 44px); margin-top: 14px; line-height: 1.08; }
.section-lead { font-size: 18px; color: var(--text-2); max-width: 40em; margin-top: 14px; }

/* ============================================================
   Wallet
   ============================================================ */
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.wallet-card { padding: 32px; display: flex; }
.wallet-signedout { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; margin: auto; padding: 12px 0; }
.wallet-signedout p { color: var(--text-2); max-width: 26em; margin: 0; }
.wallet-balance { width: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.wb-top { display: flex; align-items: center; gap: 20px; }
.wb-label { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.wb-coins { font-family: var(--serif); font-size: 38px; line-height: 1.1; margin-top: 4px; }
.wb-coins span { font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--text-2); }
.wb-gbp { font-size: 17px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.wb-actions { display: flex; gap: 12px; align-items: center; }
.wb-redeem { display: flex; gap: 10px; }
.wb-redeem .input { padding: 10px 12px; font-size: 14px; }

.activity-card { padding: 28px 32px; }
.activity-title { font-size: 19px; margin-bottom: 8px; }
.activity-empty { color: var(--muted-2); padding: 28px 0; font-size: 15px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border-bottom: none; }
.act-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.act-in { background: var(--good); }
.act-out { background: var(--accent); }
.act-main { flex: 1; }
.act-label { font-weight: 600; font-size: 15px; }
.act-time { font-size: 12.5px; color: var(--muted-2); margin-top: 1px; }
.act-amt { font-weight: 700; font-size: 16px; }
.act-amt.in { color: var(--good); }
.act-amt.out { color: var(--accent); }

/* ============================================================
   Buy tiers
   ============================================================ */
.tier-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 40px; }
.tier {
  position: relative; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 28px 18px 22px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--sans); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.tier:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tier.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent), var(--shadow-md); }
.tier-tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.tier-coins { font-family: var(--serif); font-size: 26px; margin-top: 8px; color: var(--text); }
.tier-unit { font-size: 13px; color: var(--text-2); }
.tier-bonus { font-size: 13px; font-weight: 700; color: var(--gold-deep); }
.tier-price { margin-top: 8px; font-weight: 700; font-size: 16px; color: var(--accent); }

.buy-bar { margin-top: 22px; padding: 24px 28px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; }
.buy-blurb { color: var(--text-2); font-size: 14.5px; }
.buy-blurb strong { color: var(--text); font-weight: 700; }
.buy-summary { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border-left: 1px solid var(--line); padding-left: 28px; }
.bs-line { display: flex; align-items: baseline; gap: 10px; width: 100%; justify-content: space-between; }
.bs-line span { color: var(--text-2); font-size: 14px; }
.bs-line strong { font-family: var(--serif); font-size: 22px; }
.bs-bonus { font-size: 13px; color: var(--gold-deep); font-weight: 600; }
.buy-go { margin-top: 8px; width: 100%; justify-content: center; }
.buy-go.is-done, .gift-send.is-done { background: var(--good); }
.fineprint { font-size: 13px; color: var(--muted-2); margin-top: 22px; max-width: 50em; }

/* ============================================================
   Gift
   ============================================================ */
.gift-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.giftcard {
  position: relative; overflow: hidden; margin-top: 34px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-radius: 20px; padding: 26px 28px; color: #fff6fb;
  box-shadow: var(--shadow-lg); aspect-ratio: 1.6 / 1; max-width: 420px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.gc-shine { position: absolute; inset: 0; background: radial-gradient(120% 80% at 80% -10%, rgba(255,255,255,.22), transparent 60%); pointer-events: none; }
.gc-top { display: flex; align-items: center; gap: 12px; }
.gc-brand { font-weight: 700; letter-spacing: .03em; font-size: 15px; }
.gc-amt { font-family: var(--serif); font-size: 48px; line-height: 1; }
.gc-foot { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; opacity: .92; }

.gift-form { padding: 30px; display: flex; flex-direction: column; gap: 18px; }
.opt { color: var(--muted-2); font-weight: 500; }
.gift-presets { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
  font-family: var(--sans); font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 9px 16px; transition: all .16s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.is-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip.is-disabled { opacity: .4; cursor: not-allowed; }
.gift-cost { font-size: 13.5px; color: var(--text-2); margin-top: 8px; }
.bal-ok { color: var(--muted-2); }
.bal-bad { color: var(--bad); font-weight: 600; }
.gift-send { width: 100%; justify-content: center; margin-top: 4px; }
.gift-status { font-size: 14px; margin: 4px 0 0; min-height: 1.2em; }
.gift-status.ok { color: var(--good); }
.gift-status.err { color: var(--bad); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); margin-top: 40px; padding: 56px 0 28px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.footer-tagline { color: var(--text-2); font-size: 14.5px; max-width: 30em; margin: 16px 0 0; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.footer-col h4 { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--text-2); font-size: 14.5px; padding: 5px 0; transition: color .16s ease; }
.footer-col a:hover { color: var(--accent); }
.footer-legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted-2); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-credit { color: var(--text-2); }
.footer-credit a { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }
.footer-credit a:hover { text-decoration: underline; }
.credit-heart { color: #c0392b; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-family: var(--sans); font-weight: 600;
  font-size: 14.5px; padding: 13px 20px; border-radius: 999px; z-index: 100;
  box-shadow: var(--shadow-lg); max-width: 90vw;
}
.toast.ok { background: var(--good); color: #fff; }
.toast.err { background: var(--bad); color: #fff; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner, .wallet-grid, .buy-bar, .gift-wrap, .footer-inner { grid-template-columns: 1fr; }
  .hero-art { height: 240px; order: 2; }
  .tier-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
  .buy-summary { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .giftcard { margin-left: auto; margin-right: auto; }
}
@media (max-width: 860px) {
  .section { padding: 64px 0; }
  body { font-size: 16px; }
}
@media (max-width: 520px) {
  .tier-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 20px; }
  .wrap-divider { width: calc(100% - 40px); }
}
