/* ============================================================
   Lbby Website — Complete Stylesheet
   Design tokens aligned with R Studio (rstudio.live)
   Monochrome: black, white, grey, silver only
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 100px;
  --max-w: 1040px;
  --nav-h: 56px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur-normal: 0.3s;
  --dur-slow: 0.6s;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-soft: #050505;
  --surface: #0a0a0a;
  --surface-soft: #111111;
  --text: #f5f5f5;
  --text-muted: #b3b3b3;
  --text-faint: #7a7a7a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(192, 192, 192, 0.30);
  --accent-silver: #c0c0c0;
  --accent-silver-soft: #9a9a9a;
  --glow: rgba(192, 192, 192, 0.10);
  --btn-primary-bg: #f5f5f5;
  --btn-primary-text: #000000;
  --btn-secondary-border: rgba(255, 255, 255, 0.20);
  --btn-secondary-text: #f5f5f5;
}

[data-theme="light"] {
  --bg: #f7f7f7;
  --bg-soft: #efefef;
  --surface: rgba(255, 255, 255, 0.70);
  --surface-soft: rgba(255, 255, 255, 0.88);
  --text: #111111;
  --text-muted: #555555;
  --text-faint: #808080;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(160, 160, 160, 0.34);
  --accent-silver: #b8b8b8;
  --accent-silver-soft: #8f8f8f;
  --glow: rgba(160, 160, 160, 0.10);
  --btn-primary-bg: #111111;
  --btn-primary-text: #ffffff;
  --btn-secondary-border: rgba(0, 0, 0, 0.20);
  --btn-secondary-text: #111111;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color var(--dur-normal) var(--ease), color var(--dur-normal) var(--ease);
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

/* ── Typography ────────────────────────────────────────────── */
.hero__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero__headline {
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
  color: var(--text);
}

.hero__sub {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-muted);
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}

.body-text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-normal) var(--ease), border-color var(--dur-normal) var(--ease);
}

.nav.scrolled {
  background: var(--bg);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.nav__logo img { border-radius: 4px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.nav__link:hover { color: var(--text); }

.nav__link--brand {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.5px;
}

.nav__toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast) var(--ease);
}

.theme-toggle:hover { background: var(--border); }

.theme-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Language Toggle */
.lang-toggle {
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-faint);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.lang-toggle:hover { color: var(--text-muted); background: var(--border); }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  gap: 5px;
  border-radius: var(--radius-sm);
}

.nav__hamburger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text-muted);
  transition: transform var(--dur-normal) var(--ease), opacity var(--dur-fast) var(--ease);
}

.nav__hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile Dropdown */
.nav__dropdown {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  z-index: 999;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--dur-normal) var(--ease), transform var(--dur-normal) var(--ease);
  pointer-events: none;
}

.nav__dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav__dropdown a {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--dur-fast) var(--ease);
}

.nav__dropdown a:hover { color: var(--text); }

.nav__dropdown-toggles {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

@media (max-width: 768px) {
  .nav__links, .nav__toggles .nav__link--brand { display: none; }
  .nav__hamburger { display: flex; }
  .nav__dropdown { display: block; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn--primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn--secondary {
  background: transparent;
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
}

.btn--secondary:hover { background: var(--border); transform: translateY(-1px); }

/* ── Section Layout ────────────────────────────────────────── */
.section {
  padding: 100px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section__header {
  text-align: center;
  margin-bottom: 64px;
}

.section__header .body-text {
  max-width: 520px;
  margin: 0 auto;
}

/* ── Reveal Animation ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 24px;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
}

.hero__eyebrow { margin-bottom: 20px; }

.hero__headline { margin-bottom: 20px; }

.hero__sub {
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero__buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-faint);
}

.hero__meta-divider { opacity: 0.4; }

.hero__strip {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  opacity: 0.3;
  white-space: nowrap;
  overflow: hidden;
}

@media (max-width: 768px) {
  .hero__headline { letter-spacing: -1px; }
  .hero__sub { font-size: 16px; }
  .hero__meta { font-size: 11px; }
  .hero__strip { display: none; }
}

/* ── Supported Games ───────────────────────────────────────── */
.games__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.game-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color var(--dur-normal) var(--ease);
}

.game-card:hover { border-color: var(--border-strong); }

.game-card--upcoming { opacity: 0.65; }

.game-card__index {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-faint);
  opacity: 0.3;
  margin-bottom: 16px;
  line-height: 1;
}

.game-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.game-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.game-card__status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.game-card__status--available {
  color: var(--accent-silver);
  border: 1px solid var(--accent-silver);
}

.game-card__status--coming {
  color: var(--text-faint);
  border: 1px dashed var(--text-faint);
}

.game-card__desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.game-card__features li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0 6px 16px;
  position: relative;
}

.game-card__features li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent-silver);
}

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

