/* ===== Tokens: syrmaq felt + flag colours ===== */
:root {
  --sky: #00A3C4;
  --sky-deep: #00809B;
  --sky-ink: #00778F;   /* white text passes AA on this */
  --sky-pale: #E3F6FA;
  --sun: #FFC21A;
  --sun-deep: #E9A800;
  --sun-pale: #FFF3C9;
  --night: #22195E;
  --night-2: #2F2577;
  --crimson: #D7263D;
  --steppe: #4FAE62;
  --snow: #F1FAFC;
  --white: #FFFFFF;
  --ink: var(--night);
  --ink-soft: #4B4680;

  --font-display: "Rubik", "Nunito Sans", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(.875rem, .84rem + .15vw, .95rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
  --step-1: clamp(1.15rem, 1.08rem + .4vw, 1.4rem);
  --step-2: clamp(1.4rem, 1.2rem + .9vw, 2rem);
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  --step-4: clamp(2.7rem, 1.4rem + 5.2vw, 6.4rem);

  --space-section: clamp(4.5rem, 3rem + 6vw, 9rem);
  --radius-s: 12px;
  --radius-m: 22px;
  --radius-l: 40px;
  --header-h: 76px;

  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 180ms;
  --dur: 420ms;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--snow);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-s);
  background: var(--night); color: var(--white); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: min(1200px, 100% - 2 * clamp(16px, 4vw, 40px)); margin-inline: auto; }

/* ===== Type ===== */
.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-3);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1.15; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 36em; text-wrap: pretty; }
.section-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }

/* ===== Buttons ===== */
.btn {
  --btn-bg: var(--white);
  --btn-edge: var(--night);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px;
  border: 3px solid var(--btn-edge);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--night);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--btn-edge);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--btn-edge); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn--sun { --btn-bg: var(--sun); }
.btn--sun:hover { --btn-bg: #FFCD3D; }
.btn--ghost { --btn-bg: rgba(255, 255, 255, .72); }
.btn--ghost:hover { --btn-bg: var(--white); }
.btn--lg { padding: 16px 28px; font-size: var(--step-1); }

/* ===== Header ===== */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  transition: transform var(--dur) var(--ease-out), background var(--dur), box-shadow var(--dur);
}
.site-header.is-scrolled {
  background: rgba(241, 250, 252, .9);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(34, 25, 94, .1);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

/* Logo «Ою тәж»: a ram-horn (қошқар мүйіз) crown over a soft rounded name */
.logo {
  --logo-word: var(--sky-ink); --logo-tag: var(--crimson); --logo-horn: var(--crimson); --logo-gem: var(--sun);
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; position: relative; z-index: 60;
}
.logo__mark { width: 50px; height: 23px; overflow: visible; }
.logo__mark path { fill: none; stroke: var(--logo-horn); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.logo__mark .logo__gem { fill: var(--logo-gem); stroke-width: 7; }
.logo:hover .logo__mark path:not(.logo__gem) { stroke-dasharray: 1; stroke-dashoffset: 1; animation: crownDraw 1.1s var(--ease-out) forwards; }
.logo:hover .logo__gem { animation: gemPop .6s var(--ease-bounce); transform-box: fill-box; transform-origin: center; }
.logo__text { display: grid; justify-items: center; line-height: 1; }
.logo__text b { font-family: "Comfortaa", var(--font-display); font-weight: 700; font-size: 1.62rem; letter-spacing: -.02em; color: var(--logo-word); }
.logo__text small { margin-top: 3px; padding-left: .24em; font-family: "Comfortaa", var(--font-body); font-weight: 700; font-size: .6rem; letter-spacing: .24em; color: var(--logo-tag); }
.logo--light { --logo-word: var(--white); --logo-tag: var(--sun); --logo-horn: var(--sun); --logo-gem: var(--crimson); }
.logo--light .logo__mark { width: 64px; height: 29px; }
.logo--light .logo__text b { font-size: 2rem; }
.logo--light .logo__text small { font-size: .7rem; }
@keyframes crownDraw { to { stroke-dashoffset: 0; } }
@keyframes gemPop { 50% { transform: scale(1.35) rotate(12deg); } }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); }
.nav__list { display: flex; gap: clamp(12px, 1.8vw, 26px); }
.nav__list a {
  position: relative; display: block; padding: 6px 0;
  font-weight: 700; text-decoration: none; font-size: .98rem;
}
.nav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px;
  background: var(--crimson); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}
