/* Grably design system. Tokens are documented in DESIGN.md — change them here only. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Color */
  --c-accent: #3D34FF;
  --c-accent-hover: #2C22E6;
  --c-accent-soft: #EEEDFF;
  --c-on-accent: #FFFFFF;
  --c-ink: #0E0E12;
  --c-ink-2: #4A4A55;
  --c-ink-3: #6E6E7A;
  --c-line: #E7E7EC;
  --c-bg: #FFFFFF;
  --c-bg-2: #F6F6F8;
  --c-success: #0F8A4F;
  --c-warn-bg: #FFF4D6;
  --c-warn-ink: #6B4E00;

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1.0625rem;   /* 17 body */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --fs-2xl: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --fs-3xl: clamp(2.375rem, 1.6rem + 3.6vw, 4.25rem);

  /* Space (4px base) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4rem; --s-9: 6rem;

  /* Shape */
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(14,14,18,.04), 0 8px 24px rgba(14,14,18,.06);
  --max: 1160px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.6;
  color: var(--c-ink); background: var(--c-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 var(--s-4); font-weight: 800; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); letter-spacing: -0.01em; font-weight: 700; }
p { margin: 0 0 var(--s-4); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--c-ink); color: #fff; padding: 8px 12px; z-index: 100; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

/* Layout */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s-8) 0; }
.section--tint { background: var(--c-bg-2); }
.section__head { max-width: 680px; margin-bottom: var(--s-6); }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { display: inline-block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent); margin-bottom: var(--s-3); }
.lead { font-size: var(--fs-lg); color: var(--c-ink-2); }
.muted { color: var(--c-ink-3); }
.grid { display: grid; gap: var(--s-5); }
@media (min-width: 720px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } .section { padding: var(--s-9) 0; } }
@media (min-width: 720px) and (max-width: 979px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 0 var(--s-6); border-radius: var(--r-pill); border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: var(--fs-md); text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn--primary { background: var(--c-accent); color: var(--c-on-accent); box-shadow: 0 6px 18px rgba(61,52,255,.28); }
.btn--primary:hover { background: var(--c-accent-hover); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line); }
.btn--ghost:hover { border-color: var(--c-ink); }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; font-size: var(--fs-lg); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--c-line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 850; font-size: 1.625rem; letter-spacing: -0.05em; text-decoration: none; color: var(--c-ink); line-height: 1; }
.logo span { color: var(--c-accent); }
.nav { display: none; gap: var(--s-6); }
.nav a { text-decoration: none; font-weight: 600; font-size: var(--fs-sm); color: var(--c-ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--c-ink); }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; border-radius: var(--r-sm); }
.nav-toggle svg { width: 24px; height: 24px; }
.mobile-nav { display: none; border-top: 1px solid var(--c-line); padding: var(--s-3) 0 var(--s-5); }
.mobile-nav.is-open { display: block; }
.mobile-nav a { display: block; padding: var(--s-3) 0; font-weight: 600; text-decoration: none; font-size: var(--fs-lg); }
@media (min-width: 820px) { .nav { display: flex; } .nav-toggle, .mobile-nav, .mobile-nav.is-open { display: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--c-line); padding: var(--s-7) 0 var(--s-6); font-size: var(--fs-sm); color: var(--c-ink-2); }
.site-footer__grid { display: grid; gap: var(--s-6); }
.site-footer__grid > * { min-width: 0; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-size: var(--fs-sm); color: var(--c-ink); margin: 0 0 var(--s-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--s-2); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--c-ink); text-decoration: underline; }
.site-footer__bottom { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--c-line); display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }

/* Home hero */
.hero { padding: var(--s-8) 0 var(--s-7); }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 560px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

/* Product card */
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--r-lg); background: var(--c-bg); transition: transform .2s ease; }
.card:hover { transform: translateY(-3px); }
.card__media { aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--c-bg-2); position: relative; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--s-4) var(--s-1) 0; }
.card__title { font-size: var(--fs-md); font-weight: 700; margin: 0 0 var(--s-1); }
.card__tagline { font-size: var(--fs-sm); color: var(--c-ink-3); margin: 0 0 var(--s-2); }
.card__price { font-weight: 800; }
.badge { display: inline-block; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--c-accent-soft); color: var(--c-accent); }
.badge--warn { background: var(--c-warn-bg); color: var(--c-warn-ink); }
.card .badge { position: absolute; top: 12px; left: 12px; }
.empty { text-align: center; padding: var(--s-8) var(--s-4); border: 1px dashed var(--c-line); border-radius: var(--r-lg); color: var(--c-ink-2); }

