/* Palette: assets/PALETTE.md. A road: asphalt, road paint and one amber. */
:root {
  --asphalt: #1B1D20;
  --asphalt-2: #24272B;
  --paint: #E8E4DA;
  --amber: #F2B134;
  --text: #F1EEE7;
  --muted: #B8B3A8;
  --stripes: repeating-linear-gradient(90deg, rgb(232 228 218 / 0.07) 0 34px, transparent 34px 64px);
  --hazard: repeating-linear-gradient(-45deg, var(--amber) 0 18px, var(--asphalt) 18px 36px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

/* Scrollbar: a slim amber-grey thumb on a transparent track that widens when you reach for it.
   Chrome ignores ::-webkit-scrollbar once scrollbar-color is set, so the standard
   properties are only for browsers without it (Firefox). */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  border: 4px solid transparent; border-radius: 99px; background-clip: padding-box;
  background-color: rgb(232 228 218 / .18);
}
::-webkit-scrollbar-thumb:hover { border-width: 2px; background-color: rgb(242 177 52 / .7); }
::-webkit-scrollbar-thumb:active { border-width: 2px; background-color: var(--amber); }
@supports not selector(::-webkit-scrollbar) {
  html, .cmds code { scrollbar-width: thin; scrollbar-color: rgb(232 228 218 / .25) transparent; }
}

@font-face { font-family: "Thmanyah Serif Text"; src: url(fonts/thmanyahseriftext-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url(fonts/thmanyahseriftext-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url(fonts/thmanyahseriftext-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(fonts/thmanyahserifdisplay-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--asphalt);
  color: var(--text);
  font: 400 1.125rem/1.6 "Thmanyah Serif Text", Georgia, serif;
  overflow-x: hidden;
}
::selection { background: var(--amber); color: var(--asphalt); }
a { color: var(--amber); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2 { font-family: "Thmanyah Serif Display", "Thmanyah Serif Text", serif; font-weight: 700; line-height: 1.15; text-wrap: balance; margin: 0 0 .5em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
section { padding: 6rem max(6vw, calc((100% - 1080px) / 2)); }

.button {
  display: inline-block;
  padding: .7em 1.4em;
  border-radius: 10px;
  background: var(--amber);
  color: var(--asphalt);
  font-weight: 700;
  text-decoration: none;
}
.button { position: relative; overflow: hidden; isolation: isolate; }
.button.ghost { background: none; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--muted); }
.button, .copy, .lang { transition: transform 160ms var(--ease-out); }
.button:active, .copy:active, .lang:active { transform: scale(.97); }
/* hover: a band of road paint sweeps across the button */
.button::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / .22) 0 8px, transparent 8px 16px);
  transform: translateX(-101%); transition: transform 420ms var(--ease-out);
}
.button.ghost::before { background: repeating-linear-gradient(90deg, rgb(242 177 52 / .16) 0 8px, transparent 8px 16px); }
[dir=rtl] .button::before { transform: translateX(101%); }
@media (hover: hover) and (pointer: fine) {
  .button:hover::before { transform: translateX(0); }
}
.button.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); }

/* 1. hero */
.hero {
  position: relative; min-height: 100svh;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3rem;
  overflow: hidden;
}
.hero-stripes { position: absolute; inset: -20% 0; background: var(--stripes); }
.hero-logo { position: relative; width: clamp(140px, 22vw, 260px); height: auto; }
/* moved every frame: their own layers, so Firefox moves them instead of repainting */
.motion :is(.hero-logo, .hero-stripes, .win, .file, .road, .shots img) { will-change: transform; }
.hero-text { position: relative; }
.hero h1 { font-size: clamp(3.5rem, 10vw, 6rem); margin: 0; }
.badge { display: inline-block; margin: 0 0 .5rem; padding: .1em .8em; border-radius: 99px; border: 1.5px solid var(--amber); color: var(--amber); font-weight: 500; font-size: .9rem; }
.means { color: var(--amber); font-size: 1.3rem; margin: 0 0 1rem; }
.tagline { font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--muted); max-width: 30ch; margin: 0 0 2rem; }
.hero .links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 1rem; margin: 0; }
.hint { position: absolute; bottom: 1.5rem; inset-inline: 0; text-align: center; color: var(--muted); font-size: .95rem; margin: 0; }

