/* yanjac.com — визитка студии YanJac Apps.
   Палитра снята с логотипа: бумага, чёрный плащ, охра букв.
   Шрифты: Yeseva One — заголовки, Raleway — всё остальное (fonts.css). */

:root {
  --paper: #F1DDB2;
  --paper-2: #EAD2A2;
  --surface: #F7E9CB;
  --ink: #0E0F0D;
  --ink-soft: #4A3D28;
  --gold: #CE8914;
  --gold-ink: #8A5508;
  --line: #0E0F0D;
  --shadow: #0E0F0D;
  --on-gold: #0E0F0D;
  --band: #0E0F0D;
  --band-ink: #F1DDB2;
  --band-soft: #CDBB92;
  --grain-blend: multiply;
  --grain-opacity: .22;
  --map-filter: sepia(.28) saturate(.85) contrast(1.02);

  --f-display: "Yeseva One", "Iowan Old Style", Georgia, serif;
  --f-text: "Raleway", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E0F0D;
    --paper-2: #15130E;
    --surface: #1A1812;
    --ink: #F1DDB2;
    --ink-soft: #CDBB92;
    --gold: #E0A030;
    --gold-ink: #E9B04A;
    --line: #F1DDB2;
    --shadow: #5A3F10;
    --band: #050605;
    --grain-blend: screen;
    --grain-opacity: .08;
    --map-filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.92) saturate(.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E0F0D;
  --paper-2: #15130E;
  --surface: #1A1812;
  --ink: #F1DDB2;
  --ink-soft: #CDBB92;
  --gold: #E0A030;
  --gold-ink: #E9B04A;
  --line: #F1DDB2;
  --shadow: #5A3F10;
  --band: #050605;
  --grain-blend: screen;
  --grain-opacity: .08;
  --map-filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.92) saturate(.55);
  color-scheme: dark;
}

/* Языки: на странице лежат все три текста, видно только выбранный. */
html[data-lang="en"] [data-l]:not([data-l="en"]),
html[data-lang="ru"] [data-l]:not([data-l="ru"]),
html[data-lang="kk"] [data-l]:not([data-l="kk"]) { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-weight: 460;
  font-size: clamp(16px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

/* Бумажное зерно, как на логотипе */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .15 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--on-gold); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--gold); color: var(--on-gold); padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 12px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- шапка ---------- */
/* Шапка закреплена: остаётся сверху при прокрутке (просьба Андрея) */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .35s ease;
}
.topbar.is-stuck {
  border-bottom-color: color-mix(in srgb, var(--line) 22%, transparent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 12px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
.brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 3px 3px 0 var(--shadow); }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name b { font-family: var(--f-display); font-weight: 400; font-size: 27px; letter-spacing: .01em; }
.brand-name small {
  margin-top: 5px; font-size: 10.5px; font-weight: 750; letter-spacing: .26em;
  text-transform: uppercase; color: var(--ink-soft); white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  font-size: 14px; font-weight: 650; letter-spacing: .06em; text-decoration: none;
  color: var(--ink-soft); padding-block: 4px; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav a:hover { color: var(--ink); border-color: var(--gold); }

.tools { display: flex; align-items: center; gap: 10px; }
.langs {
  display: flex; border: 2px solid var(--line); border-radius: 999px; overflow: hidden;
  background: var(--surface);
}
.langs button {
  font: 750 12px/1 var(--f-text); letter-spacing: .08em;
  padding: 9px 11px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background-color .2s, color .2s;
}
.langs button + button { border-left: 2px solid var(--line); }
/* подсветка — от языка страницы, а не от скрипта: верно с первого кадра */
html[data-lang="en"] .langs [data-set-lang="en"],
html[data-lang="ru"] .langs [data-set-lang="ru"],
html[data-lang="kk"] .langs [data-set-lang="kk"] { background: var(--gold); color: var(--on-gold); }
.langs button:hover { color: var(--ink); }
html[data-lang="en"] .langs [data-set-lang="en"]:hover,
html[data-lang="ru"] .langs [data-set-lang="ru"]:hover,
html[data-lang="kk"] .langs [data-set-lang="kk"]:hover { color: var(--on-gold); }

.theme {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border: 2px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink); cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.theme:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.theme:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.theme svg { width: 20px; height: 20px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

@media (max-width: 860px) { .nav { display: none; } }
@media (max-width: 420px) {
  .top { gap: 10px; }
  .brand { gap: 9px; }
  .brand-name small { display: none; }
  .brand-name b { font-size: 23px; }
  .brand img { width: 38px; height: 38px; }
  .langs button { padding: 9px 7px; font-size: 11.5px; }
  .theme { width: 38px; height: 38px; }
}
@media (max-width: 350px) { .brand-name { display: none; } }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 750 14px/1 var(--f-text); letter-spacing: .12em; text-transform: uppercase;
  padding: 16px 22px; border: 2px solid var(--line); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--shadow); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-plain { background: var(--surface); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }

/* ---------- первый экран ---------- */
.hero {
  overflow: clip; padding-block: clamp(28px, 6vw, 80px) clamp(48px, 7vw, 96px);
  /* первый экран — на всю высоту окна под шапкой, бегущая строка видна
     только при прокрутке (Андрей). Растягиваем только высоту: сетка, а не
     flex — иначе блок теряет ширину и текст прилипает к краю (было 15.10) */
  min-height: calc(100vh - 60px); min-height: calc(100svh - 60px);
  display: grid; align-content: center;
}
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: clamp(28px, 5vw, 72px);
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-ink);
}
.kicker::before { content: ""; width: 34px; height: 2px; background: currentColor; }
.hero h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(44px, 6.6vw, 90px); line-height: 1.02; letter-spacing: -.005em;
  margin: 20px 0 22px; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--gold-ink); }