/* Value props */
.value { padding: var(--s-5); border-radius: var(--r-md); background: var(--c-bg); border: 1px solid var(--c-line); }
.value__icon, .benefit__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c-accent-soft); color: var(--c-accent); margin-bottom: var(--s-4); }
.value__icon svg, .benefit__icon svg { width: 22px; height: 22px; }
.value h3 { margin-bottom: var(--s-2); }
.value p { margin: 0; color: var(--c-ink-2); font-size: var(--fs-sm); }

/* Prose (about, legal) */
.prose { max-width: 720px; }
.prose h2 { font-size: var(--fs-xl); margin-top: var(--s-7); }
.prose h3 { margin-top: var(--s-6); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: var(--s-2); }
.page-head { padding: var(--s-8) 0 var(--s-5); }
.page-head h1 { font-size: var(--fs-2xl); }
.tbd { background: var(--c-warn-bg); color: var(--c-warn-ink); padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* Forms */
.form { display: grid; gap: var(--s-4); max-width: 560px; }
.field label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s-2); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 16px; padding: 14px 16px; border: 1.5px solid var(--c-line); border-radius: var(--r-sm); background: #fff; color: var(--c-ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.field textarea { min-height: 160px; resize: vertical; }
.hp { display: none; }

/* ---------- Product landing page ---------- */
.notice { padding: var(--s-3) 0; font-size: var(--fs-sm); font-weight: 600; text-align: center; background: var(--c-warn-bg); color: var(--c-warn-ink); }
.pdp-hero { padding: var(--s-5) 0 var(--s-7); }
.pdp-hero__grid { display: grid; gap: var(--s-6); }
.pdp-hero__grid > *, .split > *, .grid > * { min-width: 0; } /* long thumb rows must scroll, not widen the column */
@media (min-width: 900px) { .pdp-hero__grid { grid-template-columns: 1.1fr 1fr; gap: var(--s-8); align-items: start; } .pdp-hero__info { position: sticky; top: 96px; } }
.gallery__main { aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--c-bg-2); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: var(--s-2); margin-top: var(--s-3); overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs button { flex: 0 0 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: var(--c-bg-2); cursor: pointer; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--c-accent); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-hero h1 { font-size: var(--fs-2xl); margin-bottom: var(--s-3); }
.pdp-price { font-size: var(--fs-xl); font-weight: 800; margin: var(--s-4) 0; }
.checklist { list-style: none; padding: 0; margin: var(--s-5) 0; display: grid; gap: var(--s-3); }
.checklist li { display: flex; gap: var(--s-3); align-items: flex-start; }
.checklist svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--c-accent); margin-top: 2px; }
.trust-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--c-ink-2); }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { width: 18px; height: 18px; color: var(--c-ink-3); }
.draft-note { padding: var(--s-4); border-radius: var(--r-md); background: var(--c-warn-bg); color: var(--c-warn-ink); font-size: var(--fs-sm); font-weight: 600; }
.benefit h3 { margin-bottom: var(--s-2); }
.benefit p { color: var(--c-ink-2); margin: 0; }
.split { display: grid; gap: var(--s-6); align-items: center; }
.split + .split { margin-top: var(--s-8); }
.split__media { border-radius: var(--r-lg); overflow: hidden; background: var(--c-bg-2); aspect-ratio: 4 / 3; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; gap: var(--s-8); } .split--rev .split__media { order: 2; } }
.specs { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.specs th, .specs td { text-align: left; padding: var(--s-3) 0; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.specs th { width: 40%; color: var(--c-ink-3); font-weight: 600; padding-right: var(--s-4); }
.quote { padding: var(--s-5); border-radius: var(--r-md); background: var(--c-bg); border: 1px solid var(--c-line); margin: 0; }
.quote p { font-size: var(--fs-md); }
.quote footer { font-size: var(--fs-sm); color: var(--c-ink-3); font-weight: 600; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--c-line); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s-5) 0; font-weight: 700; display: flex; justify-content: space-between; gap: var(--s-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--c-accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--c-ink-2); padding-bottom: var(--s-5); margin: 0; }
.info-list { display: grid; gap: var(--s-4); }
.info-list div { padding: var(--s-5); border-radius: var(--r-md); background: var(--c-bg); border: 1px solid var(--c-line); }
.info-list h3 { font-size: var(--fs-md); margin-bottom: var(--s-1); }
.info-list p { margin: 0; color: var(--c-ink-2); font-size: var(--fs-sm); }
.final-cta { text-align: center; padding: var(--s-8) var(--gutter); border-radius: var(--r-lg); background: var(--c-ink); color: #fff; }
.final-cta h2 { color: #fff; }
.final-cta p { color: rgba(255,255,255,.75); max-width: 560px; margin: 0 auto var(--s-5); }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--c-line); display: flex; align-items: center; gap: var(--s-4); transform: translateY(110%); transition: transform .25s ease; }
.sticky-cta.is-visible { transform: none; }
.sticky-cta__price { font-weight: 800; white-space: nowrap; }
.sticky-cta .btn { flex: 1; min-height: 48px; }
@media (min-width: 900px) { .sticky-cta { display: none; } }
body.has-sticky { padding-bottom: 80px; }
@media (min-width: 900px) { body.has-sticky { padding-bottom: 0; } }

