/* ===========================================================
   NotedSuite v2 — staging redesign (light theme)
   Calm, low-noise, ADHD-friendly. One message at a time.
   READABILITY RULE: hero copy always sits on a near-light
   scrim; particle/line alpha and size are clamped in the
   shader. The animation never fights the copy.
   =========================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Light palette — v1's navy becomes the INK, coral stays the accent */
  --bg:         #faf9f7;   /* warm off-white page background */
  --bg-soft:    #f2efe9;   /* alternating section tint */
  --text:       #10162e;   /* ink navy — primary text */
  --text-dim:   #565e78;   /* secondary text, still readable */
  --accent:     #ff8a6b;   /* sunset coral — graphics, wordmark, lines */
  --accent-deep:#bc431f;   /* darker coral for small text/links (contrast) */
  --accent-2:   #ffd2a8;   /* soft highlight */
  --card:       #ffffff;
  --card-line:  rgba(16, 22, 46, 0.10);
  --shadow:     rgba(16, 22, 46, 0.10);

  /* Theme plumbing (overridden in dark mode below) */
  --chip-bg:   #ffffff;
  --header-bg: rgba(250, 249, 247, 0.85);
  --nav-bg:    rgba(250, 249, 247, 0.97);
  --cue-line:  rgba(16, 22, 46, 0.25);
  --scrim-rgb: 250, 249, 247;   /* hero readability scrim color */

  --radius: 18px;
  --maxw: 1040px;
  --gap: clamp(3rem, 8vw, 6.5rem);

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

/* ---------- DARK MODE: the dusk-lake scheme ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0e1326;
    --bg-soft:    #141a32;
    --text:       #f2f4fb;
    --text-dim:   #aeb6cf;
    --accent:     #ff8a6b;
    --accent-deep:#ff9d80;  /* coral bright enough to read on navy */
    --accent-2:   #ffd2a8;
    --card:       #141a32;
    --card-line:  rgba(255, 255, 255, 0.14);
    --shadow:     rgba(0, 0, 0, 0.35);

    --chip-bg:   #141a32;
    --header-bg: rgba(14, 19, 38, 0.82);
    --nav-bg:    rgba(14, 19, 38, 0.96);
    --cue-line:  rgba(255, 255, 255, 0.25);
    --scrim-rgb: 10, 14, 30;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* no horizontal body scroll, ever */
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { font-family: var(--font-display); }

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 0.9rem 1.25rem;
  transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
  background: transparent;
}
.site-header.is-solid {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--card-line), 0 10px 30px rgba(16, 22, 46, 0.06);
  padding: 0.6rem 1.25rem;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--accent-deep); }

.site-nav { display: flex; gap: 1.4rem; }
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem 4rem;
  overflow: hidden;
  /* CSS gradient = the no-WebGL fallback (canvas sits on top when it loads) */
  background:
    radial-gradient(900px 480px at 50% 108%, rgba(255, 138, 107, 0.14), transparent 62%),
    radial-gradient(700px 420px at 12% -8%, rgba(255, 210, 168, 0.22), transparent 60%),
    linear-gradient(170deg, #fdfcfa 0%, #f7f4ee 55%, #f3ede4 100%);
}
@media (prefers-color-scheme: dark) {
  .hero {
    background:
      radial-gradient(1200px 600px at 50% 110%, rgba(255, 138, 107, 0.16), transparent 60%),
      linear-gradient(160deg, #1b2350 0%, #2a2448 40%, #3a2a55 70%, #0e1326 100%);
  }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* READABILITY: near-bg scrim behind the copy at all times
   (light scrim in light mode, near-dark vignette in dark mode) */
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 55% at 50% 46%, rgba(var(--scrim-rgb), 0.82) 0%, rgba(var(--scrim-rgb), 0.48) 55%, rgba(var(--scrim-rgb), 0) 100%),
    linear-gradient(180deg, rgba(var(--scrim-rgb), 0.65) 0%, rgba(var(--scrim-rgb), 0.08) 35%, rgba(var(--scrim-rgb), 0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

/* Masked reveal wrappers */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span { display: inline-block; }

.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 600;
}
.hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2.9rem, 9vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero-title .suite { color: var(--accent-deep); } /* the two-tone wordmark, writ large */
.hero-sub {
  margin: 0 auto;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  max-width: 40ch;
}

.hero-tiles {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 2.75rem);
  flex-wrap: wrap;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease;
}
.app-tile:hover { transform: translateY(-4px); }
.app-tile img,
.app-tile svg {
  width: 72px;
  height: 72px;
  border-radius: 17px;
  box-shadow: 0 12px 28px rgba(16, 22, 46, 0.22);
}
.app-tile span:last-child { font-size: 0.92rem; font-weight: 600; }
.app-tile--soon { opacity: 0.6; cursor: default; }

.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--cue-line);
  border-radius: 999px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent-deep);
  animation: cue 2s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60%      { transform: translateY(14px); opacity: 0; }
}

