/* DownSide landing — monochromatic synthwave (shared AltaForma aesthetic) */

:root {
  --bg-deep: #060608;
  --bg: #0a0a0e;
  --bg-raised: #111116;
  --bg-card: rgba(18, 18, 24, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.18);
  --text: #e8e8ec;
  --text-muted: #8a8a96;
  --text-dim: #5c5c68;
  --accent: #ffffff;
  --glow: rgba(255, 255, 255, 0.06);
  --glow-strong: rgba(255, 255, 255, 0.14);
  --grid-line: rgba(255, 255, 255, 0.04);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --section-pad: clamp(4rem, 10vw, 7rem);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.4;
}

.title, .subtitle, .content, .navbar, .footer {
  font-family: var(--font);
}

/* ── Nav ── */
.downside-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.75rem 0;
  background: rgba(6, 6, 8, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease-out);
}

.downside-nav.is-scrolled {
  background: rgba(6, 6, 8, 0.92);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.nav-brand span {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
}

.badge-soon::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow-strong);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

@media (max-width: 768px) {
  .nav-links a:not(.badge-soon) { display: none; }
}

/* ── Hero ── */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  perspective: 400px;
  overflow: hidden;
  pointer-events: none;
}

.hero-grid-floor {
  position: absolute;
  bottom: -20%;
  left: -50%;
  width: 200%;
  height: 70%;
  background:
    linear-gradient(to bottom, transparent 0%, var(--bg) 85%),
    repeating-linear-gradient(
      90deg,
      var(--grid-line) 0px,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 60px
    ),
    repeating-linear-gradient(
      0deg,
      var(--grid-line) 0px,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 60px
    );
  transform: rotateX(72deg);
  transform-origin: center bottom;
  animation: grid-drift 24s linear infinite;
  mask-image: linear-gradient(to top, black 30%, transparent 100%);
}

.hero-grid-horizon {
  position: absolute;
  bottom: 28%;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
  box-shadow: 0 0 40px var(--glow-strong), 0 0 80px var(--glow);
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 0 0, 60px 0, 0 60px; }
}

.hero-glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 90vw);
  height: 400px;
  background: radial-gradient(ellipse, var(--glow-strong) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-breathe 6s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.hero-icon-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 2rem;
}

.hero-icon-wrap img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 1px var(--border-bright),
    0 24px 48px rgba(0, 0, 0, 0.5),
    0 0 60px var(--glow);
}

.hero-icon-ring {
  position: absolute;
  inset: -12px;
  border: 1px solid var(--border);
  border-radius: 28px;
  animation: ring-rotate 12s linear infinite;
}

.hero-icon-ring::before {
  content: "";
  position: absolute;
  top: -1px; left: 50%;
  width: 8px; height: 8px;
  margin-left: -4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--glow-strong);
}

@keyframes ring-rotate {
  to { transform: rotate(360deg); }
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  max-width: 14ch;
}

.hero-title .line-accent {
  display: block;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.btn-appstore {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.35rem 0.65rem 1rem;
  background: var(--text);
  color: var(--bg-deep);
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.btn-appstore:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.12);
}

.btn-appstore svg { flex-shrink: 0; }

