/* GlorySmile — foundation: tokens, base, shared components.
   Page-specific styles live in assets/css/pages/<page>.css. */

/* fonts.css is linked separately in each page head (parallel download, no @import chain). */

/* ---------- Tokens ---------- */
:root {
  /* colour */
  --enamel: #F2F4F9;      /* page base: cool porcelain white */
  --pearl: #FFFFFF;       /* raised surfaces */
  --ink: #1A1438;         /* text: deep violet ink */
  --ink-2: #4A4566;       /* secondary text */
  --mist: #DDE1EC;        /* hairlines, quiet fills */
  --ultra: #5A2BFF;       /* the one accent: corrector violet */
  --ultra-deep: #3E17D6;  /* pressed / hover */
  --night: #0D0A24;       /* LED dark room only */
  --glow: #3D8BFF;        /* LED blue, only inside the dark room */
  --halo: conic-gradient(from 210deg, #FFD3F0, #CFE2FF, #D4FFF0, #FFF0CC, #E6D6FF, #FFD3F0);

  /* type */
  --f-display: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
  --f-text: 'Onest', 'Segoe UI', system-ui, sans-serif;
  --t-xs: 0.8125rem;
  --t-s: 0.9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.3125rem;
  --t-xl: clamp(1.625rem, 2.4vw + 0.8rem, 2.5rem);
  --t-2xl: clamp(2.25rem, 5vw + 0.5rem, 5rem);
  --t-3xl: clamp(3rem, 9vw, 9.5rem);
  --t-mega: clamp(4.5rem, 21.5vw, 24rem);

  /* space + shape */
  --gutter: clamp(1.125rem, 4vw, 3.5rem);
  --section: clamp(5rem, 12vw, 11rem);
  --max: 1520px;
  --header-h: 76px;
  --r-pill: 999px;
  --r-soft: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  min-height: 100svh;
  background: var(--enamel);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: var(--t-m);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 300; line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
p { text-wrap: pretty; max-width: 62ch; }
::selection { background: var(--ultra); color: var(--pearl); }

:focus-visible { outline: 3px solid var(--ultra); outline-offset: 3px; border-radius: 6px; }
.on-night :focus-visible, .on-ink :focus-visible { outline-color: var(--pearl); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 1rem; top: -100px; z-index: 200;
  background: var(--ink); color: var(--pearl); padding: 0.85rem 1.25rem; border-radius: var(--r-pill);
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Type helpers */
.display { font-family: var(--f-display); font-weight: 300; letter-spacing: -0.04em; line-height: 0.92; }
.h-mega { font-size: var(--t-mega); }
.h-3xl { font-size: var(--t-3xl); }
.h-2xl { font-size: var(--t-2xl); }
.h-xl { font-size: var(--t-xl); }
.lead { font-size: var(--t-l); line-height: 1.4; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.price { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ultra); --fg: var(--pearl);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 56px; padding: 0.9rem 1.9rem;
  border-radius: var(--r-pill); border: 1.5px solid transparent;
  background: var(--bg); color: var(--fg);
  font-family: var(--f-text); font-size: var(--t-m); font-weight: 600; line-height: 1.1;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { --bg: var(--ultra-deep); }
.btn:active { transform: scale(0.97); }
.btn--ink { --bg: var(--ink); --fg: var(--pearl); }
.btn--ink:hover { --bg: #000; }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: currentColor; }
.btn--ghost:hover { --bg: var(--ink); --fg: var(--pearl); border-color: var(--ink); }
.btn--light { --bg: var(--pearl); --fg: var(--ink); }
.btn--light:hover { --bg: var(--enamel); }
.on-night .btn--ghost { --fg: var(--pearl); }
.on-night .btn--ghost:hover { --bg: var(--pearl); --fg: var(--night); border-color: var(--pearl); }
.btn--block { width: 100%; }
.btn--sm { min-height: 46px; padding: 0.65rem 1.25rem; font-size: var(--t-s); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }
.btn.is-added { --bg: var(--ink); }

/* Round icon button (+, ×, arrows) */
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--pearl); color: var(--ink); border: 1.5px solid var(--mist);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--ink); color: var(--pearl); border-color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--ultra { background: var(--ultra); color: var(--pearl); border-color: var(--ultra); }
.icon-btn--ultra:hover { background: var(--ultra-deep); border-color: var(--ultra-deep); }

/* ---------- Halo (signature ring) ---------- */
.halo {
  --size: 60vmin; --ring: 2px;
  width: var(--size); aspect-ratio: 1; border-radius: 50%;
  background: var(--halo);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring)), #000 calc(100% - var(--ring) + 0.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring)), #000 calc(100% - var(--ring) + 0.5px));
  filter: drop-shadow(0 0 18px rgba(207, 226, 255, 0.9));
  pointer-events: none;
}
.halo-dot { display: inline-block; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--halo); vertical-align: middle; }

