/* «Скоро отваряме» — the shop's tokens and type (storefront globals.css), one page. */
@font-face { font-family: 'Geologica'; font-weight: 300 500; font-display: swap; src: url('fonts/geologica-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geologica'; font-weight: 300 500; font-display: swap; src: url('fonts/geologica-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Ysabeau Office'; font-weight: 400 700; font-display: swap; src: url('fonts/ysabeau-office-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Ysabeau Office'; font-weight: 400 700; font-display: swap; src: url('fonts/ysabeau-office-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* «Работилница» (day) */
:root {
  --bg: #F2F0E9;
  --surface-2: #E8E5DC;
  --line: #D6D3C9;
  --fg: #1C1F1D;
  --muted: #5F645E;
  --accent: #4F6A12;
  --dot: #4F6A12;
  --sun: #E6E0CC;
  --star: #F2F0E9;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t: .7s;
  color-scheme: light;
}
/* «Нощна витрина» (night) */
html[data-theme="dark"] {
  --bg: #0C0F0D;
  --surface-2: #1E231F;
  --line: #2B312C;
  --fg: #F2F0E9;
  --muted: #9EA39C;
  --accent: #D8F55A;
  --dot: #D8F55A;
  --sun: #2B312C;
  --star: #F2F0E9;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Ysabeau Office', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--bg); }

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: calc(1312px + 8rem);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 1024px) { .page { padding: 0 64px; } }

/* ---- header: logo + «Угаси» / «Светни» --------------------------------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
@media (min-width: 1024px) { .bar { height: 88px; } }
.logo { display: inline-flex; align-items: center; gap: .3em; font-size: 40px; line-height: 1; text-decoration: none; color: var(--fg); }
.logo svg { display: block; width: 1em; height: 1em; overflow: visible; flex: none; }
.logo path { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.logo-dot { fill: var(--dot); transition: fill var(--t) var(--ease); }
.logo-glow circle { fill: var(--dot); filter: blur(9px); opacity: 0; transition: opacity var(--t) var(--ease); }
html[data-theme="dark"] .logo-glow circle:first-child { opacity: .9; }
html[data-theme="dark"] .logo-glow circle:last-child { opacity: .5; }
.word { font-family: 'Geologica', sans-serif; font-size: .26em; font-weight: 400; letter-spacing: .22em; display: inline-flex; gap: .7em; white-space: nowrap; }

.toggle {
  height: 44px; display: inline-flex; align-items: center; gap: 10px;
  padding: 0 6px 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--fg); font: 600 14px/1 'Ysabeau Office', sans-serif;
  cursor: pointer; transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; background: #4F6A12; transition: background-color .2s, box-shadow .2s; flex: none; }
.knob { position: absolute; top: 4px; left: 24px; width: 20px; height: 20px; border-radius: 50%; background: #FBFAF6; box-shadow: 0 1px 2px #0000004D; transition: left .2s, background-color .2s, box-shadow .2s; }
html[data-theme="dark"] .switch { background: #1E231F; box-shadow: inset 0 0 0 1px #3A413B; }
html[data-theme="dark"] .knob { left: 4px; background: #D8F55A; box-shadow: 0 0 10px 3px #D8F55A8C; }

/* ---- hero ---------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end; padding: 16px 0 24px; }
@media (min-width: 1024px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 64px; align-items: center; padding: 24px 0 40px; } }
.copy { display: flex; flex-direction: column; gap: 20px; max-width: 600px; }
@media (min-width: 1024px) { .copy { gap: 28px; } }
.label { margin: 0; font: 400 12px/16px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); transition: color var(--t) var(--ease); }
@media (min-width: 1024px) { .label { font-size: 13px; } }
.title { margin: 0; font-family: 'Geologica', sans-serif; font-weight: 300; font-size: 52px; line-height: 56px; letter-spacing: -.01em; }
@media (min-width: 640px) { .title { font-size: 72px; line-height: 76px; } }
@media (min-width: 1024px) { .title { font-size: 104px; line-height: 104px; } }
.lead { margin: 0; color: var(--muted); font-size: 18px; line-height: 28px; max-width: 540px; transition: color var(--t) var(--ease); }
@media (min-width: 1024px) { .lead { font-size: 19px; line-height: 29px; } }
.hint { margin: 0; font: 400 12px/18px 'IBM Plex Mono', monospace; letter-spacing: .04em; color: var(--accent); transition: color var(--t) var(--ease); }
.contact { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 22px; transition: border-color var(--t) var(--ease); }
.contact a { color: var(--accent); text-underline-offset: 3px; transition: color var(--t) var(--ease); }

/* ---- scene ---------------------------------------------------------------- */
.scene { position: relative; width: 100%; max-width: 280px; justify-self: center; cursor: pointer; -webkit-tap-highlight-color: transparent; order: -1; }
@media (min-width: 640px) { .scene { max-width: 400px; } }
@media (min-width: 1024px) { .scene { max-width: 560px; justify-self: end; order: 0; } }
.scene svg { display: block; width: 100%; height: auto; overflow: visible; }

.sun { fill: var(--sun); transition: fill var(--t) var(--ease); }
.moon-cut { fill: var(--bg); transform: translate(92px, -8px); transition: transform 1s var(--ease), fill var(--t) var(--ease); }
html[data-theme="dark"] .moon-cut { transform: translate(18px, -10px); }
.table { stroke: var(--line); stroke-width: 2; transition: stroke var(--t) var(--ease); }
.lamp { fill: none; stroke: var(--fg); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--t) var(--ease); }
.bulb { fill: var(--dot); transition: fill .25s var(--ease); }
.bulb-glow circle { fill: #D8F55A; }
.bulb-glow, .light { opacity: 0; transition: opacity .3s var(--ease); }
html[data-theme="dark"] .bulb-glow, html[data-theme="dark"] .light { opacity: 1; }
/* switching off the light: the bulb flickers on, the room catches up */
html.lighting .bulb-glow, html.lighting .light { animation: flicker 1.1s linear both; }
html.lighting .bulb { animation: bulb-on 1.1s linear both; }
@keyframes flicker {
  0% { opacity: 0 } 8% { opacity: .85 } 14% { opacity: .1 } 24% { opacity: .95 } 30% { opacity: .25 } 44% { opacity: 1 } 52% { opacity: .7 } 64%, 100% { opacity: 1 }
}
@keyframes bulb-on {
  0% { fill: #4F6A12 } 8% { fill: #D8F55A } 14% { fill: #6E8424 } 24%, 100% { fill: #D8F55A }
}

.star { fill: var(--star); opacity: 0; transition: opacity 1.2s var(--ease); }
html[data-theme="dark"] .star { opacity: var(--o, .6); animation: twinkle var(--d, 4s) ease-in-out var(--delay, 0s) infinite alternate; }
@keyframes twinkle { from { opacity: var(--o, .6) } to { opacity: .12 } }

/* fireflies: drift on their own path, blink; they arrive with the night */
.fly { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: 0s; }
.fly circle { fill: #D8F55A; }
/* page just opened: everything that comes with the night starts hidden */
html.boot .fly, html[data-theme="dark"].boot .fly { opacity: 0; transform: scale(.2); }
html.boot .bulb-glow, html.boot .light { opacity: 0 !important; }
.fly .halo { filter: url(#blur-s); opacity: .9; }
html[data-theme="dark"] .fly { opacity: 1; transform: none; transition-delay: var(--in, 0s); }
.fly .path { animation: drift var(--d, 9s) ease-in-out var(--delay, 0s) infinite alternate; }
.fly .glow { animation: blink var(--b, 3s) ease-in-out var(--delay, 0s) infinite; }
@keyframes drift {
  0% { transform: translate(0, 0) }
  33% { transform: translate(var(--x1), var(--y1)) }
  66% { transform: translate(var(--x2), var(--y2)) }
  100% { transform: translate(var(--x3), var(--y3)) }
}
@keyframes blink { 0%, 100% { opacity: 1 } 45% { opacity: .15 } 60% { opacity: .9 } }

/* ---- footer ---------------------------------------------------------------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 20px; transition: border-color var(--t) var(--ease), color var(--t) var(--ease); }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .06em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html[data-theme="dark"] .star { opacity: var(--o, .6); }
}
