/* Roko Games homepage. The Unspool app's type (Space Grotesk, JetBrains Mono for every number) and the
   logo's navy, cream and orange. Light and dark come from light-dark(): the visitor's system setting,
   or the theme switch (assets/js/theme.js sets <html data-theme> and data-scheme, which the map reads). */

:root {
  color-scheme: light dark;
  --bg:        light-dark(#F6EFE1, #0B1020);
  --card:      light-dark(#FFFBF3, #141C31);
  --card-2:    light-dark(#EFE5D3, #1A2440);
  --line:      light-dark(rgb(20 35 63 / .12), rgb(233 237 245 / .09));
  --line-2:    light-dark(rgb(20 35 63 / .24), rgb(233 237 245 / .2));
  --text:      light-dark(#14233F, #E9EDF5);
  --muted:     light-dark(#55627A, #9AA6BD);
  --accent:    light-dark(#E2581F, #FF6A2B);
  --accent-2:  light-dark(#B23F0E, #FF8A57);     /* orange as small text: links, labels */
  --teal:      light-dark(#22625F, #8CC7C4);
  --on-accent: #0B1020;
  /* the logo's navy: the watch band and the footer, in both themes */
  --band:       light-dark(#14233F, #070B16);
  --band-text:  #F3EBDD;
  --band-muted: rgb(243 235 221 / .72);
  --band-line:  rgb(243 235 221 / .12);

  --font: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --h1: clamp(42px, 5.4vw, 80px);
  --h2: clamp(32px, 3.7vw, 54px);
  --lead: clamp(17px, 1.35vw, 20px);
  --pad: clamp(20px, 4vw, 48px);
  --sec: clamp(80px, 9.5vw, 144px);
  --radius: 22px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }
/* a browser without light-dark(): the light theme */
@supports not (color: light-dark(#000, #fff)) {
  :root { --bg: #F6EFE1; --card: #FFFBF3; --card-2: #EFE5D3; --line: rgb(20 35 63 / .12); --line-2: rgb(20 35 63 / .24);
          --text: #14233F; --muted: #55627A; --accent: #E2581F; --accent-2: #B23F0E; --teal: #22625F; --band: #14233F; }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: min(100% - 2 * var(--pad), 1200px); margin-inline: auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font: 500 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
       border-radius: 999px; border: 1px solid transparent; font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
       transition: transform .15s ease, background-color .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in oklab, var(--accent) 86%, white); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn--ghost:hover { background: var(--card-2); }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform .2s ease; }
.btn:hover svg { transform: translateX(3px); }
.link { color: var(--accent-2); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.link:hover { text-decoration-thickness: 2px; }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line);
       background: color-mix(in oklab, var(--bg) 94%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.top__bar { height: 68px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.top__links { display: flex; gap: 2px; margin-left: auto; }
.top__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px; border-radius: 999px; font-size: 15px; color: var(--muted); text-decoration: none; transition: color .2s, background-color .2s; }
.top__links a:hover { color: var(--text); background: var(--card-2); }
.top__end { display: flex; align-items: center; gap: 10px; }
.top__end .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 999px;
                border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 500 14px/1 var(--font); cursor: pointer; transition: background-color .2s; }
.theme-toggle:hover { background: var(--card-2); }
.theme-toggle .icon { display: none; width: 18px; height: 18px; flex: none; }
.theme-toggle:not([data-theme]) .icon-system, .theme-toggle[data-theme="system"] .icon-system,
.theme-toggle[data-theme="dark"] .icon-dark, .theme-toggle[data-theme="light"] .icon-light { display: block; }
.menu-btn { display: none; width: 44px; height: 44px; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }
.menu { border-top: 1px solid var(--line); padding: 8px 0 20px; }
.menu a:not(.btn) { display: flex; align-items: center; min-height: 48px; font-size: 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
.menu .btn { margin-top: 16px; width: 100%; }
@media (max-width: 919px) {
  .top__links, .top__end > .btn { display: none; }
  .top__end { margin-left: auto; }
  .menu-btn { display: inline-grid; }
}
@media (min-width: 920px) { .menu { display: none; } }
@media (max-width: 479px) { .theme-toggle span { display: none; } .theme-toggle { padding: 0; justify-content: center; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: clip; padding: clamp(48px, 6vw, 96px) 0 clamp(72px, 8vw, 120px); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
                background: radial-gradient(620px 460px at 76% 46%, color-mix(in oklab, var(--accent) 17%, transparent), transparent 70%); }
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-top: 20px; font-size: var(--h1); }
.hero__lead { margin-top: 24px; max-width: 33em; font-size: var(--lead); color: var(--muted); }
.hero__actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.phones { position: relative; height: clamp(500px, 44vw, 620px); }
.phone { position: absolute; width: clamp(220px, 19.5vw, 280px); aspect-ratio: 600 / 1066; padding: 8px; border-radius: 36px; background: #05070D;
         box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1), 0 40px 80px -36px rgb(5 7 13 / .7); }
.phone > img, .phone > video { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; }
.phone--back { right: 4%; top: 0; }
.phone--front { left: 4%; bottom: 0; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .rise--2 { animation-delay: .08s; } .rise--3 { animation-delay: .16s; } .rise--4 { animation-delay: .24s; }
  .phone--back { animation: rise 1s .2s cubic-bezier(.2, .7, .2, 1) both; }
  .phone--front { animation: rise 1s .32s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
}

/* ---------------------------------------------------------------- sections */
.section { padding-block: var(--sec); }
.section + .section:not(.band) { border-top: 1px solid var(--line); }
.head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.head h2 { font-size: var(--h2); }
.head p { font-size: var(--lead); color: var(--muted); }
.head .link { display: inline-block; margin-top: 14px; }
.media { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--card-2); border: 1px solid var(--line); }
.media > img, .media > video { width: 100%; height: 100%; object-fit: cover; }

/* the Unspool session: the map, the lap table and the controls */
.kart { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; }
.kart__map { position: relative; min-height: 540px; border-radius: var(--radius); overflow: hidden; background: var(--card-2); border: 1px solid var(--line); }
.kart__map > .kart-map, .kart__map > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.kart.has-map .kart__map > canvas { display: none; }
:root[data-scheme="dark"] .kart-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.86) saturate(.4); }
:root:not([data-scheme="dark"]) .kart-map .leaflet-tile-pane { filter: saturate(.5) contrast(.96) brightness(1.03); }
.kart__map .kart-map .leaflet-control-attribution { font: 11px/1.6 var(--font); background: color-mix(in oklab, var(--card) 88%, transparent); color: var(--muted); }
.kart__map .kart-map .leaflet-control-attribution a { color: var(--text); }
.kart__map .kart-map .leaflet-bar { border: 1px solid var(--line-2); box-shadow: none; }
.kart__map .kart-map .leaflet-bar a { background: var(--card); color: var(--text); border-color: var(--line); }
.kart__side { display: grid; align-content: start; gap: 24px; padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.read { display: flex; justify-content: space-between; gap: 16px; }
.read div { display: grid; gap: 6px; }
.read span { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.read output { font: 600 30px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.read output[data-kart-clock] { color: var(--accent); }
.laps { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.laps th { padding: 0 0 10px; text-align: left; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.laps td { height: 54px; border-top: 1px solid var(--line); font: 400 16px/1 var(--mono); }
.laps td + td, .laps th + th { text-align: right; }
.laps .best { color: var(--teal); font-weight: 600; }
.laps button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 600 16px/1 var(--font); }
.laps button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
.laps tr.is-on button::before { background: var(--accent); border-color: var(--accent); }
.laps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.ctl { display: grid; gap: 10px; }
.ctl label { font-size: 14px; color: var(--muted); }
.ctl input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); }

/* the watch faces, on the logo's navy */
.band { background: var(--band); color: var(--band-text); }
.band .head p { color: var(--band-muted); }
.dials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dial { display: grid; justify-items: center; align-content: start; gap: 22px; padding: 32px 24px 28px; text-align: center; border-radius: var(--radius);
        background: rgb(243 235 221 / .035); border: 1px solid var(--band-line); }
.dial__frame { position: relative; width: min(270px, 100%); }
.dial roko-watch, .dial video { width: 100%; box-shadow: 0 30px 60px -28px rgb(0 0 0 / .9); }
.dial video { display: block; height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #1A2150; }
.dial h3 { font-size: 21px; }
.dial p { margin-top: 8px; font-size: 15px; color: var(--band-muted); }

/* Rash Racer and UniPDI */
.pair { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 20px; }
.pair .media { height: 520px; }
.media--clip { background: #121212; }
.pdi { height: 520px; }
.pdi .wide { position: absolute; left: 32px; top: 40px; width: calc(100% - 264px); height: auto; border-radius: 12px;
             box-shadow: 0 0 0 1px var(--line), 0 24px 48px -28px rgb(5 7 13 / .5); }
.pdi .phone-shot { position: absolute; right: 32px; top: 40px; width: 176px; height: auto; border-radius: 22px;
                   box-shadow: 0 0 0 6px #05070D, 0 24px 48px -24px rgb(5 7 13 / .6); }

/* the studio: a short band */
.studio { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px clamp(24px, 5vw, 72px); align-items: end; }
.studio h2 { font-size: clamp(40px, 6.2vw, 88px); line-height: .98; letter-spacing: -0.035em; }
.studio p { font-size: var(--lead); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 24px 0 0; }
.facts div { padding-top: 12px; border-top: 1px solid var(--line-2); }
.facts dt { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 8px 0 0; }

/* the journal */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 0; overflow: hidden; border-radius: var(--radius);
        background: var(--card); border: 1px solid var(--line); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 20px 40px -28px rgb(5 7 13 / .45); }
.card h3 { font-size: 21px; }
/* the title's link covers the card; a clip's pause button sits above it */
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card p { font-size: 15px; color: var(--muted); }
.card__media { position: relative; margin: auto -24px 0; height: 280px; overflow: hidden; background: var(--card-2); }
.card__media > img, .card__media > video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media > img { transform: scale(1.03); }
.card__media--retro { display: grid; place-items: center; background: #0D1830; }
.card__media--retro > video { width: 200px; height: 200px; border-radius: 50%; }

/* clip and dial pause buttons (added by loop-video.js and dials.js) */
.loop-pause { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
              border-radius: 50%; border: 1px solid rgb(255 255 255 / .2); background: rgb(11 16 32 / .62); color: #fff; cursor: pointer;
              -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .15s ease, background-color .2s ease; }
.loop-pause:hover { background: rgb(11 16 32 / .82); }
.loop-pause:active { transform: scale(.94); }
.loop-pause svg { width: 14px; height: 14px; fill: currentColor; }
.dial__frame .loop-pause { right: -4px; bottom: -4px; }

/* ---------------------------------------------------------------- footer */
.foot { padding: clamp(72px, 9vw, 128px) 0 28px; background: var(--band); color: var(--band-text); }
.foot__cta { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 28px; padding-bottom: 56px; border-bottom: 1px solid var(--band-line); }
.foot__cta h2 { font-size: clamp(38px, 5vw, 72px); }
.foot__cta p { margin-top: 14px; font-size: var(--lead); color: var(--band-muted); }
.foot__cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-block: 40px; }
.foot .brand img { width: 40px; height: 40px; }
.foot h3 { margin-bottom: 12px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--band-muted); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }
.foot li a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; border-top: 1px solid var(--band-line); font-size: 13px; color: var(--band-muted); }

/* ---------------------------------------------------------------- tablet and phone */
@media (max-width: 1023px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .phones { width: min(100%, 580px); height: 600px; margin-inline: auto; }
  .head, .studio { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .kart { grid-template-columns: minmax(0, 1fr); }
  .pair { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .pair .media { height: 440px; }
  .pdi { height: 460px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 24px; padding: 0 0 0 24px; }
  .card h3 { padding-top: 24px; }
  .card__media { grid-column: 2; grid-row: 1 / span 2; margin: 0; height: 240px; }
  .foot__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot__cols > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 719px) {
  .phones { height: auto; display: flex; justify-content: center; }
  .phone { position: relative; inset: auto; width: 240px; }
  .phone--back { display: none; }
  .kart__map { min-height: 460px; }
  .kart__side { padding: 20px; }
  .read output { font-size: 22px; }
  .dials { grid-template-columns: minmax(0, 1fr); }
  .dial__frame { width: min(240px, 100%); }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair .media { height: 380px; }
  .pair .media--clip { height: 460px; }
  .pdi { height: 340px; }
  .pdi .wide { left: 16px; top: 24px; width: calc(100% - 32px); }
  .pdi .phone-shot { display: none; }
  .card { display: flex; padding: 22px 22px 0; }
  .card h3 { padding-top: 0; }
  .card__media { margin: auto -22px 0; height: 220px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}
