/* bygromov.com — "Orbit" main page
   Tokens first; everything below uses them. */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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: "Montserrat";
  src: url("../fonts/montserrat-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-017F;
}
/* metric-matched fallback: keeps text boxes the same size while the webfont loads (no layout shift) */
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 112.8%;
  ascent-override: 85.8%;
  descent-override: 22.2%;
  line-gap-override: 0%;
}

:root {
  --bg: #110f10;
  --bg-2: #1a1718;
  --bg-3: #231f20;          /* the original bygromov.com charcoal */
  --fg: #eaeaea;            /* the original light */
  --fg-2: rgba(234, 234, 234, .62);
  --fg-3: rgba(234, 234, 234, .55);   /* 5.4:1 on --bg (AA for small text) */
  --line: rgba(234, 234, 234, .14);
  --accent: #ff5b35;        /* one restrained signal colour (on dark only) */
  --accent-ink: #b83a1b;    /* the same signal, dark enough for text on the light side (4.8:1) */
  --ink: #231f20;
  --ink-2: rgba(35, 31, 32, .72);     /* 5.9:1 on --fg */
  --ink-line: rgba(35, 31, 32, .16);
  --font: "Montserrat", "Montserrat Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --bar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-weight: 400; font-size: 16px; line-height: 1.5; background: var(--bg); overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
::selection { background: var(--fg); color: var(--ink); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 12px 18px; background: var(--fg); color: var(--ink); font-weight: 600; border-radius: 999px; transform: translateY(-160%); transition: transform .25s var(--ease); }
.skip:focus-visible { transform: none; }

/* film grain — one static layer, never repainted */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .07;
  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%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto; }

/* ─────────────── top bar ─────────────── */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(var(--gutter), env(safe-area-inset-left)) 0 max(var(--gutter), env(safe-area-inset-left));
  color: var(--fg); mix-blend-mode: difference; pointer-events: none;
}
/* the difference blend is only for the top of the hero; once the page moves, the bar gets a solid backdrop
   (at every width: over the hero meta and the light Contact section the blend garbles text) */
.bar::before {
  --bb: 17, 15, 16;
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: calc(100% + 14px);
  background: linear-gradient(rgb(var(--bb)) 76%, rgba(var(--bb), 0)); opacity: 0; transition: opacity .35s var(--ease);
}
.is-scrolled .bar { mix-blend-mode: normal; }
.is-scrolled .bar::before { opacity: 1; }
.is-scrolled.bar-on-light .bar { color: var(--ink); }
.is-scrolled.bar-on-light .bar::before { --bb: 234, 234, 234; }
.bar a { pointer-events: auto; display: inline-flex; align-items: center; min-height: 44px; }
.bar__brand { font-size: 19px; font-weight: 500; letter-spacing: -.01em; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js.has-hero:not(.is-scrolled) .bar__brand:not(:focus-visible) { opacity: 0; transform: translateY(-6px); }
.bar__nav { display: flex; gap: clamp(8px, 2.4vw, 36px); }
.bar__nav a { position: relative; padding: 0 6px; font-size: clamp(13px, .6vw, 15px); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.bar__nav a::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 10px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.bar__nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ─────────────── hero ─────────────── */
.hero {
  --size: min(calc(100vw - 20px), calc(100svh - 150px), 980px);
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; overflow: hidden; isolation: isolate;
  padding-top: var(--bar-h);
  background:
    radial-gradient(62% 58% at 50% 46%, rgba(52, 44, 46, .55) 0%, rgba(35, 31, 32, .32) 40%, rgba(17, 15, 16, 0) 74%),
    var(--bg);
}
.hero__stage { display: flex; align-items: center; justify-content: center; min-width: 0; will-change: transform, opacity; }
.orbit { position: relative; flex: none; width: var(--size); height: var(--size); perspective: 1500px; }
.tilt { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }

.glow {
  position: absolute; left: 10%; top: 10%; width: 80%; height: 80%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 236, 226, .13), rgba(255, 120, 80, .04) 55%, transparent 100%);
  transform: translateZ(-120px); will-change: transform;
}

