/* Lampa Advent — токени (з tokens.json дизайн-системи) і розкладка сторінки */
:root {
  --bg: #0e0e0e; --surface: #161616; --surface-raised: #1f1f1f;
  --line: #2c2c2c; --line-strong: #707070;
  --ink: #ffffff; --ink-muted: #b5b5b5; --ink-dim: #8a8a8a;
  --lamp: #f8cb2e; --lamp-bright: #ffe27a; --lamp-deep: #c99a0a; --on-lamp: #0e0e0e;
  --glow: rgba(248, 203, 46, 0.38); --glow-soft: rgba(248, 203, 46, 0.10);
  --bulb-off: #4a4a4a; --bulb-base: #a3a3a3; --snow: #ffffff; --danger: #ff8a7a;
  --glow-sm: 0 0 14px rgba(248, 203, 46, 0.55); --glow-lg: 0 0 56px rgba(248, 203, 46, 0.35); --lift: 0 24px 80px rgba(0, 0, 0, 0.6);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --radius-none: 0; --radius-sm: 2px; --radius-round: 999px;
  --font-sans: Montserrat, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.la-page { position: relative; background: var(--bg); color: var(--ink); font-family: var(--font-sans); overflow: hidden; }
.la-page::before { /* тепле світло згори, від гірлянди */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 520px; pointer-events: none;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, var(--glow-soft), transparent 70%);
}
.la-wrap { position: relative; z-index: 1; max-width: 1128px; margin: 0 auto; padding-inline: max(16px, 4vw); }
.la-top { padding-block: 20px; }

.la-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px; padding-block: 56px 64px; }
.la-hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; min-width: 0; }
.la-hero__art { display: flex; align-items: flex-end; gap: 32px; padding-right: 24px; }
.la-hero__art .la-bulb { width: 150px; }

.la-cal { display: flex; flex-direction: column; gap: 24px; }

