/* 
  =========================
  GLOBAL VARIABLES & RESET
  =========================
  - :root: CSS variables for colors, spacing, layout
  - Reset for box-sizing, html/body, font smoothing
*/
:root {
  /* === Color Palette === */
  --bg: #0b0d12;          /* single background */
  --text: #e6eaf0;        /* primary text */
  --muted: #8d98ab;       /* secondary text */
  --line: #1c2230;        /* hairline */
  --grid-line: rgba(255,255,255,0.04); /* grid lines */
  --grid-line-subtle: rgba(255,255,255,0.02); /* subtle grid lines */

  /* === Spacing Scale === */
  --s-1: 4px; --s0: 8px; --s1: 12px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 72px; --s7: 112px; --s8: 160px;

  /* === Layout === */
  --g: 24px; /* Fixed page gutter */
  --r-sm: 6px; --r: 10px; --r-lg: 14px; /* Border radii */
  --hdr: 104px; /* Header height */

  /* === Dynamic (set by JS in @app.js) === */
  --margin-left: 120px;   /* For .vertical-margins lines */
  --margin-right: 120px;
  --grid-spacing-small: 60px;
  --grid-spacing-large: 180px;
  --line-width: 1px;
}

/* === CSS Reset & Base === */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
html { 
  scrollbar-gutter: stable; 
  /* Prevent iOS Safari auto text zoom that causes inconsistent card sizes until tap */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: ui-sans-serif, -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  color: var(--text);
  background: var(--bg);
  padding-top: var(--hdr);
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased; 
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 
  =========================
  MAIN PAGE STRUCTURE
  =========================
  - .pages-container: wraps all pages
  - .page: each full-screen section
  - #page-1: hero section (see @app.js: Page1)
  - #page-2: features section (see @app.js: Page2)
*/
.pages-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page {
  min-height: calc(100vh - var(--hdr));
  width: 100%;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Only vertical padding, aligns with margin lines */
  padding-block: var(--s4);
  padding-inline: 0;
}
/* === Page-specific padding tweaks === */
#page-1 { /* Hero: move up */
  padding-top: calc(var(--s4) - 60px);
  padding-bottom: calc(var(--s4) + 60px);
}
#page-2 { /* Features: footer flush bottom */
  padding-bottom: 0;
}

/* 
  =========================
  PAGE CONTENT WRAPPERS
  =========================
  - .page-content: centers/caps content
  - .page-title, .page-subtitle: main headings
  - .hard-gutter: enforces margin lines (see @app.js: MarginLines)
*/
.page-content {
  text-align: center;
  max-width: 800px;
  z-index: 10;
  position: relative;
}
.page-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  margin: 0 0 var(--s3) 0;
  color: var(--text);
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.hard-gutter {
  width: 100%;
  box-sizing: border-box;
  /* Never allow children to cross the margin lines */
  padding-left: var(--margin-left);
  /* Use 100% instead of 100vw so scrollbars don't add extra space */
  padding-right: calc(100% - var(--margin-right));
  /* Allow only special decorative elements (title lines) to extend */
  overflow-x: visible;
}

/* 
  =========================
  PAGE 1: HERO SECTION
  =========================
  - .bounded: max-width, obeys hard gutter
  - .p1-hero, .p1-hero-inner: layout
  - .p1-badge, .p1-eyebrow, .p1-title, .p1-sub: text
  - .p1-cta: input/button row
*/
.bounded {
  width: min(100%, 1160px);
  margin-inline: auto;
  padding-inline: var(--g);
  overflow: visible; /* allow title lines to extend to gutter */
}
.p1-hero { width: 100%; display: grid; place-items: center; }
.p1-hero-inner { text-align: center; }
.p1-badge { 
  display: inline-block; padding: 10px 20px; border-radius: var(--r); 
  border: 1px solid var(--line); color: var(--muted); font-size: 14px; 
  letter-spacing: .04em; text-transform: uppercase; 
  background: rgba(255,255,255,0.02); margin-bottom: var(--s3); 
}
.p1-eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--s4); }
.p1-title { 
  font-size: clamp(44px, 7vw, 72px); line-height: 1.06; letter-spacing: -0.02em; 
  margin: 0 0 var(--s3) 0; font-weight: 800; position: relative; 
}
/* --- Decorative lines above/below hero title --- */
.p1-title::before,
.p1-title::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
  background: transparent;
  pointer-events: none;
  opacity: 0.4;
}
.p1-title::before { top: -12px; }
.p1-title::after { bottom: -12px; }
.p1-sub { 
  font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); 
  max-width: 58ch; margin: 0 auto var(--s3) auto; line-height: 1.55; 
}
/* --- Call to action row --- */
.p1-cta { 
  display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: center; 
  margin: var(--s3) auto var(--s1) auto; max-width: 520px; width: 100%; overflow: hidden; 
}
.p1-input { 
  width: 100%; max-width: 100%; padding: 16px 18px; border-radius: var(--r); 
  border: 1px solid var(--line); background: #11141a; color: var(--text); 
  font-size: 15px; outline: none; transition: border-color .15s ease, box-shadow .15s ease, color .15s ease; 
}
.p1-input::placeholder { color: #8591a6; }
.p1-input.invalid { 
  border-color: rgba(228,88,88,0.28); 
  box-shadow: 0 0 0 1px rgba(228,88,88,0.08) inset, 0 0 0 2px rgba(228,88,88,0.04); 
}
.p1-btn { 
  padding: 16px 24px; border-radius: var(--r); border: 1px solid #3d57ff; 
  background: #5076F5; color: white; font-weight: 600; cursor: pointer; white-space: nowrap; 
}
.p1-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: var(--s1); margin-bottom: 0; }