.dial, .sat { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; will-change: transform; }
.dial { transform: translateZ(-50px); }
.dial circle { fill: none; }
.dial__line  { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dial__ticks { stroke: rgba(234, 234, 234, .22); stroke-width: 7; stroke-dasharray: 1.3 24.04; }
.dial__major { stroke: rgba(234, 234, 234, .5); stroke-width: 14; stroke-dasharray: 1.8 253.19; }
.dial__core  { stroke: rgba(234, 234, 234, .2); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 7; }
.sat { transform: translateZ(-50px); }
.sat__trail { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 100 3100; opacity: .55; vector-effect: non-scaling-stroke; }
.sat__dot { fill: var(--accent); }

.emblem {
  position: absolute; inset: 5%; border-radius: 50%; transform-style: preserve-3d;
  cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.emblem:focus-visible { outline: 1px solid rgba(255, 91, 53, .8); outline-offset: 6px; border-radius: 50%; }
.emblem.is-grabbing { cursor: grabbing; }

/* cursor follower over the emblem (fine pointers): says what to do, right where it can be done */
.follow {
  position: fixed; left: 0; top: 0; z-index: 55; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(234, 234, 234, .7);
  font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--fg);
  opacity: 0; transform: translate3d(-200px, -200px, 0); transition: opacity .3s var(--ease); will-change: transform, opacity;
}
.follow > span { display: block; padding-left: .18em; transition: opacity .25s, transform .4s var(--ease); }
.follow::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid transparent; transition: transform .4s var(--ease), border-color .3s; }
.follow.is-on { opacity: 1; }
.follow.is-down > span { opacity: 0; transform: scale(.6); }
.follow.is-down::before { transform: scale(.45); border-color: var(--accent); }
.has-follow .emblem { cursor: none; }
.ring { position: absolute; max-width: none; pointer-events: none; will-change: transform; transition: opacity .5s var(--ease); backface-visibility: hidden; }
.ring--out { width: 100%;    height: 100%;    left: 0;       top: 0; }
.ring--mid { width: 76.26%;  height: 76.26%;  left: 11.87%;  top: 11.87%; }
.ring--in  { width: 50.48%;  height: 50.48%;  left: 24.76%;  top: 24.76%; }
.ring--mid { opacity: .9; }
.ring--out { opacity: .82; }
.emblem.is-grabbing .ring { opacity: .45; }
.emblem.is-grabbing .ring.is-held { opacity: 1; }

.core {
  position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; margin: -15% 0 0 -15%;
  display: grid; place-items: center; text-align: center; pointer-events: none; transform: translateZ(70px);
}
.core h1 { font-size: calc(var(--size) * .048); font-weight: 400; letter-spacing: -.015em; line-height: 1; white-space: nowrap; }

.hero__meta {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  padding: 0 var(--gutter) max(28px, env(safe-area-inset-bottom)); position: relative; z-index: 2;
}
.hero__tag { display: grid; gap: 4px; font-size: clamp(15px, .75vw, 20px); font-weight: 500; }
.hero__kicker { font-size: clamp(11px, .5vw, 13px); letter-spacing: .22em; text-transform: uppercase; color: var(--fg-3); }
.hero__cue { justify-self: end; display: grid; justify-items: center; gap: 10px; min-width: 44px; min-height: 44px; font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-2); transition: color .3s; }
.hero__cue:hover { color: var(--fg); }
.hero__cue-line { width: 1px; height: 40px; background: var(--line); position: relative; overflow: hidden; }
.hero__cue-line::after { content: ""; position: absolute; inset: 0; background: var(--fg); transform: translateY(-100%); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 55% { transform: translateY(0); } 100% { transform: translateY(100%); } }
.hero__hint { justify-self: center; display: grid; justify-items: center; gap: 4px; font-size: clamp(13px, .7vw, 17px); color: var(--fg-2); text-align: center; }
.hero__hint-text { transition: opacity .35s, color .6s var(--ease); }
.hero__hint-text.is-nudge { color: var(--fg); }
.hero__hint-text.is-swap { opacity: 0; }
.hero__rpm { font-size: clamp(11px, .5vw, 13px); letter-spacing: .18em; text-transform: uppercase; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.hero__rpm b { display: inline-block; min-width: 4.2ch; text-align: right; font-weight: 500; color: var(--fg-2); letter-spacing: .04em; }
.hero__rpm b.is-hot { color: var(--accent); }

/* intro: rings arrive, then drift (JS spins them; CSS only fades the stage in) */
/* "by Gromov" (the LCP text) is painted at once; the rings and the dial fade in around it */
.js .orbit { transform: scale(.9); transition: transform 1.8s var(--ease); }
.js.is-live .orbit { transform: none; }
.js:not(.is-live) .ring, .js:not(.is-live) .dial, .js:not(.is-live) .sat, .js:not(.is-live) .glow { opacity: 0; }
.js.is-live .ring, .js.is-live .dial, .js.is-live .sat, .js.is-live .glow { animation: fade-in 1.4s var(--ease) backwards; }
@keyframes fade-in { from { opacity: 0; } }
.js .hero__meta, .js .bar { opacity: 0; transition: opacity 1.2s .6s var(--ease); }
.js.is-live .hero__meta, .js.is-live .bar { opacity: 1; }

/* ─────────────── section heads ─────────────── */
.eyebrow { display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--fg-2); }
.eyebrow span { font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: .1em; }
.eyebrow::after { content: ""; flex: 0 0 48px; height: 1px; background: currentColor; opacity: .5; }

