/* Keychain Reaction — storefront + dashboard styles (Bright Indigo, light) */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f4f6fb;
  --line: #e4e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-soft: #eef0fe;
  --good: #16a34a;
  --bad: #dc2626;
  --radius: 16px;
  --maxw: 1100px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 6px 20px rgba(16,24,40,.07);
  --shadow-lg: 0 18px 40px rgba(79,70,229,.16);
  font-synthesis: none;
}

/* Cards get a soft shadow so they read on a white background. */
.card, .stat-card, .tier-card, .configurator, .chart-card, .cart-summary,
.cart-pack, .dash-table, .mini-dash, .locked-panel, .login-form .field {
  box-shadow: var(--shadow);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.accent { color: var(--accent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; }
.pad { padding: 48px 20px; }

/* buttons */
.btn {
  display: inline-block; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: 0; border-radius: 999px;
  padding: 11px 22px; font-weight: 600; font-size: .98rem;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; text-align: center; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text);
}
.link-danger { background: none; border: 0; color: var(--bad); cursor: pointer; font: inherit; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.cart-link {
  border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px; color: var(--text) !important;
}

.flash {
  background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(6,182,212,.10));
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.flash .wrap { padding: 11px 20px; font-size: .92rem; }

/* hero */
.hero { padding: 64px 0 40px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--accent); font-weight: 700; margin-bottom: .6rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 26px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }

/* hero keychain art */
.kc-stack { position: relative; height: 360px; }
.kc-chip {
  position: absolute; top: calc(var(--i) * 12px); left: calc(var(--i) * 26px);
  width: 150px; height: 150px; border-radius: 26px;
  background: var(--kc);
  box-shadow: 0 16px 36px rgba(16,24,40,.18), inset 0 0 0 1px rgba(0,0,0,.06);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(calc(var(--i) * -4deg)); transition: transform .3s ease;
  color: rgba(255,255,255,.9); mix-blend-mode: normal;
}
/* the white keychain needs a visible edge + dark text on a white page */
.kc-chip:nth-child(2) { color: rgba(0,0,0,.55); box-shadow: 0 16px 36px rgba(16,24,40,.16), inset 0 0 0 1px var(--line); }
.kc-stack:hover .kc-chip { transform: rotate(0) translateY(0); }
.kc-hole { width: 14px; height: 14px; border-radius: 50%; background: rgba(0,0,0,.3); position: absolute; top: 14px; }
.kc-logo { font-weight: 800; letter-spacing: .1em; font-size: .9rem; opacity: .85; }
.kc-wave { position: absolute; bottom: 14px; right: 18px; font-size: 1.1rem; opacity: .7; }

/* bands */
.band { padding: 64px 0; border-top: 1px solid var(--line); }
.band-alt { background: var(--bg-soft); }
.section-title { text-align: center; }
.section-sub { text-align: center; max-width: 60ch; margin: -.3rem auto 2rem; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.step {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 700; margin-bottom: 12px;
}

/* configurator */
.configurator { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; margin-top: 8px; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.field { border: 0; padding: 0; margin: 0 0 24px; }
.field legend { font-weight: 700; margin-bottom: 12px; font-size: 1.05rem; padding: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch-dot {
  display: inline-block; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line); vertical-align: middle;
}
.swatch-dot.inline { width: 14px; height: 14px; margin-right: 6px; }
.swatch-name { display: inline-block; margin-left: 7px; color: var(--muted); font-size: .92rem; vertical-align: middle; }
.swatch input:checked + .swatch-dot { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.25); }
.swatch input:checked ~ .swatch-name { color: var(--text); }

.uploader {
  display: block; position: relative; border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 26px; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.uploader:hover, .uploader.drag { border-color: var(--accent); background: var(--accent-soft); }
.uploader-icon { font-size: 1.8rem; display: block; }
.uploader.has-file .uploader-inner { display: none; }
.uploader-preview { max-height: 120px; max-width: 100%; border-radius: 8px; }

/* link builder */
.link-rows { display: flex; flex-direction: column; gap: 12px; }
.link-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.link-row-fields { display: flex; flex-direction: column; gap: 8px; }
.link-row input[type=text], .lr-qty, .login-form input, .editor input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 10px 12px; font: inherit;
}
.link-row input:focus, .lr-qty:focus, .login-form input:focus, .editor input:focus,
.filter-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.link-row-qty { display: flex; align-items: center; gap: 6px; }
.qty-label { color: var(--muted); font-size: .8rem; }
.lr-qty { width: 62px; }
.lr-remove { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.lr-remove:hover { color: var(--bad); }

.link-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 14px; flex-wrap: wrap; }
.qty-meter { color: var(--muted); font-size: .92rem; }
.qty-meter.bad #qty-sum { color: var(--bad); font-weight: 700; }
.qty-ok { color: var(--good); font-weight: 700; }

/* "What's a tracked link?" explainer + account note */
.explainer { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 14px; }
.explainer > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 12px 0; list-style: none; display: flex; align-items: center; }
.explainer > summary::-webkit-details-marker { display: none; }
.explainer > summary::before { content: "?"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; margin-right: 8px; flex: none; }
.explainer[open] > summary { color: var(--text); }
.explainer-body { padding: 0 0 12px; }
.explainer-body p { margin: 0 0 .6rem; }
.account-note { margin-top: 14px; background: var(--bg-soft); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: .88rem; color: var(--muted); }
.lr-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; margin-bottom: 2px; }