/* --- Responsive: Hero --- */
@media (max-width: 900px) {
  .p1-title { font-size: clamp(36px, 8.5vw, 64px); }
  .p1-sub { font-size: clamp(15px, 3.6vw, 19px); }
}
@media (max-width: 600px) {
  .p1-badge { padding: 8px 14px; font-size: 12px; }
  .p1-title { font-size: clamp(28px, 10.5vw, 46px); }
  .p1-sub { font-size: clamp(14px, 4vw, 18px); line-height: 1.65; }
  .p1-cta { grid-template-columns: 1fr; }
  .p1-btn { justify-self: stretch; padding: 14px 16px; width: 100%; max-width: 100%; }
  .p1-input { padding: 14px 16px; font-size: 15px; }
}

/* 
  =========================
  PAGE 2: FEATURES SECTION
  =========================
  - .p2-container: wrapper
  - .p2-header: title/subtitle
  - .p2-features: grid of features
  - .p2-feature: individual card
  - .p2-footer: sticky footer
*/
.p2-container { width: 100%; }
.p2-header { text-align: center; margin: 0 auto var(--s5); }
.p2-title { font-size: 24px; font-weight: 600; color: var(--text); margin: 0 0 var(--s2) 0; letter-spacing: -0.01em; }
.p2-subtitle { color: var(--muted); font-size: 16px; margin: 0; max-width: 54ch; margin-left: auto; margin-right: auto; }
.p2-features { 
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); 
  max-width: 800px; margin: 0 auto var(--s4); 
}
.p2-feature { 
  border: 1px solid var(--line); border-radius: var(--r-lg); 
  padding: var(--s5) var(--s4); background: rgba(255,255,255,0.02); 
  display: flex; flex-direction: column; min-height: 200px; 
  transition: border-color .2s ease, background .2s ease, transform .2s ease; 
  position: relative; 
}
.p2-feature:hover { 
  border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.035); 
  transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.15); 
}
/* --- Selection affordances (PowerPoint-like) --- */
.p2-feature::before { 
  content: ""; position: absolute; inset: 0; z-index: 2;
  border-radius: 0; /* rectangular selection frame */
  border: 0.5px solid rgba(80,118,245,0.75); /* brand blue */
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.p2-feature::after { 
  content: ""; position: absolute; inset: -12px; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .18s ease;
  /* Handles: smaller light dots positioned outside card. 
     Offset (o) from the card edge = 12px inset value
     radii: outer 5px, inner 3px */
  background:
    /* top-left */
    radial-gradient(circle at 12px 12px, rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at 12px 12px, #ffffff 0 3px, transparent 3px),
    /* top-center */
    radial-gradient(circle at 50% 12px, rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at 50% 12px, #ffffff 0 3px, transparent 3px),
    /* top-right */
    radial-gradient(circle at calc(100% - 12px) 12px, rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at calc(100% - 12px) 12px, #ffffff 0 3px, transparent 3px),
    /* middle-right */
    radial-gradient(circle at calc(100% - 12px) 50%, rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at calc(100% - 12px) 50%, #ffffff 0 3px, transparent 3px),
    /* bottom-right */
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #ffffff 0 3px, transparent 3px),
    /* bottom-center */
    radial-gradient(circle at 50% calc(100% - 12px), rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at 50% calc(100% - 12px), #ffffff 0 3px, transparent 3px),
    /* bottom-left */
    radial-gradient(circle at 12px calc(100% - 12px), rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at 12px calc(100% - 12px), #ffffff 0 3px, transparent 3px),
    /* middle-left */
    radial-gradient(circle at 12px 50%, rgba(255,255,255,0.55) 0 5px, transparent 5px),
    radial-gradient(circle at 12px 50%, #ffffff 0 3px, transparent 3px);
}
.p2-feature:hover::before,
.p2-feature:hover::after { opacity: 1; }
.p2-feature h3 { margin: 0 0 var(--s3) 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); line-height: 1.3; }
.p2-feature p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; flex-grow: 1; }
/* --- Features footer --- */
.p2-footer { 
  display: flex; align-items: center; justify-content: space-between; 
  height: 56px; margin-top: var(--s5); font-size: 14px; color: var(--muted); position: relative; 
}
/* --- Decorative line above footer --- */
.p2-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw; /* extend from edge to edge */
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
  background: transparent;
  pointer-events: none;
  opacity: 0.4;
}
.p2-footer a { color: var(--muted); text-decoration: none; }

/* --- Responsive: Features --- */
@media (max-width: 640px) {
  .p2-features { grid-template-columns: 1fr; gap: var(--s3); max-width: 100%; }
  .p2-feature { padding: var(--s4) var(--s3); }
  .p2-title { font-size: 22px; }
  .p2-subtitle { font-size: 15px; }
  .p2-footer { font-size: 13px; }
}

/* 
  =========================
  BACKGROUND LAYERS
  =========================
  - .bg-grid: grid lines (see @app.js: BgGrid)
  - .bg-patches: subtle color overlays
  - #grid-waves: SVG wave overlay
*/
.bg-grid { 
  position: fixed; 
  inset: 0; 
  z-index: -2; 
  pointer-events: none; 
}
.bg-grid::before { 
  content: ""; 
  position: absolute; 
  inset: 0; 
  background-image: 
    linear-gradient(90deg, var(--grid-line) var(--line-width), transparent var(--line-width)),
    linear-gradient(180deg, var(--grid-line) var(--line-width), transparent var(--line-width));
  background-size: var(--grid-spacing-small) var(--grid-spacing-small); 
  opacity: .4;
}
.bg-grid::after { 
  content: ""; 
  position: absolute; 
  inset: 0; 
  background-image: 
    linear-gradient(90deg, var(--grid-line-subtle) var(--line-width), transparent var(--line-width)),
    linear-gradient(180deg, var(--grid-line-subtle) var(--line-width), transparent var(--line-width));
  background-size: var(--grid-spacing-large) var(--grid-spacing-large); 
  opacity: .25;
}
.bg-patches { 
  position: fixed; 
  inset: 0; 
  z-index: -3; 
  pointer-events: none; 
  background: 
    radial-gradient(ellipse 1200px 900px at 85% 20%, rgba(80,118,245,0.035) 0%, rgba(80,118,245,0.015) 25%, rgba(80,118,245,0.005) 50%, transparent 75%),
    radial-gradient(ellipse 900px 750px at 15% 120%, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.012) 30%, rgba(255,255,255,0.004) 55%, transparent 80%),
    radial-gradient(ellipse 600px 525px at 60% 90%, rgba(80,118,245,0.018) 0%, rgba(80,118,245,0.008) 35%, rgba(80,118,245,0.003) 60%, transparent 85%);
}
#grid-waves { position: fixed; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: screen; }

/* 
  =========================
  TOAST NOTIFICATION
  =========================
  - .toast: notification popup (see @app.js: Toast)
*/
.toast {
  --toast-accent: #2f9e44;
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(6px);
  z-index: 1000;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #11141a;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast .toast-emoji{ font-size: 14px; line-height: 1; }
.toast .toast-message{ letter-spacing: .01em; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 
  =========================
  HEADER & NAVIGATION
  =========================
  - .header: sticky top bar (see @app.js: Header)
  - .nav: flex container for nav items
  - .brand, .brand-icon, .brand-wordmark: logo
  - .badge: small badge
*/
.header { 
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; 
  backdrop-filter: blur(12px) saturate(130%); -webkit-backdrop-filter: blur(12px) saturate(130%); 
  background: rgba(11,13,18,0.45); border-bottom: 1px solid rgba(255,255,255,0.06); 
  height: var(--hdr); display: flex; align-items: center; justify-content: center; 
}
.nav { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.brand { display: flex; align-items: center; gap: var(--s2); }
.brand-icon { width: 28px; height: 28px; }
.brand-wordmark { height: 22px; opacity: .96; filter: invert(1) brightness(1.2); }
.badge { padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,0.02); }

/* 
  =========================
  VERTICAL MARGIN LINES
  =========================
  - .vertical-margins: container for margin lines (see @app.js: MarginLines)
  - .margin-line, .margin-line-left, .margin-line-right: lines
*/
.vertical-margins {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 15;
}
.margin-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dashed rgba(255, 255, 255, 0.3);
  background: transparent;
  opacity: 0.4;
}
.margin-line-left {
  left: var(--margin-left);
}
.margin-line-right {
  left: var(--margin-right);
}


/* 
  =========================
  RESPONSIVE ADJUSTMENTS
  =========================
  - Header, gutter, padding, icon sizes
*/
@media (max-width: 900px) {
  :root { 
    --hdr: 80px; 
    --g: 20px;
  }
  .page { padding-block: var(--s3); padding-inline: 0; }
}
@media (max-width: 600px) {
  :root { 
    --hdr: 64px; 
    --g: 16px;
  }
  .page { padding-block: var(--s2); padding-inline: 0; }
  .brand-icon { width: 22px; height: 22px; }
  .brand-wordmark { height: 18px; }
}
@media (max-width: 400px) {
  :root { --g: 12px; }
}
