/* Ansomneya Games — stage 4. Shared design foundation.
   Source: approved Figma frames and component sets; see docs/styles.md.
   Only local assets. No runtime framework, external font request or JS dependency. */

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/geologica-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/geologica-latin-wght-normal.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: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(../fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(../fonts/golos-text-latin-wght-normal.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;
}

/* Base/mobile tokens, calibrated at 390px. Values in rem assume 16px root.
   Higher widths change only semantic tokens rather than each component. */
:root {
  color-scheme: dark;
  --font-display: "Geologica", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --spark-blue: #1463ff;
  --spark-violet: #8b35f5;
  --spark-pink: #ff174f;
  --spark-orange: #ff6d00;
  --spark-yellow: #ffd000;
  --spark-mint: #00cda5;
  --color-background: #100d25;
  --color-footer: #0d0a1e;
  --color-game: #111722;
  --color-text: #fff;
  --color-body: #e1daf3;
  --color-muted: #c7bfe4;
  --color-ink: #17132d;
  --color-game-status: #e4c99e;
  --color-game-genre: #e5d7c1;
  --color-button-hover: #e6daff;
  --color-link-hover: #d7c5ff;
  --color-kiber: #b8bac7;
  --color-kiber-hover: #9b77f0;
  --color-divider: rgb(199 191 228 / 16%);
  --color-outline: rgb(199 191 228 / 24%);
  --color-outline-hover: rgb(191 160 255 / 67%);
  --color-outline-hover-bg: rgb(139 53 245 / 15%);
  --shadow-primary: 0 4px 30px rgb(139 53 245 / 30%);
  --shadow-primary-hover: 0 4px 32px rgb(139 53 245 / 45%);
  --shadow-secondary-hover: 0 0 16px rgb(139 53 245 / 20%);
  --motion-fast: 180ms;
  --motion-ease: ease-in-out;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 64px;
  --space-12: 80px;
  --space-13: 96px;

  --gutter: 20px;
  --header-gutter: 20px;
  --content-max: 1280px;
  --header-max: 1312px;
  --policy-max: 880px;
  --policy-gutter: 20px;
  --header-height: 104px;
  --header-offset: 12px;
  --header-line-y: 124px;
  --nav-gap: 32px;
  --footer-nav-gap: 28px;
  --hero-min-height: 844px;
  --worlds-min-height: 690px;
  --game-card-min-height: 586px;
  --game-card-inset: 52px;
  --about-min-height: 780px;
  --contact-min-height: 690px;
  --footer-min-height: 420px;
  --hero-gap: 22px;
  --about-gap: 28px;
  --contact-description-gap: 22px;
  --contact-channel-gap: 40px;
  --game-radius: 24px;
  --hero-title-max: 350px;
  --hero-subtitle-max: 330px;
  --about-title-max: 350px;
  --about-copy-max: 334px;
  --contact-title-max: 350px;
  --contact-copy-max: 334px;
  --contact-channel-max: 350px;
  --policy-top: 162px;
  --policy-intro-gap: 20px;
  --policy-article-gap: 40px;
  --policy-section-gap: 30px;
  --policy-paragraph-gap: 10px;
  --policy-footer-gap: 64px;

  --size-hero: 2.5rem;
  --size-hero-en: 2.5rem;
  --lh-hero: 1.12;
  --size-hero-subtitle: 1.0625rem;
  --lh-hero-subtitle: 1.45;
  --size-section-title: 2.125rem;
  --size-contact-title: 2.125rem;
  --size-about-copy: 1.0625rem;
  --lh-about-copy: 1.5;
  --size-contact-copy: 1.0625rem;
  --size-game-genre: 1.0625rem;
  --size-game-tagline: 1.1875rem;
  --lh-game-tagline: 1.38;
  --size-game-status: .875rem;
  --size-channel-label: .875rem;
  --size-contact-link: 1.5rem;
  --size-header-link: 1rem;
  --size-footer-link: 1.0625rem;
  --size-footer-slogan: 1rem;
  --size-footer-meta: .875rem;
  --size-policy-title: 1.875rem;
  --size-policy-intro: 1.0625rem;
  --size-policy-note: .8125rem;
  --size-policy-heading: 1.25rem;
  --size-policy-body: 1rem;
  --size-button: 1.0625rem;
  --size-button-secondary: .9375rem;
  --size-kiber: .8125rem;
  --button-height: 62px;
  --button-secondary-height: 46px;
  --button-padding: 32px;
  --button-radius: 40px;
  --button-explore-radius: 100px;
  --button-secondary-radius: 30px;
  --language-radius: 24px;
  --language-height: 44px;
  --touch-target: 44px;
}

/* Tablet target: Figma 834px. Breakpoints are implementation choices,
   not independent fixed-width pages. */
@media (min-width: 768px) {
  :root {
    --gutter: 32px;
    --header-gutter: 32px;
    --policy-gutter: 64px;
    --policy-max: 880px;
    --header-height: 72px;
    --header-offset: 24px;
    --header-line-y: 108px;
    --nav-gap: 24px;
    --footer-nav-gap: 32px;
    --hero-min-height: 1112px;
    --worlds-min-height: 880px;
    --game-card-min-height: 682px;
    --game-card-inset: 99px;
    --about-min-height: 800px;
    --contact-min-height: 650px;
    --footer-min-height: 330px;
    --hero-gap: 28px;
    --about-gap: 36px;
    --contact-description-gap: 24px;
    --contact-channel-gap: 48px;
    --hero-title-max: 738px;
    --hero-subtitle-max: 690px;
    --about-title-max: 738px;
    --about-copy-max: 690px;
    --contact-title-max: 770px;
    --contact-copy-max: 730px;
    --contact-channel-max: 770px;
    --policy-top: 157px;
    --policy-article-gap: 48px;
    --policy-section-gap: 32px;
    --policy-paragraph-gap: 12px;
    --policy-footer-gap: 80px;
    --size-hero: 4.25rem;
    --size-hero-en: 4.25rem;
    --lh-hero: 1.10;
    --size-hero-subtitle: 1.25rem;
    --size-section-title: 3rem;
    --size-contact-title: 2.75rem;
    --size-about-copy: 1.3125rem;
    --size-contact-copy: 1.25rem;
    --size-game-genre: 1.25rem;
    --size-game-tagline: 1.375rem;
    --lh-game-tagline: 1.2;
    --size-channel-label: .9375rem;
    --size-footer-slogan: 1.125rem;
    --size-footer-meta: .9375rem;
    --size-policy-title: 2.5rem;
    --size-policy-intro: 1.25rem;
    --size-policy-note: .875rem;
    --size-policy-heading: 1.4375rem;
    --size-policy-body: 1.125rem;
    --language-height: 40px;
  }
}

/* Desktop target: Figma 1440px. */
@media (min-width: 1200px) {
  :root {
    --gutter: 80px;
    --header-gutter: 64px;
    --hero-min-height: 900px;
    --worlds-min-height: 1000px;
    --game-card-inset: 150px;
    --about-min-height: 960px;
    --contact-min-height: 700px;
    --footer-min-height: 290px;
    --hero-gap: 26px;
    --game-radius: 28px;
    --nav-gap: 32px;
    --footer-nav-gap: 42px;
    --hero-title-max: 614px;
    --hero-subtitle-max: 525px;
    --about-title-max: 1120px;
    --about-copy-max: 880px;
    --contact-title-max: 1160px;
    --contact-copy-max: 900px;
    --contact-channel-max: 800px;
    --policy-intro-gap: 24px;
    --policy-footer-gap: 96px;
    --size-hero: 5.5rem;
    --size-hero-en: 5.125rem;
    --size-hero-subtitle: 1.375rem;
    --lh-hero-subtitle: 1.4;
    --size-section-title: 3.75rem;
    --size-contact-title: 3.75rem;
    --size-about-copy: 1.5rem;
    --lh-about-copy: 1.45;
    --size-contact-copy: 1.5rem;
    --size-game-genre: 1.375rem;
    --size-game-tagline: 1.5rem;
    --size-policy-title: 3.25rem;
    --size-policy-intro: 1.375rem;
    --size-policy-heading: 1.5rem;
    --size-policy-body: 1.1875rem;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--color-text);
  background: var(--color-background);
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-synthesis: none;
  line-height: 1.5;
}
main { flex: 1; min-width: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: 1.12;
}
p { color: var(--color-body); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-inline-size: 100%; block-size: auto; }
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--color-link-hover);
  outline-offset: 4px;
}
.container { width: min(calc(100% - var(--gutter) * 2), var(--content-max)); margin-inline: auto; }
.header-container { width: min(calc(100% - var(--header-gutter) * 2), var(--header-max)); margin-inline: auto; }
.policy-container { width: min(calc(100% - var(--policy-gutter) * 2), var(--policy-max)); margin-inline: auto; }
.text-center { text-align: center; }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Typography roles shared across RU/EN and page layouts. */
.type-hero {
  font-size: var(--size-hero);
  line-height: var(--lh-hero);
  letter-spacing: -.03em;
  max-inline-size: var(--hero-title-max);
  margin-inline: auto;
  overflow-wrap: break-word;
}
:lang(en) .type-hero { font-size: var(--size-hero-en); }
.type-hero-subtitle {
  font-size: var(--size-hero-subtitle);
  line-height: var(--lh-hero-subtitle);
  max-inline-size: var(--hero-subtitle-max);
  margin-inline: auto;
}
.type-section-title, .type-contact-title {
  font-size: var(--size-section-title);
  letter-spacing: -.02em;
  line-height: 1.12;
  margin-inline: auto;
  overflow-wrap: break-word;
}
.type-section-title { max-inline-size: var(--about-title-max); }
.type-contact-title { font-size: var(--size-contact-title); max-inline-size: var(--contact-title-max); }
.type-about-copy { max-inline-size: var(--about-copy-max); margin-inline: auto; font-size: var(--size-about-copy); line-height: var(--lh-about-copy); color: var(--color-body); }
.type-contact-copy { max-inline-size: var(--contact-copy-max); margin-inline: auto; font-size: var(--size-contact-copy); line-height: 1.45; color: var(--color-body); }
.type-game-status { font-size: var(--size-game-status); font-weight: var(--weight-medium); line-height: 1.2; color: var(--color-game-status); }
.type-game-genre { font-size: var(--size-game-genre); font-weight: var(--weight-medium); line-height: 1.2; color: var(--color-game-genre); }
.type-game-tagline { font-size: var(--size-game-tagline); line-height: var(--lh-game-tagline); color: var(--color-text); }
.type-channel-label { color: var(--color-muted); font-size: var(--size-channel-label); line-height: 1.2; }
.type-footer-slogan { color: var(--color-muted); font-size: var(--size-footer-slogan); line-height: 1.2; }
.type-footer-meta { color: var(--color-muted); font-size: var(--size-footer-meta); line-height: 1.2; }
.type-policy-title { font-size: var(--size-policy-title); line-height: 1.15; letter-spacing: -.02em; overflow-wrap: break-word; }
.type-policy-intro { font-size: var(--size-policy-intro); line-height: 1.45; }
.type-policy-note { font-size: var(--size-policy-note); line-height: 1.45; font-weight: var(--weight-medium); color: var(--color-muted); }
.type-policy-heading { font-size: var(--size-policy-heading); line-height: 1.3; }
.type-policy-body { font-size: var(--size-policy-body); line-height: 1.55; overflow-wrap: break-word; }

