/* Shell: tokens, base, language switch, world layers. The home page (hero, index, contact) is in home.css. */

/* Type system (all files self-hosted in vendor/fonts and fonts/):
     display  Unbounded (variable, 200-900): the home headline and world names only
     text     Golos Text (variable, 400-900): everything else, Latin and Cyrillic
     Persian  Peyda for both roles */
@font-face { font-family: 'Unbounded Variable'; font-style: normal; font-display: swap; font-weight: 200 900; src: url('../vendor/fonts/unbounded-latin-wght-normal.woff2') format('woff2-variations'); 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: 'Unbounded Variable'; font-style: normal; font-display: swap; font-weight: 200 900; src: url('../vendor/fonts/unbounded-latin-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded Variable'; font-style: normal; font-display: swap; font-weight: 200 900; src: url('../vendor/fonts/unbounded-cyrillic-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded Variable'; font-style: normal; font-display: swap; font-weight: 200 900; src: url('../vendor/fonts/unbounded-cyrillic-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

@font-face { font-family: 'Golos Text Variable'; font-style: normal; font-display: swap; font-weight: 400 900; src: url('../vendor/fonts/golos-text-latin-wght-normal.woff2') format('woff2-variations'); 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 Variable'; font-style: normal; font-display: swap; font-weight: 400 900; src: url('../vendor/fonts/golos-text-latin-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Golos Text Variable'; font-style: normal; font-display: swap; font-weight: 400 900; src: url('../vendor/fonts/golos-text-cyrillic-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text Variable'; font-style: normal; font-display: swap; font-weight: 400 900; src: url('../vendor/fonts/golos-text-cyrillic-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

/* Persian: Peyda (premium, self-hosted; the FaNum build renders digits as Persian numerals). */
@font-face { font-family: 'Peyda'; src: url('../fonts/PeydaWebFaNum-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../fonts/PeydaWebFaNum-Medium.woff2') format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../fonts/PeydaWebFaNum-Bold.woff2') format('woff2'); font-weight: 700 799; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../fonts/PeydaWebFaNum-Black.woff2') format('woff2'); font-weight: 800 900; font-display: swap; }

:root {
  --font: 'Golos Text Variable', 'Golos Text', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-fa: 'Peyda', 'Golos Text Variable', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Unbounded Variable', 'Golos Text Variable', ui-sans-serif, system-ui, sans-serif;
  --paper: #f2efe8;
  --ink: #16150f;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-portal: cubic-bezier(0.76, 0, 0.18, 1);
  --gutter: clamp(20px, 5.2vw, 76px);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
html[lang='fa'] { font-family: var(--font-fa); --font-display: var(--font-fa); }
/* Latin tokens inside Persian text (B2B, iOS, codes): keep Latin letters and digits. */
.lat { font-family: var(--font); unicode-bidi: isolate; }
html.world-open { overflow: hidden; }
body { margin: 0; min-height: 100svh; background: var(--paper); color: var(--ink); font-size: 1.0625rem; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
img, video, canvas, svg { max-width: 100%; }
h1, h2, h3, p { overflow-wrap: break-word; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.skip { position: fixed; z-index: 100; inset-block-start: 8px; inset-inline-start: 8px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Language switch (shell header and every world bar) */
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in oklab, currentColor 9%, transparent); }
.lang__btn { min-width: 40px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 999px; background: none; font-size: 0.8125rem; font-weight: 650; line-height: 1; cursor: pointer; transition: background-color 0.25s, color 0.25s; }
.lang__btn[lang='fa'] { font-family: var(--font-fa); font-size: 0.9375rem; font-weight: 700; }
.lang__btn[aria-pressed='true'] { background: var(--ink); color: var(--paper); }

/* World layers */
.world { position: fixed; inset: 0; z-index: 60; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--g, #111); visibility: hidden; outline: none; scrollbar-width: none; contain: layout style; }
.world::-webkit-scrollbar { display: none; }
.world.is-visible { visibility: visible; }

.toast { position: fixed; z-index: 120; inset-inline: 0; inset-block-end: calc(22px + env(safe-area-inset-bottom, 0px)); margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.9375rem; font-weight: 500; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.3s, transform 0.5s var(--ease-out); }
.toast.is-on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