.config-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 20px; flex-wrap: wrap; gap: 14px; }
.price-tag .price { font-size: 1.7rem; font-weight: 800; margin-right: 8px; }

/* tracking section */
.tracking-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.check-list li { padding-left: 28px; position: relative; margin-bottom: 8px; color: var(--muted); }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.tracking-price { font-size: 1.1rem; }
.mini-dash { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.mini-dash-head { font-weight: 600; margin-bottom: 16px; }
.mini-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; }
.mini-bars span { flex: 1; height: var(--h); background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 6px 6px 0 0; }
.mini-dash-foot { margin-top: 16px; color: var(--muted); }
.mini-dash-foot strong { color: var(--text); font-size: 1.3rem; }

/* pricing tiers */
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 760px; margin: 28px auto 0; }
.tier-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.tier-pro { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 40px rgba(79,70,229,.16); }
.tier-badge { position: absolute; top: -11px; right: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.tier-head h3 { margin: 0 0 4px; }
.tier-price { font-size: 1.9rem; font-weight: 800; margin-bottom: 16px; }
.tier-price span { display: block; font-size: .82rem; font-weight: 400; color: var(--muted); }
.included-note { background: rgba(22,163,74,.10); border: 1px solid rgba(22,163,74,.28); color: #15803d; border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 12px 0; }

/* cart */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 16px; }
.cart-pack { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cart-pack-logo img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px; }
.cart-pack-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cart-links { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.cart-links li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.chip-count { font-weight: 700; color: var(--accent); }
.chip-url { word-break: break-all; }
.cart-pack-price { font-weight: 700; }
.cart-summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 80px; }
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 1.2rem; font-weight: 800; }
.upsell { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; margin: 12px 0; }
.upsell span { display: block; }
.upsell-price { font-weight: 700; color: var(--accent); }
.empty-cart { text-align: center; padding: 60px 0; }

/* dashboard (used in later phases) */
.dash-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dash-table th, .dash-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.dash-table th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.dash-table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; background: var(--panel-2); border: 1px solid var(--line); }
.login-form, .editor { max-width: 420px; }
.login-form label, .editor label { display: block; margin: 14px 0 6px; font-weight: 600; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card .num { font-size: 2rem; font-weight: 800; }
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0; }
.filter-bar input { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 9px 11px; font: inherit; }

/* test-mode badge (dev simulation pages) */
.dev-badge { display:inline-block; background:#fef3c7; color:#92400e; border:1px solid #fcd34d; padding:4px 12px; border-radius:999px; font-size:.78rem; font-weight:700; letter-spacing:.05em; margin-bottom:14px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; margin-top: 40px; background: var(--bg-soft); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* responsive */
@media (max-width: 900px) {
  .hero-inner, .config-grid, .tracking-inner, .cart-layout, .tier-grid { grid-template-columns: 1fr; }
  .cards3, .stat-cards { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .kc-stack { height: 240px; }
  .cart-summary { position: static; }
}
