/* ==========================================================================
   Noctis Automotive — base system (values per DESIGN-SPEC.md)
   ========================================================================== */

@property --ring { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@property --fill { syntax: "<number>"; initial-value: -16; inherits: true; }

:root {
  --bc1: #0c0c0c;
  --bc2: #161616;
  --bc3: #361403;
  --accent: #f06900;
  --accent-soft: rgba(240, 105, 0, .16);
  --bc4: #c5a064;
  --bc5: #f2f1ed;
  --black: #000;
  --white: #fff;
  --dim: rgba(242, 241, 237, .8);
  --mute: rgba(242, 241, 237, .6);
  --label: rgba(242, 241, 237, .55);
  --line: rgba(242, 241, 237, .2);
  --fill-from: rgba(255, 255, 255, .18);

  --sans: "Geist", Arial, Helvetica, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --bezzy: cubic-bezier(.8, 0, 0, 1);
  --bezzy2: cubic-bezier(.43, .195, .02, 1);
  --bezzy3: cubic-bezier(.5, 0, 0, 1);

  --gm: 1.6rem;           /* grid margin */
  --header-h: 10rem;
}
@media (min-width: 768px) { :root { --gm: 2.4rem; } }
@media (min-width: 1200px) { :root { --gm: 3.2rem; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; -webkit-text-size-adjust: 100%; }
@media (min-width: 1600px) { html { font-size: 68.75%; } }
@media (min-width: 1920px) { html { font-size: 75%; } }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 1.8rem; line-height: 1.4; font-weight: 300; letter-spacing: -.05rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: clip;
}
* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
::selection { background: var(--accent); color: var(--white); }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: none; }
:focus-visible { outline: 1px solid var(--bc5); outline-offset: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; border: 0; }
.skip { position: fixed; left: var(--gm); top: -10rem; z-index: 2000; background: var(--bc5); color: var(--bc1); padding: 1rem 1.6rem; font-size: 1.2rem; }
.skip:focus { top: var(--gm); }

/* ---------- Type scale ---------- */
.serif { font-family: var(--serif); font-weight: 300; font-variation-settings: "opsz" 72; color: var(--white); }
.t-xl   { font-size: clamp(6.4rem, 9.72vw, 14rem); line-height: 1.1;  letter-spacing: -.2rem; }
.t-l    { font-size: clamp(5.2rem, 6.67vw, 9.6rem); line-height: 1.2;  letter-spacing: -.2rem; }
.t-hero { font-size: clamp(5.2rem, 6.25vw, 9rem);  line-height: 1.2;  letter-spacing: -.2rem; }
.t-h2   { font-size: clamp(4.4rem, 5.56vw, 8rem);  line-height: 1.2;  letter-spacing: -.1rem; }
.t-s    { font-size: 2.4rem; line-height: 1.2; letter-spacing: -.05rem; }
.italic { font-style: italic; }
/* Newsreader is wider than the reference face: condense heading lines. */
.ln { display: block; scale: .86 1; transform-origin: left center; }
.center .ln, .ln.c { transform-origin: center; }
.w { display: inline-block; }

.body  { font-size: 1.8rem; line-height: 1.4; font-weight: 300; letter-spacing: -.05rem; color: var(--dim); }
.small { font-size: 1.4rem; line-height: 1.2; font-weight: 400; letter-spacing: -.05rem; color: var(--label); }
.label { font-family: var(--sans); font-size: 1rem; line-height: 2; font-weight: 600; letter-spacing: .3rem; text-transform: uppercase; }
.label.mute { color: var(--label); }

/* Fill sweep: unrevealed text at 18% white, revealed by moving --fill. */
.fill { display: block; overflow: clip; padding: .14em; margin: -.14em; }
.fill > .lt {
  display: inline-block; color: transparent;
  background-image: linear-gradient(97deg, var(--white) 0%, var(--white) calc((var(--fill) - 8) * 1%), var(--accent) calc(var(--fill) * 1%), var(--fill-from) calc((var(--fill) + 8) * 1%), var(--fill-from) 100%);
  -webkit-background-clip: text; background-clip: text;
  padding: .14em; margin: -.14em;
}