/* Cookie banner */
.consent { position: fixed; left: var(--s-3); right: var(--s-3); bottom: var(--s-3); z-index: 90; max-width: 520px; padding: var(--s-5); border-radius: var(--r-md); background: var(--c-bg); box-shadow: 0 10px 40px rgba(14,14,18,.18); border: 1px solid var(--c-line); font-size: var(--fs-sm); }
.consent p { margin-bottom: var(--s-4); color: var(--c-ink-2); }
.consent__actions { display: flex; gap: var(--s-3); }
.consent .btn { min-height: 44px; padding: 0 var(--s-5); font-size: var(--fs-sm); flex: 1; }

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

/* ---------- Newsletter (footer form + popup) ---------- */
.nl-form__row { display: flex; gap: var(--s-2); }
.nl-form input[type="email"] { flex: 1; width: 100%; min-width: 0; min-height: 48px; padding: 0 var(--s-4); border: 1px solid var(--c-line); border-radius: 8px; font: inherit; font-size: var(--fs-sm); color: var(--c-ink); background: var(--c-bg); }
.nl-form input[type="email"]:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; border-color: var(--c-accent); }
.nl-form .btn { flex: none; white-space: nowrap; min-height: 48px; padding: 0 var(--s-5); font-size: var(--fs-sm); }
.nl-form__note { margin: var(--s-2) 0 0; font-size: var(--fs-xs); color: var(--c-ink-3); }
.nl-form__msg { margin: var(--s-2) 0 0; font-size: var(--fs-sm); font-weight: 600; }
.nl-form__msg:empty { display: none; }
.nl-form__msg.is-ok { color: var(--c-success); }
.nl-form__msg.is-err { color: #B42318; }
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.nl-form--footer { max-width: 380px; }
.nl-pop { position: fixed; inset: auto var(--s-3) var(--s-3) var(--s-3); z-index: 95; display: flex; justify-content: center; }
.nl-pop[hidden] { display: none; }
.nl-pop__card { position: relative; width: 100%; max-width: 440px; padding: var(--s-6) var(--s-5) var(--s-5); border-radius: 22px; background: var(--c-bg); border: 1px solid var(--c-line); box-shadow: 0 18px 60px rgba(14,14,18,.22); animation: nl-in .28s ease-out; }
.nl-pop__card h2 { font-size: var(--fs-xl); margin: var(--s-2) 0; }
.nl-pop__card > p { color: var(--c-ink-2); margin: 0 0 var(--s-4); font-size: var(--fs-sm); }
.nl-pop__close { position: absolute; top: var(--s-3); right: var(--s-3); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--c-bg-2); color: var(--c-ink-2); cursor: pointer; }
.nl-pop__close svg { width: 20px; height: 20px; }
.nl-pop__close:hover { color: var(--c-ink); }
@media (min-width: 720px) { .nl-pop { inset: auto var(--s-5) var(--s-5) auto; } }
@keyframes nl-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nl-pop__card { animation: none; } }
.has-sticky .nl-pop { bottom: 88px; }
@media (min-width: 900px) { .has-sticky .nl-pop { bottom: var(--s-5); } }