.nowrap { white-space: nowrap; }
.lead { font-size: clamp(18px, 1.2vw + 12px, 21px); color: var(--ink-soft); max-width: 34em; margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 16px; }

/* Первый экран — исходный вариант (решение Андрея 15.10.2026): логотип-карточка
   с лёгким наклоном на золотом солнце, вокруг вращается кольцо с надписью.
   Круглый знак-медальон — в шапке, подвале, визитке и на иконках. */
.stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.stage .ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--ink); animation: spin 48s linear infinite;
}
.stage .ring text { font: 800 11.5px var(--f-text); letter-spacing: .32em; fill: currentColor; }
.stage .disc { position: absolute; inset: 9%; border-radius: 50%; background: var(--gold); opacity: .9; }
.stage .disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, transparent 0 6deg, rgba(14, 15, 13, .10) 6deg 12deg);
}
.stage > img {
  position: relative; width: 72%; height: auto;
  transform: rotate(-5deg);
  filter: drop-shadow(10px 12px 0 var(--shadow));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.stage:hover > img { transform: rotate(-1deg) scale(1.02); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .stage { order: -1; width: min(380px, 86%); margin-inline: auto; }
}

/* ---------- бегущая строка ---------- */
.marquee {
  background: var(--band); color: var(--band-ink);
  border-block: 2px solid var(--line); overflow: hidden; white-space: nowrap;
}
.marquee-track { display: inline-flex; animation: run 40s linear infinite; }
.marquee span {
  font-family: var(--f-display); font-size: clamp(20px, 2.2vw, 28px);
  padding: 16px 22px; display: inline-flex; align-items: center; gap: 44px;
}
.marquee span::after { content: "✦"; color: var(--gold); font-size: .8em; }
@keyframes run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .stage .ring { animation: none; }
}

/* ---------- секции ---------- */
section { padding-block: clamp(56px, 8vw, 110px); }
/* переходы из меню останавливаются у подписи раздела, а не на верхнем отступе —
   так карточка визитки видна целиком */
.wrap[id] { scroll-margin-top: 92px; }  /* высота шапки (~70) + воздух */
@media (max-width: 420px) { .wrap[id] { scroll-margin-top: 80px; } }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 58px); line-height: 1.06; margin: 14px 0 12px; text-wrap: balance;
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: clamp(17px, 1vw + 12px, 19px); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 28px); }
@media (max-width: 900px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px 30px; box-shadow: 8px 8px 0 var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--shadow); }
.card .icon {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--on-gold); border: 2px solid var(--line); margin-bottom: 22px;
}
.card .icon svg { width: 30px; height: 30px; }
.card h3 { font-family: var(--f-display); font-weight: 400; font-size: 27px; line-height: 1.15; margin: 0 0 10px; }
.card p { margin: 0; color: var(--ink-soft); }