/* ---------- Texture ---------- */
.grain { position: relative; isolation: isolate; background-color: var(--bc1); }
.grain::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='a'><feTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='4' seed='7'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 -2 1.25'/></filter><rect width='100%' height='100%' filter='url(%23a)' opacity='.022'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .075 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Media ---------- */
.pic { position: relative; overflow: hidden; background: var(--bc2); }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.66) contrast(1.1) saturate(.75); }
.pic.soft img { filter: brightness(.8) contrast(1.05) saturate(.8); }
.blurred { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
.blurred img { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: brightness(.55) saturate(1.15); }

/* ---------- Button ---------- */
.btn {
  position: relative; display: inline-grid; place-items: center; width: max-content; white-space: nowrap;
  padding: 1.6rem 3.2rem;
  border: 1px solid rgba(242, 241, 237, .1);
  background: rgba(0, 0, 0, .1);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  cursor: pointer; transition: border-color .5s ease-in-out;
}
.btn > span {
  position: relative; z-index: 1; display: block; overflow: clip;
  font-family: var(--sans); font-size: 1rem; line-height: 2; font-weight: 600; letter-spacing: .3rem; text-transform: uppercase; color: var(--white);
  transition: opacity .5s ease-in-out;
}
.btn > span > span {
  display: inline-block; white-space: pre;
  text-shadow: rgba(242, 241, 237, .6) 0 -4em 0;
  transition: transform .5s var(--bezzy2);
}
.btn:hover { border-color: rgba(242, 241, 237, .4); }
.btn:hover > span { opacity: .6; }
.btn:hover > span > span { transform: translateY(4em); }
.btn > i {
  position: absolute; inset: -1px; z-index: 0; padding: 1px; pointer-events: none; mix-blend-mode: screen;
  background: conic-gradient(from var(--ring) at center,
    transparent 15%, rgba(242,241,237,0) 20%, #fff 25%, rgba(242,241,237,0) 30%, transparent 35%,
    transparent 65%, rgba(242,241,237,0) 70%, #fff 75%, rgba(242,241,237,0) 80%, transparent 85%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ring 5s linear infinite; animation-play-state: var(--play, paused);
}
@keyframes ring { to { --ring: 360deg; } }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn[disabled] > i { opacity: 0; }

.tag { display: inline-flex; gap: .8rem; }
.tag > span { display: grid; place-items: center; height: 2.4rem; padding: .3rem .6rem .1rem .8rem; background: rgba(242, 241, 237, .1); color: var(--bc5); }
.tag > span.hot { background: var(--accent); color: var(--white); }
.accent { color: var(--accent); }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 1000; height: var(--header-h); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.site-header > * { pointer-events: auto; }
.socials { display: flex; padding: 3.2rem; overflow: clip; }
.socials a { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; padding: .8rem; transition: opacity .3s ease-in-out; }
.socials a:hover { opacity: .5; }
.socials svg { width: 1.6rem; height: 1.6rem; fill: currentColor; }
.logo { position: absolute; top: 4rem; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; color: var(--white); }
.logo .mark { width: 5.2rem; height: auto; display: block; color: var(--accent); filter: drop-shadow(0 0 6px rgba(240,105,0,.45)); }
.logo .word { display: flex; overflow: clip; height: 1.5rem; margin-top: .2rem; }
.logo .word span { display: block; font-family: var(--sans); font-size: 1.25rem; line-height: 1.5rem; font-weight: 700; letter-spacing: .24em; white-space: pre; }
.logo .word span:last-child { letter-spacing: 0; }
.nav-toggle { display: flex; align-items: center; gap: 1.6rem; padding: 4rem; overflow: clip; cursor: pointer; }
.nav-toggle em { position: relative; display: block; overflow: clip; font-style: normal; height: 2rem; }
.nav-toggle em span { display: block; transition: transform .6s var(--bezzy2); }
.nav-toggle em span + span { position: absolute; inset: 0 0 auto auto; transform: translateY(100%); }
.menu-open .nav-toggle em span:first-child { transform: translateY(-100%); }
.menu-open .nav-toggle em span + span { transform: none; }
.nav-toggle i { position: relative; display: flex; width: 1.6rem; height: 1.5rem; margin-bottom: .1rem; }
.nav-toggle i span { position: absolute; left: 0; width: 100%; height: 1px; background: var(--white); transition: transform .6s var(--bezzy2), scale .4s var(--bezzy2), opacity .3s; }
.nav-toggle i span:nth-child(1) { top: 3.5px; }
.nav-toggle i span:nth-child(2) { top: 7.5px; transform-origin: right; }
.nav-toggle i span:nth-child(3) { top: 11.5px; }
.nav-toggle:hover i span:nth-child(2) { scale: .5 1; }
.menu-open .nav-toggle i span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-open .nav-toggle i span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle i span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

.right { display: flex; align-items: center; }
.lang { display: flex; gap: .2rem; padding: 4rem 0 4rem 4rem; }
.lang button { cursor: pointer; padding: .2rem .4rem; color: var(--label); transition: color .3s; }
.lang button[aria-pressed="true"] { color: var(--white); }
.lang button:hover { color: var(--white); }
.right .nav-toggle { padding-left: 2.4rem; }

/* ---------- Progress ---------- */
.progress { position: fixed; left: 1.6rem; right: 1.6rem; bottom: 1.6rem; height: 2px; z-index: 997; overflow: hidden; background: rgba(255, 255, 255, .1); pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- Menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 990; background: var(--bc3); overflow: hidden;
  display: grid; grid-template-rows: 1fr auto; justify-items: center;
  opacity: 0; visibility: hidden; transition: opacity .3s ease-in-out, visibility 0s linear .3s;
}
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity .3s ease-in-out, visibility 0s; }
.menu .facets { position: absolute; inset: 0; pointer-events: none; }
.menu .facets svg { position: absolute; fill: rgba(255, 255, 255, .035); }
.menu nav { position: relative; align-self: center; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3.2rem; }
.menu .big a { display: block; overflow: clip; text-transform: uppercase; transition: opacity .3s ease-in-out; }
.menu .big a > span { display: block; transform: translateY(110%); transition: transform .9s var(--bezzy2); }
.menu-open .menu .big a > span { transform: none; }
.menu-open .menu .big li:nth-child(2) a > span { transition-delay: .06s; }
.menu-open .menu .big li:nth-child(3) a > span { transition-delay: .12s; }
.menu .big:hover a { opacity: .3; }
.menu .big a:hover { opacity: 1; }
.menu .small { display: flex; gap: 2.4rem; }
.menu .small a, .menu .small button { font-family: var(--serif); font-variation-settings: "opsz" 72; font-size: 1.8rem; line-height: 1.2; font-weight: 300; letter-spacing: -.05rem; text-transform: uppercase; cursor: pointer; transition: opacity .3s; }
.menu .small a:hover, .menu .small button:hover { opacity: .5; }
.menu .foot { position: relative; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 3.2rem 3.2rem; color: var(--label); }
.menu .foot .mid { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.menu .foot .mid b { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 2rem; letter-spacing: 0; text-transform: none; color: var(--bc5); }

/* ---------- Gate ---------- */
.gate { position: fixed; inset: 0; z-index: 1500; background: var(--black); display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: 4rem 3.2rem 4rem; transition: opacity 1.2s var(--bezzy2), visibility 0s linear 1.2s; }
.gate .gate-logo { width: 9.6rem; height: 9.6rem; border-radius: 50%; overflow: hidden; }
.gate .gate-logo img { width: 100%; height: 100%; object-fit: cover; }
.gate .tagline { align-self: center; max-width: 45.5rem; text-align: center; opacity: 0; animation: rise 1.4s var(--bezzy2) .3s forwards; }
.gate .choices { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; opacity: 0; animation: rise 1.4s var(--bezzy2) .7s forwards; }
.gate .choices div { display: flex; gap: 2rem; }
.gate .choices button { font-family: var(--serif); font-variation-settings: "opsz" 72; font-size: 1.8rem; font-weight: 300; text-transform: uppercase; letter-spacing: -.05rem; cursor: pointer; border-bottom: 1px solid rgba(242,241,237,.6); padding-bottom: .1rem; transition: opacity .3s; }
.gate .choices button:hover { opacity: .6; }
.gate .choices p { font-size: .8rem; line-height: 1.4; letter-spacing: .05rem; text-transform: uppercase; color: var(--label); text-align: center; max-width: 23rem; font-weight: 500; }
.gate.gone { opacity: 0; visibility: hidden; }
html.gated body { overflow: hidden; }
@keyframes rise { from { opacity: 0; transform: translateY(1.2rem); } to { opacity: 1; transform: none; } }

/* ---------- Page veil ---------- */
.veil { position: fixed; inset: 0; z-index: 1400; background: var(--black); pointer-events: none; opacity: 1; transition: opacity 1.2s cubic-bezier(.2, .7, .2, 1); }
.page-ready .veil { opacity: 0; }
.page-leaving .veil { opacity: 1; transition: opacity .7s var(--bezzy2); }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee ul { display: flex; gap: 6.4rem; width: max-content; animation: marquee 40s linear infinite; }
.marquee li { font-family: var(--serif); font-variation-settings: "opsz" 72; font-weight: 300; font-size: 2.4rem; letter-spacing: -.05rem; white-space: nowrap; color: rgba(242,241,237,.45); height: 6rem; display: flex; align-items: center; }
@keyframes marquee { to { transform: translateX(calc(-50% - 3.2rem)); } }

/* ---------- Footer ---------- */
.site-footer { position: relative; height: 100vh; min-height: 64rem; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 17rem var(--gm) 4.8rem; }
.site-footer .bg { position: absolute; inset: 0; z-index: -1; opacity: 0; }
.site-footer .bg img { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: brightness(.32) saturate(1.3); }
.site-footer .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #000 0%, rgba(0,0,0,.6) 45%, rgba(0,0,0,.2) 100%); }
.site-footer .cta { display: flex; flex-direction: column; align-items: center; }
.site-footer .cta .label { color: var(--label); margin-bottom: 1.6rem; }
.site-footer .cta .btn { margin-top: 3.2rem; }
.site-footer .totop { margin-top: auto; display: flex; gap: .8rem; align-items: center; cursor: pointer; }
.site-footer .totop svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; }
.site-footer .legal { position: absolute; left: 3.2rem; right: 3.2rem; bottom: 4.8rem; display: flex; justify-content: space-between; color: var(--label); pointer-events: none; }
.site-footer .legal a { pointer-events: auto; }
.site-footer .legal a:hover { color: var(--bc5); }

@media (max-width: 767px) {
  .socials { padding: 2.4rem 1.6rem; }
  .nav-toggle { padding: 3.2rem 2.4rem; }
  .nav-toggle em { display: none; }
  .lang { padding: 3.2rem 0 3.2rem 1.6rem; }
  .right .nav-toggle { padding-left: 1.2rem; }
  .logo { top: 3.2rem; }
  .site-footer .legal { position: static; flex-direction: column; gap: .8rem; align-items: center; margin-top: 3.2rem; }
  .menu .foot { flex-direction: column; align-items: center; gap: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Audit additions ---------- */
.fill > .lt.rest { background-image: none; color: var(--fill-from); }
.fill > .lt .ch { display: inline-block; will-change: transform; }
.marquee.paused ul { animation-play-state: paused; }
.site-footer .spot { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(circle 32vmax at var(--mx, 50%) var(--my, 50%), rgba(255, 190, 120, .16), rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 100%); mix-blend-mode: normal; }
.gate .load { position: absolute; left: 50%; top: calc(50% + 6rem); width: 12rem; height: 1px; translate: -50% 0; background: rgba(242, 241, 237, .12); overflow: hidden; }
.gate .load i { position: absolute; inset: 0; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.gate .gw { display: inline-block; }

/* ---------- Performance ---------- */
.tracked { height: auto; overflow: visible !important; }
.sticky-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; isolation: isolate; }
@media (hover: none) {
  .btn, .tag > span, .c-info .rows, .process li { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .btn { background: rgba(0, 0, 0, .38); }
  .c-info .rows { background: rgba(12, 12, 12, .88); }
  .process li { background: rgba(28, 28, 28, .82); }
  .fill > .lt .ch { will-change: auto; }
}
/* split words never break inside (keeps "Премиум-авто" on one line) */
.ln > .w { white-space: nowrap; }
@media (max-width: 420px) { .intro .t-hero { font-size: 4.6rem; } .intro .title h1 { max-width: 96vw; } }

/* Hidden until fonts and split headings are ready (see common.js "ready"); the veil then fades once. */
html.pending body > :not(.veil) { visibility: hidden; }

/* Phones: native snap points at scene stops (positions set by common.js); the browser does it all. */
html.touch-snap { scroll-snap-type: y proximity; }
.snap-marks { position: absolute; top: 0; left: 0; width: 1px; height: 0; pointer-events: none; }
.snap-marks i { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; scroll-snap-stop: always; }
/* Fleet page on phones: mandatory snapping + snap-stop, so a hard flick can't skip cars */
html.touch-snap.snap-strict { scroll-snap-type: y mandatory; }
