:root{
  /* ---- Colors ---- */
  /* Dark system. The names keep their meaning — paper is the surface things
     sit on, graphite is the ink — only the values are inverted, so every rule
     written against them flips with the theme instead of being rewritten. */
  --color-graphite:#ffffff;      /* ink */
  --color-pure-black:#000;       /* the bar, and the ground behind the hero */
  --color-concrete:#232c35;      /* hairlines, quiet button fill */
  --color-ash:#313c46;
  --color-fog:#8b959f;           /* tertiary — 6.2:1, the darker grey failed */
  --color-steel:#a3aeb8;         /* secondary text */
  --color-paper:#0d1117;         /* page ground */
  --color-chalk:#151d25;         /* alternate section */
  --color-charcoal:#1a232b;      /* input fields */
  /* white stays white on top of photography, whatever the theme does */
  --color-on-photo:#ffffff;
  /* The single chromatic accent. Solar Yellow's role, SDK's red — softened.
     Brick red rather than pure #e30613: warmer on a white gallery and it
     clears 5.17:1 with white text. Swap this one value to move the system. */
  --color-accent:#c8382f;
  --color-accent-hover:#b02f27;
  --color-accent-ink:#fff;
  --color-accent-text:#e04a3f;  /* the accent used as text on the dark ground */

  /* ---- Type ---- */
  --font-primary:'Rubik',ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  --font-mono-mark:'Archivo','Rubik',ui-sans-serif,system-ui,sans-serif;

  --text-caption:10px;
  --text-fine:12px;      --leading-fine:1.55;
  --text-body:14px;
  --text-body-lg:16px;   --leading-body-lg:1.5;
  --text-subheading:20px;--leading-subheading:1.33;
  --text-heading-sm:24px;--leading-heading-sm:1.25;
  --text-heading-lg:44px;--leading-heading-lg:1.14;
  --text-heading-xl:56px;--leading-heading-xl:1.13;
  --text-display:72px;   --leading-display:1.09;
  --text-display-lg:120px;--leading-display-lg:1;

  --w-regular:400; --w-medium:500; --w-semibold:600;

  /* ---- Spacing ---- */
  --spacing-8:8px;   --spacing-16:16px; --spacing-24:24px; --spacing-32:32px;
  --spacing-40:40px; --spacing-48:48px; --spacing-56:56px; --spacing-80:80px;
  --spacing-112:112px;

  /* ---- Layout ---- */
  --page-max-width:1440px;

  /* ---- Radius ---- */
  --radius-inputs:4px;
  --radius-cards:20px; --radius-images:20px;
  --radius-buttons:40px; --radius-chips:99px; --radius-pills:9999px;
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  background:var(--color-paper);
  color:var(--color-graphite);
  font-family:var(--font-primary);
  font-size:var(--text-body-lg);
  line-height:var(--leading-body-lg);
  font-weight:var(--w-regular);
  letter-spacing:-.01em;
  font-feature-settings:"clig" 0,"liga" 0;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;overflow-x:clip;
}
html{overflow-x:clip}
/* A double tap zooms nothing but a photo in the viewer (assets/model.js has its own
   double tap there, touch-action:none). Everywhere else two quick taps are two taps —
   on a stepper, an arrow or a chip — not a page zoom; pinching still zooms the page. */
html{touch-action:manipulation}
a{color:inherit;text-decoration:none}
/* nothing may widen the page: long model names, emails, URLs wrap instead */
h1,h2,h3,p,a,span,div,li{overflow-wrap:break-word}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit;color:inherit}

/* Tracking tightens aggressively above 20px — the rule that holds the type together */
h1,h2,h3{font-weight:var(--w-semibold)}

.wrap{max-width:var(--page-max-width);margin:0 auto;padding:0 var(--spacing-40)}
@media(max-width:760px){.wrap{padding:0 var(--spacing-24)}}

/* Chips — the other radius. 99px against the buttons' 40px */
.chip{
  display:inline-flex;align-items:center;
  background:var(--color-concrete);color:var(--color-graphite);
  font-size:var(--text-fine);font-weight:var(--w-medium);letter-spacing:normal;
  padding:6px 14px;border-radius:var(--radius-chips);
}
.chip-quiet{background:var(--color-chalk);color:var(--color-steel)}

/* ---- loading ----
   Pictures never pop in: one still loading waits invisible and fades in once
   it has arrived and been decoded (assets/app.js marks them); one already
   cached shows at once. Going from page to page cross-fades instead of
   flashing — browsers that cannot simply navigate. */
img.lazy-fade{opacity:0;transition:opacity .35s ease}
img.lazy-fade.is-in{opacity:1}
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.32s;animation-timing-function:cubic-bezier(.22,.8,.24,1)}

/* no back/forward on a sideways swipe: a two-finger swipe on a trackpad
   (Chrome) or a sideways overscroll no longer leaves the page */