.la-faq { padding-block: 72px 56px; display: flex; flex-direction: column; gap: 32px; }
.la-faq h2 { margin: 0; font: 800 clamp(24px, 4vw, 32px)/1.1 var(--font-sans); letter-spacing: -.01em; }
.la-faq__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.la-faq__item { border-top: 1px solid var(--line-strong); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.la-faq__item h3 { margin: 0; font: 700 18px/1.3 var(--font-sans); }
.la-faq__item p { margin: 0; font: 500 15px/1.6 var(--font-sans); color: var(--ink-muted); }

.la-foot { border-top: 1px solid var(--line); padding-block: 24px 32px; display: flex; justify-content: space-between; gap: 16px; font: 600 13px/1.2 var(--font-sans); color: var(--ink-dim); }
.la-foot a { color: var(--ink-muted); }
.la-foot a:hover { color: var(--lamp); }

/* сніг у макеті: CSS-шари; на сайті — canvas (див. компонент Snow) */
.la-snow {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background-image:
    radial-gradient(circle, #fff 1.6px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, .7) 1.1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, .45) .8px, transparent 1.2px),
    radial-gradient(circle, #f8cb2e 1.4px, transparent 1.8px);
  background-size: 210px 230px, 150px 170px, 90px 110px, 470px 510px;
  background-position: 20px 30px, 80px 10px, 40px 60px, 200px 120px;
  animation: la-fall 16s linear infinite;
}
@keyframes la-fall { to { background-position: 20px 260px, 80px 350px, 40px 500px, 200px 630px; } }

/* підкладка для екрана входу та модального вікна */
.la-backdrop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; }
.la-backdrop--dim { background: rgba(14, 14, 14, .82); }
.la-sparks { position: absolute; left: 50%; top: 78px; width: 0; height: 0; }
.la-sparks i { position: absolute; width: 5px; height: 5px; background: var(--lamp); box-shadow: var(--glow-sm); }

/* телефон: медіазапит для сайту, .la-m — для макетів фіксованої ширини */
@media (max-width: 720px) {
  .la-hero { grid-template-columns: minmax(0, 1fr); padding-block: 32px 40px; }
  .la-hero__art { display: none; }
  .la-faq__list { grid-template-columns: minmax(0, 1fr); }
  .la-switch span, .la-user__name { display: none; }
  .la-switch { padding: 0 10px; }
}
.la-m .la-hero { grid-template-columns: minmax(0, 1fr); padding-block: 32px 40px; }
.la-m .la-hero__art { display: none; }
.la-m .la-faq__list { grid-template-columns: minmax(0, 1fr); }
.la-m .la-switch span, .la-m .la-user__name { display: none; }
.la-m .la-switch { padding: 0 10px; }
.la-m .la-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.la-m .la-cell { padding: 10px; }
.la-m .la-cell__num { font-size: 24px; }
.la-m .la-cell__foot { font-size: 10px; }
.la-m .la-timer { font-size: 12px; }
.la-m .la-h1 { font-size: 38px; }
.la-m .la-lead { font-size: 16px; }
.la-m .la-wrap { padding-inline: 16px; }

@media (prefers-reduced-motion: reduce) { .la-snow { animation: none; } }
/* Lampa Advent — стилі компонентів. Усі значення беруться з токенів (tokens.css). */

.la, .la * { box-sizing: border-box; }
.la { font-family: var(--font-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
.la-nowrap { white-space: nowrap; }

/* ───────── Лампочка ───────── */
.la-bulb {
  --la-glass: transparent; --la-stroke: var(--bulb-off); --la-fil: var(--bulb-off);
  --la-base: var(--bulb-off); --la-shine: transparent;
  display: block; width: 48px; aspect-ratio: 64 / 96; height: auto; overflow: visible;
}
.bp-glass    { fill: var(--la-glass); stroke: var(--la-stroke); stroke-width: 2.5; transition: fill .45s, stroke .45s; }
.bp-filament { fill: none; stroke: var(--la-fil); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .45s; }
.bp-shine    { fill: none; stroke: var(--la-shine); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.bp-base     { fill: var(--la-base); transition: fill .45s; }

.la-bulb.is-on {
  --la-glass: var(--lamp); --la-stroke: var(--lamp-bright); --la-fil: var(--on-lamp);
  --la-base: var(--bulb-base); --la-shine: var(--ink);
  filter: drop-shadow(0 0 10px var(--glow)) drop-shadow(0 0 30px var(--glow));
}
.la-bulb.is-on.is-white {
  --la-glass: var(--ink); --la-stroke: var(--ink); --la-fil: var(--lamp-deep);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .45));
}
/* на жовтому тлі: чорний контур, біле скло */
.la-bulb.is-ink {
  --la-glass: var(--ink); --la-stroke: var(--on-lamp); --la-fil: var(--on-lamp);
  --la-base: var(--on-lamp); --la-shine: transparent; filter: none;
}

/* ───────── Гірлянда ───────── */
.la-garland { position: relative; height: 84px; width: 100%; overflow: hidden; pointer-events: none; }
.la-garland__wire { position: absolute; inset: 0 auto auto 0; overflow: visible; }
.la-garland__wire path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.la-garland__bulb {
  position: absolute; width: 22px; margin-left: -11px; transform-origin: 50% 0;
  animation: la-sway 3.6s ease-in-out infinite alternate; animation-delay: var(--d, 0s);
}
.la-garland__bulb .la-bulb { width: 100%; transform: rotate(180deg); filter: none; }
.la-garland__bulb::after {
  content: ""; position: absolute; left: 50%; top: 62%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  animation: la-twinkle 2.8s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.la-garland__bulb.is-white::after { background: radial-gradient(circle, rgba(255, 255, 255, .28) 0%, transparent 65%); }
.la-lights-off .la-garland__bulb::after { display: none; }
.la-lights-off .la-garland__bulb .la-bulb {
  --la-glass: transparent; --la-stroke: var(--bulb-off); --la-fil: var(--bulb-off); --la-base: var(--bulb-off); --la-shine: transparent;
}
@keyframes la-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes la-twinkle { 0%, 100% { opacity: 1; } 45% { opacity: .35; } 60% { opacity: .9; } }

/* ───────── Бейдж ───────── */
.la-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: 700 12px/1.2 var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--lamp); border: 1px solid var(--lamp); padding: 7px 12px; border-radius: var(--radius-none);
}
.la-badge::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-round); background: var(--lamp); box-shadow: var(--glow-sm); }

/* ───────── Кнопки ───────── */
.la-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--space-12); padding: 0 28px; border: 1px solid transparent; border-radius: var(--radius-none);
  font: 700 15px/1 var(--font-sans); cursor: pointer; text-decoration: none;
  transition: background-color .18s, color .18s, border-color .18s, transform .12s;
}
.la-btn:active { transform: translateY(1px); }
.la-btn:focus-visible, .la-cell:focus-visible, .la-link:focus-visible { outline: 2px solid var(--lamp-bright); outline-offset: 3px; }
.la-btn--lamp  { background: var(--lamp); color: var(--on-lamp); }
.la-btn--lamp:hover  { background: var(--lamp-bright); }
.la-btn--lamp:active { background: var(--lamp-deep); }
.la-btn--light { background: var(--ink); color: var(--on-lamp); }
.la-btn--light:hover { background: var(--lamp); }
.la-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.la-btn--ghost:hover { border-color: var(--lamp); color: var(--lamp); }
.la-btn--sm { min-height: 36px; padding: 0 16px; font-size: 13px; }
.la-link {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-muted);
  font: 700 12px/1.2 var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: underline; text-decoration-color: var(--lamp); text-underline-offset: 4px;
}
.la-link:hover { color: var(--lamp); }