/* ---------- ACCENT LINES (scroll-scrubbed) ---------- */
.accent-line {
  height: 2px;
  max-width: var(--maxw);
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  transform-origin: left center;
  border-radius: 2px;
}

/* ---------- APP SECTIONS ---------- */
.app-section { padding: var(--gap) 1.25rem; scroll-margin-top: 4.5rem; }
.app-section--alt { background: var(--bg-soft); }

.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section-inner--narrow { max-width: 760px; text-align: center; }

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 600;
}
.section-title {
  margin: 0 0 1rem;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 24ch;
}
.section-inner--narrow .section-title { margin-inline: auto; }
.section-lead {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  max-width: 62ch;
}
.section-inner--narrow .section-lead { margin-inline: auto; }

.badge-row { margin: 0 0 0.5rem; }
.badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: default;
}
.badge-pending .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.cta-note { color: var(--text-dim); font-size: 0.88rem; margin: 0.4rem 0 0; }

/* ---------- SCREENSHOTS ---------- */
.shot { margin: 2.5rem 0 0; text-align: center; }
.shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--card-line);
  box-shadow: 0 24px 55px rgba(16, 22, 46, 0.18);
}
.shot figcaption { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.75rem; }
.shot-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.shot-pair .shot { margin-top: 0; }

/* ---------- STATS ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 2.75rem 0 0;
}
.stat {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(16, 22, 46, 0.05);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--text-dim); font-size: 0.88rem; }

/* ---------- CARDS (pointer-tracked glow) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 1.6rem;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(16, 22, 46, 0.05);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 138, 107, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}
.card p { margin: 0; color: var(--text-dim); font-size: 0.96rem; }

/* ---------- CHIPS ---------- */
.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 2rem 0 0;
}
.chip-list li {
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: var(--chip-bg);
  padding: 0.4rem 0.95rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.section-links { margin: 2rem 0 0; }
.text-link { color: var(--accent-deep); text-decoration: none; font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* ---------- TABLES (content pages / future use) ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; min-width: 480px; }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--card-line);
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
}
footer a { color: var(--text-dim); text-decoration: none; margin: 0 0.6rem; }
footer a:hover { color: var(--text); text-decoration: underline; }
footer .copyright { margin-top: 1rem; opacity: 0.8; }

/* ---------- MOBILE ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100svh;
    width: min(78vw, 320px);
    flex-direction: column;
    gap: 0;
    padding: 5.5rem 2rem 2rem;
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--card-line);
    box-shadow: -20px 0 50px rgba(16, 22, 46, 0.12);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: -1; /* below the toggle button */
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav a { padding: 0.9rem 0; font-size: 1.1rem; border-bottom: 1px solid rgba(16, 22, 46, 0.07); }

  .hero { padding-top: 5rem; }
  .hero-tiles { gap: 1rem; }
  .app-tile img, .app-tile svg { width: 60px; height: 60px; border-radius: 14px; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue span { animation: none; }
  .site-header, .site-nav, .nav-toggle span, .app-tile, .card::before { transition: none; }
}
