/*
 * Header and footer matching mi8os.com (mi8os-shopify: sections/header.liquid, sections/footer.liquid,
 * assets/critical.css), in the theme's dark palette. Shared by app.mi8os.com and guide.mi8os.com;
 * keep the two copies identical.
 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-latin.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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-greek.woff2) format("woff2");
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }

:root {
  --sc-ink: oklch(.135 .004 30);
  --sc-ink-2: oklch(.165 .005 30);
  --sc-paper: oklch(.95 .008 60);
  --sc-muted: oklch(.84 .01 55);
  --sc-quiet: oklch(.74 .012 55);
  --sc-rose: oklch(.85 .055 48);
  --sc-rose-mid: oklch(.78 .06 42);
  --sc-rose-deep: oklch(.45 .065 30);
  --sc-line: oklch(1 0 0 / .13);
  --sc-page: 1440px;
  --sc-gutter: clamp(1.25rem, 4vw, 4rem);
  --sc-ease: cubic-bezier(.16, 1, .3, 1);
  --sc-display: Manrope, system-ui, sans-serif;
  --sc-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc-gradient-rose: linear-gradient(115deg, var(--sc-rose-deep) 0%, var(--sc-rose-mid) 28%, var(--sc-rose) 50%, var(--sc-rose-mid) 72%, var(--sc-rose-deep) 100%);
  --sc-header-bg: rgba(11, 10, 10, .9);
  --sc-surface-hover: rgba(255, 255, 255, .055);
  --sc-gradient-key: linear-gradient(115deg, #e8baa3 0%, #d79a82 38%, #c47e6a 68%, #b87361 100%);
}

/* Light appearance, same palette as the shop's :root[data-theme='light'] (critical.css). */
:root[data-theme='light'] {
  --sc-ink: #f7f4f0;
  --sc-ink-2: #fffdfb;
  --sc-paper: #241d1a;
  --sc-muted: #5e514b;
  --sc-quiet: #6d5e57;
  --sc-rose: #914f3c;
  --sc-rose-mid: #9b5743;
  --sc-rose-deep: #67362b;
  --sc-line: rgba(52, 39, 33, .16);
  --sc-header-bg: rgba(247, 244, 240, .9);
  --sc-surface-hover: rgba(66, 45, 37, .065);
}

