/* ==========================================================================
   StockApp Marketing Site - Consistent with app theme
   Uses the same design tokens and patterns as the main application
   ========================================================================== */

/* Theme tokens - mirrored from app's variables.css */
:root {
  --bg-rgb: 6 7 10;
  --surface-1-rgb: 9 10 14;
  --surface-2-rgb: 11 12 16;
  --surface-3-rgb: 14 15 20;
  --border-rgb: 28 30 40;
  --text-rgb: 231 234 242;
  --text-muted-rgb: 167 175 191;
  --text-subtle-rgb: 111 119 138;
  --accent-rgb: 255 106 0;
  --accent-2-rgb: 255 140 64;
  --success-rgb: 34 197 94;
  --danger-rgb: 239 68 68;
  --warning-rgb: 234 179 8;
  --hover-rgb: 16 17 23;

  /* Derived vars */
  --bg: rgb(var(--bg-rgb));
  --surface-1: rgb(var(--surface-1-rgb));
  --surface-2: rgb(var(--surface-2-rgb));
  --surface-3: rgb(var(--surface-3-rgb));
  --border: rgb(var(--border-rgb));
  --text: rgb(var(--text-rgb));
  --text-muted: rgb(var(--text-muted-rgb));
  --text-subtle: rgb(var(--text-subtle-rgb));
  --accent: rgb(var(--accent-rgb));
  --accent-2: rgb(var(--accent-2-rgb));
  --focus-ring: rgb(var(--accent-rgb) / 0.45);
}

/* ==========================================================================
   Base Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.small {
  font-size: 0.875rem;
}

/* ==========================================================================
   Skip Link
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: rgb(var(--bg-rgb));
  font-weight: 600;
  border-radius: 0.375rem;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgb(var(--bg-rgb) / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(var(--border-rgb) / 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  transition: opacity 0.15s;
}

.brand:hover {
  opacity: 0.85;
}

.logo {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
}

.site-nav {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.site-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgb(var(--surface-1-rgb) / 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(var(--border-rgb) / 0.5);
  padding: 1rem;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 0.375rem;
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-link:hover {
  background: rgb(var(--hover-rgb));
  color: var(--text);
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-toggle:hover {
  background: rgb(var(--hover-rgb));
}

.nav-toggle-lines {
  position: relative;
  width: 1.25rem;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: background 0.15s;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
}

.nav-toggle-lines::before {
  top: -6px;
}

.nav-toggle-lines::after {
  top: 6px;
}

@media (min-width: 768px) {
  .site-nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: 8rem 0 5rem;
  background:
    radial-gradient(ellipse 1200px 600px at 20% 30%, rgb(var(--accent-rgb) / 0.08), transparent 50%),
    radial-gradient(ellipse 800px 500px at 80% 60%, rgb(var(--accent-2-rgb) / 0.05), transparent 50%);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
  }
}

.hero-copy {
  max-width: 560px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Buttons (matching app's custom.css)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
}

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

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-ghost {
  background: rgb(var(--surface-3-rgb) / 0.5);
  color: var(--text);
  border-color: rgb(var(--border-rgb) / 0.65);
}

.btn-ghost:hover {
  background: rgb(var(--hover-rgb));
}

.btn-large {
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
}

.card-cta {
  text-align: center;
  padding: 2.5rem 2rem;
}

.card-cta h3 {
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

.card-cta p {
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ==========================================================================
   Pills / Labels (matching app's label styles)
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgb(var(--surface-3-rgb) / 0.6);
  border: 1px solid rgb(var(--border-rgb) / 0.5);
  border-radius: 9999px;
}

.pill-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: var(--accent);
}

.pill-icon.flag-no {
  width: 1.125rem;
  height: 0.8125rem;
  color: inherit;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(var(--border-rgb) / 0.35);
}

.label-accent {
  background: rgb(var(--accent-rgb) / 0.15);
  color: var(--accent);
  border-color: rgb(var(--accent-rgb) / 0.2);
}

/* ==========================================================================
   Hero Preview Card
   ========================================================================== */

.hero-preview {
  position: relative;
}

.shot-card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgb(var(--surface-1-rgb) / 0.55);
  border: 1px solid rgb(var(--border-rgb) / 0.5);
  box-shadow:
    0 0 0 1px rgb(var(--border-rgb) / 0.25),
    0 26px 80px -34px rgb(0 0 0 / 0.6);
  transform: rotate(-1.5deg);
  transform-origin: 30% 20%;
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
  filter: saturate(1.03) contrast(1.02);
}