.nav__list a:hover::after, .nav__list a[aria-current="true"]::after { transform: scaleX(1); }
.nav__cta { padding: 9px 18px; font-size: .95rem; box-shadow: 0 4px 0 var(--night); }

.burger {
  display: none; width: 48px; height: 48px; padding: 0;
  border: 3px solid var(--night); border-radius: 50%;
  background: var(--sun); cursor: pointer; position: relative; z-index: 60;
}
.burger span {
  position: absolute; left: 11px; right: 11px; height: 3px; border-radius: 2px; background: var(--night);
  transition: transform var(--dur) var(--ease-bounce), opacity var(--dur-fast);
}
.burger span:nth-child(1) { top: 13px; }
.burger span:nth-child(2) { top: 19.5px; }
.burger span:nth-child(3) { top: 26px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 1080px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; justify-content: center; gap: 32px;
    background: var(--sky-ink);
    clip-path: circle(0 at calc(100% - 44px) 38px);
    visibility: hidden;
    transition: clip-path .6s var(--ease-out), visibility 0s .6s;
  }
  .nav.is-open { clip-path: circle(150% at calc(100% - 44px) 38px); visibility: visible; transition: clip-path .7s var(--ease-out); }
  .nav__list { flex-direction: column; align-items: center; gap: 8px; }
  .nav__list a { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--white); }
  .nav__list a::after { background: var(--sun); }
  .nav.is-open .nav__list li { animation: navIn .5s var(--ease-bounce) both; }
  .nav.is-open .nav__list li:nth-child(2) { animation-delay: .05s; }
  .nav.is-open .nav__list li:nth-child(3) { animation-delay: .1s; }
  .nav.is-open .nav__list li:nth-child(4) { animation-delay: .15s; }
  .nav.is-open .nav__list li:nth-child(5) { animation-delay: .2s; }
  .nav.is-open .nav__list li:nth-child(6) { animation-delay: .25s; }
  .nav__cta { font-size: 1.1rem; padding: 14px 26px; }
  body.menu-open { overflow: hidden; }
  /* transform / backdrop-filter would trap the fixed menu inside the header box */
  body.menu-open .site-header { transform: none; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; transition: none; }
  body.menu-open .logo { --logo-word: var(--white); --logo-tag: var(--sun); --logo-horn: var(--sun); --logo-gem: var(--crimson); }
}
@keyframes navIn { from { opacity: 0; transform: translateY(24px) scale(.9); } }

/* ===== Ornament divider: a ram-horn (қошқар мүйіз) that draws itself ===== */
.oy {
  display: flex; align-items: center; gap: 18px;
  width: min(560px, 100% - 32px); margin: 0 auto;
  color: var(--crimson);
}
.oy::before, .oy::after { content: ""; flex: 1; height: 3px; border-radius: 3px; background: currentColor; opacity: .25; }
.oy__horn { width: 110px; flex-shrink: 0; }
.js .oy__horn path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-out); }
.js .oy__horn path:nth-child(2) { transition-delay: .1s; }
.js .oy__horn path:nth-child(3) { transition-delay: .8s; }
.js .is-drawn .oy__horn path { stroke-dashoffset: 0; }

/* ===== Footer ===== */
.footer { background: var(--night); color: rgba(255, 255, 255, .78); padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); font-size: var(--step--1); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.footer__copy { flex: 1 1 280px; }
.footer__credit a { color: var(--sun); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