/* 2-3. the story */
.story { display: grid; gap: 3rem; }
.stage {
  display: grid; grid-template-columns: 1fr minmax(70px, .8fr) 1fr; align-items: center;
  width: 100%; max-width: 900px; margin-inline: auto;
}
.pc { text-align: center; }
.screen {
  position: relative; aspect-ratio: 16 / 10;
  border: 3px solid var(--paint); border-radius: 12px;
  background: var(--asphalt-2);
}
.screen::after { /* the stand */
  content: ""; position: absolute; top: 100%; left: 42%; width: 16%; height: 14px; background: var(--paint);
}
.pc-label { margin: 1.4rem 0 0; color: var(--muted); font-size: .95rem; }
.icons { position: absolute; inset: 14%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12%; }
.icons i { border-radius: 6px; background: rgb(232 228 218 / .18); }
.file { position: absolute; bottom: 10%; inset-inline-end: 10%; }
.road { position: relative; height: 70px; background: var(--stripes); background-size: 40px 100%; transform-origin: left; }
[dir=rtl] .road { transform-origin: right; }
.road::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 2px dashed var(--amber); }
.road-label, .road-mode { position: absolute; inset-inline: 0; text-align: center; font-size: .8rem; }
.road-label { top: -1.8rem; color: var(--amber); font-weight: 700; }
.road-mode { bottom: -1.8rem; color: var(--muted); }
.win {
  position: absolute; inset: 14% 12%;
  border-radius: 6px; overflow: hidden;
  background: var(--paint); color: var(--asphalt);
  box-shadow: 0 8px 24px rgb(0 0 0 / .4);
}
.bar { display: flex; gap: 4px; justify-content: flex-end; padding: 5px 6px; background: var(--amber); }
.bar b { width: 7px; height: 7px; border-radius: 50%; background: var(--asphalt); opacity: .5; }
.win-body { display: grid; place-items: center; height: calc(100% - 17px); }
.waves { width: 40%; height: auto; }
.waves .w { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

.captions { list-style: none; padding: 0; margin: 0 auto; width: 100%; max-width: 640px; display: grid; gap: 2.5rem; text-align: center; }
.captions h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
.captions p { color: var(--muted); margin: 0; }

/* with motion, the story is one pinned screen and the captions take turns */
.motion .story { height: 100svh; align-content: center; gap: 2.5rem; padding-block: 5rem 2rem; }
.motion .captions { position: relative; min-height: 9.5em; }
.motion .captions li { position: absolute; inset: 0 0 auto; }

/* sections after the story: start-aligned, each with its own road element */
.screens h2, .features h2, .install h2, .alpha h2 { position: relative; width: fit-content; }
.wipe { position: absolute; inset: -.1em -.2em; background: var(--hazard); transform: scaleX(0); pointer-events: none; }

/* 4. screenshots, driving in on a road */
.screens { overflow-x: clip; }
.shots { display: grid; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 2.5rem; margin-top: 3rem; }
.shots img { width: 100%; height: auto; border-radius: 12px; }  /* no shadow: costly while they move */
.shots img[data-en]:not([src]) { display: none; }  /* without JS, the <noscript> copies show */
.road-strip { position: relative; height: 56px; margin-top: 2rem; background: var(--stripes); background-size: 48px 100%; }
.lane { position: absolute; inset: 50% 0 auto; border-top: 3px dashed var(--amber); transform-origin: left; }
[dir=rtl] .lane { transform-origin: right; }

/* 5. features: two lanes */
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 3rem; }
.group { position: relative; padding-inline-start: 2rem; }
.lane-v { position: absolute; inset-block: 0; inset-inline-start: 0; border-inline-start: 3px dashed rgb(242 177 52 / .55); transform-origin: top; }
.group h3 { margin: 0 0 1.6rem; font: 700 clamp(1.6rem, 3vw, 2.2rem)/1.1 "Thmanyah Serif Display", serif; color: rgb(232 228 218 / .28); }
.group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.8rem; }
.group li { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-content: start; }
.icon { grid-row: span 2; fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: .15rem; }
.group strong { color: var(--text); font-weight: 700; }
.group span { color: var(--muted); text-wrap: pretty; }

