/* nurlan.enso7.com: thirty-eight floors instead of candles. Palette and type from enso7.com. */
:root {
  --bg: #0b0b0a;
  --ink: #f3f0ea;
  --text: #bdb8af;
  --muted: #7d7970;
  --light: #ffd79c;
  --rule: rgba(243, 240, 234, 0.14);
  --gutter: clamp(20px, 4.2vw, 68px);
  --col: min(60vw, 1040px);
  --display: "Roboto Flex", "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[lang="ru"] .ky, html[lang="ky"] .ru { display: none !important; }
body { margin: 0; color: var(--text); font-family: var(--body); font-weight: 300; font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, figure, dl, dd, ol { margin: 0; padding: 0; }
ol { list-style: none; }
:focus-visible { outline: 1px solid var(--light); outline-offset: 4px; }
::selection { background: rgba(255, 215, 156, 0.35); color: #fff; }

#scene { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; display: block; }

/* ---------- Header and lift ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px var(--gutter); pointer-events: none; }
.top::before { content: ""; position: absolute; inset: 0 0 -26px; background: linear-gradient(rgba(11, 11, 10, 0.94) 45%, rgba(11, 11, 10, 0)); pointer-events: none; }
.top > * { position: relative; pointer-events: auto; }
.top__logo img { height: 24px; width: auto; }
.lift { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 999px; background: rgba(11, 11, 10, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; transition: border-color 0.6s, box-shadow 0.6s; }
.lift__arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 6px solid var(--light); opacity: 0.25; transition: opacity 0.3s; }
.lift.is-moving .lift__arrow { opacity: 1; }
.lift__floor { font-weight: 400; font-size: 14px; color: var(--light); letter-spacing: 0.06em; min-width: 2ch; text-align: center; }
.lift__year { color: var(--muted); }
.lift.is-top { border-color: rgba(255, 215, 156, 0.6); box-shadow: 0 0 26px rgba(255, 215, 156, 0.28); }
.sound { display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 36px; height: 36px; flex: none; border: 1px solid var(--rule); border-radius: 50%; background: rgba(11, 11, 10, 0.55); transition: border-color 0.4s; }
.sound:hover { border-color: rgba(255, 215, 156, 0.6); }
.sound i { width: 2px; height: 4px; border-radius: 1px; background: var(--muted); transform-origin: center; }
.music-on .sound { border-color: rgba(255, 215, 156, 0.5); }
.music-on .sound i { background: var(--light); height: 14px; animation: eq 1.3s ease-in-out infinite; }
.music-on .sound i:nth-child(2) { animation-delay: -0.4s; }
.music-on .sound i:nth-child(3) { animation-delay: -0.8s; }
.music-on .sound i:nth-child(4) { animation-delay: -1.1s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.langs { display: inline-flex; gap: 2px; }
.langs button { height: 36px; padding: 0 6px; font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); transition: color 0.3s; }
.langs button:hover { color: var(--ink); }
html[lang="ru"] .langs [data-lang="ru"], html[lang="ky"] .langs [data-lang="ky"] { color: var(--ink); }

/* ---------- Type ---------- */
.kicker { font-family: var(--display); font-stretch: 151%; font-variation-settings: "wdth" 151; font-weight: 300; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: clamp(20px, 3vh, 34px); }
h1 { font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 200; color: var(--ink); font-size: clamp(40px, 5.7vw, 100px); line-height: 1.02; letter-spacing: -0.015em; margin-bottom: clamp(24px, 4vh, 44px); }
h2 { font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 200; color: var(--ink); font-size: clamp(30px, 3.7vw, 62px); line-height: 1.08; letter-spacing: -0.012em; margin-bottom: clamp(24px, 3.4vh, 40px); }
h3 { font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 300; color: var(--ink); font-size: clamp(21px, 1.9vw, 28px); line-height: 1.2; margin-bottom: 12px; }
.lead { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--ink); font-size: clamp(23px, 2.2vw, 34px); line-height: 1.28; max-width: 26em; }
.body { max-width: 37em; font-size: clamp(16.5px, 1.2vw, 18.5px); }
.from { margin-top: 26px; font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--light); }

.music { align-self: flex-start; margin-top: 24px; display: inline-flex; align-items: center; gap: 11px; height: 44px; padding: 0 20px 0 16px; border: 1px solid rgba(255, 215, 156, 0.45); border-radius: 999px; color: var(--light); font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; transition: background-color 0.4s, color 0.4s; }
.music:hover { background: rgba(255, 215, 156, 0.1); }
.music__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--light); }
.music-on .music__dot { animation: beat 1.579s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(0.45); opacity: 0.5; } }
.music__on { display: none; }
.music-on .music__on { display: inline; }
.music-on .music__off { display: none; }