/* ---------- визитка ---------- */
.ticket {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--shadow); overflow: hidden;
}
.stub {
  position: relative; background: var(--band); color: var(--band-ink);
  padding: clamp(20px, 2.6vw, 30px) clamp(24px, 3.4vw, 40px); display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
/* перфорация, как у билета */
.stub::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -9px; width: 18px;
  background: radial-gradient(circle at 9px 12px, var(--surface) 0 5.5px, transparent 6px) 0 0 / 18px 24px repeat-y;
}
/* круглый знак на бумаге логотипа — как в шапке */
.stub .mark { width: min(220px, 80%); height: auto; margin-inline: auto; }
.stub > div:last-child { text-align: center; }
.stub b { display: block; font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 3vw, 40px); line-height: 1; }
.stub small {
  display: block; margin-top: 8px; font-size: 11px; font-weight: 800; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold); white-space: nowrap;
}
.facts { margin: 0; padding: clamp(16px, 2.2vw, 26px) clamp(22px, 3.6vw, 40px); display: grid; gap: 0; }
.facts div {
  display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: 14px;
  padding-block: 9px; border-bottom: 2px dashed color-mix(in srgb, var(--line) 28%, transparent);
}
.facts div:last-child { border-bottom: 0; }
.facts dt {
  font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft); padding-top: 3px;
}
.facts dd { margin: 0; overflow-wrap: anywhere; line-height: 1.45; }
.facts a { text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.facts a:hover { color: var(--gold-ink); }
@media (max-width: 760px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .stub { flex-direction: row; align-items: center; padding: 24px 22px 30px; gap: 18px; }
  .stub .mark { width: 104px; flex: none; margin: 0; }
  .stub > div:last-child { text-align: left; }
  .stub::after {
    top: auto; left: 0; right: 0; bottom: -9px; width: auto; height: 18px;
    background: radial-gradient(circle at 12px 9px, var(--surface) 0 5.5px, transparent 6px) 0 0 / 24px 18px repeat-x;
  }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- контакт ---------- */
.contact .wrap {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
.contact h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(36px, 5vw, 66px); line-height: 1.04; margin: 14px 0 18px; text-wrap: balance;
}
.contact h2 em { font-style: normal; color: var(--gold-ink); }
.contact p { color: var(--ink-soft); margin: 0 0 26px; max-width: 32em; }
.mail {
  display: inline-block; font-family: var(--f-display); font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.1; color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 6px no-repeat;
  padding-bottom: 6px; transition: background-size .3s ease, color .2s;
}
.mail:hover { background-size: 100% 100%; color: var(--on-gold); }
.where { margin-top: 26px; display: flex; gap: 12px; align-items: flex-start; color: var(--ink-soft); font-size: 16px; }
.where svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--gold-ink); }
@media (max-width: 860px) { .contact .wrap { grid-template-columns: minmax(0, 1fr); } .map-window { max-width: 100%; } }

/* Окно с картой: рамка, латунная табличка, «стекло» */
.map-window {
  width: 100%; max-width: 460px; justify-self: center;
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--shadow); padding: 14px; display: grid; gap: 12px;
}
.map-plate {
  display: flex; align-items: center; gap: 10px; padding: 2px 4px 0;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}
.map-plate svg { width: 18px; height: 18px; color: var(--gold-ink); flex: none; }
.map-glass { position: relative; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper-2); }
.map-glass iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: var(--map-filter); }
.map-link {
  justify-self: start; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; padding: 0 4px;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 2px no-repeat; transition: background-size .25s;
}
.map-link:hover { background-size: 100% 100%; color: var(--on-gold); }

/* ---------- подвал ---------- */
.foot { background: var(--band); color: var(--band-soft); border-top: 2px solid var(--line); padding-block: 34px; font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.foot .brand { color: var(--band-ink); }
.foot .brand-name small { color: var(--band-soft); }
.foot .brand img { box-shadow: none; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { color: var(--band-ink); text-decoration: none; border-bottom: 2px solid transparent; }
.foot nav a:hover { border-color: var(--gold); }

/* ---------- документы ---------- */
.doc { padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 96px); }
.doc article { max-width: 760px; }
.doc h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(38px, 5vw, 60px); line-height: 1.06; margin: 14px 0 8px; }
.doc .updated { color: var(--ink-soft); font-size: 15px; margin: 0 0 36px; }
.doc h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(23px, 2.2vw, 28px); line-height: 1.2; margin: 38px 0 10px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--gold-ink); }
.doc a { text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--ink-soft); }
.back:hover { color: var(--ink); }
