:root {
  --bg: #050302;
  --bg-warm: #100a07;
  --panel: #0c0c0c;
  --panel-soft: #121212;
  --text: #f4f4f4;
  --muted: #b0b0b0;
  --accent: #ff7301;
  --accent-bright: #ff9a4d;
  --accent-soft: rgba(255, 115, 1, 0.22);
  --ember: #b8320a;
  --line: rgba(255, 115, 1, 0.45);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-smooth: 0.45s var(--ease-out);
  --transition-reveal: 0.85s var(--ease-out);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Ambient background (ChatAmbience-inspired) ── */

.bg-base {
  position: fixed;
  inset: 0;
  z-index: -4;
  background: linear-gradient(
    180deg,
    #100a07 0%,
    #18100c 32%,
    #0c0806 68%,
    #050302 100%
  );
}

.bg-base::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 115, 1, 0.14) 0%,
    rgba(255, 115, 1, 0.02) 28%,
    rgba(184, 50, 10, 0.08) 55%,
    transparent 100%
  );
}

.bg-base::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    transparent 42%,
    rgba(0, 0, 0, 0.52) 100%
  );
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -3;
  opacity: 0.7;
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -21deg,
    transparent 0,
    transparent 26px,
    rgba(255, 115, 1, 0.04) 27px,
    rgba(255, 115, 1, 0.04) 28px
  );
}

#sparksCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  opacity: 0.85;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  pointer-events: none;
  z-index: -2;
}

.bg-glow-top {
  width: 640px;
  height: 640px;
  top: -220px;
  right: -180px;
  background: rgba(255, 154, 77, 0.2);
  animation: glow-drift-a 14s ease-in-out infinite alternate;
}

.bg-glow-bottom {
  width: 720px;
  height: 720px;
  left: -200px;
  bottom: -280px;
  background: radial-gradient(
    circle,
    rgba(255, 115, 1, 0.24) 0%,
    rgba(184, 50, 10, 0.12) 45%,
    transparent 70%
  );
  animation: glow-drift-b 18s ease-in-out infinite alternate;
}

.bg-glow-center {
  width: 480px;
  height: 480px;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  background: rgba(255, 154, 77, 0.06);
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-drift-a {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-40px, 30px) scale(1.08); }
}

@keyframes glow-drift-b {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, -25px) scale(1.06); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
}

/* ── Layout ── */

.topbar,
main,
.footer {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow:
    0 0 0 1px rgba(255, 115, 1, 0.25),
    0 12px 30px rgba(0, 0, 0, 0.45);
  transition:
    padding var(--transition-smooth),
    border-radius var(--transition-smooth),
    background var(--transition-smooth),
    box-shadow var(--transition-smooth),
    transform var(--transition-smooth);
}

.topbar.is-scrolled {
  top: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: rgba(6, 6, 6, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 115, 1, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 115, 1, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  color: #111;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 0 20px rgba(255, 115, 1, 0.35);
  animation: brand-pulse 3s ease-in-out infinite;
}

@keyframes brand-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 115, 1, 0.3); }
  50% { box-shadow: 0 0 28px rgba(255, 115, 1, 0.55); }
}

.brand-text {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
}

.menu {
  display: flex;
  gap: 0.35rem;
}

.menu a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.88;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition:
    color var(--transition-fast),
    opacity var(--transition-fast),
    background var(--transition-fast),
    text-shadow var(--transition-fast);
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.menu a:hover,
.menu a.is-active {
  color: var(--accent-bright);
  opacity: 1;
  text-shadow: 0 0 16px rgba(255, 115, 1, 0.35);
}

.menu a:hover::after,
.menu a.is-active::after {
  transform: scaleX(1);
}

main {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
}

/* ── Hero ── */

.hero {
  padding: 0.25rem 0 0.5rem;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
  align-items: center;
}

.hero-content {
  display: grid;
  gap: 0.65rem;
  align-self: center;
  min-width: 0;
}

.hero-content h1 {
  max-width: 100%;
  font-size: clamp(2rem, 4.2vw, 4.2rem);
}