/* 6. install: a zebra crossing, then a terminal */
.crossing { display: grid; gap: 10px; margin-bottom: 3rem; }
.crossing i { display: block; height: 12px; background: var(--paint); opacity: .85; transform-origin: left; }
[dir=rtl] .crossing i { transform-origin: right; }
.install > p { color: var(--muted); max-width: 60ch; text-wrap: pretty; }
.cmds { margin: 2.5rem 0 0; }
.cmds dt { margin-top: 1.4rem; color: var(--muted); font-size: .95rem; }
.cmds dd { margin: .4rem 0 0; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 10px; background: #111214; box-shadow: inset 0 0 0 1px #2A2D31; }
.cmds code {
  flex: 1; overflow-x: auto; white-space: nowrap; font: .95rem/1.5 ui-monospace, monospace; direction: ltr; text-align: left;
  mask-image: linear-gradient(to left, transparent, #000 1.5rem);
}
.cmds code::before { content: "$ "; color: var(--amber); }
.typing::after { content: "▌"; color: var(--amber); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.copy { flex: none; padding: .3em .8em; border-radius: 6px; border: 1.5px solid var(--muted); background: none; color: var(--text); font: 500 .85rem "Thmanyah Serif Text", serif; cursor: pointer; transition: transform 160ms var(--ease-out), color 200ms ease, border-color 200ms ease; }
.copy:hover { border-color: var(--text); }
.copy.done { border-color: var(--amber); color: var(--amber); }
[dir=rtl] .cmds dd { flex-direction: row-reverse; }

/* 7. alpha: roadworks ahead */
.barrier { height: 22px; max-width: 420px; margin-bottom: 2.5rem; border-radius: 4px; background: var(--hazard); transform-origin: left; }
[dir=rtl] .barrier { transform-origin: right; }
.alpha p { color: var(--muted); max-width: 60ch; text-wrap: pretty; }
.links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* the end of the road */
footer { position: relative; padding: 0 max(6vw, calc((100% - 1080px) / 2)) 3rem; color: var(--muted); font-size: .9rem; overflow: hidden; }
.stop-line { display: block; height: 14px; background: var(--paint); transform-origin: left; }
[dir=rtl] .stop-line { transform-origin: right; }
.end { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); margin: 1rem 0 1.5rem; }
.end-logo { width: clamp(4.5rem, 14vw, 10rem); height: auto; opacity: .12; filter: grayscale(1); }
.end-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0 0 1.2rem; }
.star { display: inline-flex; align-items: center; gap: .55em; }
.end-word { margin: 0; font: 700 clamp(5rem, 18vw, 13rem)/.9 "Thmanyah Serif Display", serif; color: rgb(232 228 218 / .07); }
.lang {
  padding: .4em 1.2em; border-radius: 99px; cursor: pointer;
  border: 1.5px solid var(--muted); background: none; color: var(--text);
  font: 500 1rem "Thmanyah Serif Text", serif;
}
.lang:hover { border-color: var(--text); }

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; padding-top: 6rem; }
  .hero-logo { margin-inline: auto; }
  .tagline { margin-inline: auto; }
  .hero .links { justify-content: center; }
  .stage { grid-template-columns: 1fr 50px 1fr; }
  .road { height: 46px; }
  .road-mode { display: none; }
  .hero { align-content: center; }
  .shots, .groups { grid-template-columns: 1fr; }
  .motion .captions { min-height: 12em; }
}
