/* ===== Chrome: nav, footer, loader, hero, theme toggle ===== */

/* --- Wordmark --- */
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.wordmark__txt { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.wordmark__alt { color: var(--text-3); transition: color 0.3s var(--ease); }
.wordmark:hover .wordmark__alt { color: var(--accent); }

/* --- Magnetic --- */
.magnetic { display: inline-flex; transition: transform 0.45s var(--ease); will-change: transform; }

/* --- Nav --- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 90; padding: 14px var(--pad-x); transition: padding 0.4s var(--ease); }
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 9px 9px 9px 18px; border-radius: 100px;
  border: 1px solid transparent; transition: all 0.5s var(--ease);
}
.nav--solid .nav__inner {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-color: var(--line); box-shadow: var(--shadow-sm);
}
.nav__links { display: flex; gap: 4px; }
.nav__link {
  position: relative; padding: 9px 16px; font-size: 15px; font-weight: 500; color: var(--text-2);
  border-radius: 100px; transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--text); background: var(--accent-soft); }
.nav__right { display: flex; align-items: center; gap: 10px; }
.nav__burger {
  display: none; color: var(--text); width: 44px; height: 44px;
  align-items: center; justify-content: center; flex: none;
  border-radius: 50%; border: 1px solid transparent;
}

/* --- Language switch --- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
}
.lang-switch__btn {
  min-width: 30px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 100px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.lang-switch__btn:hover { color: var(--text); }
.lang-switch__btn.is-active { color: var(--accent-text); background: var(--accent); }

/* --- Theme toggle --- */
.theme-toggle { padding: 4px; }
.theme-toggle__track {
  width: 52px; height: 30px; border-radius: 100px; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; padding: 3px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.theme-toggle__thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg);
  display: grid; place-items: center; transition: transform 0.5s var(--ease), background 0.4s var(--ease);
}
html[data-theme="dark"] .theme-toggle__thumb { transform: translateX(22px); }

/* --- Mobile menu --- */
.mmenu {
  position: fixed; inset: 0; z-index: 120; background: var(--bg);
  display: flex; flex-direction: column; padding: 18px var(--pad-x) max(40px, calc(28px + var(--safe-bottom)));
  min-height: 100dvh;
  transform: translateY(-100%); transition: transform 0.6s var(--ease); visibility: hidden;
}
.mmenu.is-open { transform: none; visibility: visible; }
.mmenu__top { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.mmenu__close { color: var(--text); padding: 8px; }
.mmenu__links { display: flex; flex-direction: column; margin-top: auto; margin-bottom: auto; gap: 6px; }
.mmenu__link {
  display: flex; align-items: baseline; gap: 18px; text-align: left;
  font-size: clamp(38px, 13vw, 72px); font-weight: 500; letter-spacing: -0.03em; color: var(--text);
  padding: 6px 0; opacity: 0; transform: translateY(20px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.3s;
}
.mmenu.is-open .mmenu__link { opacity: 1; transform: none; }
.mmenu__link:hover { color: var(--accent); }
.mmenu__num { font-size: 13px; color: var(--text-3); font-weight: 400; }
.mmenu__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mmenu__controls { display: flex; align-items: center; gap: 10px; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 7vw, 96px) 40px; background: var(--bg-2); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer__h { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 18px; }
.footer__col { display: flex; flex-direction: column; gap: 11px; align-items: flex-start; }
.footer__link { color: var(--text-2); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; transition: color 0.3s var(--ease); }
.footer__link:hover { color: var(--accent); }
.footer__mark { font-size: 12px; margin-top: 22px; letter-spacing: 0.04em; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; margin-top: clamp(40px, 6vw, 72px); padding-top: 24px; border-top: 1px solid var(--line); gap: 16px; flex-wrap: wrap; }

/* --- Loader / intro --- */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity 0.8s var(--ease), visibility 0.8s var(--ease);
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__mark { color: var(--text); animation: loaderspin 4s linear infinite; }
@keyframes loaderspin { to { transform: rotate(360deg); } }
.loader__bar { width: min(260px, 60vw); height: 2px; background: var(--line); position: relative; overflow: hidden; border-radius: 2px; }
.loader__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--accent); transition: width 0.2s linear; }
.loader__meta { display: flex; justify-content: space-between; width: min(260px, 60vw); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-3); text-transform: uppercase; }
.loader__word { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .loader__mark { animation: none; } }