.shot-body {
  position: relative;
  background: rgb(var(--surface-2-rgb) / 0.25);
}

.shot-body::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 520px 280px at 50% 10%, rgb(var(--accent-rgb) / 0.12), transparent 55%),
    linear-gradient(to bottom, transparent 60%, rgb(var(--bg-rgb) / 0.85));
}

.shot-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 2536 / 1289;
  opacity: 0.98;
}

.shot-link {
  display: block;
}

.shot-link:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 0.9);
  outline-offset: 2px;
}

.shot-image-wide {
  aspect-ratio: 2527 / 1233;
}

.shot-image-tall {
  aspect-ratio: 1439 / 1143;
}

.hero-preview:hover .shot-card {
  transform: translateY(-6px) rotate(-1deg);
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgb(var(--surface-2-rgb) / 0.5);
  border-bottom: 1px solid rgb(var(--border-rgb) / 0.5);
}

.dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
}

.dot-red {
  background: rgb(var(--danger-rgb) / 0.7);
}

.dot-yellow {
  background: rgb(var(--warning-rgb) / 0.7);
}

.dot-green {
  background: rgb(var(--success-rgb) / 0.7);
}

.preview-title {
  margin-left: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-subtle);
}

.preview-body {
  padding: 1.25rem;
}

/* Hero stat - large featured metric like "Year in Review" */
.hero-stat {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-bottom: 1.25rem;
  background: radial-gradient(ellipse 300px 150px at 50% 30%, rgb(var(--accent-rgb) / 0.12), transparent 60%);
  border-radius: 0.75rem;
  border: 1px solid rgb(var(--border-rgb) / 0.4);
}

.hero-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}

.hero-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.hero-stat-value.accent {
  color: var(--accent);
}

.hero-stat-sub {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-top: 0.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 480px) {
  .metric-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric {
  padding: 0.875rem;
  background: rgb(var(--surface-2-rgb) / 0.45);
  border: 1px solid rgb(var(--border-rgb) / 0.45);
  border-radius: 0.5rem;
}

.metric-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-subtle);
  margin-bottom: 0.375rem;
}

.metric-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.metric-value-accent {
  color: var(--accent);
}