.container { width: 100%; max-width: var(--sc-page); margin-inline: auto; padding-inline: var(--sc-gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- wordmark (snippets/mi8os-logo.liquid) ---------- */
.mi8os-logo { display: inline-flex; height: var(--logo-height); align-items: center; font-family: var(--sc-display); font-size: var(--logo-height); font-weight: 600; line-height: 1; letter-spacing: .24em; color: var(--sc-paper); }
.site-header .mi8os-logo { font-weight: 700; }
.mi8os-logo > span { transform: scaleX(.94); transform-origin: left; }
.mi8os-logo__eight { color: var(--sc-rose); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .mi8os-logo__eight { background: var(--sc-gradient-rose); background-size: 220% 100%; background-position: 42% 50%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: title-metal 9s ease-in-out infinite; }
}
@keyframes title-metal { 0%, 100% { background-position: 12% 50%; } 50% { background-position: 88% 50%; } }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 80; font-family: var(--sc-body); border-bottom: 1px solid transparent; transition: background-color .4s, border-color .4s, backdrop-filter .4s; }
.site-header.is-scrolled { background: var(--sc-header-bg); border-bottom-color: var(--sc-line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.site-header__inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-header__inner > a { text-decoration: none; }
.site-header__actions { display: flex; align-items: center; gap: .75rem; }

.header-lang { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .6rem .55rem; border-radius: .65rem; color: var(--sc-quiet); font: 500 .9375rem/1 var(--sc-body); cursor: pointer; transition: color .25s; }
.header-lang:hover, .header-lang:focus-within { color: var(--sc-rose); }
.header-lang .globe { width: 1.15rem; height: 1.15rem; flex: none; }
.header-lang .chev { width: .6rem; flex: none; }
.header-lang .current { white-space: nowrap; }
.header-lang .short { display: none; letter-spacing: .04em; }
/* the native select sits invisibly on top, so the label is exactly as wide as the chosen language */
.header-lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 1rem; }
.header-lang:focus-within { outline: 2px solid var(--sc-rose); outline-offset: 1px; }
.header-lang option, .footer-lang option { color: initial; }

/* theme toggle, as in the shop header */
.theme-toggle { position: relative; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; display: grid; place-items: center; padding: 0; background: transparent; color: var(--sc-paper); cursor: pointer; transition: background-color .25s ease, color .25s ease, transform .25s ease; }
.theme-toggle:hover { background: var(--sc-surface-hover); color: var(--sc-rose); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle:focus-visible { outline: 2px solid var(--sc-rose); outline-offset: 2px; }
.theme-toggle svg { position: absolute; width: 1.25rem; height: 1.25rem; transition: opacity .2s ease, transform .35s var(--sc-ease); }
.theme-toggle__moon, :root[data-theme='light'] .theme-toggle__sun { opacity: 0; transform: rotate(-25deg) scale(.7); }
:root[data-theme='light'] .theme-toggle__moon { opacity: 1; transform: rotate(0) scale(1); }
.no-js .theme-toggle { display: none; }

.btn-shop { appearance: none; border: 1px solid rgba(232, 186, 163, .5); border-radius: .75rem; min-height: 2.5rem; padding: .5rem 1.1rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--sc-gradient-key); background-color: var(--sc-rose); background-size: 170% 170%; background-position: 0 50%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .32) inset, 0 10px 24px -14px rgba(184, 115, 97, .72);
  color: #181210; font: 650 .875rem/1.2 var(--sc-body); letter-spacing: .015em; text-decoration: none; white-space: nowrap;
  transition: background-position .45s var(--sc-ease), border-color .3s var(--sc-ease), box-shadow .3s var(--sc-ease), transform .3s var(--sc-ease); }
.btn-shop:hover { border-color: rgba(232, 186, 163, .88); background-position: 100% 50%; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .38) inset, 0 15px 30px -14px rgba(184, 115, 97, .85); }

/* ---------- footer (sections/footer.liquid) ---------- */
/* Room below the language menu, as in the shop (which keeps it free for its sticky purchase bar). */
.site-footer { position: relative; overflow: hidden; isolation: isolate; padding-bottom: calc(4 * 2.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sc-line); font-family: var(--sc-body); color: var(--sc-quiet); }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; }
.site-footer__main, .site-footer__follow, .site-footer__bar, .site-footer__localization { position: relative; z-index: 1; }
/* The key mark from the cards, faint behind the footer like a watermark. */
.site-footer__key { position: absolute; z-index: 0; top: 4.75rem; right: -14%; width: 62%; height: auto; opacity: .09; pointer-events: none; }
:root[data-theme='light'] .site-footer__key { opacity: .07; }
.site-footer__main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 3fr); gap: 3rem; padding-block: 4.5rem 3.5rem; }
.site-footer .mi8os-logo { font-weight: 700; }
.site-footer__brand p { max-width: 30ch; margin-top: 1.25rem; color: var(--sc-muted); font-size: .9375rem; line-height: 1.6; }
.site-footer__badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
.site-footer__badges .store-badge { display: inline-flex; flex: none; border-radius: .55rem; line-height: 0; }
.site-footer__badges .store-badge img { width: auto; height: 2.5rem; }
.site-footer__badges .btn { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border: 1px solid var(--sc-line); border-radius: .65rem; color: var(--sc-paper); font-size: .875rem; }
.site-footer__nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; }
.site-footer__title { margin-bottom: 1.1rem !important; color: var(--sc-paper); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.site-footer__col li + li { margin-top: .8rem; }
.site-footer__col a { font-size: .9375rem; }
.site-footer__follow, .site-footer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; border-top: 1px solid var(--sc-line); }
.site-footer__follow { padding-block: 1.75rem; }
.site-footer__social { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; }
.site-footer__social a { display: block; color: var(--sc-quiet); transition: color .25s, transform .3s var(--sc-ease); }
.site-footer__social a:hover { color: var(--sc-rose); transform: translateY(-2px); }
.site-footer__social svg { display: block; width: 24px; height: 24px; }
.site-footer__swiss { display: inline-flex; align-items: center; gap: .45rem; color: var(--sc-quiet); font-size: .875rem; }
.site-footer__swiss svg { flex: none; border-radius: 3px; }
.site-footer__bar { padding-block: 1.5rem; font-size: .8125rem; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.site-footer__pay { display: flex; flex-wrap: wrap; gap: .4rem; }
.site-footer__pay svg { width: auto; height: 1.3rem; }
.site-footer__localization { display: flex; justify-content: center; padding-block: 1.5rem; text-align: center; }
.link-quiet { color: var(--sc-quiet); transition: color .25s; }
.link-quiet:hover { color: var(--sc-rose); }
.footer-lang { position: relative; display: inline-flex; align-items: center; }
.footer-lang select { appearance: none; -webkit-appearance: none; max-width: calc(100vw - (2 * var(--sc-gutter))); min-height: 2.75rem; border: 1px solid var(--sc-line); border-radius: .65rem; padding: .6rem 2.5rem .6rem 1rem; background: var(--sc-ink-2); color: var(--sc-paper); cursor: pointer; font: 400 .875rem/1.2 var(--sc-body); }
.footer-lang svg { position: absolute; right: .9rem; width: .65rem; pointer-events: none; color: var(--sc-paper); }
.site-footer .langs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; padding-bottom: 1.5rem; font-size: .875rem; }

