/*
 * valencelab.gg — one stylesheet for every page.
 *
 * The look is the app's r4 shell (design/valence-ui-prototypes/src/styles/
 * shell.css and tokens.css): ink on near-black, Geist, hairline modules, one
 * cool blue for "your focus", and each game's colour only on its glyph tile
 * and the top hairline. Light is the app's v4 ink-on-white palette.
 *
 * Theme resolution matches the app: an explicit html[data-theme] wins (the
 * toggle, persisted per browser), then prefers-color-scheme, then light.
 * Dark is written twice so the toggle wins in both directions.
 */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --bg: #ffffff;
  --mod: #fafafa;
  --mod2: #f4f4f5;
  --line: #ebebed;
  --line2: #d4d4d8;
  --fg: #09090b;
  --fg2: #3f3f46;
  --fg3: #63636b;
  --cool: #0a6f91;
  --btn-bg: #09090b;
  --btn-fg: #ffffff;
  --frame: #e4e4e7;
  --shadow: 0 24px 60px -24px rgba(9, 9, 11, 0.28);
  --glass: rgba(255, 255, 255, 0.86);

  /* A game's identity: the glyph tiles and the top hairline, nowhere else. */
  --g-valorant: #f2626b;
  --g-league: #cfae63;
  --g-deadlock: #aeb993;
  --g-on: #0a0a0b;

  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --col: 1180px;
  --gut: 32px;
  --r-mod: 20px;
  --r-ctl: 12px;
  --target: 44px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0a0b;
    --mod: #111113;
    --mod2: #151518;
    --line: #1c1c1f;
    --line2: #26262a;
    --fg: #ededef;
    --fg2: #a9a9ae;
    --fg3: #8a8a90;
    --cool: #78d3ef;
    --btn-bg: #ededef;
    --btn-fg: #0a0a0b;
    --frame: #26262a;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
    --glass: rgba(10, 10, 11, 0.82);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --mod: #111113;
  --mod2: #151518;
  --line: #1c1c1f;
  --line2: #26262a;
  --fg: #ededef;
  --fg2: #a9a9ae;
  --fg3: #8a8a90;
  --cool: #78d3ef;
  --btn-bg: #ededef;
  --btn-fg: #0a0a0b;
  --frame: #26262a;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  --glass: rgba(10, 10, 11, 0.82);
}

@media (max-width: 767px) {
  :root { --gut: 16px; --r-mod: 16px; }
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--r-ctl);
  text-decoration: none;
  font-weight: 500;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gut));
  margin: 0 auto;
  padding: 0 var(--gut);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ── The bar ──────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

/* The three games, a third each: the only place their colours meet. */
.bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--g-valorant) 0 33.33%,
    var(--g-league) 33.33% 66.66%,
    var(--g-deadlock) 66.66% 100%);
  opacity: 0.85;
}

@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.bar-in {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--target);
  margin-right: auto;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0a0a0b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f4f6;
}
.mark svg { width: 18px; height: 18px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 12px;
  color: var(--fg2);
  text-decoration: none;
  font-size: 15px;
  border-radius: var(--r-ctl);
  transition: color 160ms var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

.theme-btn {
  display: inline-grid;
  place-items: center;
  width: var(--target);
  height: var(--target);
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg2);
  border-radius: var(--r-ctl);
  cursor: pointer;
}
.theme-btn:hover { color: var(--fg); }
.theme-btn svg { width: 18px; height: 18px; }
/* Show the icon for the theme a press switches to. */
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}

@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .nav a { padding: 0 10px; }
}