.hero-copy {
  max-width: 100%;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.5;
}

.hero-aside {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  width: min(280px, 42vw);
  align-self: center;
}

.hero-phone {
  width: 100%;
}

.hero-phone .device-showcase {
  width: 100%;
}

.hero-screen-meta {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  width: 100%;
}

.hero-screen-meta .screen-dots {
  margin-top: 0;
}

.hero-screen-caption {
  font-size: 0.82rem;
  text-align: center;
  min-height: auto;
  max-width: 100%;
  line-height: 1.45;
}

.hero-screen-meta .screen-dot {
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
}

.device-hero {
  width: 100%;
}

.eyebrow {
  display: inline-block;
  width: fit-content;
  margin: 0;
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--accent-bright);
  background: var(--accent-soft);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  animation: eyebrow-glow 4s ease-in-out infinite;
}

@keyframes eyebrow-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 115, 1, 0); }
  50% { box-shadow: 0 0 18px rgba(255, 115, 1, 0.18); }
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.2rem, 8vw, 5.6rem);
  letter-spacing: 0.02em;
  max-width: 12ch;
  text-wrap: balance;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    #fff 0%,
    #ffe0c2 35%,
    var(--accent-bright) 70%,
    var(--accent) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 24px rgba(255, 115, 1, 0.25));
}

h2 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  color: var(--accent);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0;
  color: #e1e1e1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.35rem;
}

/* ── Buttons ── */

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  padding: 0.72rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.25s ease,
    filter 0.25s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.65s var(--ease-out);
  pointer-events: none;
}

.btn:hover::before {
  transform: translateX(120%);
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-expand 0.65s var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes ripple-expand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent-bright), var(--accent) 55%, #e06500);
  color: #121212;
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(255, 115, 1, 0.4),
    0 10px 28px rgba(255, 115, 1, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(255, 115, 1, 0.55),
    0 16px 36px rgba(255, 115, 1, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.06);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
  transition-duration: 0.1s;
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 115, 1, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 115, 1, 0.15);
}

.btn-ghost:hover {
  background: rgba(255, 115, 1, 0.16);
  border-color: rgba(255, 115, 1, 0.55);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 115, 1, 0.3),
    0 8px 24px rgba(255, 115, 1, 0.12);
}

.btn-ghost:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.btn[aria-disabled="true"] {
  cursor: not-allowed;
}

/* ── Sections ── */

.block,
.download {
  background: linear-gradient(160deg, rgba(12, 12, 12, 0.95), rgba(11, 11, 11, 0.88));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(0.85rem, 2.5vw, 1.35rem);
  box-shadow:
    0 0 0 1px rgba(255, 115, 1, 0.12),
    inset 0 0 60px rgba(255, 115, 1, 0.04);
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-color var(--transition-smooth);
}

.block:hover,
.download:hover {
  border-color: rgba(255, 115, 1, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 115, 1, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 60px rgba(255, 115, 1, 0.06);
}

.block p {
  margin-top: 0.4rem;
  max-width: 65ch;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.card {
  background: var(--panel-soft);
  border: 1px solid rgba(255, 115, 1, 0.34);
  border-radius: 10px;
  padding: 0.9rem;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-color var(--transition-smooth);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #ff8a2a, #ff7301 60%, #a34700);
  transition: width 0.35s var(--ease-out);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 115, 1, 0.12) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 115, 1, 0.6);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 115, 1, 0.1);
}

.card:hover::before {
  width: 8px;
}

.card:hover::after {
  opacity: 1;
}

.card p {
  margin-top: 0.45rem;
  color: var(--muted);
}

/* ── Device showcase ── */

.device-showcase {
  display: flex;
  justify-content: center;
}

.device-wrap {
  position: relative;
  perspective: 900px;
}

.device {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 320 / 660;
  animation: phone-float 5s ease-in-out infinite;
}