.metric-sub {
  font-size: 0.6875rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

/* Chart preview */
.chart {
  background: rgb(var(--surface-2-rgb) / 0.35);
  border: 1px solid rgb(var(--border-rgb) / 0.4);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid rgb(var(--border-rgb) / 0.35);
}

.chart-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chart-chip {
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  background: rgb(var(--surface-3-rgb) / 0.5);
  border: 1px solid rgb(var(--border-rgb) / 0.4);
  border-radius: 0.25rem;
  color: var(--text-subtle);
}

.chart-canvas {
  position: relative;
  height: 100px;
  padding: 1rem;
  overflow: hidden;
}

/* Animated chart lines */
.spark {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 1px;
  animation: sparkMove 3s ease-in-out infinite;
}

.s1 {
  top: 20%;
  background: linear-gradient(90deg, transparent, var(--accent));
  animation-delay: 0s;
}

.s2 {
  top: 40%;
  background: linear-gradient(90deg, transparent, rgb(var(--success-rgb)));
  animation-delay: 0.5s;
}

.s3 {
  top: 60%;
  background: linear-gradient(90deg, transparent, var(--accent-2));
  animation-delay: 1s;
}

.s4 {
  top: 80%;
  background: linear-gradient(90deg, transparent, rgb(var(--text-muted-rgb) / 0.5));
  animation-delay: 1.5s;
}

@keyframes sparkMove {
  0%,
  100% {
    transform: translateX(-20%);
    opacity: 0.3;
  }
  50% {
    transform: translateX(20%);
    opacity: 1;
  }
}

.preview-note {
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-align: center;
}

/* Glow effect behind preview */
.glow {
  position: absolute;
  inset: -60px;
  z-index: -1;
  background:
    radial-gradient(ellipse 400px 300px at 30% 40%, rgb(var(--accent-rgb) / 0.12), transparent 50%),
    radial-gradient(ellipse 300px 250px at 70% 60%, rgb(var(--accent-2-rgb) / 0.08), transparent 50%);
  filter: blur(40px);
  pointer-events: none;
}

@media (max-width: 639px) {
  .shot-card {
    margin-bottom: 1rem;
    transform: none;
  }

  .hero-preview:hover .shot-card,
  .hero-preview:hover .shot-card {
    transform: none;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */

/* ==========================================================================
   Screenshots
   ========================================================================== */

.screens-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.shot-card-grid {
  transform: none;
}

.shot-span-2 {
  grid-column: span 2;
}

.shot-tilt-left {
  transform: rotate(-0.6deg);
}

.shot-tilt-right {
  transform: rotate(0.6deg);
}

.shot-card-grid:hover {
  transform: translateY(-4px) rotate(0deg);
}

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

  .shot-span-2 {
    grid-column: auto;
  }
}

.section {
  padding: 5rem 0;
}

.section-header {
  max-width: 640px;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.section-accent {
  background:
    radial-gradient(ellipse 900px 400px at 10% 50%, rgb(var(--accent-rgb) / 0.06), transparent 50%),
    radial-gradient(ellipse 700px 350px at 90% 50%, rgb(var(--accent-2-rgb) / 0.04), transparent 50%),
    rgb(var(--surface-1-rgb) / 0.3);
  border-top: 1px solid rgb(var(--border-rgb) / 0.4);
  border-bottom: 1px solid rgb(var(--border-rgb) / 0.4);
}

/* ==========================================================================
   Cards (matching app's card styles)
   ========================================================================== */

.card {
  padding: 1.5rem;
  background: rgb(var(--surface-2-rgb) / 0.35);
  border: 1px solid rgb(var(--border-rgb) / 0.55);
  border-radius: 0.75rem;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.card:hover {
  border-color: rgb(var(--border-rgb) / 0.8);
  background: rgb(var(--surface-2-rgb) / 0.5);
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.card p {
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.card-side {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Feature Grid
   ========================================================================== */

.feature-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Split Layout (Norway section)
   ========================================================================== */

.split {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .split {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Bullet Lists
   ========================================================================== */

.bullets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bullets li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--accent);
  border-radius: 50%;
}

/* ==========================================================================
   Steps (How it works)
   ========================================================================== */

.steps {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: rgb(var(--surface-2-rgb) / 0.35);
  border: 1px solid rgb(var(--border-rgb) / 0.55);
  border-radius: 0.75rem;
}

.step-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.12);
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: 0.5rem;
}

.step-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.step-body p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ==========================================================================
   Waitlist Section
   ========================================================================== */

.waitlist {
  background: radial-gradient(ellipse 600px 400px at 50% 0%, rgb(var(--accent-rgb) / 0.06), transparent 50%);
}

.waitlist-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .waitlist-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.iframe-wrap {
  margin: 1rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgb(var(--bg-rgb));
  border: 1px solid rgb(var(--border-rgb) / 0.5);
}

.iframe-wrap iframe {
  width: 100%;
  height: 500px;
  border: 0;
  background: rgb(var(--bg-rgb));
}

.note {
  margin-top: 1.5rem;
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  background: rgb(var(--accent-rgb) / 0.06);
  border: 1px solid rgb(var(--accent-rgb) / 0.15);
  border-radius: 0.5rem;
}

/* ==========================================================================
   Links
   ========================================================================== */

.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgb(var(--accent-rgb) / 0.4);
  transition:
    color 0.15s,
    text-decoration-color 0.15s;
}

.link:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

/* ==========================================================================
   Code
   ========================================================================== */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  background: rgb(var(--surface-3-rgb) / 0.65);
  border: 1px solid rgb(var(--border-rgb) / 0.5);
  border-radius: 0.25rem;
  color: var(--text);
}

/* Section background helper (used by other sections) */
.section-dark {
  background: rgb(var(--surface-1-rgb));
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 2rem 0;
  background: rgb(var(--surface-1-rgb) / 0.3);
  border-top: 1px solid rgb(var(--border-rgb) / 0.4);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy {
  animation: fadeInUp 0.6s ease-out;
}

.hero-preview {
  animation: fadeInUp 0.6s ease-out 0.15s both;
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */

@media (max-width: 639px) {
  .hero {
    padding: 6rem 0 3rem;
  }

  .section {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .cta-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
