/* Racing with Elliot: shared styles for every page. Brand rules are in BRAND.md. */
:root {
  --ink: #0B0C0C;         /* carbon black */
  --paper: #F1F2EE;       /* off-white */
  --mint: #56F0B4;        /* the brand color */
  --mint-deep: #0A8F62;   /* mint that is readable on white */
  --bg: var(--ink); --bg2: #101211; --card: #151716; --line: #272A29; --slate: #323635;
  --silver: #BFC4C1; --dim: #858B88; --text: #F4F5F2;
  --acc: var(--mint); --orange: var(--acc); --red: var(--acc);   /* old names still used by the Kart Crew page */
  --gut: clamp(18px, 4vw, 56px);
  --head: 64px;
  --disp: "Sofia Sans Extra Condensed", "Arial Narrow", Impact, sans-serif;
  --sans: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--sans); --wide: var(--disp);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --cut: 14px;            /* size of the angled cut on buttons and panels */
}
/* a white section and a mint section: same parts, different paint */
.light { --bg: var(--paper); --bg2: #E7E9E3; --card: #fff; --line: #D3D6CF; --slate: #C3C7BF; --silver: #3A3E3C; --dim: #676C69; --text: var(--ink);
  --acc: var(--mint-deep); --orange: var(--acc); --red: var(--acc); background: var(--paper); color: var(--ink); }
.mint { --bg: var(--mint); --bg2: #48E0A6; --card: #6DF4C1; --line: rgba(11,12,12,.2); --slate: rgba(11,12,12,.28); --silver: #0C3526; --dim: #175640; --text: var(--ink);
  --acc: var(--ink); --orange: var(--acc); --red: var(--acc); background: var(--mint); color: var(--ink); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); overflow-x: clip; }