/* ── Buttons and tags ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r-ctl);
  font: 500 16px/1 var(--sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bg); }
.btn-primary:hover { opacity: 0.9; }
.btn-quiet { background: transparent; color: var(--fg); border: 1px solid var(--line2); }
.btn-quiet:hover { border-color: var(--fg3); }
.btn svg { width: 18px; height: 18px; flex: none; }

.nav .btn-nav {
  min-height: 36px;
  padding: 0 14px;
  margin-left: 4px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 500;
  border-radius: 10px;
}
.nav a.btn-nav,
.nav a.btn-nav:hover,
.nav a.btn-nav[aria-current="page"] { color: var(--btn-fg); }
.nav a.btn-nav:hover { opacity: 0.9; }
/* The nav pill is 36px to look like the app's; its hit area is still 44px. */
.nav .btn-nav { position: relative; }
.nav .btn-nav::after { content: ""; position: absolute; inset: -4px 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  color: var(--fg2);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cool); flex: none; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--fg3);
  font-size: 14px;
  line-height: 20px;
}
.eyebrow .cool { color: var(--cool); }

/* ── Type ─────────────────────────────────────────────────────────────── */

h1, h2, h3 { margin: 0; font-weight: 600; color: var(--fg); text-wrap: balance; }

.display {
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.h-page {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.h-sec {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.h-mod { font-size: 20px; line-height: 28px; letter-spacing: -0.02em; }

.lede {
  margin: 20px 0 0;
  max-width: 620px;
  color: var(--fg2);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  text-wrap: pretty;
}

p { text-wrap: pretty; }

/* ── Home: hero ───────────────────────────────────────────────────────── */

.hero { padding: clamp(56px, 9vw, 112px) 0 0; }

.hero .tag { margin-bottom: 28px; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}
.cta-note { color: var(--fg3); font-size: 14px; margin-left: 4px; }

.shot {
  margin: clamp(48px, 7vw, 80px) 0 0;
}

.frame {
  border-radius: var(--r-mod);
  border: 1px solid var(--frame);
  background: #0a0a0b;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.shot figcaption, .feature figcaption {
  margin-top: 14px;
  color: var(--fg3);
  font-size: 14px;
  line-height: 20px;
}

/* The phone shot sits in a narrower frame so it reads as a phone. */
@media (max-width: 640px) {
  .shot .frame { max-width: 360px; margin: 0 auto; border-radius: 28px; }
  .shot figcaption { text-align: center; }
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.sec { padding: clamp(72px, 10vw, 128px) 0 0; }

.sec-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 48px); }
.sec-head .lede { margin-top: 16px; }

.mod {
  background: var(--mod);
  border: 1px solid var(--line);
  border-radius: var(--r-mod);
  padding: clamp(24px, 3vw, 36px);
}

/* The promise: a wide module, statement left, the real screen right. */
.promise {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.promise .h-sec { margin-bottom: 18px; }
.promise p { margin: 0 0 14px; color: var(--fg2); font-size: 17px; line-height: 1.6; }
.promise p:last-child { margin-bottom: 0; }
.promise .frame { box-shadow: none; }

@media (max-width: 900px) {
  .promise { grid-template-columns: 1fr; }
}

/* How it works: three numbered steps. */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 28px;
  color: var(--fg3);
  font-size: 14px;
  font-weight: 500;
}
.steps h3 { margin-bottom: 10px; }
.steps p { margin: 0; color: var(--fg2); }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .steps li::before { margin-bottom: 16px; }
}

/* Games: one module each, the glyph tile the only colour. */
.games {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.game { display: flex; flex-direction: column; }
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.glyph {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--g-on);
}
.glyph svg { width: 16px; height: 16px; }
.glyph-valorant { background: var(--g-valorant); }
.glyph-league { background: var(--g-league); }
.glyph-deadlock { background: var(--g-deadlock); }
.game h3 { margin-bottom: 10px; }
.game p { margin: 0; color: var(--fg2); }
.game .status {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--fg2);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--mod2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.game .fine { margin-top: auto; padding-top: 20px; color: var(--fg3); font-size: 14px; line-height: 20px; }

@media (max-width: 900px) {
  .games { grid-template-columns: 1fr; }
}

/* Principles: a quiet two-by-two. */
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.principle {
  padding: 28px 32px 28px 0;
  border-bottom: 1px solid var(--line);
}
.principle:nth-child(even) { padding: 28px 0 28px 32px; border-left: 1px solid var(--line); }
.principle h3 { margin-bottom: 8px; }
.principle p { margin: 0; color: var(--fg2); max-width: 460px; }

@media (max-width: 767px) {
  .principles { grid-template-columns: 1fr; }
  .principle, .principle:nth-child(even) { padding: 24px 0; border-left: 0; }
}

/* Closing call. */
.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.closing p { margin: 10px 0 0; color: var(--fg2); max-width: 560px; }

/* ── Download ─────────────────────────────────────────────────────────── */

.page-head { padding: clamp(48px, 8vw, 96px) 0 0; }
.page-head .tag { margin-bottom: 24px; }

.dl {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px;
  margin-top: 48px;
  align-items: start;
}
@media (max-width: 900px) { .dl { grid-template-columns: 1fr; } }

.dl-main .btn { margin-top: 4px; }
.dl-meta { margin: 14px 0 0; color: var(--fg3); font-size: 14px; line-height: 20px; }

/* Shown only when the download redirect lands on /download/#not-yet. */
.notice {
  display: none;
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px dashed var(--line2);
  border-radius: var(--r-ctl);
  color: var(--fg2);
}
.notice:target { display: block; }
.notice strong { color: var(--fg); }

.reqs { margin: 0; padding: 0; list-style: none; }
.reqs li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 22px;
}
.reqs li:first-child { border-top: 0; padding-top: 0; }
.reqs .k { color: var(--fg3); }
.reqs .v { color: var(--fg); }
@media (max-width: 480px) {
  .reqs li { grid-template-columns: 1fr; gap: 2px; }
}