.btn-appstore-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.btn-appstore-text small {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.btn-appstore-text strong {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-appstore-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  backdrop-filter: blur(1px);
}

.hero-meta {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-meta dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.hero-meta dd {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Sections ── */
.section-block {
  padding: var(--section-pad) 1.5rem;
  position: relative;
}

.section-block.alt {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.container-narrow {
  max-width: 1120px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  max-width: 22ch;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: 3rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-grid-floor, .hero-glow, .hero-icon-ring, .badge-soon::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── Feature cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}

.feature-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  color: var(--text);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

/* ── Philosophy panel ── */
.philosophy-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

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

.markdown-sample {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text-muted);
  overflow-x: auto;
}

.markdown-sample .h1 {
  display: block;
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  border-bottom: 2px solid var(--border-bright);
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
}

.markdown-sample .h2 {
  display: block;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
  margin: 1rem 0 0.5rem;
}

.markdown-sample .cm { color: var(--text-dim); }
.markdown-sample .ln { color: rgba(255,255,255,0.2); user-select: none; }

.philosophy-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.philosophy-stat {
  text-align: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.philosophy-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.philosophy-stat span {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Screenshot placeholders ── */
.showcase-grid {
  display: grid;
  gap: 2.5rem;
}

.showcase-item {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: center;
}

.showcase-item:nth-child(even) {
  direction: rtl;
}

.showcase-item:nth-child(even) > * {
  direction: ltr;
}

@media (max-width: 900px) {
  .showcase-item,
  .showcase-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }
}

.showcase-copy h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.showcase-copy p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.mock-window {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 32px 64px rgba(0, 0, 0, 0.45);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s;
}

.mock-window:hover {
  transform: perspective(800px) rotateY(-2deg) rotateX(1deg);
  box-shadow:
    0 0 0 1px var(--border-bright),
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 40px var(--glow);
}

.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
}

.mock-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border-bright);
}

.mock-dot:first-child { background: rgba(255,255,255,0.25); }
.mock-dot:nth-child(2) { background: rgba(255,255,255,0.15); }
.mock-dot:nth-child(3) { background: rgba(255,255,255,0.08); }

.mock-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-right: 46px;
}

.mock-body {
  aspect-ratio: 16 / 10;
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%),
    var(--bg-deep);
  display: flex;
  overflow: hidden;
}

.mock-placeholder-label {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.35rem 0.65rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  z-index: 2;
}

.mock-split {
  display: flex;
  width: 100%;
  height: 100%;
}

.mock-pane {
  flex: 1;
  border-right: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mock-pane:last-child { border-right: none; }

.mock-pane-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mock-block {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

.mock-block::after {
  content: "";
  position: absolute;
  inset: 20%;
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 4px;
}

.mock-bar {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
}

/* Editor mock — monospace lines */
.mock-editor-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: rgba(255,255,255,0.25);
  line-height: 1.4;
}

.mock-editor-lines .hl { color: rgba(255,255,255,0.45); }
.mock-editor-lines .dim { color: rgba(255,255,255,0.12); }

/* Preview mock — prose blocks */
.mock-prose {
  flex: 1;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mock-prose-title {
  height: 14px;
  width: 72%;
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
}

.mock-prose-rule {
  height: 2px;
  width: 100%;
  background: rgba(255,255,255,0.12);
  margin-bottom: 0.25rem;
}

.mock-prose-line {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}

.mock-prose-line:nth-child(odd) { width: 95%; }
.mock-prose-line:nth-child(even) { width: 78%; }

.mock-sidebar-tree {
  width: 28%;
  border-right: 1px solid var(--border);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mock-tree-item {
  height: 8px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
}

.mock-tree-item.active {
  background: rgba(255,255,255,0.12);
  width: 85%;
}

.mock-float {
  position: absolute;
  width: 38%;
  min-height: 55%;
  right: 8%;
  top: 12%;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  padding: 0.75rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.mock-slider {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0.5rem 0;
  position: relative;
}

.mock-slider::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 60%;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

/* ── Audience pills ── */
.audience-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.audience-pill {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}

/* ── Steps ── */
.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}

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

.step-card {
  position: relative;
  padding: 2rem 1.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
}

.step-card::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: rgba(255,255,255,0.06);
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  line-height: 1;
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── CTA ── */
.cta-band {
  text-align: center;
  padding: var(--section-pad) 1.5rem;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, var(--glow-strong), transparent),
    repeating-linear-gradient(
      90deg,
      var(--grid-line) 0px,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 80px
    );
  opacity: 0.5;
  pointer-events: none;
}

.cta-band .container-narrow {
  position: relative;
  z-index: 1;
}

.cta-band h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta-band p {
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0 auto 2rem;
}

/* ── Footer ── */
.site-footer {
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 32ch;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 3rem;
}

.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: 1120px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: none;
}

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