/* ==========================================================================
   StockAtlas.app — design system
   --------------------------------------------------------------------------
   One stylesheet for the whole site. Edit the tokens in :root to restyle
   globally. Page accent is switched with a body class: .theme-atlas (blue)
   or .theme-tiles (violet -> blue).
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Brand palette */
  --ink:            #0a1428;   /* deep navy — StockAtlas ink */
  --ink-2:          #0f1d3a;
  --blue:           #2d7ff9;   /* StockAtlas accent */
  --blue-light:     #5aa9ff;
  --violet:         #6d5bd0;   /* Collection Tiles accent */
  --violet-light:   #8b7be8;

  /* Neutrals */
  --white:          #ffffff;
  --bg:             #ffffff;
  --bg-soft:        #f6f8fc;   /* section tint */
  --bg-soft-2:      #eef2f9;
  --border:         #e4e9f2;
  --text:           #1c2434;   /* body text */
  --text-soft:      #5a6378;   /* muted text */
  --text-faint:     #8a93a6;

  /* Accent — overridden per page theme */
  --accent:         var(--blue);
  --accent-light:   var(--blue-light);
  --accent-grad:    linear-gradient(120deg, var(--blue), var(--blue-light));

  /* Typography */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;

  /* Spacing / shape */
  --radius:    14px;
  --radius-lg: 22px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
  --maxw:      1140px;
  --nav-h:     68px;
}

