/* =========================================================
   GLASS TREE — 2026 / base
   tokens · reset · type · primitives · header · menu · preloader
   ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  /* night — cinematic base */
  --night: #0c0a10;
  --night-2: #13101a;
  --night-3: #1c1724;
  --snow: #f4f0ea;
  --fog: rgba(244, 240, 234, 0.66);
  --fog-2: rgba(244, 240, 234, 0.42);
  --hair: rgba(244, 240, 234, 0.12);

  /* birch — light sections */
  --birch: #eee8de;
  --birch-2: #e4dccf;
  --ink: #15121b;
  --ink-soft: #5d5666;
  --hair-ink: rgba(21, 18, 27, 0.12);

  /* light sources */
  --violet: #6b45e0;
  --violet-hi: #9a7dff;
  --lilac: #cdbcff;
  --amber: #e0a468;
  --amber-hi: #f4c58e;
  --walnut: #6b4428;

  --grad-accent: linear-gradient(100deg, var(--lilac) 0%, #e9c7ff 38%, var(--amber-hi) 100%);
  --grad-accent-ink: linear-gradient(100deg, var(--violet) 0%, #8a4fc9 45%, var(--walnut) 100%);

  --shell: 1320px;
  --gutter: clamp(18px, 4.2vw, 64px);
  --section-y: clamp(96px, 13vw, 200px);
  --r-sm: 14px;
  --r: 24px;
  --r-lg: 36px;
  --r-xl: clamp(28px, 4vw, 56px);

  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --font-sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--snow);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }
html.is-loading,
html.is-loading body { overflow: hidden; }

img,
svg,
picture { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button,
input,
textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }

::selection { background: var(--violet); color: #fff; }

:focus-visible {
  outline: 2px solid var(--violet-hi);
  outline-offset: 3px;
  border-radius: 6px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-block;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--snow);
  color: var(--ink);
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* film grain — static, cheap */
.grain {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */

.display {
  font-weight: 300;
  font-size: clamp(44px, 7.4vw, 124px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.display em,
.hero__title em,
.ethos__title em,
.contact__title em,
.footer__tagline em,
.metrics__caption em,
.step__cta-text em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.015em;
  padding-right: 0.06em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section--light .display em,
.section--light .metrics__caption em,
.section--light .step__cta-text em {
  background: var(--grad-accent-ink);
  -webkit-background-clip: text;
  background-clip: text;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.label--light { color: var(--fog); }

.label__num {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ef0a4;
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #8ef0a4;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ---------- glass ---------- */

.glass {
  position: relative;
  border-radius: var(--r-lg);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 40px 90px -40px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  isolation: isolate;
}

/* specular highlight that follows the pointer (set by JS: --mx / --my) */
.glass::before,
[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: var(--shine, 0.55);
  transition: opacity 0.6s var(--ease);
  z-index: 1;
}
.glass > * { position: relative; z-index: 2; }

.glass--warm {
  background:
    linear-gradient(150deg, rgba(255, 244, 230, 0.26) 0%, rgba(255, 236, 214, 0.08) 55%, rgba(255, 236, 214, 0.05) 100%);
  border-color: rgba(255, 238, 220, 0.28);
}

/* ---------- buttons & links ---------- */

.btn {
  --btn-bg: var(--snow);
  --btn-fg: var(--ink);
  --btn-icon-bg: var(--ink);
  --btn-icon-fg: var(--snow);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 7px 7px 7px 26px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background-color 0.4s;
  will-change: transform;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }

.btn__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--btn-icon-bg);
  color: var(--btn-icon-fg);
  font-size: 18px;
  transition: transform 0.6s var(--ease);
}
.btn:hover .btn__icon { transform: rotate(45deg); }
.btn:hover .btn__icon:has(use[href="#i-arrow-down"]) { transform: translateY(3px); }

.btn--accent {
  --btn-bg: linear-gradient(120deg, #5a35d6, #8a63ff 60%, #b48cff);
  --btn-fg: #fff;
  --btn-icon-bg: rgba(255, 255, 255, 0.95);
  --btn-icon-fg: var(--violet);
  background: var(--btn-bg);
  box-shadow: 0 18px 50px -14px rgba(107, 69, 224, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn--accent:hover { box-shadow: 0 24px 60px -12px rgba(124, 84, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

.btn--ghost {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: var(--snow);
  --btn-icon-bg: rgba(255, 255, 255, 0.12);
  --btn-icon-fg: var(--snow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn--dark {
  --btn-bg: var(--ink);
  --btn-fg: var(--snow);
  --btn-icon-bg: var(--snow);
  --btn-icon-fg: var(--ink);
}

.btn--light { --btn-bg: var(--snow); }

.btn--sm {
  min-height: 44px;
  padding: 4px 4px 4px 18px;
  gap: 10px;
  font-size: 14px;
}
.btn--sm .btn__icon { width: 36px; height: 36px; font-size: 15px; }

.btn--block { width: 100%; justify-content: space-between; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding-bottom: 4px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.6s var(--ease), gap 0.5s var(--ease);
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; gap: 12px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fog);
}
.tags--sm span { padding: 4px 10px; font-size: 11px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--accent, var(--lilac)));
  box-shadow: 0 0 14px var(--dot, var(--accent, var(--lilac)));
  flex: none;
}

/* ---------- reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition:
    opacity 1.1s var(--ease) var(--reveal-delay, 0ms),
    transform 1.3s var(--ease) var(--reveal-delay, 0ms),
    clip-path 1.5s var(--ease) var(--reveal-delay, 0ms);
}
/* mask reveal clips the children: IntersectionObserver ignores fully clipped targets */
.js [data-reveal="mask"] {
  opacity: 1;
  transform: none;
}
.js [data-reveal="mask"] > * {
  clip-path: inset(100% 0 0 0 round var(--r-lg));
  transition: clip-path 1.5s var(--ease) var(--reveal-delay, 0ms);
}
.js [data-reveal].is-inview {
  opacity: 1;
  transform: none;
}
.js [data-reveal="mask"].is-inview > * { clip-path: inset(0 0 0 0 round var(--r-lg)); }

/* hero title lines */
.line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.line > span { display: block; }
.js .line > span {
  transform: translate3d(0, 110%, 0);
  transition: transform 1.5s var(--ease);
}
.js .line:nth-child(2) > span { transition-delay: 0.12s; }
.is-ready .line > span { transform: none; }

/* ---------- header ---------- */

.header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  padding-inline: 14px;
  pointer-events: none;
  transition: transform 0.7s var(--ease);
}
.header.is-hidden { transform: translateY(calc(-100% - 60px)); }

.header__pill {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  width: min(100%, 1080px);
  padding: 7px 7px 7px 16px;
  border-radius: 999px;
  background: rgba(16, 13, 22, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: var(--snow);
  overflow: hidden;
  transition: background-color 0.5s;
}
.header.is-scrolled .header__pill { background: rgba(16, 13, 22, 0.72); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.brand__mark { width: 34px; height: 34px; transition: transform 0.9s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-12deg) scale(1.06); }
.brand__name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.nav { display: flex; gap: 6px; }
.nav a {
  position: relative;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fog);
  transition: color 0.3s, background-color 0.3s;
}
.nav a:hover { color: var(--snow); background: rgba(255, 255, 255, 0.06); }
.nav a.is-active { color: var(--snow); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--amber-hi);
}

.header__progress {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}
.header__progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--grad-accent);
}

.burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--snow);
}
.burger span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.5s var(--ease);
}
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 25px; }