html,body{overscroll-behavior-x:none}

/* ================= NAV ================= */
/* Always the same black bar — over the hero too. The mark and, right after
   it, one «☰ Меню» control — both on the left, as on audi.com. */
nav{
  position:fixed;top:0;left:0;right:0;z-index:100;height:60px;
  background:var(--color-pure-black);border-bottom:1px solid var(--color-concrete);
  display:flex;align-items:center;
}
nav .inner{width:100%;max-width:var(--page-max-width);margin:0 auto;padding:0 var(--spacing-40);
  display:flex;align-items:center;justify-content:flex-start;gap:var(--spacing-32);
  min-width:0;position:relative}
@media(max-width:760px){nav .inner{padding:0 var(--spacing-24)}}

.menu{position:relative;flex:none}
.menu-btn{display:flex;align-items:center;gap:12px;height:40px;padding:0 10px;
  background:none;border:0;border-radius:var(--radius-pills);cursor:pointer;
  color:var(--color-graphite);font-size:var(--text-body);font-weight:var(--w-medium);letter-spacing:normal;
  -webkit-tap-highlight-color:transparent}
.menu-btn:focus-visible{outline:2px solid var(--color-graphite);outline-offset:2px}
.burger{position:relative;width:22px;height:14px;flex:none}
.burger i{position:absolute;left:0;right:0;height:2px;border-radius:1px;background:currentColor;
  transition:transform .28s cubic-bezier(.2,.8,.2,1),opacity .2s}
.burger i:nth-child(1){top:0}
.burger i:nth-child(2){top:6px}
.burger i:nth-child(3){top:12px}
.menu.open .burger i:nth-child(1){transform:translateY(6px) rotate(45deg)}
.menu.open .burger i:nth-child(2){opacity:0}
.menu.open .burger i:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

.menu-panel{position:absolute;top:calc(100% + 10px);left:0;width:300px;padding:8px;
  background:var(--color-pure-black);border:1px solid var(--color-concrete);border-radius:16px;
  box-shadow:0 24px 60px rgba(0,0,0,.6);
  display:flex;flex-direction:column;
  opacity:0;visibility:hidden;transform:translateY(-6px);
  transition:opacity .2s,transform .2s,visibility 0s .2s}
/* a bridge over the gap, so the pointer can travel from the button into the panel */
.menu-panel::before{content:"";position:absolute;left:0;right:0;top:-12px;height:12px}
.menu.open .menu-panel{opacity:1;visibility:visible;transform:none;transition:opacity .2s,transform .2s}
.menu-panel a{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:10px;
  font-size:var(--text-body-lg);font-weight:var(--w-medium);letter-spacing:normal;color:var(--color-graphite);
  transition:background .2s,color .2s}
.menu-panel a:hover,.menu-panel a:focus-visible{background:var(--color-chalk);outline:none}
.menu-panel .menu-tg{margin-top:6px;border-top:1px solid var(--color-concrete);border-radius:0 0 10px 10px;
  padding-top:16px;color:var(--color-accent-text)}
.menu-panel .menu-tg svg{width:20px;height:20px;flex:none}
.menu-panel .menu-tg:hover{color:var(--color-graphite)}

/* socials under the links: icons only, YouTube shown but not yet a link */
.menu-soc{display:flex;gap:10px;padding:10px 16px 8px}
.menu-panel .menu-soc .soc{width:40px;height:40px;padding:0;border:1px solid var(--color-concrete);border-radius:50%;
  display:grid;place-items:center;background:none;color:var(--color-steel);font-size:0}
.menu-panel .menu-soc a.soc:hover,.menu-panel .menu-soc a.soc:focus-visible{background:none;color:var(--color-graphite);border-color:var(--color-steel)}
.menu-soc .soc svg{width:18px;height:18px}
.menu-soc .soc-soon{opacity:.45;cursor:default}

/* phone: the panel becomes a sheet under the bar, the page behind it dims */
@media(max-width:760px){
  .menu-panel{position:fixed;top:60px;left:0;right:0;width:auto;max-height:calc(100vh - 60px);max-height:calc(100dvh - 60px);
    overflow-y:auto;overscroll-behavior:contain;padding:8px var(--spacing-24) calc(var(--spacing-24) + env(safe-area-inset-bottom,0px));
    border:0;border-bottom:1px solid var(--color-concrete);border-radius:0;box-shadow:none}
  .menu-panel::before{display:none}
  /* full bar height, so a thumb cannot miss it */
  .menu-btn{height:60px;border-radius:0}
  nav .inner{gap:var(--spacing-16)}
  /* a phone gets a smaller mark — at 20px it took half the bar */
  nav .mark{font-size:15px;padding-bottom:6px}
  nav .mark::after{height:2px}
  .menu-panel a{font-size:22px;font-weight:var(--w-semibold);padding:18px 0;border-radius:0;
    border-bottom:1px solid var(--color-concrete)}
  .menu-panel a:hover,.menu-panel a:focus-visible{background:none;color:var(--color-steel)}
  .menu-panel .menu-tg{border-bottom:0;margin-top:0;border-top:0;padding-top:22px}
  .menu-soc{padding:6px 0 0}
  .menu-panel .menu-soc .soc{width:44px;height:44px}
  html.menu-open body::after{content:"";position:fixed;inset:60px 0 0;z-index:99;background:rgba(0,0,0,.6)}
}
@media(prefers-reduced-motion:reduce){.menu-panel,.burger i{transition:none}}