body.theme-tiles {
  --accent:       var(--violet);
  --accent-light: var(--violet-light);
  --accent-grad:  linear-gradient(120deg, var(--violet), var(--blue));
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
ul { margin: 0 0 1rem; padding-left: 1.2em; }

/* ---- Layout helpers ------------------------------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding: 56px 0; }
.center { text-align: center; }
.measure { max-width: 720px; margin-left: auto; margin-right: auto; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: 1.18rem; color: var(--text-soft); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 14px 24px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(45,127,249,.28); }
.btn--primary:hover { box-shadow: 0 10px 26px rgba(45,127,249,.36); }
body.theme-tiles .btn--primary { box-shadow: 0 6px 18px rgba(109,91,208,.30); }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(4px); }
.btn--light:hover { background: rgba(255,255,255,.2); }
.btn--lg { padding: 16px 30px; font-size: 1.05rem; }

/* ---- Navigation ---------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 1px 12px rgba(16,24,40,.05); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.nav__links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__links a { color: var(--text-soft); font-weight: 500; padding: 8px 14px; border-radius: 8px; font-size: .98rem; }
.nav__links a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.nav__links a.is-active { color: var(--accent); }
/* Keep the CTA text white — .nav__links a (gray) + :hover (ink) outrank .btn--primary otherwise. */
.nav__links a.btn--primary,
.nav__links a.btn--primary:hover { color: #fff; background: var(--accent-grad); }
.nav__cta { margin-left: 8px; }
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  width: 42px; height: 42px; border-radius: 8px;
}
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px auto; border-radius: 2px; transition: .2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px; box-shadow: var(--shadow);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 14px; }
  .nav__cta { margin: 8px 0 0; }
  .nav__links .btn { width: 100%; }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #eaf0fb;
  background: radial-gradient(1100px 520px at 78% -10%, rgba(45,127,249,.40), transparent 60%),
              radial-gradient(900px 460px at 8% 8%, rgba(109,91,208,.28), transparent 55%),
              var(--ink);
  padding: clamp(64px, 11vw, 128px) 0 clamp(56px, 9vw, 104px);
}
.hero h1 { color: #fff; }
.hero .lead { color: #b8c4dc; }
.hero__inner { max-width: 760px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #dbe6fb;
}
.hero__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-light); box-shadow: 0 0 0 4px rgba(90,169,255,.18); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* Home hero: app logos with names (replaces CTA buttons there) */
.hero__apps { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 32px; }
.hero-app { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: transform .15s; }
.hero-app:hover { text-decoration: none; transform: translateY(-2px); }
.hero-app__logo { width: 128px; height: 128px; border-radius: 32px; box-shadow: 0 6px 18px rgba(8,14,32,.35); transition: box-shadow .15s; }
.hero-app:hover .hero-app__logo { box-shadow: 0 10px 26px rgba(8,14,32,.45); }
.hero-app__name { font-weight: 700; font-size: 1.1rem; color: #fff; letter-spacing: -.01em; }

/* ---- Cards / grids ------------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* Product cards (home) */
.product-card { display: flex; flex-direction: column; height: 100%; }
.product-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.product-card__logo { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.product-card h3 { margin: 0; }
.product-card p { color: var(--text-soft); flex: 1; }
.product-card__foot { margin-top: 18px; font-weight: 600; color: var(--accent); }

.badge {
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.badge--soon  { background: #fff4e0; color: #9a6500; }
.badge--avail { background: #e4f6ec; color: #137a47; }

/* Feature grid */
.feature { padding: 26px; }
.feature__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-soft-2); color: var(--accent); margin-bottom: 16px;
}
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--text-soft); margin: 0; font-size: .98rem; }
.feat-pro { color: var(--accent); font-weight: 700; margin-left: 1px; }
.features-note { margin-top: 32px; color: var(--text-faint); font-size: .92rem; }

/* Steps (how it works) */
.steps { counter-reset: step; max-width: 720px; margin-left: auto; margin-right: auto; }
.step { position: relative; padding-left: 0; text-align: center; }
.step__num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; font-weight: 700; margin-bottom: 16px;
  margin-left: auto; margin-right: auto;
}
.step h3 { font-size: 1.12rem; }
.step p { color: var(--text-soft); margin: 0; font-size: .98rem; }

/* ---- Mockup frames (placeholder screenshots) ---------------------------- */
.mockup {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: var(--white); box-shadow: var(--shadow-lg);
}
.mockup__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #f1f4fa; border-bottom: 1px solid var(--border); }
.mockup__bar i { width: 11px; height: 11px; border-radius: 50%; background: #d3dae6; display: block; }
.mockup__bar i:nth-child(1) { background: #ff5f57; }
.mockup__bar i:nth-child(2) { background: #febc2e; }
.mockup__bar i:nth-child(3) { background: #28c840; }
.mockup__body { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 24px;
  background: repeating-linear-gradient(45deg, #f7f9fd, #f7f9fd 12px, #f1f4fa 12px, #f1f4fa 24px); }
.mockup__label { text-align: center; color: var(--text-faint); font-weight: 600; font-size: .92rem; }
.mockup__label small { display: block; font-weight: 500; color: var(--text-faint); opacity: .8; margin-top: 4px; }

/* ---- Pricing ------------------------------------------------------------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; height: 100%; }
.plan--featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); position: relative; }
.plan__tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent-grad); color: #fff; font-size: .74rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px;
}
.plan h3 { margin-bottom: 4px; }
.plan__price { font-size: 2.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.plan__price span { font-size: .98rem; font-weight: 500; color: var(--text-soft); }
.plan__desc { color: var(--text-soft); font-size: .96rem; min-height: 44px; }
.plan__features { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan__features li { position: relative; padding: 7px 0 7px 28px; color: var(--text); font-size: .96rem; border-top: 1px solid var(--border); }
.plan__features li::before {
  content: ""; position: absolute; left: 0; top: 13px; width: 16px; height: 16px;
  background: var(--accent); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/14px no-repeat;
}
.plan__features li.muted { color: var(--text-faint); }
.plan__features li.muted::before { background: var(--text-faint); }

/* ---- FAQ accordion ------------------------------------------------------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 1.08rem; color: var(--ink);
  padding: 22px 40px 22px 0; position: relative;
}
.faq__q::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--accent); transition: transform .2s;
}
.faq__q[aria-expanded="true"]::after { content: "\2212"; }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq__a p { color: var(--text-soft); margin: 0 0 22px; }

/* ---- CTA band ------------------------------------------------------------ */
.cta-band {
  border-radius: var(--radius-lg); padding: clamp(40px, 6vw, 64px); text-align: center;
  color: #eaf0fb; position: relative; overflow: hidden;
  background: radial-gradient(700px 300px at 80% 0%, rgba(45,127,249,.5), transparent 60%), var(--ink);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #b8c4dc; }

/* ---- Waitlist form ------------------------------------------------------- */
.waitlist { display: flex; gap: 12px; max-width: 460px; margin: 22px auto 0; flex-wrap: wrap; }
.waitlist input[type="email"] {
  flex: 1; min-width: 220px; font: inherit; font-size: 1rem; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff;
}
.waitlist input::placeholder { color: #b8c4dc; }
.waitlist input:focus { outline: none; border-color: #fff; background: rgba(255,255,255,.16); }
.form-note { font-size: .85rem; color: #9fb0cc; margin-top: 12px; }
.form-success { display: none; background: rgba(40,200,100,.14); border: 1px solid rgba(40,200,100,.4); color: #d6ffe6; padding: 14px 18px; border-radius: var(--radius-sm); margin-top: 18px; }
.waitlist--light input[type="email"] { background: var(--white); border-color: var(--border); color: var(--text); }
.waitlist--light input::placeholder { color: var(--text-faint); }

/* ---- Legal / prose pages ------------------------------------------------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.note {
  background: var(--bg-soft); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 16px 20px; margin: 24px 0; font-size: .95rem; color: var(--text-soft);
}
.meta { color: var(--text-faint); font-size: .92rem; }

/* ---- Footer -------------------------------------------------------------- */
.footer { background: var(--ink); color: #aebbd4; padding: 64px 0 32px; }
.footer a { color: #c7d3ea; }
.footer a:hover { color: #fff; }
.footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer__top { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer__top { grid-template-columns: 1fr; } }
.footer__brand .brand { color: #fff; margin-bottom: 14px; }
.footer__brand p { color: #8a99b8; font-size: .95rem; max-width: 280px; }
.footer__col h4 { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: 10px; font-size: .96rem; }
.footer__bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .9rem; color: #7e8db0;
}

/* ---- Coming-soon hero variant ------------------------------------------- */
.soon { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; }