@media (max-width: 1050px) {
  .theme-toggle { width: 2.75rem; height: 2.75rem; flex: 0 0 2.75rem; }
  }
@media (max-width: 520px) {
  .site-header__inner { height: 64px; }
  .site-header__actions { gap: .25rem; }
  .site-header__actions .btn-shop { display: none; }
  .header-lang .current { display: none; }
  .header-lang .short { display: inline; }
}
@media (max-width: 900px) {
  .site-footer__main { grid-template-columns: minmax(0, 1fr); }
  .site-footer__key { top: 1.25rem; right: -30%; width: 92%; }
}
@media (max-width: 560px) {
  .site-footer__main { gap: 2.25rem; padding-block: 3.5rem 2.5rem; }
  .site-footer__nav { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .site-footer__badges { flex-wrap: nowrap; }
  .site-footer__key { top: -1.25rem; right: -32%; width: 100%; }
  .site-footer__follow { flex-direction: column; align-items: flex-start; }
  .site-footer__social { flex-wrap: nowrap; justify-content: space-between; width: 100%; gap: 0; }
  .site-footer__bar { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .site-footer__legal { flex-direction: column; gap: .85rem; font-size: .875rem; }
  .site-footer__copyright { order: 9; margin-top: .5rem; }
  .footer-lang, .footer-lang select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .mi8os-logo__eight { animation: none; }
}

/* ---------- footer key draw (snippets/mi8os-key-draw.liquid) ---------- */
/* Key write-on: the mask line runs from the spiral's outer tail to the teeth tip
   (pathLength=1, so the dash maths is the same at any size). Without JS, or with
   reduced motion, the key simply shows complete. */
.key-draw.is-armed .key-draw__line { stroke-dasharray: 1 2; stroke-dashoffset: 1.01; }
.key-draw.is-drawing .key-draw__line { animation: key-draw 3.2s cubic-bezier(.33, .04, .67, .96) forwards; }
@keyframes key-draw { from { stroke-dashoffset: 1.01; } to { stroke-dashoffset: 0; } }
@media (max-width: 900px) { .site-footer__key { top: 1.25rem; right: -30%; width: 92%; } }
@media (max-width: 560px) { .site-footer__key { top: .5rem; right: -24%; width: 100%; } }

/* ---------- nav wordmark -> key on scroll (snippets/mi8os-nav-logo-key.liquid) ---------- */
.site-header { --paper: var(--sc-paper); --rose: var(--sc-rose); --rose-mid: var(--sc-rose-mid); --rose-deep: var(--sc-rose-deep); }
.nav-logo-key { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
