/* RiftPlayer landing — dark, minimal, hairlines over gradients. */

:root {
  --bg: #09090b;
  --surface: #101013;
  --surface-2: #16161a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --muted: #9d9da8;
  --faint: #6b6b76;
  --accent: #6d5cff;
  --accent-soft: rgba(109, 92, 255, 0.14);
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: 0.92em; }

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.12; margin: 0; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}

/* ---- nav ---- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.nav-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; color: var(--accent); }
.brand-name { font-size: 16px; letter-spacing: -0.02em; }
.brand-name b { font-weight: 700; }
.brand-name { color: var(--muted); font-weight: 400; }
.brand-name b { color: var(--text); }

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }

/* ---- hero ---- */

.hero {
  padding: 168px 0 96px;
  background:
    radial-gradient(640px 320px at 50% -40px, rgba(109, 92, 255, 0.16), transparent 70%),
    var(--bg);
}

.hero h1 { font-size: clamp(36px, 5.4vw, 58px); font-weight: 750; }
.hero h1 em { font-style: normal; color: var(--accent); }

.hero-sub {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---- url cards ---- */

.url-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 44px;
}

.url-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.url-card:hover { border-color: var(--line-2); transform: translateY(-2px); }

.u-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.u-url {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u-hint { margin: 6px 0 0; font-size: 13px; color: var(--faint); min-height: 1.4em; }
.u-hint em { color: var(--muted); font-style: normal; font-weight: 550; }

.u-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---- buttons / inputs ---- */

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.24); }
.btn:active { transform: scale(0.97); }

.btn-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-solid:hover { background: #7c6cff; border-color: #7c6cff; }

input, select {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder { color: var(--faint); }

input[type="color"] {
  padding: 2px;
  width: 40px;
  height: 38px;
  flex: none;
  cursor: pointer;
  border-radius: 10px;
}

/* ---- preview frame ---- */

.preview {
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.preview.sm { margin-top: 18px; border-radius: 14px; }

/* ---- sections ---- */

section { padding: 88px 0 8px; scroll-margin-top: 70px; }

.sec-head { max-width: 640px; }
.sec-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; }
.sec-sub { margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }

/* ---- continue watching ---- */

.hist {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}

.p-hist {
  position: relative;
  flex: none;
  width: 172px;
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: 14px;
}

.p-hist img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: block;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.p-hist:hover img { border-color: var(--line-2); transform: translateY(-3px); }

.p-hist .resume {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 650;
  color: #fff;
}

.p-hist .rm {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 8px;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #bbb;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.p-hist:hover .rm { opacity: 1; }
.p-hist .rm:hover { color: #fff; }

.p-hist .t {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-hist .s { font-size: 12px; color: var(--faint); margin-top: 1px; }

.p-hist .prog {
  margin-top: 8px;
  height: 3px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.p-hist .prog i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.p-hist-empty {
  padding: 28px 0;
  color: var(--faint);
  font-size: 14px;
}

/* ---- playground ---- */

.pg {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 40px;
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}

.pg-form { display: grid; gap: 16px; align-content: start; }

.f { display: grid; gap: 7px; }
.f > span {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.color-in { display: flex; gap: 8px; }
.color-in input:not([type="color"]) { font-family: var(--mono); text-transform: uppercase; }

.switches > span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin-bottom: 9px;
}

.sw-group { display: flex; gap: 18px; flex-wrap: wrap; }

.sw {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.sw input { position: absolute; opacity: 0; pointer-events: none; }

.sw i {
  width: 36px; height: 21px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
  flex: none;
}

.sw i::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 15px; height: 15px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.18s ease;
}

.sw input:checked + i { background: var(--accent); border-color: var(--accent); }
.sw input:checked + i::after { transform: translateX(15px); }
.sw input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  width: max-content;
}

.seg button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button.on { background: var(--accent); color: #fff; }
.seg button:not(.on):hover { color: var(--text); }

.pg-out { display: flex; flex-direction: column; min-width: 0; }

.pg-url {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  word-break: break-all;
}

.pg-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---- docs ---- */

.code-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.code {
  position: relative;
  margin: 0;
  background: #0d0d10;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.code figcaption {
  padding: 12px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}

.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: #c9c9d4;
}

.copy-chip {
  position: absolute;
  top: 8px; right: 10px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: rgba(9, 9, 11, 0.8);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.copy-chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }

.tbl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 40px;
}

.tbl-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 12px;
}

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.tbl td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

.tbl td:first-child { color: var(--text); width: 46%; padding-right: 14px; }

.tbl code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-soft);
  color: #cfc8ff;
  padding: 1.5px 6px;
  border-radius: 6px;
}

/* ---- footer ---- */

footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
}

footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--faint);
}

footer b { color: var(--muted); font-weight: 650; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---- responsive ---- */

@media (max-width: 860px) {
  .hero { padding: 132px 0 72px; }
  .url-grid, .code-grid, .tbl-grid { grid-template-columns: 1fr; }
  .pg { grid-template-columns: 1fr; padding: 20px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12.5px; }
}

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