/* The public pages (store, product, thank-you, resend, sign-in). One phone-width column on every screen, white
   cards on a soft ground. --main / --accent (and the text colors on them) come from Admin → Settings, set inline
   by the Worker (src/core/pages.ts). */
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-latin.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --main: #0b2347; --accent: #ffd166; --on-main: #fff; --on-accent: #0f1b2d;
  --bg: #f3f5f9; --surface: #fff; --surface-2: #f8fafc; --ink: #0f1b2d; --ink-2: #3a4760; --muted: #52607a;
  --line: #dde3ec; --line-2: #e6eaf1; --error: #b42318; --ok: #127a4b;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --r-md: 12px; --r-lg: 16px; --r-xl: 24px;
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .06); --shadow-2: 0 12px 32px -12px rgba(15, 27, 45, .18); --shadow-3: 0 30px 60px -20px rgba(15, 27, 45, .3);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6rem; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
p { margin: 0 0 1rem; }
a { color: var(--main); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--main); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--error); font-weight: 600; font-size: .95rem; }
.ok { color: var(--ok); font-weight: 600; }

.col { width: 100%; max-width: 31rem; margin: 0 auto; padding: 0 16px 3rem; }
.col.narrow { padding-top: 2rem; }
.sheet { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line-2); padding: 1.5rem 1.25rem; margin: 1rem 0; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .75rem 1.4rem; border: 0; border-radius: var(--r-lg); background: var(--main); color: var(--on-main); font: 800 1.05rem var(--font-display); text-decoration: none; cursor: pointer; transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.08); color: var(--on-main); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-block { display: flex; width: 100%; }
.btn-pay, .btn-buy { background: var(--accent); color: var(--on-accent); }
.btn-pay:hover, .btn-buy:hover { color: var(--on-accent); }
.field { display: block; margin: 0 0 .9rem; font-size: .9rem; font-weight: 700; }
.field .muted { font-weight: 400; }
.field input { display: block; width: 100%; min-height: 48px; margin-top: .3rem; padding: .65rem .9rem; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-md); }
.field input:focus { outline: none; border-color: var(--main); background: #fff; box-shadow: 0 0 0 3px rgba(15, 27, 45, .08); }

/* Profile */
.profile { position: relative; text-align: center; padding-top: 6rem; margin-bottom: 1.25rem; }
.profile-band { position: absolute; inset: 0 -16px auto; height: 8.5rem; border-radius: 0 0 var(--r-xl) var(--r-xl); background-color: var(--main);
  background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px; }
@media (min-width: 520px) { .profile-band { inset: 16px 0 auto; border-radius: var(--r-xl); } .profile { padding-top: 7rem; } }
.profile-photo { position: relative; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow-2); }
.profile-initials { display: inline-grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 800 2.2rem var(--font-display); }
.profile-name { margin: .75rem 0 .25rem; font-size: 1.6rem; }
.profile-bio { margin: 0 auto .75rem; max-width: 24rem; color: var(--ink-2); font-size: .95rem; text-wrap: balance; }
.profile-social { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.social { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.social svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.social .dot { fill: currentColor; stroke: none; }
.mini-profile { display: flex; align-items: center; gap: .6rem; padding: 1rem 0 0; color: var(--ink); font-weight: 700; text-decoration: none; }
.mini-profile .profile-photo { width: 40px; height: 40px; border-width: 2px; box-shadow: var(--shadow-1); font-size: 1rem; }

/* Product cards */
.label { margin: 1.5rem 0 .5rem; text-align: center; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cards { display: grid; gap: 1rem; }
.card { display: grid; grid-template-columns: 88px 1fr; gap: .75rem 1rem; padding: 1rem; border-radius: var(--r-xl); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line-2); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--line); color: var(--ink); }
.thumb { width: 88px; height: 88px; border-radius: var(--r-md); overflow: hidden; background: var(--main); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.card-title { font: 800 1.05rem/1.25 var(--font-display); }
.card-desc { font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.price { display: inline-flex; align-items: baseline; gap: .4rem; }
.price strong { font: 800 1.2rem var(--font-display); }
.price s { color: var(--muted); font-size: .9rem; }
.card-btn { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 52px; border-radius: var(--r-lg); background: var(--main); color: var(--on-main); font: 800 1.05rem var(--font-display); }
.card-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; color: var(--muted); }

/* Product page */
.product-image { display: block; width: 100%; border-radius: var(--r-lg); margin-bottom: 1rem; }
.product-price { margin-bottom: .5rem; }
.product-price .price strong { font-size: 1.5rem; }
.lead { color: var(--ink-2); }
.btn-buy { margin: .5rem 0 1.25rem; }
.prose { color: var(--ink-2); }
.prose h1, .prose h2 { color: var(--ink); margin-top: 1.5rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin: .3rem 0; }
.checkout { scroll-margin-top: 1rem; box-shadow: var(--shadow-3), inset 0 0 0 2px var(--accent); }
.payment { min-height: 120px; margin: .5rem 0 1rem; }
.trust { margin: .75rem 0 0; text-align: center; color: var(--muted); font-size: .85rem; }

/* Thank-you */
.thanks h1 { font-size: 1.6rem; }
.spinner { width: 36px; height: 36px; margin: 1rem auto; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--main); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.foot { margin-top: 2.5rem; text-align: center; color: var(--muted); font-size: .85rem; }
.foot p { margin: 0 0 .5rem; }
.foot a { color: inherit; }
.fine { margin-top: .75rem; }

@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } .card:hover { transform: none; } .spinner { animation: none; } }