[id] { scroll-margin-top: calc(var(--head) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
::selection { background: var(--mint); color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display { font-family: var(--disp); font-weight: 900; font-style: italic; text-transform: uppercase; line-height: .86; letter-spacing: 0; text-wrap: balance; }
.display em { color: var(--acc); }
.mono { font: 600 13px/1.5 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--silver); }
.mono b { color: var(--text); font-weight: 600; }
/* small label: a slanted mint tab with a number or word in it */
.tag, .label { font: 700 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; gap: 12px; align-items: center; }
.tag::before { content: ""; width: 26px; height: 10px; background: var(--acc); transform: skewX(-24deg); }
.label b { background: var(--acc); color: var(--bg); padding: 5px 10px 4px; transform: skewX(-14deg); font-weight: 800; letter-spacing: .06em; }
.mint .label b { color: var(--mint); }

/* ---------- header ---------- */
.site-head { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--head); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 var(--gut);
  color: #F4F5F2; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.site-head.solid { background: rgba(11, 12, 12, .88); border-color: #272A29; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.brand .mk { width: 30px; height: 30px; }
.brand .wm { font: 900 italic 25px/1 var(--disp); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.brand .wm i { font-weight: 600; color: #858B88; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 32px); align-items: center; }
.nav a { font: 700 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: #BFC4C1; padding: 10px 0; position: relative; white-space: nowrap; transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; background: var(--mint); transform: scaleX(0) skewX(-30deg); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover { color: #F4F5F2; }
.nav a:hover::after { transform: scaleX(1) skewX(-30deg); }
.nav a.cta { color: var(--ink); background: var(--mint); padding: 11px 18px 10px; clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%); transition: background .2s; }
.nav a.cta::after { content: none; }
.nav a.cta:hover { background: #fff; color: var(--ink); }
.menu-btn { display: none; background: none; border: 0; color: inherit; padding: 12px 0 12px 12px; cursor: pointer; font: 700 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; align-items: center; gap: 10px; }
.menu-btn i { display: grid; gap: 5px; width: 22px; }
.menu-btn i::before, .menu-btn i::after { content: ""; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
.menu-btn i::after { width: 70%; justify-self: end; background: var(--mint); }
.menu-open .menu-btn i::before { transform: translateY(3.5px) rotate(45deg); }
.menu-open .menu-btn i::after { width: 100%; transform: translateY(-3.5px) rotate(-45deg); }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .nav { position: fixed; inset: 0; z-index: -1; background: var(--ink); flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: var(--head) var(--gut) 40px; visibility: hidden; opacity: 0; transition: opacity .3s, visibility 0s .3s; }
  .menu-open .nav { visibility: visible; opacity: 1; transition: opacity .3s; }
  .nav a, .nav a.cta { font: 900 italic clamp(52px, 16vw, 88px)/.95 var(--disp); letter-spacing: 0; color: #F4F5F2; padding: 4px 0; white-space: normal; background: none; clip-path: none; }
  .nav a.cta { color: var(--mint); }
  .menu-open { overflow: hidden; }
  .menu-open .site-head { -webkit-backdrop-filter: none; backdrop-filter: none; background: transparent; border-color: transparent; }
}
@media (max-width: 400px) { .brand .wm { font-size: 22px; } .brand .mk { width: 26px; height: 26px; } }

/* ---------- buttons ---------- */
/* solid button with slanted ends */
.btn, .cut-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 12px 30px 11px; border: 0; cursor: pointer; text-decoration: none;
  font: 900 italic 24px/1 var(--disp); letter-spacing: .03em; text-transform: uppercase; color: var(--bg); background: var(--acc);
  clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); transition: background .2s, color .2s, transform .3s var(--ease);
}
.btn::after, .cut-btn::after { content: "→"; font: 700 20px/1 var(--sans); font-style: normal; transition: transform .3s var(--ease); }
.btn:hover, .cut-btn:hover { background: var(--text); }
.btn:hover::after, .cut-btn:hover::after { transform: translateX(6px); }
.btn.ghost { background: var(--text); }
.btn.ghost:hover { background: var(--acc); }
.btn[aria-disabled="true"], .btn:disabled { background: var(--slate); color: var(--dim); cursor: default; }
.btn[aria-disabled="true"]::after, .btn:disabled::after { content: none; }
/* text link with an arrow */
.go { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; cursor: pointer; font: 900 italic 24px/1 var(--disp); text-transform: uppercase; letter-spacing: .03em; color: var(--acc); padding: 12px 0; position: relative; background: none; border: 0; }
.go .ar { width: 34px; height: 12px; flex: none; transition: transform .35s var(--ease); }
.go::after { content: ""; position: absolute; left: 0; right: 48px; bottom: 6px; height: 2px; background: currentColor; transform-origin: left; transform: scaleX(.25); transition: transform .45s var(--ease); }
.go:hover::after { transform: scaleX(1); }
.go:hover .ar { transform: translateX(8px); }
.go.white { color: var(--text); }
.go.white::after { background: var(--acc); }

/* ---------- textures and shapes ---------- */
.carbon { background-color: #0E0F0F; background-image:
  repeating-linear-gradient(45deg, rgba(255,255,255,.045) 0 1.5px, transparent 1.5px 6px),
  repeating-linear-gradient(-45deg, rgba(0,0,0,.6) 0 1.5px, transparent 1.5px 6px); }
.kerb { height: 10px; background: repeating-linear-gradient(90deg, var(--mint) 0 30px, var(--ink) 30px 60px); transform: skewX(-30deg) scaleX(1.05); }
.rule { height: 1px; background: var(--line); }
/* moving band of words */
.ticker { overflow: hidden; background: var(--mint); color: var(--ink); padding: 13px 0 11px; transform: rotate(-1.2deg) scaleX(1.03); position: relative; z-index: 3; margin: -18px 0; }
.ticker.dark { background: var(--ink); color: var(--mint); }
.ticker div { display: flex; width: max-content; gap: 0; animation: ticker 26s linear infinite; }
.ticker span { font: 900 italic clamp(22px, 2.6vw, 34px)/1 var(--disp); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; padding-right: 28px; display: flex; align-items: center; gap: 28px; }
.ticker span::after { content: ""; width: 22px; height: 12px; background: currentColor; transform: skewX(-24deg); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- motion: things come in once as they scroll on screen ---------- */
.js.motion [data-write], .js.motion [data-rise] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js.motion [data-write].is-in, .js.motion [data-rise].is-in { opacity: 1; transform: none; }
/* headlines wipe up from behind a line */
.js.motion .display[data-write], .js.motion .display[data-rise] { opacity: 1; clip-path: inset(0 0 100% 0); transform: translateY(.35em) skewY(2deg); transition: clip-path .9s var(--ease), transform .9s var(--ease); }
.js.motion .display[data-write].is-in, .js.motion .display[data-rise].is-in { clip-path: inset(-10% -10% -10% -10%); transform: none; }

/* header logo: the checkered E. On hover its three bars stretch out and spell RACING / WITH / ELLIOT. */
/* every part of the morph shares one slow-in, slow-out curve and one length, and runs on the GPU, so it glides
   instead of stepping. The words dissolve into the bars while the letters fade in under them (they overlap, no gap). */
.brand { --lg: cubic-bezier(.45, 0, .2, 1); --lt: .6s; }
.brand .elogo { display: inline-flex; align-items: stretch; gap: .0476em; width: auto; height: 1em; font-size: 30px; margin-left: 5px; flex: none; transform: skewX(-14deg) translateZ(0); transform-origin: left center; transition: transform var(--lt) var(--lg); will-change: transform; backface-visibility: hidden; }
.elogo .ck { width: .2857em; height: 1em; fill: currentColor; flex: none; }
.elogo .bars { display: flex; flex-direction: column; justify-content: space-between; }
.elogo i { display: block; height: .2857em; width: var(--w); background: currentColor; overflow: hidden; transition: width var(--lt) var(--lg); }
.elogo i.m { background: var(--mint); }
.elogo path { fill: #0B0C0C; stroke: #0B0C0C; stroke-width: 1; }
.brand .wm > * { display: inline-block; transform-origin: left center; will-change: transform, opacity; backface-visibility: hidden;
  transition: transform var(--lt) var(--lg), opacity .3s ease .1s; }
.elogo i svg { display: block; height: 100%; width: var(--l); opacity: 0; transform: translateX(.25em); will-change: transform, opacity;
  transition: opacity .2s ease, transform .35s var(--lg); }
@media (hover: hover) {
  .brand:hover .elogo, .brand:focus-visible .elogo { transform: skewX(-14deg) scale(1.8) translateZ(0); }
  .brand:hover .elogo i, .brand:focus-visible .elogo i { width: var(--l); }
  .brand:hover .elogo i svg, .brand:focus-visible .elogo i svg { opacity: 1; transform: none; transition: opacity .35s ease .2s, transform var(--lt) var(--lg) .08s; }
  /* the name's three words fly into the three bars */
  .brand:hover .wm > *, .brand:focus-visible .wm > * { opacity: 0; }
  .brand:hover .w1, .brand:focus-visible .w1 { transform: translate(-22px, -19px) scale(.58); }
  .brand:hover .w2, .brand:focus-visible .w2 { transform: translate(-82px, 0) scale(.58); transition-delay: .03s, .13s; }
  .brand:hover .w3, .brand:focus-visible .w3 { transform: translate(-124px, 19px) scale(.58); transition-delay: .06s, .16s; }
}
@media (max-width: 400px) { .brand .elogo { font-size: 26px; } }

/* ---------- footer ---------- */
.site-foot { padding: clamp(40px, 6vw, 72px) var(--gut) calc(28px + env(safe-area-inset-bottom)); background: var(--ink); color: #F4F5F2; position: relative; overflow: hidden; }
.site-foot .row { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; align-items: center; }
.site-foot .row a { text-decoration: none; color: #BFC4C1; }
.site-foot .row a:hover { color: var(--mint); }
.site-foot .links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-foot .who { display: flex; align-items: center; gap: 10px; color: #F4F5F2; }
.site-foot .who svg { width: 26px; height: 26px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ticker div { animation: none; }
}