/* ── Dashboard / Showcase ──────────────────────────────────── */
.showcase__image {
  margin-bottom: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.showcase__image img {
  width: 100%;
  display: block;
}

.showcase__bullets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.showcase__bullet {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0 8px 16px;
  position: relative;
}

.showcase__bullet::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent-silver);
}

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

/* ── Features ──────────────────────────────────────────────── */
.features__list { max-width: 720px; margin: 0 auto; }

.feature-row {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.feature-row:first-child { border-top: 1px solid var(--border); }

.feature-row__index {
  font-size: 12px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-faint);
  min-width: 24px;
  padding-top: 2px;
}

.feature-row__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.feature-row__desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .feature-row { flex-direction: column; gap: 8px; }
}

/* ── Screenshots ───────────────────────────────────────────── */
.screenshots__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.screenshot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--dur-normal) var(--ease);
}

.screenshot-card:hover { border-color: var(--border-strong); }

.screenshot-card__index {
  font-size: 11px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.screenshot-card img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.screenshot-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.screenshot-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

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

/* ── Download ──────────────────────────────────────────────── */
.download__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.download-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--dur-normal) var(--ease);
}

.download-card:hover { border-color: var(--border-strong); }

.download-card__platform {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.download-card__ext {
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-muted);
}

.download-card__size {
  font-size: 12px;
  color: var(--text-faint);
}

.download-card__btn {
  margin-top: auto;
  padding-top: 16px;
}

.download__footer {
  text-align: center;
}

.download__gh-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}

.download__gh-link:hover { color: var(--text); }

.download__beta {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 2px solid var(--border-strong);
  text-align: left;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

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

/* ── Docs ──────────────────────────────────────────────────── */
.docs__content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}

.docs__sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.docs__nav-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  padding: 8px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.docs__nav-link:hover { color: var(--text-muted); }

.docs__nav-link.active {
  color: var(--text);
  border-left-color: var(--accent-silver);
}

.docs__section {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.docs__section:first-child { padding-top: 0; }
.docs__section:last-child { border-bottom: none; }

.docs__section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.docs__steps {
  counter-reset: step;
  padding-left: 0;
}

.docs__steps li {
  counter-increment: step;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 8px 0 8px 36px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.docs__steps li:last-child { border-bottom: none; }

.docs__steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-faint);
  padding-top: 2px;
}

.docs__summary {
  margin-top: 16px;
}

.docs__summary code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  background: var(--surface-soft);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: inline-block;
}

.docs__list li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 6px 0 6px 16px;
  position: relative;
}

.docs__list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent-silver);
}

@media (max-width: 768px) {
  .docs__content { grid-template-columns: 1fr; }
  .docs__sidebar {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .docs__nav-link {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
  }
  .docs__nav-link.active { border-bottom-color: var(--accent-silver); border-left-color: transparent; }
}

/* ── Changelog ─────────────────────────────────────────────── */
.changelog__list { max-width: 640px; margin: 0 auto; }

.changelog-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.changelog-item:first-child { border-top: 1px solid var(--border); }

.changelog-item__header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.changelog-item__version {
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text);
}

.changelog-item__date {
  font-size: 12px;
  color: var(--text-faint);
}

.changelog-item__body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.changelog__footer {
  text-align: center;
  margin-top: 32px;
}

.changelog__footer a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.changelog__footer a:hover { color: var(--text); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 40px;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.footer__brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.footer__by {
  font-size: 13px;
  color: var(--text-faint);
}

.footer__by a { text-decoration: underline; text-underline-offset: 2px; }
.footer__by a:hover { color: var(--text-muted); }

.footer__links {
  display: flex;
  gap: 20px;
}

.footer__links a {
  font-size: 13px;
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease);
}

.footer__links a:hover { color: var(--text); }

.footer__copy {
  font-size: 12px;
  color: var(--text-faint);
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .footer__inner { flex-direction: column; align-items: center; text-align: center; }
}