/* Image frames: arches and circles echo plinths and the halo */
.frame { position: relative; overflow: hidden; background: var(--pearl); }
.frame > img { width: 100%; height: 100%; object-fit: cover; }
.frame--arch { border-radius: var(--r-pill) var(--r-pill) var(--r-soft) var(--r-soft); }
.frame--circle { border-radius: 50%; aspect-ratio: 1; }
.frame--soft { border-radius: var(--r-soft); }
/* Packshots sit on near-white; multiply melts their backdrop into the enamel page */
.shot { background: var(--enamel); }
.shot > img { mix-blend-mode: multiply; object-fit: contain; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  color: var(--ink);
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.35s var(--ease);
}
.site-header__in { height: 100%; display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.site-header.is-solid, body:not([data-header^='overlay']) .site-header {
  background: color-mix(in srgb, var(--enamel) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 0 var(--mist);
}
body[data-header='overlay-night'] .site-header:not(.is-solid) { color: var(--pearl); }
body:not([data-header^='overlay']) main { padding-top: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; text-decoration: none; margin-right: auto; }
.brand__ring {
  width: 26px; height: 26px; border-radius: 50%; background: var(--halo);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  box-shadow: inset 0 0 0 1px rgba(26, 20, 56, 0.08);
  position: relative;
}
.brand__ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 4px rgba(90, 43, 255, 0.35); }
.brand__word { font-family: var(--f-display); font-weight: 500; font-size: 1.125rem; letter-spacing: -0.03em; }

.nav { display: flex; gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.nav a { text-decoration: none; font-weight: 500; padding-block: 0.5rem; position: relative; }
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 1.5px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current='page']::after { transform: scaleX(1); }

.cart-btn {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 46px; padding: 0.4rem 0.5rem 0.4rem 1.1rem;
  border-radius: var(--r-pill); border: 1.5px solid currentColor; font-weight: 600;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.cart-btn:hover { background: var(--ink); color: var(--pearl); border-color: var(--ink); }
.cart-btn__count {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 0.4rem; border-radius: var(--r-pill);
  background: var(--ultra); color: var(--pearl); font-size: var(--t-s); font-variant-numeric: tabular-nums;
}
.cart-btn__count.is-bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

.menu-btn { display: none; min-height: 46px; padding: 0 1.1rem; border-radius: var(--r-pill); border: 1.5px solid currentColor; font-weight: 600; }

/* Full-screen mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 90; background: var(--enamel); color: var(--ink);
  display: flex; flex-direction: column; padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu__close { position: absolute; top: 14px; right: var(--gutter); }
.menu__links { display: grid; gap: 0.25rem; margin-top: 1rem; }
.menu__links a { font-family: var(--f-display); font-weight: 300; font-size: clamp(2.5rem, 12vw, 4rem); letter-spacing: -0.04em; line-height: 1.1; text-decoration: none; }
.menu__shop { margin-top: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; padding-top: 2rem; }
.menu__shop a { display: grid; gap: 0.35rem; text-decoration: none; font-size: var(--t-xs); text-align: center; font-weight: 500; }
.menu__shop .frame { aspect-ratio: 1; }

@media (max-width: 820px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .cart-btn > span:first-child { display: none; }
  .cart-btn { padding: 0.4rem; }
  .brand__word { font-size: 1rem; }
}

/* ---------- Product tile (shop grids, related) ---------- */
.tile { position: relative; display: grid; gap: 1rem; align-content: start; }
.tile__media { aspect-ratio: 1; border-radius: var(--r-soft); }
.tile__media img { transition: transform 0.8s var(--ease); }
.tile:hover .tile__media img { transform: scale(1.04); }
.tile__row { display: flex; align-items: center; gap: 1rem; }
.tile__name { font-family: var(--f-text); font-weight: 600; font-size: var(--t-l); line-height: 1.2; letter-spacing: -0.01em; }
.tile__name a { text-decoration: none; }
.tile__name a::after { content: ''; position: absolute; inset: 0; } /* whole tile clickable */
.tile__meta { display: grid; gap: 0.15rem; margin-right: auto; }
.tile__price { font-size: var(--t-m); }
.tile .icon-btn { position: relative; z-index: 1; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--mist); border-radius: var(--r-pill); background: var(--pearl); }
.qty button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.qty button:hover { background: var(--enamel); }
.qty output { min-width: 2ch; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty svg { width: 16px; height: 16px; }

/* ---------- Cart drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 95; background: rgba(26, 20, 56, 0.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(460px, 100vw);
  display: flex; flex-direction: column; background: var(--pearl); color: var(--ink);
  transform: translateX(102%); transition: transform 0.5s var(--ease);
  box-shadow: -30px 0 80px rgba(26, 20, 56, 0.18);
}
.drawer.is-open { transform: none; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; }
.drawer__title { font-family: var(--f-display); font-weight: 300; font-size: var(--t-xl); letter-spacing: -0.03em; }
.drawer__body { flex: 1; overflow-y: auto; padding: 0 1.5rem; }
.drawer__foot { padding: 1.25rem 1.5rem 1.5rem; border-top: 1px solid var(--mist); display: grid; gap: 0.9rem; }
.drawer__line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.drawer__total { font-size: var(--t-l); font-weight: 600; }
.drawer__empty { display: grid; justify-items: start; gap: 1.25rem; padding: 2rem 0; }
.drawer__empty .halo { --size: 120px; --ring: 3px; margin-bottom: 0.5rem; }

.line { display: grid; grid-template-columns: 84px 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--mist); }
.line__img { width: 84px; height: 84px; border-radius: 50%; }
.line__name { font-weight: 600; line-height: 1.25; }
.line__name a { text-decoration: none; }
.line__actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.line__remove { font-size: var(--t-s); color: var(--ink-2); text-decoration: underline; min-height: 44px; }
.line__price { align-self: start; padding-top: 0.15rem; }

/* Free-shipping meter: the halo gradient fills as the cart grows */
.meter { display: grid; gap: 0.5rem; font-size: var(--t-s); }
.meter__track { height: 6px; border-radius: var(--r-pill); background: var(--mist); overflow: hidden; }
.meter__fill { height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, #CFE2FF, #E6D6FF, var(--ultra)); transition: width 0.6s var(--ease); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.45rem; }
.field label, .field legend { font-weight: 600; font-size: var(--t-s); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 56px; padding: 0.9rem 1.1rem; border-radius: 16px;
  border: 1.5px solid var(--mist); background: var(--pearl); font-size: var(--t-m);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--ultra); box-shadow: 0 0 0 4px rgba(90, 43, 255, 0.15); }
.field [aria-invalid='true'] { border-color: #C4123A; }
.field__error { color: #B00E33; font-size: var(--t-s); font-weight: 500; }
.field__hint { color: var(--ink-2); font-size: var(--t-s); }

/* Choice cards (radio as big pills) */
.choice { position: relative; display: flex; align-items: center; gap: 0.9rem; min-height: 64px; padding: 0.9rem 1.2rem; border: 1.5px solid var(--mist); border-radius: 18px; background: var(--pearl); cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink-2); flex: none; display: grid; place-items: center; }
.choice__dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ultra); transform: scale(0); transition: transform 0.2s var(--ease); }
.choice:has(input:checked) { border-color: var(--ultra); box-shadow: 0 0 0 3px rgba(90, 43, 255, 0.12); }
.choice:has(input:checked) .choice__dot { border-color: var(--ultra); }
.choice:has(input:checked) .choice__dot::after { transform: scale(1); }
.choice:has(input:focus-visible) { outline: 3px solid var(--ultra); outline-offset: 3px; }

/* ---------- Accordion ---------- */
.acc { border-top: 1px solid var(--mist); }
.acc details { border-bottom: 1px solid var(--mist); }
.acc summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 64px; padding: 1rem 0; font-weight: 600; font-size: var(--t-l);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: ''; width: 14px; height: 14px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-4px); transition: transform 0.3s var(--ease); }
.acc details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.acc details > div { padding: 0 0 1.5rem; color: var(--ink-2); }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--mist); padding-block: 1.1rem; }
.marquee__track { display: flex; width: max-content; gap: 2.5rem; animation: marquee 38s linear infinite; }
.marquee__item { display: inline-flex; align-items: center; gap: 2.5rem; font-family: var(--f-display); font-weight: 300; font-size: var(--t-xl); letter-spacing: -0.03em; white-space: nowrap; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Trust facts ---------- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--mist); border-block: 1px solid var(--mist); }
.fact { display: flex; align-items: center; gap: 1rem; padding: 1.5rem var(--gutter); background: var(--enamel); font-weight: 500; }
.fact svg { width: 32px; height: 32px; flex: none; color: var(--ultra); }
@media (max-width: 820px) { .facts { grid-template-columns: 1fr; } .fact { padding-block: 1.1rem; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 120; transform: translate(-50%, calc(100% + 3rem)); visibility: hidden;
  display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.4rem; border-radius: var(--r-pill);
  background: var(--ink); color: var(--pearl); font-weight: 500; box-shadow: 0 20px 50px rgba(26, 20, 56, 0.3);
  transition: transform 0.45s var(--ease), visibility 0s linear 0.45s;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform 0.45s var(--ease); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--enamel); padding-top: var(--section); overflow: hidden; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2.5rem; }
.footer__lead { font-family: var(--f-display); font-weight: 300; font-size: var(--t-xl); letter-spacing: -0.03em; line-height: 1.15; max-width: 14ch; }
.footer__col h2 { font-family: var(--f-text); font-weight: 600; font-size: var(--t-s); letter-spacing: 0; color: rgba(242, 244, 249, 0.6); margin-bottom: 1rem; }
.footer__col ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.footer__col a { display: inline-block; padding-block: 0.15rem; }
.footer__word {
  display: block; margin-top: clamp(3rem, 8vw, 7rem);
  font-family: var(--f-display); font-weight: 200; font-size: clamp(3.5rem, 15.6vw, 17rem); letter-spacing: -0.06em; line-height: 0.8;
  white-space: nowrap; text-align: center;
  background: linear-gradient(180deg, #E6D6FF 0%, #CFE2FF 45%, rgba(207, 226, 255, 0.05) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.06em;
}
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid rgba(242, 244, 249, 0.14); font-size: var(--t-s); color: rgba(242, 244, 249, 0.6); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .marquee__track { animation: none; }
}