/* ───────── Шапка ───────── */
.la-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.la-logo { font: 800 28px/1 var(--font-sans); letter-spacing: -.03em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; gap: var(--space-2); }
.la-logo span { font: 700 11px/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); }
.la-top__right { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.la-user { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font: 600 13px/1.2 var(--font-sans); color: var(--ink-muted); }
.la-user img, .la-user__pic { width: 32px; height: 32px; border-radius: var(--radius-round); flex: none; background: var(--lamp); color: var(--on-lamp); display: grid; place-items: center; font-weight: 800; }
.la-user__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch; }
.la-switch { display: inline-flex; align-items: center; gap: var(--space-2); background: none; border: 1px solid var(--line-strong); color: var(--ink); min-height: 36px; padding: 0 12px 0 8px; cursor: pointer; font: 700 12px/1 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.la-switch .la-bulb { width: 14px; filter: none; }
.la-switch:hover { border-color: var(--lamp); }

/* ───────── Прогрес ───────── */
.la-progress { display: flex; align-items: center; gap: var(--space-4); font: 600 13px/1.2 var(--font-sans); color: var(--ink-muted); }
.la-progress b { color: var(--ink); font-weight: 800; }
.la-progress__bar { flex: 1; height: 4px; background: var(--line); border-radius: var(--radius-sm); min-width: 40px; }
.la-progress__bar i { display: block; height: 100%; background: var(--lamp); border-radius: var(--radius-sm); box-shadow: var(--glow-sm); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

/* ───────── Комірка дня ───────── */
.la-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 760px) { .la-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .la-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); } }

.la-cell {
  position: relative; aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-none);
  background: var(--surface); color: var(--ink); text-align: left; font-family: var(--font-sans);
  overflow: hidden; cursor: pointer; transition: border-color .2s, transform .2s;
}
.la-cell__num { font: 800 clamp(24px, 4.2vw, 40px)/1 var(--font-sans); letter-spacing: -.02em; position: relative; }
.la-cell__foot { display: flex; flex-direction: column; gap: var(--space-1); font: 700 11px/1.2 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; position: relative; }
.la-cell .la-bulb { position: absolute; left: 50%; top: 50%; width: 36%; transform: translate(-50%, -48%); filter: none; }
.la-timer { font: 700 clamp(12px, 1.6vw, 15px)/1 var(--font-mono); color: var(--lamp); letter-spacing: 0; font-variant-numeric: tabular-nums; }

