@font-face {
  font-family: 'Playfair';
  src: url('/fonts/playfair.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/fonts/onest.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Тема светлая и безусловная: в Tor prefers-color-scheme подделан под светлую
   у всех посетителей, так что «умное» переключение там всё равно не работает. */
:root {
  --bg:        oklch(97.6% 0.009 85);
  --bg-2:      oklch(94.2% 0.016 240);
  --card:      oklch(99.4% 0.003 85);
  --ink:       oklch(23% 0.026 262);
  --muted:     oklch(47% 0.022 262);
  --ua-blue:   oklch(47% 0.185 257);
  --ua-deep:   oklch(33% 0.135 260);
  --ua-yellow: oklch(83% 0.165 88);
  --hair:      color-mix(in oklab, var(--ink) 13%, transparent);
  --shadow:    oklch(40% 0.06 262 / .16);

  --s--1: clamp(0.85rem, 0.83rem + 0.12vw, 0.93rem);
  --s-0:  clamp(1rem, 0.96rem + 0.22vw, 1.14rem);
  --s-1:  clamp(1.18rem, 1.08rem + 0.45vw, 1.45rem);
  --s-2:  clamp(1.45rem, 1.25rem + 1vw, 2.05rem);
  --s-3:  clamp(1.9rem, 1.5rem + 2vw, 3.1rem);
  --s-5:  clamp(2.7rem, 1.5rem + 5.8vw, 6.2rem);

  --spring: linear(0, .32 8%, .72 20%, .94 32%, 1.03 46%, 1.005 72%, 1);
  --serif: 'Playfair', Georgia, 'Times New Roman', serif;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pride: linear-gradient(90deg, #e40303, #ff8c00, #ffed00, #008026, #24408e, #732982);
}

* { box-sizing: border-box; }
html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--s-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* у Playfair по умолчанию старостильные цифры: «300» читалось бы как «зоо» */
  font-variant-numeric: lining-nums;
}

/* Зерно: растровый тайл, не SVG-фильтр. SVG отключается в Tor на уровне «Safest». */
.grain {
  position: fixed; inset: 0; z-index: 900;
  pointer-events: none;
  background-image: url('/img/noise.png');
  background-repeat: repeat;
  opacity: .035;
  mix-blend-mode: multiply;
}

h1, h2, h3 { margin: 0 0 .5em; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: .94; letter-spacing: -0.025em; }
h1 { font-size: var(--s-5); line-height: .9; letter-spacing: -0.035em; }
h2 { font-size: var(--s-3); }
h3 { font-size: var(--s-1); font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }

.grid {
  display: grid;
  grid-template-columns:
    [full-start] minmax(1.25rem, 1fr)
    [wide-start] minmax(0, 4.5rem)
    [main-start] min(68ch, 100% - 2.5rem) [main-end]
    minmax(0, 4.5rem) [wide-end]
    minmax(1.25rem, 1fr) [full-end];
}
.grid > * { grid-column: main; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

.skip { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--ua-yellow); color: #000; padding: 10px 16px; font-weight: 600; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--ua-blue); outline-offset: 3px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--bg) 93%, transparent);
  border-bottom: 1px solid var(--hair);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-flag { width: 27px; height: 18px; border-radius: 2px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; white-space: nowrap; }
.brand-text b { font-family: var(--serif); font-size: 1.04rem; font-weight: 700; letter-spacing: -0.015em; }
.brand-text em { font-style: normal; font-size: .7rem; color: var(--muted); }
.brand-text i { font-style: normal; font-size: .63rem; color: color-mix(in oklab, var(--muted) 75%, transparent); }

.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: .89rem; }
.nav a { text-decoration: none; color: var(--muted); transition: color .18s; }
.nav a:hover { color: var(--ink); }
.nav .nav-cta {
  color: #fff; background: var(--ua-blue);
  padding: 9px 17px; border-radius: 999px 999px 999px 4px; font-weight: 650;
}
.nav .nav-cta:hover { color: #fff; background: var(--ua-deep); }

.burger { display: none; flex: none; width: 44px; height: 40px; background: none; border: 0; cursor: pointer; padding: 10px 9px; }
.burger span { display: block; width: 100%; height: 2px; background: var(--ink); border-radius: 2px; margin: 4px 0; }

.pride-rule { height: 3px; background: var(--pride); }

/* Быстрый выход живёт в липкой шапке: виден всегда, ни на что не налезает */
.quick-exit {
  margin-left: 14px; flex: none;
  background: oklch(52% 0.20 25); color: #fff; border: 0; cursor: pointer;
  font: 650 .8rem/1 var(--sans); padding: 11px 16px;
  border-radius: 999px 999px 4px 999px;
}
.quick-exit:hover { background: oklch(45% 0.21 25); }

/* ---------- Первый экран ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 55%, var(--bg));
}
.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 4vw, 4rem); align-items: center;
  padding-block: clamp(3rem, 7vw, 6.5rem);
}
.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ua-deep); margin-bottom: 1.5em;
  display: flex; align-items: center; gap: .8em;
}
.eyebrow::before { content: ''; width: 2.2rem; height: 2px; background: var(--ua-yellow); }
.hero h1 { margin-bottom: .1em; }
.hero-alias {
  font-family: var(--serif); font-size: var(--s-2); color: var(--ua-blue);
  margin-bottom: .15em; letter-spacing: -0.02em;
}
.hero-sub { font-size: var(--s--1); color: var(--muted); margin-bottom: 1.4em; }
.hero-sub b { font-weight: 650; color: var(--ink); }
.lede { font-size: var(--s-1); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 650; font-size: .95rem;
  padding: 14px 28px; border: 1px solid transparent; cursor: pointer;
  transition: transform .3s var(--spring), background .2s, color .2s;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--ua-blue); color: #fff; border-radius: 999px 999px 999px 6px; }
.btn-primary:hover { background: var(--ua-deep); }
.btn-ghost { border-color: var(--hair); color: var(--ink); border-radius: 6px 999px 999px 999px; }
.btn-ghost:hover { border-color: var(--ua-blue); background: color-mix(in oklab, var(--ua-blue) 9%, transparent); }
.btn-yellow { background: var(--ua-yellow); color: oklch(25% 0.06 88); border-radius: 999px 999px 999px 6px; }

.hero-media { display: flex; flex-direction: column; gap: 1.3rem; }
.hero-photo { margin: 0; position: relative; }
.hero-photo img {
  display: block; width: 100%; height: auto;
  border-radius: 6px 60px 6px 60px;
  box-shadow: 0 26px 60px -22px var(--shadow);
}
.hero-photo::after {
  content: ''; position: absolute; inset: -2px; z-index: -1;
  border-radius: 6px 60px 6px 60px;
  background: linear-gradient(145deg, var(--ua-yellow), transparent 45%, var(--ua-blue));
}

.flags { display: flex; gap: clamp(1rem, 2.5vw, 2rem); align-items: flex-start; }
.flagwrap { margin: 0; flex: 1; }
.flag-gl, .flag-img {
  width: 100%; max-width: 190px; height: auto; display: block;
  filter: drop-shadow(0 10px 18px var(--shadow));
}
.flag-gl { aspect-ratio: 3 / 2; }
.gl-on .flag-img { display: none; }
.flagwrap figcaption {
  margin-top: .7rem; font-size: .68rem; font-weight: 650;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Секции ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 7.5rem); position: relative; }
.section-alt { background: var(--bg-2); }
.section-deep { background: linear-gradient(165deg, var(--ua-deep), oklch(28% 0.12 262)); color: #fff; }
.section-deep .section-num { color: var(--ua-yellow); }
.section-deep .list li::marker { color: var(--ua-yellow); }
.section-deep .muted-on-deep { color: oklch(88% 0.02 262); }
main > .section:not(:first-of-type) { content-visibility: auto; contain-intrinsic-size: auto 620px; }

.section-num {
  font-family: var(--serif); font-size: .82rem; color: var(--ua-blue);
  letter-spacing: .1em; display: block; margin-bottom: .9em;
  font-variant-numeric: lining-nums tabular-nums;
}
.big { font-family: var(--serif); font-size: var(--s-2); line-height: 1.16; letter-spacing: -0.02em; margin-bottom: .8em; }
.section-intro { color: var(--muted); max-width: 52ch; margin-bottom: 2.2em; }
.list { padding-left: 1.1em; margin: 0 0 1.5em; }
.list li { margin-bottom: .6em; }
.list li::marker { color: var(--ua-blue); }

.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-flip { grid-template-columns: 0.9fr 1.1fr; }
.split-media { margin: 0; }
.split-media img { display: block; width: 100%; height: auto; border-radius: 4px 48px 4px 48px; box-shadow: 0 22px 55px -24px var(--shadow); }
.split-media figcaption { margin-top: .9rem; font-size: var(--s--1); color: var(--muted); }

/* ---------- Карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(260px, 40%, 340px), 1fr)); gap: clamp(1.2rem, 2.5vw, 2rem); }
.card {
  position: relative; padding: clamp(1.8rem, 3vw, 2.6rem);
  background: var(--card); border-radius: 4px 40px 4px 40px;
  box-shadow: 0 18px 44px -28px var(--shadow);
}
.card::before {
  content: ''; position: absolute; left: 0; top: clamp(1.8rem, 3vw, 2.6rem); bottom: clamp(1.8rem, 3vw, 2.6rem);
  width: 3px; border-radius: 3px; background: var(--ua-blue);
}
.card-flag-img { width: 54px; height: 36px; border-radius: 3px; margin-bottom: 1.1rem; display: block; }
.card h3 { margin-bottom: .6em; }
.card p { color: var(--muted); margin-bottom: 0; }

/* ---------- Стих ---------- */
.poem {
  position: relative; margin: 0;
  padding: clamp(2rem, 4vw, 3.2rem) clamp(1.6rem, 4vw, 3.5rem);
  background: linear-gradient(150deg, color-mix(in oklab, var(--ua-yellow) 26%, var(--card)), var(--card));
  border-radius: 6px 56px 6px 56px;
  box-shadow: 0 20px 50px -30px var(--shadow);
}
.poem::before {
  content: ''; position: absolute; left: 0; top: 2rem; bottom: 2rem;
  width: 4px; border-radius: 4px; background: var(--pride);
}
.poem p {
  font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.95rem);
  line-height: 1.45; letter-spacing: -0.015em; margin: 0;
}
.poem footer { margin-top: 1.2rem; font-size: var(--s--1); color: var(--muted); font-style: normal; }

/* ---------- Цитаты ---------- */
.quotebox {
  background: var(--card); border-radius: 6px 48px 6px 48px;
  padding: clamp(1.8rem, 4vw, 3rem);
  box-shadow: 0 18px 44px -28px var(--shadow);
  min-height: 15rem; display: flex; flex-direction: column; justify-content: center;
}
.quote-text { font-family: var(--serif); font-size: var(--s-2); line-height: 1.3; letter-spacing: -0.02em; margin-bottom: 1rem; }
.quote-author { font-weight: 650; margin-bottom: .15em; }
.quote-src { font-size: var(--s--1); color: var(--muted); margin: 0; }
.quote-dots { display: flex; gap: 7px; margin-top: 1.6rem; }
.quote-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: var(--hair); cursor: pointer; }
.quote-dots button[aria-current='true'] { background: var(--ua-blue); }

/* ---------- Галерея ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 4px 32px 4px 32px; box-shadow: 0 16px 40px -26px var(--shadow); }
.shot figcaption { margin-top: .7rem; font-size: var(--s--1); color: var(--muted); }
.shot-tall img { aspect-ratio: 3 / 4; object-fit: cover; }

/* ---------- Соцсети ---------- */
.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.soc {
  display: flex; flex-direction: column; align-items: flex-start; gap: .2rem;
  padding: 1.6rem 1.5rem; text-decoration: none;
  background: var(--card); border-radius: 4px 28px 4px 28px;
  box-shadow: 0 16px 40px -30px var(--shadow);
  transition: transform .35s var(--spring), background .2s;
}
.soc:hover { transform: translateY(-5px); background: color-mix(in oklab, var(--brand) 12%, var(--card)); }
.soc-vk { --brand: #0077ff; }
.soc-ok { --brand: #ee8208; }
.soc-tg { --brand: #229ed9; }
.soc-yt { --brand: #ff0000; }
.soc-icon { color: var(--brand); margin-bottom: .9rem; }
.soc-icon svg { width: 46px; height: 46px; display: block; }
.soc-name { font-weight: 650; font-size: 1rem; }
.soc-handle { font-size: var(--s--1); color: var(--muted); word-break: break-word; }

.stack-sm { margin-top: 1.5rem; }
.stack-md { margin-top: 2rem; }

/* ---------- Поддержка ---------- */
.support {
  background: var(--card); border-radius: 4px 36px 4px 36px;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: 0 16px 40px -28px var(--shadow);
}
.support h3 { margin-bottom: .5em; }
.support p { color: var(--muted); margin-bottom: 0; }
.support-contact { margin-top: 1.1rem !important; color: var(--ink) !important; line-height: 1.75; }
.support-contact a { color: var(--ua-blue); font-weight: 650; }

.contact-line { font-size: var(--s-1); font-weight: 650; }
.contact-line a { color: var(--ua-blue); }

/* ---------- Заглушки ---------- */
.ph {
  position: relative; padding: 1.4rem 1.2rem 1.1rem;
  border-radius: 3px 20px 3px 20px; color: var(--muted);
  background: color-mix(in oklab, var(--ua-yellow) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ua-yellow) 55%, transparent);
}
.ph::before {
  content: attr(data-ph); position: absolute; top: -.6rem; left: 1rem;
  background: var(--ua-yellow); color: oklch(25% 0.06 88);
  font-size: .64rem; font-weight: 700; letter-spacing: .04em;
  padding: 2px 9px; border-radius: 999px;
}

/* ---------- Появление при скролле ---------- */
.js .reveal { opacity: 0; translate: 0 1.6rem; }
.js .reveal.in { opacity: 1; translate: 0; transition: opacity .7s ease, translate .7s var(--spring); }
.reduce-motion .reveal, .reduce-motion .reveal.in { opacity: 1 !important; translate: 0 !important; transition: none !important; }
.reduce-motion * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.in { opacity: 1; translate: 0; transition: none; }
}

/* В Tor prefers-reduced-motion не срабатывает никогда, нужен ручной выключатель */
.motion-toggle {
  position: fixed; left: 14px; bottom: 14px; z-index: 85;
  background: var(--card); color: var(--muted); border: 1px solid var(--hair);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
  font: 600 .74rem/1 var(--sans);
  box-shadow: 0 6px 18px -8px var(--shadow);
}
.motion-toggle:hover { color: var(--ink); }

/* ---------- Прощание ---------- */
.goodbye {
  position: fixed; inset: 0; z-index: 950;
  display: grid; place-items: center; padding: 1.5rem;
  background: color-mix(in oklab, var(--ua-deep) 88%, transparent);
}
.goodbye[hidden] { display: none; }
.goodbye-card {
  background: var(--card); border-radius: 8px 64px 8px 64px;
  padding: clamp(1.5rem, 4vw, 2.5rem); text-align: center;
  max-width: 460px; box-shadow: 0 40px 90px oklch(20% 0.05 262 / .5);
}
.goodbye-card img {
  display: block; width: 100%; height: auto;
  border-radius: 6px 44px 6px 44px; margin-bottom: 1.3rem;
  box-shadow: 0 0 0 4px var(--ua-yellow);
}
.goodbye-text { font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.25; margin-bottom: .6em; }
.goodbye-sub { font-size: var(--s--1); color: var(--muted); margin: 0; }
.goodbye-stay { margin-top: 1.2rem; background: none; border: 1px solid var(--hair); border-radius: 999px; padding: 9px 18px; cursor: pointer; font: 600 .82rem/1 var(--sans); color: var(--muted); }

/* ---------- Виджет вопроса (крупный) ---------- */
.ask { position: fixed; right: 20px; bottom: 20px; z-index: 90; }
.ask-fab {
  display: flex; align-items: center; gap: 16px; cursor: pointer;
  background: var(--card); border: 1px solid var(--hair);
  border-radius: 999px; padding: 10px 30px 10px 10px; color: var(--ink);
  font: 650 1.02rem/1.25 var(--sans); text-align: left;
  box-shadow: 0 16px 38px -14px var(--shadow);
  transition: transform .35s var(--spring);
}
.ask-fab:hover { transform: translateY(-3px); }
.ask-ava { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 3px var(--ua-yellow); }
.ask-ava-sm { width: 76px; height: 76px; box-shadow: 0 0 0 3px var(--ua-yellow); }

.ask-panel {
  position: absolute; bottom: calc(100% + 14px); right: 0;
  width: min(520px, calc(100vw - 40px));
  background: var(--card); border: 1px solid var(--hair);
  border-radius: 8px 44px 8px 44px; padding: 2rem;
  box-shadow: 0 40px 90px -30px var(--shadow);
  opacity: 0; transform: translateY(14px) scale(.97);
  transition: opacity .22s ease, transform .35s var(--spring);
}
.ask-panel.open { opacity: 1; transform: none; }
.ask-panel[hidden] { display: none; }
.ask-head { display: flex; align-items: center; gap: 16px; margin-bottom: 1.4rem; }
.ask-head-text { flex: 1; min-width: 0; }
.ask-title { margin: 0; font-weight: 700; font-size: 1.28rem; font-family: var(--serif); }
.ask-sub { margin: 0; font-size: .92rem; color: var(--muted); }
.ask-close { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1.4rem; padding: 4px; line-height: 1; }
.ask-form { display: flex; flex-direction: column; gap: .9rem; }
.ask-form[hidden] { display: none; }
.ask-label { font-size: .95rem; font-weight: 600; color: var(--muted); }
.ask-form textarea {
  width: 100%; resize: vertical; font: inherit; font-size: 1.05rem;
  padding: 14px 16px; border-radius: 4px 20px 4px 20px;
  border: 1px solid var(--hair); background: var(--bg); color: var(--ink);
}
.ask-send { align-self: flex-start; padding: 14px 32px; font-size: 1rem; }
.ask-hint { margin: 0; font-size: .88rem; color: var(--muted); }
.ask-done { text-align: center; padding: 1.6rem .4rem .8rem; }
.ask-done[hidden] { display: none; }
.ask-done-main { font-family: var(--serif); font-weight: 700; font-size: 1.7rem; margin-bottom: .2em; }
.ask-done-kiss { font-size: 2rem; margin-bottom: .35em; color: var(--ua-blue); }
.ask-done-sign { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--hair); }
/* Колонкой и по левому краю: в правом нижнем углу постоянно висит виджет вопроса,
   и кнопка «Пока!» там оказалась бы под ним. */
.footer-inner { padding-block: 2.6rem 3.2rem; display: flex; flex-direction: column; align-items: flex-start; gap: 1.6rem; }
.footer-brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; margin-bottom: .3em; }
.footer-note { font-size: var(--s--1); color: var(--muted); max-width: 58ch; margin: 0; }

/* Брейкпоинты на нечётных значениях: Tor округляет окно до кратных 200×100 */
@media (max-width: 1041px) {
  .hero-inner { grid-template-columns: 1fr; }
  .lede { max-width: 48ch; }
  .split, .split-flip { grid-template-columns: 1fr; }
  .flags { max-width: 440px; }
}

@media (max-width: 761px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--hair); padding: 8px 1.25rem 1.2rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 0; }
  .nav .nav-cta { text-align: center; margin-top: 10px; }
  .quick-exit { margin-left: auto; margin-right: 8px; padding: 10px 13px; font-size: .74rem; }
  .ask { right: auto; left: 14px; bottom: 14px; }
  .ask-panel { right: auto; left: 0; }
  .ask-fab { padding: 8px; gap: 0; }
  .ask-ava { width: 88px; height: 88px; }
  .ask-fab-label { display: none; }
  .motion-toggle { left: auto; right: 14px; bottom: 14px; }
}