/* Interaction components. Preserve default geometry; never shift content on hover. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  min-block-size: var(--button-height);
  max-inline-size: 100%;
  padding: 12px var(--button-padding);
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--size-button);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease);
}
.button--primary { color: var(--color-ink); background: var(--color-text); box-shadow: var(--shadow-primary); }
.button--explore { border-radius: var(--button-explore-radius); min-inline-size: min(271px, 100%); }
:lang(en) .button--explore { min-inline-size: min(254px, 100%); }
.button--game { min-inline-size: min(166px, 100%); }
:lang(en) .button--game { min-inline-size: min(230px, 100%); }
.button__icon { flex: 0 0 auto; font-size: 1.125rem; line-height: 1; }
.button--secondary {
  gap: 10px;
  min-block-size: var(--button-secondary-height);
  min-inline-size: min(110px, 100%);
  padding: 10px 15px;
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-outline);
  border-radius: var(--button-secondary-radius);
  font-size: var(--size-button-secondary);
}
:lang(en) .button--secondary { min-inline-size: min(138px, 100%); }
.button--secondary .button__icon { font-size: 1.0625rem; }
.button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; box-shadow: none; }
.button--primary:not(:disabled):not([aria-disabled="true"]):focus-visible { background: var(--color-button-hover); box-shadow: var(--shadow-primary-hover); }
.button--secondary:not(:disabled):not([aria-disabled="true"]):focus-visible { background: var(--color-outline-hover-bg); border-color: var(--color-outline-hover); box-shadow: var(--shadow-secondary-hover); }

.text-link { display: inline-flex; align-items: center; color: inherit; text-decoration: none; transition: color var(--motion-fast) var(--motion-ease); }
.text-link:focus-visible { color: var(--color-link-hover); text-decoration: underline; text-underline-offset: .2em; }
.site-nav, .footer-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: var(--nav-gap); }
.site-nav .text-link { color: var(--color-muted); font-size: var(--size-header-link); line-height: 1.2; }
.site-nav .text-link.is-active, .site-nav .text-link[aria-current="location"], .site-nav .text-link[aria-current="page"] { color: var(--color-text); font-weight: var(--weight-medium); }
.footer-nav { gap: var(--footer-nav-gap); }
.footer-nav .text-link { color: var(--color-text); font-size: var(--size-footer-link); font-weight: var(--weight-medium); line-height: 1.2; }
.contact-link { justify-content: center; color: var(--color-text); font-size: var(--size-contact-link); font-weight: var(--weight-medium); line-height: 1.2; overflow-wrap: anywhere; }
.policy-link { color: var(--color-muted); font-size: var(--size-footer-meta); line-height: 1.2; }
.language-switch {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0; min-inline-size: 105px; min-block-size: var(--language-height);
  padding-inline: 5px; border: 1px solid rgb(199 191 228 / 16%);
  border-radius: var(--language-radius); background: rgb(255 255 255 / 3%);
  font-size: .9375rem; line-height: 1.2;
  transition: background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease);
}
.language-switch a { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 38px; min-block-size: var(--language-height); color: var(--color-muted); transition: color var(--motion-fast) var(--motion-ease); }
.language-switch a[aria-current="page"], .language-switch a:focus-visible { color: var(--color-text); }
.language-switch a[aria-current="page"] { font-weight: var(--weight-medium); }
.language-switch__separator { color: rgb(199 191 228 / 38%); }
.language-switch:focus-within { background: var(--color-outline-hover-bg); border-color: var(--color-outline-hover); box-shadow: var(--shadow-secondary-hover); }
.developer-credit { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; color: var(--color-kiber); font-size: var(--size-kiber); line-height: 1.2; }
.developer-credit__link { display: inline-flex; gap: 5px; align-items: center; color: inherit; font-weight: var(--weight-medium); white-space: nowrap; transition: color var(--motion-fast) var(--motion-ease); }
.developer-credit__bird { position: relative; display: inline-block; flex: 0 0 21px; inline-size: 21px; block-size: 14px; background: url("../images/kiber-bird.svg") center / contain no-repeat; }
.developer-credit__bird::after { content: ""; position: absolute; inset: 0; background: url("../images/kiber-bird-hover.svg") center / contain no-repeat; opacity: 0; transition: opacity var(--motion-fast) var(--motion-ease); }
.developer-credit__link:focus-visible { color: var(--color-kiber-hover); }
.developer-credit__link:focus-visible .developer-credit__bird::after { opacity: 1; }

@media (hover: hover) and (pointer: fine) {
  .button--primary:not(:disabled):not([aria-disabled="true"]):hover { color: var(--color-ink); background: var(--color-button-hover); box-shadow: var(--shadow-primary-hover); }
  .button--secondary:not(:disabled):not([aria-disabled="true"]):hover { background: var(--color-outline-hover-bg); border-color: var(--color-outline-hover); box-shadow: var(--shadow-secondary-hover); }
  .text-link:hover, .site-nav .text-link:hover, .footer-nav .text-link:hover { color: var(--color-link-hover); text-decoration: underline; text-underline-offset: .2em; }
  .language-switch:hover { background: var(--color-outline-hover-bg); border-color: var(--color-outline-hover); box-shadow: var(--shadow-secondary-hover); }
  .language-switch a:hover { color: var(--color-text); }
  .developer-credit__link:hover { color: var(--color-kiber-hover); }
  .developer-credit__link:hover .developer-credit__bird::after { opacity: 1; }
}
@media (max-width: 767px) {
  .text-link, .developer-credit__link { min-block-size: var(--touch-target); min-inline-size: var(--touch-target); }
  .site-nav .text-link, .footer-nav .text-link, .policy-link { justify-content: center; }
  .language-switch a { min-inline-size: var(--touch-target); }
}
@media (max-width: 359px) {
  :root { --gutter: 16px; --header-gutter: 16px; --policy-gutter: 16px; --size-hero: 2.125rem; --size-hero-en: 2.125rem; --size-contact-title: 1.875rem; --size-section-title: 1.875rem; --size-contact-link: 1.25rem; --button-padding: 24px; --nav-gap: 20px; --footer-nav-gap: 20px; }
}

/* Reusable section primitives. Actual section markup is intentionally left
   for the upcoming implementation stages, as is the continuous background. */