.mod h2.h-mod { margin-bottom: 16px; }
.mod p { color: var(--fg2); margin: 0 0 12px; }
.mod p:last-child { margin-bottom: 0; }

.howto { margin: 8px 0 12px; padding-left: 22px; color: var(--fg2); }
.howto li { margin: 6px 0; }
.howto strong { color: var(--fg); font-weight: 500; }

.stack { display: grid; gap: 16px; }

/* ── Legal pages ──────────────────────────────────────────────────────── */

.legal { max-width: 760px; }
.legal h2 {
  margin: 48px 0 12px;
  font-size: 22px;
  line-height: 30px;
  letter-spacing: -0.02em;
}
.legal p, .legal li { color: var(--fg2); }
.legal ul { padding-left: 22px; }

.draft {
  margin-top: 32px;
  padding: 18px 20px;
  border: 1px dashed var(--line2);
  border-radius: var(--r-ctl);
  background: var(--mod);
}
.draft strong { color: var(--fg); }
.draft p { margin: 0; color: var(--fg2); }
.draft p + p { margin-top: 8px; }

.meta {
  display: grid;
  gap: 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}
.meta div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.meta dt { color: var(--fg3); }
.meta dd { margin: 0; color: var(--fg); }
@media (max-width: 480px) { .meta div { grid-template-columns: 1fr; gap: 2px; } }

.ph-inline {
  padding: 1px 6px;
  border: 1px dashed var(--line2);
  border-radius: 6px;
  color: var(--fg2);
  font-size: 0.95em;
}

.ph {
  display: block;
  padding: 12px 14px;
  border-left: 2px solid var(--line2);
  background: var(--mod);
  color: var(--fg3);
  font-size: 15px;
  border-radius: 0 8px 8px 0;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.foot {
  margin-top: clamp(80px, 10vw, 128px);
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--fg3);
  font-size: 14px;
  line-height: 22px;
}
.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 8px;
  color: var(--fg2);
  text-decoration: none;
}
.foot-links a:hover { color: var(--fg); }
.foot p { margin: 0 0 10px; max-width: 820px; }

/* ── Motion ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