.la-cell.is-locked { cursor: default; color: var(--ink-dim); }
.la-cell.is-next   { border-color: var(--lamp-deep); color: var(--ink); }
.la-cell.is-next .la-cell__foot { color: var(--ink-muted); }
.la-cell.is-ready  { background: var(--lamp); border-color: var(--lamp); color: var(--on-lamp); animation: la-pulse 2.2s ease-out infinite; }
.la-cell.is-ready:hover { background: var(--lamp-bright); transform: translateY(-3px); }
.la-cell__cta { align-self: flex-start; background: var(--on-lamp); color: var(--ink); padding: 7px 10px; letter-spacing: .06em; }
.la-cell.is-open   { background: radial-gradient(circle at 50% 50%, var(--glow) 0%, transparent 62%), var(--surface); border-color: var(--lamp-deep); }
.la-cell.is-open .la-cell__foot { color: var(--lamp); }
.la-cell.is-open:hover { border-color: var(--lamp); }
.la-cell.is-shake { animation: la-shake .4s; }
@keyframes la-pulse { 0% { box-shadow: 0 0 0 0 var(--glow); } 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes la-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ───────── Картка: модальне вікно та вхід ───────── */
.la-card {
  width: min(440px, 100%); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-none);
  padding: var(--space-8); color: var(--ink); text-align: center; font-family: var(--font-sans);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4); position: relative; box-shadow: var(--lift);
}
.la-card h2 { margin: 0; font: 800 clamp(24px, 5vw, 32px)/1.1 var(--font-sans); letter-spacing: -.01em; text-wrap: balance; }
.la-card h2 em, .la-h1 em { font-style: normal; color: var(--lamp); }
.la-card p { margin: 0; font: 500 15px/1.6 var(--font-sans); color: var(--ink-muted); white-space: pre-line; }
.la-card__bulb { width: 72px; margin-bottom: var(--space-2); }
.la-card__close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; background: none; border: 0; color: var(--ink-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.la-card__close:hover { color: var(--lamp); }
.la-card__msg { color: var(--danger) !important; font-weight: 600 !important; min-height: 1.6em; }
.la-promo { width: 100%; border: 1px dashed var(--lamp); padding: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.la-promo__label { font: 700 11px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.la-promo code { font: 700 clamp(18px, 5vw, 22px)/1 var(--font-mono); letter-spacing: .06em; color: var(--lamp); overflow-wrap: anywhere; user-select: all; }

/* ───────── Заголовок героя ───────── */
.la-h1 { margin: 0; font: 800 clamp(38px, 7vw, 64px)/1.02 var(--font-sans); letter-spacing: -.02em; text-wrap: balance; }
.la-lead { margin: 0; font: 500 clamp(16px, 2vw, 18px)/1.55 var(--font-sans); color: var(--ink-muted); max-width: 56ch; }

/* ───────── Точкова сітка (декор Lampa) ───────── */
.la-dots { width: 72px; height: 96px; background-image: radial-gradient(circle, var(--lamp) 4px, transparent 4.5px); background-size: var(--space-6) var(--space-6); opacity: .9; }

@media (prefers-reduced-motion: reduce) {
  .la-garland__bulb, .la-garland__bulb::after, .la-cell.is-ready { animation: none; }
  .bp-glass, .bp-filament, .bp-base { transition: none; }
}

/* ───────── Лише сайт: фіксовані шари, вхід, діалог ───────── */
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
body.la-page { overflow-x: hidden; overflow-y: auto; }
.la-sprite { position: absolute; }
button { font-family: inherit; }
.la-wrap { padding-left: max(16px, 4vw, env(safe-area-inset-left)); padding-right: max(16px, 4vw, env(safe-area-inset-right)); }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.la-garland { z-index: 2; }
.la-cursor {
  position: fixed; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow-soft), transparent 65%);
  pointer-events: none; z-index: 0; opacity: 0; transition: opacity .5s; will-change: transform;
}
@media (hover: hover) and (pointer: fine) { .la-cursor.is-live { opacity: 1; } }

.la-user img { object-fit: cover; }
.la-note { margin: 0; min-height: 1.4em; font: 600 13px/1.4 var(--font-sans); color: var(--danger); }
.la-cell { -webkit-tap-highlight-color: transparent; }
.la-cell.is-busy { opacity: .7; pointer-events: none; }

/* вхід */
.la-gate { display: none; }
body.is-gated main, body.is-gated .la-top__right { display: none; }
body.is-gated .la-gate { display: grid; place-items: center; position: relative; z-index: 4; padding-block: 24px 64px; min-height: calc(100dvh - 260px); }
.la-gbtn { width: 100%; }
.la-gbtn[disabled] { opacity: .6; cursor: progress; }

/* діалог */
dialog.la-modal { border: 0; padding: 0; background: transparent; color: inherit; overflow: visible; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog.la-modal::backdrop { background: rgba(14, 14, 14, .82); }
dialog.la-modal[open] { animation: la-pop .3s cubic-bezier(.2, .9, .3, 1.15); }
dialog.la-modal .la-card { width: 100%; max-height: calc(100dvh - 32px); overflow-y: auto; }
@keyframes la-pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.la-spark { position: absolute; left: 50%; top: 74px; width: 5px; height: 5px; margin: -2px 0 0 -2px; background: var(--lamp); box-shadow: var(--glow-sm); pointer-events: none; }

@media (max-width: 520px) {
  .la-cell { padding: 10px; }
  .la-cell__foot { font-size: 10px; }
  .la-card { padding: var(--space-6); }
  .la-logo { font-size: 24px; }
  .la-top__right { gap: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) { dialog.la-modal[open] { animation: none; } }

[hidden] { display: none !important; }

/* подарунок: деталі та посилання */
dialog.la-modal { width: min(520px, calc(100vw - 32px)); }
dialog.la-modal .la-card h2 { font-size: clamp(20px, 4.6vw, 26px); }
.la-details { margin: 0; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: var(--space-4); }
.la-details dt { font: 700 11px/1.2 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--lamp); margin-top: 10px; }
.la-details dt:first-child { margin-top: 0; }
.la-details dd { margin: 0; font: 500 15px/1.55 var(--font-sans); color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.la-links { width: 100%; display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.la-links .la-btn { flex: 1 1 auto; min-height: 44px; }

dialog.la-modal:focus, dialog.la-modal:focus-visible { outline: none; }