.centered-section { display: grid; place-items: center; text-align: center; padding-block: var(--space-11); }
.hero-content, .about-content, .contact-content { display: flex; flex-direction: column; align-items: center; min-inline-size: 0; }
.hero-content { gap: var(--hero-gap); }
.about-content { gap: var(--about-gap); }
.contact-content { gap: var(--contact-description-gap); }
.contact-channels { width: min(100%, var(--contact-channel-max)); display: grid; grid-template-columns: 1fr; gap: var(--space-8); margin-top: var(--contact-channel-gap); }
@media (min-width: 768px) { .contact-channels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-9); } }
.game-card { position: relative; isolation: isolate; min-block-size: var(--game-card-min-height); border-radius: var(--game-radius); background: var(--color-game); overflow: hidden; }
.site-footer { background: var(--color-footer); min-block-size: var(--footer-min-height); }
.policy-intro, .policy-sections, .policy-section { display: flex; flex-direction: column; min-inline-size: 0; }
.policy-intro { gap: var(--policy-intro-gap); }
.policy-sections { gap: var(--policy-section-gap); margin-block-start: var(--policy-article-gap); margin-block-end: var(--policy-footer-gap); }
.policy-section { gap: var(--policy-paragraph-gap); }

/* Preserve a usable technical scaffold until its replacement in stages 5–10. */
body > header.container, body > footer.container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-6); }
body > header.container > nav { display: flex; gap: var(--space-4); }
body > main.container { padding-block: var(--space-11); }
body > main.container > p { margin-top: var(--space-6); }
body > footer.container { color: var(--color-muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .text-link, .language-switch, .language-switch a,
  .developer-credit__link, .developer-credit__bird::after { transition: none; }
}

/* Stage 14: preserve existing image geometry. */
.responsive-art { display: contents; }