/* ---- The mark ----
   The original is a racing wordmark: hard italic, red speed stripe, checkered
   dashes. Kept: the SDK letterforms, the red, the stripe. Dropped: the
   checkers (they turn to mud below 24px) and half the slant — 8deg instead
   of ~15deg, so the mark sits still on a gallery page instead of sprinting. */
.mark{font-family:var(--font-mono-mark);display:inline-block;white-space:nowrap;
  position:relative;font-size:20px;line-height:1;padding-bottom:8px}
.mark .row{display:flex;align-items:baseline;transform:skewX(-8deg)}
.mark .sdk{font-variation-settings:'wdth' 125;font-weight:800;letter-spacing:-.04em;
  color:var(--color-graphite)}
.mark .mot{font-variation-settings:'wdth' 100;font-weight:600;font-size:.62em;
  letter-spacing:.14em;color:var(--color-steel);margin-left:.5em}
.mark .mot i{font-style:normal;color:var(--color-accent-text)}
/* the speed rule — a skewed bar, the one decorative element that survives */
.mark::after{content:"";position:absolute;left:-2px;right:-8px;bottom:0;height:3px;
  background:var(--color-accent);transform:skewX(-24deg)}

/* ================= SECTION SCAFFOLD ================= */
/* the nav is fixed at 60px — anchor jumps must clear it */
div[id]{scroll-margin-top:calc(60px + var(--spacing-24))}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* ================= CHIP ROW ================= */
.chips{display:flex;flex-wrap:wrap;gap:var(--spacing-8)}
a.chip{text-decoration:none;transition:color .2s,border-color .2s,background-color .2s}

/* ================= FOOTER ================= */
footer{border-top:1px solid var(--color-concrete);padding:var(--spacing-80) 0 var(--spacing-40)}
.foot-bottom{display:flex;justify-content:space-between;gap:var(--spacing-24);flex-wrap:wrap;
  margin-top:var(--spacing-56);padding-top:var(--spacing-24);border-top:1px solid var(--color-concrete);
  font-size:var(--text-fine);color:var(--color-fog);letter-spacing:normal}

/* ================= FAB ================= */
.fab{position:fixed;right:var(--spacing-24);
  bottom:calc(var(--spacing-24) + env(safe-area-inset-bottom,0px));z-index:90;
  background:var(--color-graphite);color:var(--color-paper);
  font-size:var(--text-body);font-weight:var(--w-medium);letter-spacing:normal;
  padding:12px var(--spacing-24);border-radius:var(--radius-buttons)}

/* ================= PAGE HEADER — for inner pages (catalog, car, faq) ================= */
.crumbs{font-size:var(--text-body);color:var(--color-steel);letter-spacing:normal;margin-bottom:var(--spacing-16)}
.crumbs a:hover{color:var(--color-graphite)}
.crumbs span{color:var(--color-fog);margin:0 6px}

/* ================= MODEL GRID — inside a marque =================
   Photo across the top of the card, name and body type beneath it on a
   surface. Used only by the marque pages, not by the home page. */
.models{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:var(--spacing-24)}
.model-card{background:var(--color-chalk);border-radius:var(--radius-cards);
  border:1px solid rgba(255,255,255,.05);overflow:hidden;
  display:flex;flex-direction:column;
  transition:background .2s,border-color .2s,transform .2s}
.model-card:hover{background:#1a232b;border-color:var(--color-concrete);transform:translateY(-3px)}
.model-shot{width:100%;aspect-ratio:16/10;object-fit:cover;display:block;
  background:var(--color-charcoal)}
.model-body{padding:var(--spacing-24)}
.model-name{font-size:var(--text-heading-sm);font-weight:var(--w-semibold);
  letter-spacing:-.020em;line-height:1.2}
@media(max-width:640px){.models{grid-template-columns:1fr}}

/* a model card that has its own car page */
.model-link{display:block;color:inherit;text-decoration:none;border-radius:var(--radius-cards)}
.model-link .model-card{height:100%}
.model-link:focus-visible{outline:2px solid var(--color-graphite);outline-offset:3px}