/* ---------- mobile menu ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  visibility: hidden;
  pointer-events: none;
  background: var(--night);
  clip-path: circle(0% at calc(100% - 42px) 42px);
  transition: clip-path 0.9s var(--ease-io), visibility 0s linear 0.9s;
}
.menu.is-open {
  visibility: visible;
  pointer-events: auto;
  clip-path: circle(150% at calc(100% - 42px) 42px);
  transition: clip-path 0.9s var(--ease-io), visibility 0s;
}
.menu__light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 90% 0%, rgba(107, 69, 224, 0.45), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(224, 164, 104, 0.28), transparent 70%);
}
.menu__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 26px var(--gutter) calc(28px + env(safe-area-inset-bottom));
}
.menu__top { display: flex; justify-content: space-between; align-items: center; }
.menu__close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  font-size: 20px;
}
.menu__nav {
  margin-block: auto;
  display: flex;
  flex-direction: column;
}
.menu__nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: clamp(38px, 11vw, 64px);
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.menu__nav a span {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fog-2);
  font-weight: 600;
}
.menu.is-open .menu__nav a { opacity: 1; transform: none; }
.menu.is-open .menu__nav a:nth-child(1) { transition-delay: 0.25s; }
.menu.is-open .menu__nav a:nth-child(2) { transition-delay: 0.3s; }
.menu.is-open .menu__nav a:nth-child(3) { transition-delay: 0.35s; }
.menu.is-open .menu__nav a:nth-child(4) { transition-delay: 0.4s; }
.menu.is-open .menu__nav a:nth-child(5) { transition-delay: 0.45s; }
.menu__bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--fog);
}
.menu__bottom a { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- preloader ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--night);
  transition: clip-path 1.2s var(--ease-io);
  clip-path: inset(0 0 0 0);
}
.preloader.is-done { clip-path: inset(0 0 100% 0); }

.preloader__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 35% at 50% 46%, rgba(107, 69, 224, 0.35), transparent 70%);
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
  50% { opacity: 0.55; transform: scale(1.06); }
}

.preloader__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.preloader__logo {
  width: 88px;
  height: 88px;
  animation: logoIn 1.4s var(--ease) both;
}
@keyframes logoIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); filter: blur(8px); }
}
.preloader__word {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  padding-left: 0.5em;
  color: var(--fog);
  animation: logoIn 1.4s var(--ease) 0.15s both;
}
.preloader__foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 34px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog-2);
}
.preloader__count {
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 0.8;
  color: var(--snow);
  font-variant-numeric: tabular-nums;
}
.preloader__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
}
.preloader__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad-accent);
}

/* ---------- dialogs ---------- */

.dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(84vh, 860px);
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--birch);
  color: var(--ink);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.dialog[open] { animation: dialogIn 0.7s var(--ease); }
.dialog::backdrop {
  background: rgba(8, 6, 12, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
}
.dialog__panel { display: flex; flex-direction: column; max-height: inherit; }
.dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hair-ink);
}
.dialog__close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--hair-ink);
  font-size: 18px;
  transition: transform 0.5s var(--ease), background-color 0.3s;
}
.dialog__close:hover { transform: rotate(90deg); background: var(--birch-2); }
.dialog__body {
  overflow-y: auto;
  padding: 28px clamp(22px, 5vw, 48px) 40px;
  overscroll-behavior: contain;
}
.dialog__body h2 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.dialog__body h3 {
  margin-top: 26px;
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 600;
}
.dialog__body p { color: var(--ink-soft); }
.dialog__body a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }
.dialog__date { margin-top: 8px; font-size: 14px; }