.screen-caption {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 100%;
  min-height: 3.2em;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.screen-caption.is-changing {
  opacity: 0;
  transform: translateY(6px);
}

.screen-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.screen-dot {
  border: 1px solid rgba(255, 115, 1, 0.35);
  background: rgba(255, 115, 1, 0.08);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.3s var(--ease-out),
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s var(--ease-spring);
}

.screen-dot:hover {
  color: var(--text);
  border-color: rgba(255, 115, 1, 0.55);
  transform: translateY(-1px);
}

.screen-dot.is-active {
  background: rgba(255, 115, 1, 0.22);
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: 0 0 18px rgba(255, 115, 1, 0.15);
}

.device-wrap:hover .device {
  animation-play-state: paused;
}

.device-wrap:hover .device-glow {
  opacity: 0.85;
}

.device-screen {
  position: absolute;
  left: 5.625%;
  top: 7.879%;
  width: 88.75%;
  height: 87.879%;
  border-radius: 9%;
  overflow: hidden;
  background: #050505;
}

.screen-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.screen-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
  pointer-events: none;
}

.screen-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 1;
}

.screen-slide.is-exiting {
  opacity: 0;
  transform: scale(0.98);
  z-index: 0;
}

.screen-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.device-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.device-glow {
  position: absolute;
  inset: 10% -15%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 115, 1, 0.22) 0%,
    transparent 65%
  );
  z-index: -1;
  opacity: 0.75;
  transition: opacity 0.45s ease, transform 0.45s var(--ease-out);
  pointer-events: none;
}

@keyframes phone-float {
  0%, 100% { transform: translateY(0) rotateY(-4deg) rotateX(2deg); }
  50% { transform: translateY(-12px) rotateY(4deg) rotateX(-1deg); }
}

/* ── How to start ── */

.how-section {
  display: grid;
  gap: 0.75rem;
}

.how-section > h2 {
  margin-bottom: 0;
}

/* ── Timeline ── */

.timeline {
  display: grid;
  gap: 0.6rem;
}

.step {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid rgba(255, 115, 1, 0.24);
  border-radius: 10px;
  background: rgba(15, 15, 15, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 115, 1, 0.1);
  transition:
    transform var(--transition-smooth),
    border-color var(--transition-smooth),
    box-shadow var(--transition-smooth);
}

.step:hover {
  transform: translateX(6px);
  border-color: rgba(255, 115, 1, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255, 115, 1, 0.18),
    0 8px 28px rgba(0, 0, 0, 0.3);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 8px;
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: 0.06em;
  font-size: 1.45rem;
  background: rgba(255, 115, 1, 0.1);
  border: 1px solid var(--line);
  color: var(--accent);
  transition: background 0.3s ease, transform 0.35s var(--ease-spring);
}

.step:hover .step-num {
  background: rgba(255, 115, 1, 0.2);
  transform: scale(1.06);
}

.step p {
  margin-top: 0.3rem;
  color: var(--muted);
}

/* ── Download ── */

.download {
  text-align: center;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
}

.btn-lg {
  width: min(360px, 100%);
  padding: 0.9rem 1.2rem;
  font-size: 1.05rem;
}

.download-hint {
  color: #b4b4b4;
  max-width: 68ch;
  font-size: 0.92rem;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
  color: #ff9b50;
}

.footer {
  border-top: 1px solid rgba(255, 115, 1, 0.2);
  margin-top: 0.5rem;
  padding: 1rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9d9d9d;
}

/* ── Scroll reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--transition-reveal),
    transform var(--transition-reveal);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.hero.reveal {
  transform: translateY(20px) scale(0.985);
}

.hero.reveal.in-view {
  transform: translateY(0) scale(1);
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  #sparksCanvas {
    display: none;
  }
}

@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .topbar {
    border-radius: 14px;
    padding: 0.9rem;
  }

  .menu {
    display: none;
  }

  .hero-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero-content {
    justify-items: center;
  }

  .hero-content h1 {
    max-width: 100%;
  }

  .hero-aside {
    width: min(260px, 72vw);
  }
}

@media (max-width: 620px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .step {
    grid-template-columns: 1fr;
  }

  .step:hover {
    transform: translateY(-2px);
  }
}
