/* ─────────────────────────────────────────────
   NyleRP — Design System (flat, no glow, Montserrat)
   ───────────────────────────────────────────── */
:root {
  --bg: #050505;
  --bg-1: #0a0a0a;
  --bg-2: #131313;
  --bg-3: #1c1c1c;
  --border: #232323;
  --border-strong: #2e2e2e;
  --text: #f5f5f5;
  --text-2: #c9c9c9;
  --muted: #767676;
  --accent: #ff6b35;
  --accent-2: #ffb800;
  --accent-green: #34d399;
  --accent-green-2: #6ee7b7;

  --easing: cubic-bezier(0.16, 1, 0.3, 1);
  --easing-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-roll: cubic-bezier(0.65, 0, 0.35, 1);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", -apple-system, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overflow-x: visible; }
img, svg { max-width: 100%; display: block; }
.mono { font-family: "Montserrat", monospace; font-weight: 600; font-size: 0.95em; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ─── Nav ─── */
nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  background: rgba(5, 5, 5, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
nav.top.scrolled { border-bottom-color: var(--border); background: rgba(5, 5, 5, 0.85); }
nav.top .row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
nav.top .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
nav.top .brand-logo { width: 30px; height: 26px; color: var(--text); }
nav.top .brand-name { font-weight: 800; letter-spacing: 0.06em; font-size: 17px; }
nav.top ul { list-style: none; display: flex; gap: 4px; align-items: center; }
nav.top ul a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px; transition: color 0.2s, background 0.2s; display: inline-flex; align-items: center; gap: 7px; }
nav.top ul a:hover { color: var(--text); background: var(--bg-3); }
nav.top ul a.cta { background: var(--accent); color: #1a0c00; font-weight: 700; padding: 9px 18px; }
nav.top ul a.cta:hover { background: var(--accent-2); color: #1a0c00; }
nav.top ul a .nav-icon { width: 14px; height: 14px; }
@media (max-width: 720px) {
  nav.top ul li:not(.cta-li) { display: none; }
}

/* ─── Hero ─── */
.hero { padding: 120px 0 100px; position: relative; }
.hero-grid { display: grid; gap: 60px; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.2fr 1fr; gap: 80px; } }

.hero h1 {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lead { font-size: 18px; color: var(--text-2); margin-bottom: 36px; max-width: 540px; font-weight: 500; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-logo-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}
.hero-logo {
  width: 78%;
  height: auto;
  color: #fff;
}

/* ─── Buttons ─── */
.btn {
  --btn-bg: var(--bg-2);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  font: inherit;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--easing), border-color 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn:active { transform: translateY(0); }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: #ffffff;
  --btn-border: transparent;
  font-weight: 700;
}
.btn--primary:hover { background: #e85a26; border-color: transparent; color: #ffffff; }

.btn--download {
  --btn-bg: var(--accent-green);
  --btn-fg: #ffffff;
  --btn-border: transparent;
  font-weight: 700;
}
.btn--download:hover { background: #10b981; border-color: transparent; color: #ffffff; }
.btn--download .download-icon { width: 18px; height: 18px; flex-shrink: 0; }

.btn--lg { padding: 18px 36px; font-size: 15px; }

/* ─── Roll text effect ─── */
.roll {
  display: inline-flex;
  height: 1em;
  line-height: 1em;
  overflow: hidden;
  vertical-align: bottom;
}
.roll__inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.7s var(--easing-roll);
  will-change: transform;
}
.roll__inner > span {
  display: block;
  height: 1em;
  line-height: 1em;
  flex: 0 0 1em;
  white-space: nowrap;
  transition: transform 0.7s var(--easing-roll);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
.roll__inner > span:nth-child(1) { transform: skewY(0deg); }
.roll__inner > span:nth-child(2) {
  margin-top: 1.4em;
  transform: skewY(12deg);
}
.btn:hover .roll__inner { transform: translateY(calc(-100% - 1.4em)); }
.btn:hover .roll__inner > span:nth-child(1) { transform: skewY(-12deg); }
.btn:hover .roll__inner > span:nth-child(2) { transform: skewY(0deg); }

/* ─── Sections ─── */
section.block { padding: 80px 0; position: relative; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: var(--accent); padding: 6px 12px; border: 1px solid var(--accent); border-radius: 999px; margin-bottom: 18px; text-transform: uppercase; }
h2.section-title { font-size: clamp(32px, 5vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; max-width: 720px; margin-bottom: 16px; color: var(--text); }
p.section-lead { font-size: 17px; color: var(--text-2); max-width: 600px; margin-bottom: 48px; font-weight: 500; }

/* ─── Launcher panel ─── */
.launcher-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 880px) { .launcher-panel { grid-template-columns: 1.3fr 1fr; padding: 64px; } }
.launcher-panel h3 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 14px; color: var(--text); }
.launcher-panel p { color: var(--text-2); font-size: 16px; margin-bottom: 28px; max-width: 520px; font-weight: 500; }
.launcher-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; padding: 0; }
.launcher-features li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.launcher-features li::before { content: "✓"; color: var(--accent-green); font-weight: 800; flex-shrink: 0; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; background: rgba(52, 211, 153, 0.1); border-radius: 6px; font-size: 12px; }
.launcher-mockup {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  aspect-ratio: 16 / 10;
  background: var(--bg-3);
}
.launcher-mockup img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Download page (OS choice) ─── */
.os-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 920px; margin: 32px auto 0; }
@media (min-width: 720px) { .os-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.os-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition: border-color 0.3s, transform 0.3s var(--easing), background 0.3s;
}
.os-card:not(.disabled):hover { border-color: var(--accent-green); transform: translateY(-6px); background: var(--bg-3); }
.os-card .os-icon { width: 56px; height: 56px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.os-card .os-icon svg { width: 100%; height: 100%; }
.os-card h3 { font-size: 22px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.02em; }
.os-card .os-version { display: block; font-size: 12px; color: var(--muted); margin-bottom: 22px; letter-spacing: 0.04em; font-weight: 600; }
.os-card .os-cta { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; background: var(--accent-green); color: #ffffff; border-radius: 10px; font-weight: 800; font-size: 13px; letter-spacing: 0.06em; transition: background 0.2s; }
.os-card .os-cta .download-icon { width: 14px; height: 14px; flex-shrink: 0; }
.os-card:not(.disabled):hover .os-cta { background: #10b981; }
.os-card.disabled { opacity: 0.4; cursor: not-allowed; }
.os-card.disabled .os-cta { background: var(--bg-3); color: var(--muted); border: 1px solid var(--border); }

/* ─── Tutorial (CapCut-style steps) ─── */
/* Generous horizontal padding so the giant italic step numbers (right:-10px + italic overhang ~30px)
   never get clipped by the viewport edge, regardless of screen width. */
.tuto-shell { padding: 48px max(56px, 6vw) 100px; }
.tuto-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.tuto-head h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 16px; color: var(--text); }
.tuto-head p { color: var(--text-2); font-size: 16px; font-weight: 500; }
.tuto-head a { color: var(--accent); text-decoration: none; font-weight: 700; }
.tuto-head a:hover { text-decoration: underline; }

.tuto-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 80px;
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  overflow: visible;
}
@media (min-width: 720px) { .tuto-steps { grid-template-columns: 1fr 1fr; gap: 90px; } }
.tuto-step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px 28px;
  position: relative; /* needed so step-number positions inside */
  /* No z-index here so step-number can rise above sibling cards */
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
/* Step number is now an inline SVG — its glyph rendering happens inside its own
   SVG coordinate system, which is immune to weird CSS clipping bugs that affected
   absolutely-positioned italic text on some browsers. The SVG box itself sits
   inside the card; the glyph fades out at the bottom via a linearGradient. */
.tuto-step .step-number-svg {
  position: absolute;
  top: -78px;
  right: -46px;
  width: 200px;
  height: 220px;
  pointer-events: none;
  z-index: 20;
  overflow: visible;
}
.tuto-step h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; color: var(--text); }
.tuto-step .step-desc { color: var(--text-2); font-size: 15px; margin-bottom: auto; max-width: 320px; font-weight: 500; }
.tuto-step .step-visual {
  margin-top: 28px;
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px; font-weight: 600; }
.file-chip .file-icon { width: 18px; height: 18px; opacity: 0.8; }

/* ─── Footer ─── */
footer.site { padding: 60px 0 40px; border-top: 1px solid var(--border); margin-top: 80px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 500; }
footer.site .build-stamp { color: var(--muted); font-size: 11px; margin-top: 8px; opacity: 0.5; }

/* ─── Scroll reveal ─── */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--easing), transform 0.9s var(--easing);
  transition-delay: var(--delay, 0s);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--easing), transform 0.7s var(--easing);
}
[data-reveal-stagger].in-view > * { opacity: 1; transform: translateY(0); }
[data-reveal-stagger].in-view > *:nth-child(1) { transition-delay: 0s; }
[data-reveal-stagger].in-view > *:nth-child(2) { transition-delay: 0.08s; }
[data-reveal-stagger].in-view > *:nth-child(3) { transition-delay: 0.16s; }
[data-reveal-stagger].in-view > *:nth-child(4) { transition-delay: 0.24s; }
[data-reveal-stagger].in-view > *:nth-child(5) { transition-delay: 0.32s; }
[data-reveal-stagger].in-view > *:nth-child(6) { transition-delay: 0.40s; }

/* Hero entrance */
.hero h1 { animation: heroIn 1.1s var(--easing) 0.1s both; }
.hero p.lead { animation: heroIn 1.1s var(--easing) 0.25s both; }
.hero-cta { animation: heroIn 1.1s var(--easing) 0.4s both; }
.hero-logo-wrap { animation: heroLogoIn 1.2s var(--easing) 0s both; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroLogoIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