/* --- Hero --- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding-top: 90px; padding-bottom: clamp(28px, 5vw, 64px); }
.hero__canvas { position: absolute; inset: 0; z-index: 0; }
.hero__canvas canvas { width: 100% !important; height: 100% !important; }
.hero__veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 70% 50%, transparent, var(--bg) 88%),
              linear-gradient(to right, var(--bg) 0%, transparent 42%, transparent 60%, color-mix(in srgb, var(--bg) 40%, transparent) 100%);
}
html[data-theme="dark"] .hero__veil {
  background: linear-gradient(to right, var(--bg) 0%, transparent 42%, transparent 72%, color-mix(in srgb, var(--bg) 52%, transparent) 100%);
}
.hero__inner { position: relative; z-index: 2; width: 100%; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 40px; }
.hero__lead { min-width: 0; max-width: 100%; }
.hero__eyebrow { margin-bottom: 24px; }
.hero__title { margin-bottom: 20px; font-size: clamp(40px, 5.7vw, 80px); line-height: 0.98; letter-spacing: -0.035em; }
.hero__title .ln { display: block; overflow: hidden; padding-block: 0.015em; line-height: 0.98; }
.hero__title .word-reveal > span {
  transform: none !important;
  animation: none !important;
}
.hero__sub { max-width: 460px; margin-bottom: 28px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero__side { display: flex; flex-direction: column; gap: 18px; justify-self: end; align-items: flex-end; max-width: min(34vw, 440px); }
.hero__chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 100px;
  background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--text-2);
}
.hero__chip b { color: var(--text); font-weight: 600; }
.hero__scroll { display: none; }
.hero__scroll-line { width: 1px; height: 42px; background: linear-gradient(var(--text-3), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 40%; background: var(--accent); animation: scrolldrop 2.2s var(--ease) infinite; }
@keyframes scrolldrop { 0% { transform: translateY(-100%); } 60%,100% { transform: translateY(260%); } }
@media (prefers-reduced-motion: reduce) { .hero__scroll-line::after { animation: none; } }

/* Hero stat ticker under hero */
.hero__ticker { position: relative; z-index: 2; border-top: 1px solid var(--line); margin-top: clamp(24px, 3.6vw, 40px); }
.hero__ticker-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.hero__stat {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero__stat:last-child { border-right: none; }
.hero__stat .v { font-size: clamp(26px, 3vw, 40px); font-weight: 500; letter-spacing: -0.03em; }
.hero__stat .l {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px auto 0;
  text-align: center;
}

@media (max-width: 980px) {
  .nav__links { display: none; }
  .nav__right > .lang-switch { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: inline-flex; }
  .hero { min-height: auto; align-items: flex-start; padding-top: 118px; }
  .hero__veil {
    background: radial-gradient(ellipse 80% 36% at 50% 24%, transparent, var(--bg) 78%),
                linear-gradient(to bottom, color-mix(in srgb, var(--bg) 8%, transparent), var(--bg) 92%);
  }
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero__side { display: none; }
  .hero__title { font-size: clamp(42px, 12vw, 76px); max-width: none; line-height: 1.02; }
  .hero__title .ln { white-space: nowrap; overflow: visible; padding-block: 0.02em; }
  .hero__sub { max-width: 620px; margin-bottom: 28px; }
  .hero__scroll { display: none; }
  .hero__ticker-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero__stat {
    min-height: 104px;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .hero__stat:nth-child(2),
  .hero__stat:nth-child(4) {
    border-right: none;
  }
  .hero__stat:nth-child(3),
  .hero__stat:nth-child(4) {
    border-bottom: none;
  }
  .hero__stat .v,
  .hero__stat .l {
    display: block;
    margin-inline: auto;
    text-align: center;
  }
  .hero__stat .l {
    max-width: 10ch;
    line-height: 1.35;
    overflow-wrap: normal;
  }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .nav { padding: calc(8px + env(safe-area-inset-top, 0px)) var(--pad-x) 8px; }
  .nav__inner {
    min-height: 52px;
    padding: 4px 4px 4px 12px;
    gap: 8px;
    border-color: transparent;
  }
  .nav--solid .nav__inner {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
  }
  .nav__right { gap: 4px; flex: none; }
  .nav__right > .theme-toggle { display: none; }
  .wordmark__txt { font-size: 17px; }
  .wordmark { gap: 9px; }
  .wordmark svg { width: 24px; height: 24px; }
  .nav__burger {
    display: inline-flex;
    background: transparent;
    border-color: transparent;
    width: auto;
    min-width: 58px;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .nav__burger::before { content: 'Menu'; }
  .nav__burger svg { display: none; }
  .theme-toggle__track { width: 46px; height: 28px; }
  .theme-toggle__thumb { width: 20px; height: 20px; }
  html[data-theme="dark"] .theme-toggle__thumb { transform: translateX(18px); }
  .hero {
    padding-top: 92px;
    padding-bottom: max(24px, calc(18px + var(--safe-bottom)));
    background:
      linear-gradient(to bottom, color-mix(in srgb, var(--surface-2) 45%, transparent), transparent 42%),
      var(--bg);
  }
  .hero__canvas,
  .hero__veil { display: none; }
  .hero__eyebrow { margin-bottom: 18px; font-size: 10px; letter-spacing: 0.15em; }
  .hero__title {
    display: flex;
    flex-direction: column;
    gap: 0.05em;
    font-size: clamp(27px, 8.2vw, 32px);
    line-height: 1.02;
    margin-bottom: 34px;
  }
  .hero__title .ln { line-height: 1.02; }
  .hero__sub { width: 100%; max-width: 34ch; font-size: 14.5px; line-height: 1.5; margin-bottom: 20px; }
  .hero__cta { gap: 10px; }
  .hero__cta .btn { width: auto; min-height: 42px; justify-content: center; padding: 10px 16px; font-size: 14px; }
  .footer__grid { grid-template-columns: 1fr; }
  .hero__ticker { margin-top: 28px; }
  .hero__stat { padding: 14px 8px; min-height: 94px; }
  .hero__stat .v { font-size: 24px; }
  .hero__stat .l {
    font-size: 9px;
    letter-spacing: 0.04em;
    line-height: 1.35;
  }

  .mmenu {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: max(24px, calc(18px + var(--safe-bottom)));
    background:
      linear-gradient(to bottom, color-mix(in srgb, var(--surface-2) 55%, transparent), transparent 45%),
      var(--bg);
  }
  .mmenu__top { height: 52px; }
  .mmenu__close {
    width: auto; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 999px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  }
  .mmenu__close::before { content: 'Close'; }
  .mmenu__close svg { width: 18px; height: 18px; }
  .mmenu__links {
    margin-top: 32px;
    margin-bottom: 26px;
    gap: 0;
    border-top: 1px solid var(--line);
  }
  .mmenu__link {
    font-size: clamp(23px, 7.2vw, 30px);
    line-height: 1.05;
    padding: 16px 0;
    gap: 12px;
    border-bottom: 1px solid var(--line);
  }
  .mmenu__num { font-size: 11px; }
  .mmenu__foot {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .mmenu__foot .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    font-size: 14px;
  }
  .mmenu__controls {
    justify-content: space-between;
    width: 100%;
    padding-bottom: var(--safe-bottom);
  }
  .lang-switch--mobile { flex: 1; justify-content: space-between; }
  .lang-switch--mobile .lang-switch__btn { flex: 1; height: 34px; }
}