/* ─────────────── contact (the light side, like the original) ─────────────── */
.contact { position: relative; overflow: hidden; isolation: isolate; background: var(--fg); color: var(--ink); padding: clamp(96px, 13vw, 176px) 0 clamp(80px, 10vw, 140px); }
/* watermark sits in the empty top-right corner next to "Text me.", away from the email / phone */
.contact__emblem { position: absolute; z-index: -1; right: calc(min(40vw, 620px) * -.3); top: clamp(-120px, -8vw, -40px); width: min(40vw, 620px); aspect-ratio: 1; opacity: .09; filter: invert(1); pointer-events: none; }
.contact__emblem img { position: absolute; max-width: none; will-change: transform; animation-play-state: paused !important; }
.contact.is-near .contact__emblem img { animation-play-state: running !important; }
.contact__emblem .r-out { width: 100%; height: 100%; left: 0; top: 0; animation: spin 90s linear infinite; }
.contact__emblem .r-mid { width: 76.26%; height: 76.26%; left: 11.87%; top: 11.87%; animation: spin 60s linear infinite reverse; }
.contact__emblem .r-in  { width: 50.48%; height: 50.48%; left: 24.76%; top: 24.76%; animation: spin 36s linear infinite; }
.contact ::selection { background: var(--ink); color: var(--fg); }
.contact .eyebrow { color: var(--ink-2); }
.contact .eyebrow span { color: var(--accent-ink); }
.contact__mail, .contact__row, .contact__tel a { position: relative; z-index: 1; }
.contact__title { margin-top: 28px; font-size: clamp(56px, 13vw, 200px); font-weight: 400; letter-spacing: -.05em; line-height: .92; }
.contact__mail { margin-top: clamp(28px, 4vw, 48px); font-size: clamp(22px, 7.4vw, 80px); font-weight: 400; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.contact__mail a { position: relative; display: inline-block; padding: 6px 0 10px; }
.contact__mail a::before, .contact__mail a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; }
.contact__mail a::before { opacity: .16; }
.contact__mail a::after { transform: scaleX(0); transform-origin: right; transition: transform .7s var(--ease); }
.contact__mail a:hover::after, .contact__mail a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.contact__row { margin-top: clamp(48px, 7vw, 96px); padding-top: 28px; border-top: 1px solid var(--ink-line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.contact__who { display: flex; align-items: center; gap: 18px; }
.contact__who p { display: grid; gap: 2px; font-size: 15px; }
.contact__who strong { font-size: 18px; font-weight: 600; }
.contact__who span { color: var(--ink-2); }
.contact__tel a { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(18px, 2vw, 24px); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; border-bottom: 1px solid var(--ink-line); background: var(--fg); transition: border-color .3s; }
.contact__tel a:hover { border-color: var(--ink); }
.contact__tg { margin-right: 12px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.contact :focus-visible { outline-color: var(--ink); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────── footer ─────────────── */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 24px var(--gutter) max(24px, env(safe-area-inset-bottom)); background: var(--bg); color: var(--fg-3); font-size: 13px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); font-weight: 500; }
.foot p { margin-right: auto; }
.foot .foot__classic { color: var(--fg-3); font-weight: 400; transition: color .3s; }
.foot .foot__classic:hover { color: var(--fg); }

/* ─────────────── reveal on scroll ─────────────── */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ─────────────── 404 ─────────────── */
.lost { --size: min(calc(100vw - 20px), calc(100svh - 220px), 900px); }
.lost .core h1 { font-size: calc(var(--size) * .1); font-weight: 300; letter-spacing: -.04em; }
.lost__text { display: grid; justify-items: center; gap: 18px; text-align: center; padding: 0 var(--gutter) max(36px, env(safe-area-inset-bottom)); position: relative; z-index: 2; }
.lost__text p { font-size: clamp(18px, 2.2vw, 24px); }
.lost__text a { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 26px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500; letter-spacing: .04em; transition: background-color .35s var(--ease), color .35s; }
.lost__text a:hover { background: var(--fg); color: var(--ink); }

/* ─────────────── responsive ─────────────── */
@media (max-width: 640px) {
  :root { --bar-h: 56px; }
  /* the dial crops a little at the screen edges (like the original desktop crop); the ring text itself stays whole */
  .hero { --size: min(104vw, calc(100svh - 210px), 600px); min-height: 80vh; min-height: 80svh; }
  .bar__brand { font-size: 17px; }
  .bar__nav a { font-size: 12px; letter-spacing: .12em; }
  .hero__meta { grid-template-columns: 1fr auto; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .hero__hint { justify-self: end; justify-items: end; text-align: right; }
  .hero.lost { min-height: 100vh; min-height: 100svh; }
  .hero__cue { display: none; }
  .hero__tag { font-size: 14px; }
  .hero__hint { font-size: 12px; }
  .core h1 { font-size: max(17px, calc(var(--size) * .056)); }

  .contact__row { flex-direction: column; align-items: flex-start; }
  /* phones: the empty bottom-right corner beside the name / Telegram column */
  .contact__emblem { width: 80vw; right: -30vw; top: auto; bottom: -34vw; opacity: .08; }
  .foot p { flex-basis: 100%; }
  .foot .foot__classic { margin-right: auto; }
}

/* short landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { --size: min(80vw, calc(100svh - 132px)); }
  .hero__meta { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .hero__cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .orbit, .js [data-reveal], .js .hero__meta, .js .bar { opacity: 1; transform: none; }
  .hero__cue-line::after { transform: none; opacity: .5; }
  .hero__rpm { display: none; }
}