/* ---------- Layout ---------- */
main { position: relative; }
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 96px var(--gutter) 72px; width: calc(var(--col) + var(--gutter)); position: relative; }
.hint { position: absolute; left: var(--gutter); bottom: 28px; display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.hint i { width: 1px; height: 30px; background: linear-gradient(var(--light), transparent); animation: drop 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.panel { width: calc(var(--col) + var(--gutter)); padding: clamp(70px, 13vh, 150px) 0 clamp(70px, 13vh, 150px) var(--gutter); }

/* ---------- Passport ---------- */
.passport { border-top: 1px solid var(--rule); max-width: 46em; }
.passport > div { display: grid; grid-template-columns: minmax(120px, 11em) 1fr; gap: 6px 20px; padding: 13px 0 14px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.passport dt { font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.passport dd { color: var(--ink); font-size: 16.5px; line-height: 1.45; }

/* ---------- Captions (photos) ---------- */
figcaption { margin-top: 11px; font-size: 14.5px; line-height: 1.5; color: var(--text); }
figcaption b { display: block; font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 300; font-size: 17px; color: var(--ink); margin-bottom: 1px; }

/* ---------- Letter ---------- */
.letter { max-width: 34em; font-size: clamp(18px, 1.35vw, 20.5px); line-height: 1.68; color: #d3cec5; }
.letter p + p { margin-top: 1.05em; }
.letter__open, .letter__turn { font-family: var(--serif); font-style: italic; color: var(--ink); font-size: 1.5em; line-height: 1.24; }
.sign { margin-top: 2em !important; font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 300; font-size: 17px; line-height: 1.4; color: var(--ink); }
.sign span { color: var(--muted); }

/* ---------- Calculations ---------- */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 3vw, 44px); margin-top: clamp(20px, 3vh, 34px); border-top: 1px solid var(--rule); }
.calc article { padding: 26px 0 30px; border-bottom: 1px solid var(--rule); }
.calc__wide { grid-column: 1 / -1; }
.calc__n { font-family: var(--display); font-stretch: 151%; font-variation-settings: "wdth" 151; font-weight: 200; color: var(--light); font-size: clamp(44px, 5vw, 84px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.calc__n--roman { font-size: clamp(38px, 3.9vw, 66px); letter-spacing: 0.01em; }
.calc__n--live { font-size: clamp(34px, 4.4vw, 74px); }
.calc__f { margin: 10px 0 12px; font-family: var(--display); font-stretch: 120%; font-variation-settings: "wdth" 120; font-size: 12.5px; letter-spacing: 0.05em; color: var(--muted); }
.calc article > p:last-child { font-size: 16px; }
.total { margin-top: 30px; font-family: var(--serif); font-style: italic; color: var(--ink); font-size: clamp(23px, 2vw, 31px); line-height: 1.28; max-width: 28em; }

/* ---------- Neighbours ---------- */
.neighbours { border-top: 1px solid var(--rule); margin: clamp(10px, 2vh, 20px) 0 clamp(28px, 4vh, 44px); }
.neighbours li { display: grid; grid-template-columns: 76px 1fr; gap: 4px 18px; padding: 15px 0 17px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.neighbours .yr { font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-size: 13px; letter-spacing: 0.08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.neighbours b { display: block; font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 300; color: var(--ink); font-size: clamp(20px, 1.8vw, 27px); line-height: 1.2; }
.neighbours sup { font-size: 0.6em; color: var(--muted); }
.neighbours p { margin-top: 3px; font-size: 15.5px; line-height: 1.5; }
.neighbours__same .yr, .neighbours__same b { color: var(--light); }
.note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* ---------- Meanwhile ---------- */
.meanwhile { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 44px); }

/* ---------- Photos ---------- */
.photos { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.photos figure { grid-column: span 6; }
.photos figure:nth-child(3n + 1) { grid-column: 1 / -1; }
.photos img { width: 100%; }

/* ---------- Floor 38 ---------- */
.finale { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; width: calc(var(--col) + var(--gutter)); padding: 110px 0 70px var(--gutter); position: relative; }
.finale__ask, .finale__wish { grid-area: 1 / 1; transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), visibility 1.2s; }
.finale h2 { max-width: 15em; }
.js .finale__wish { opacity: 0; visibility: hidden; transform: translateY(24px); }
.is-lit .finale__ask { opacity: 0; visibility: hidden; transform: translateY(-20px); }
.is-lit .finale__wish { opacity: 1; visibility: visible; transform: none; transition-delay: 1s; }
.switch { margin-top: clamp(26px, 4vh, 44px); display: inline-flex; align-items: center; gap: 14px; height: 60px; padding: 0 30px 0 22px; border-radius: 999px; background: var(--light); color: #1a1408; font-family: var(--display); font-stretch: 132%; font-variation-settings: "wdth" 132; font-weight: 400; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; box-shadow: 0 0 0 0 rgba(255, 215, 156, 0.5); animation: breathe 2.6s ease-in-out infinite; transition: transform 0.4s var(--ease), background-color 0.3s; }
.switch:hover { background: #ffe6bf; transform: translateY(-2px); }
.switch i { width: 14px; height: 14px; border-radius: 50%; background: #1a1408; }
@keyframes breathe { 50% { box-shadow: 0 0 44px 8px rgba(255, 215, 156, 0.38); } }
.crane { margin-top: 26px; font-family: var(--serif); font-style: italic; color: var(--light); font-size: clamp(24px, 2.2vw, 34px); line-height: 1.25; }
.sign__date { color: var(--muted); font-size: 13px; }

/* ---------- Reveals ---------- */
.js [data-r] { opacity: 0; transform: translateY(22px); transition: opacity 1.2s var(--ease), transform 1.4s var(--ease); }
.js [data-r].in { opacity: 1; transform: none; }

/* ---------- Phones: the tower stands behind the text, so the text gets a soft floor of its own ---------- */
@media (max-width: 899px) {
  :root { --col: 100vw; }
  body { font-size: 16.5px; }
  .hero, .panel, .finale { width: 100%; padding-left: var(--gutter); padding-right: var(--gutter); }
  .hero { justify-content: flex-end; padding-bottom: 96px; }
  .hero > *:not(.hint), .finale__ask, .finale__wish { position: relative; }
  .hero::before, .finale::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(11, 11, 10, 0) 18%, rgba(11, 11, 10, 0.8) 52%, rgba(11, 11, 10, 0.94)); pointer-events: none; }
  .top::before { inset: 0 0 -14px; background: linear-gradient(rgba(11, 11, 10, 0.97) 70%, rgba(11, 11, 10, 0)); }
  .is-lit .finale::before { background: linear-gradient(rgba(11, 11, 10, 0.18) 8%, rgba(11, 11, 10, 0.84) 32%, rgba(11, 11, 10, 0.9)); transition: background 1s; }
  .panel { padding-top: 56px; padding-bottom: 56px; background: rgba(11, 11, 10, 0.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .panel + .panel { border-top: 1px solid rgba(243, 240, 234, 0.06); }
  .top { gap: 8px; }
  .lift { padding: 0 11px; gap: 7px; }
  .lift__label { display: none; }
  .passport > div { grid-template-columns: 1fr; gap: 2px; }
  .calc { grid-template-columns: 1fr; }
  .meanwhile { grid-template-columns: 1fr; }
  .neighbours li { grid-template-columns: 54px 1fr; gap: 2px 12px; }
  .photos figure, .photos figure:nth-child(3n + 1) { grid-column: 1 / -1; }
  .finale { align-items: end; padding-bottom: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-r] { opacity: 1; transform: none; transition: none; }
  .switch, .hint i, .music-on .sound i, .music-on .music__dot { animation: none; }
}

/* Link-preview image: rendered from the page itself with ?og */
.og .top, .og main > *:not(.hero), .og .kicker, .og .from, .og .hint, .og .music { display: none !important; }
.og .hero { min-height: 100vh; }
.og .lead { font-size: 30px; }
.og [data-r] { opacity: 1 !important; transform: none !important; }
