/* ============================================================
   StoryCave marketing site — global styles
   Plain CSS (no framework, no build). Tokens in tokens.css.
   ============================================================ */

/* --- Self-hosted variable fonts (no third-party CDN at runtime) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/fraunces-latin-wght.woff2') format('woff2');
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}

/* --- Base --- */
body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--bg-page);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}
h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  max-width: 62ch;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.section {
  padding-block: var(--space-24);
}
.section--sunken {
  background: var(--bg-sunken);
}
.section__intro {
  max-width: 56ch;
  margin-inline: auto;
  text-align: center;
  margin-bottom: var(--space-12);
}
.section__intro p {
  max-width: none;
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 1.05rem;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: var(--space-3);
}

/* --- Buttons / badges --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 18px rgba(232, 151, 31, 0.35);
}
.btn--primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text-on-shell);
  border-color: var(--border-on-shell);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* "Coming soon" store badge placeholders (non-clickable) */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-on-shell);
  color: var(--text-on-shell);
  cursor: default;
  user-select: none;
}
.badge svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.badge__label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.badge__label small {
  font-size: 0.68rem;
  color: var(--text-on-shell-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge__label span {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.badge__soon {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cave-950);
  background: var(--amber-400);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--cave-950) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-on-shell);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-on-shell);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.wordmark svg {
  width: 30px;
  height: 30px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.site-nav a {
  color: var(--text-on-shell-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
}
.site-nav a:hover {
  color: var(--text-on-shell);
}

/* --- Hero --- */
.hero {
  position: relative;
  background: var(--bg-shell);
  color: var(--text-on-shell);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* lantern glow */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 72% 18%, rgba(232, 151, 31, 0.3), transparent 60%),
    radial-gradient(50% 50% at 15% 90%, rgba(124, 92, 252, 0.22), transparent 65%);
}
.hero .container {
  padding-block: clamp(64px, 12vw, 128px);
  max-width: 760px;
  text-align: center;
}
.hero h1 {
  color: var(--text-on-shell);
}
.hero h1 .accent {
  color: var(--amber-400);
}
.hero p.lede {
  margin: var(--space-6) auto 0;
  font-size: 1.2rem;
  color: var(--text-on-shell-muted);
  max-width: 52ch;
}
.hero .badges {
  justify-content: center;
}

/* --- Feature cards --- */
.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}
.card__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: var(--space-4);
}
.card__icon svg {
  width: 24px;
  height: 24px;
}
.card--magic .card__icon {
  background: var(--magic-soft);
  color: var(--magic-strong);
}
.card h3 {
  margin-bottom: var(--space-2);
}
.card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: none;
}

/* --- Steps ("how it works") --- */
.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step {
  position: relative;
  padding-left: 56px;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--cave-950);
  color: var(--amber-400);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}
.step h3 {
  margin-bottom: var(--space-2);
}
.step p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* --- Plan cards --- */
.plans {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}
.plan {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.plan--featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.plan__flag {
  position: absolute;
  top: -12px;
  left: var(--space-8);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.plan h3 {
  font-size: 1.4rem;
}
.plan__price {
  margin: var(--space-4) 0 var(--space-2);
}
.plan__price .amount {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--text-strong);
}
.plan__price .per {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.plan__annual {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.plan__profiles {
  margin: var(--space-4) 0;
  padding: var(--space-3) 0;
  border-block: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-strong);
}
.plan__profiles span {
  color: var(--magic-strong);
}
.plan__trial {
  color: var(--leaf-400);
  font-weight: 600;
  font-size: 0.95rem;
}
.plan .btn {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-6);
  background: var(--bg-sunken);
  color: var(--text-muted);
  cursor: default;
  box-shadow: none;
}

/* "Every plan includes" */
.includes {
  display: grid;
  gap: var(--space-3) var(--space-8);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--space-12);
  max-width: 760px;
  margin-inline: auto;
}
.includes li {
  list-style: none;
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  color: var(--text-body);
}
.includes li::before {
  content: '✦';
  color: var(--accent-strong);
  flex: none;
}

/* Subscription disclosure */
.disclosure {
  margin-top: var(--space-16);
  padding: var(--space-6);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 820px;
  margin-inline: auto;
}
.disclosure p {
  max-width: none;
}
.disclosure p + p {
  margin-top: var(--space-3);
}

/* --- Legal / prose pages --- */
.prose {
  max-width: 760px;
  margin-inline: auto;
}
.prose h2 {
  margin-top: var(--space-12);
  font-size: 1.4rem;
}
.prose h3 {
  margin-top: var(--space-8);
}
.prose p,
.prose li {
  color: var(--text-body);
  margin-top: var(--space-3);
}
.prose ul {
  padding-left: var(--space-6);
  margin-top: var(--space-3);
}
.prose a {
  color: var(--magic-strong);
}
.draft-banner {
  background: var(--amber-100);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  color: var(--ink-900);
  font-weight: 500;
  margin-bottom: var(--space-8);
}
.page-head {
  text-align: center;
  padding-block: var(--space-16) var(--space-8);
}
.page-head .updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-2);
}

/* --- Contact --- */
.contact-card {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  box-shadow: var(--shadow-sm);
}
.contact-card .email {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--magic-strong);
  text-decoration: none;
  display: inline-block;
  margin: var(--space-4) 0;
}
.contact-card .email:hover {
  text-decoration: underline;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-shell);
  color: var(--text-on-shell-muted);
  padding-block: var(--space-16) var(--space-8);
}
.site-footer .container {
  display: grid;
  gap: var(--space-8);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand {
  max-width: 320px;
}
.footer-brand p {
  margin-top: var(--space-3);
  font-size: 0.92rem;
}
.footer-soon {
  margin-top: var(--space-4);
  font-size: 0.82rem;
  color: var(--text-on-shell-muted);
}
.footer-links {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-on-shell-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-links a:hover {
  color: var(--text-on-shell);
}
.footer-bottom {
  border-top: 1px solid var(--border-on-shell);
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-size: 0.85rem;
}
.footer-bottom a {
  color: var(--text-on-shell-muted);
}

/* --- Focus visibility (a11y) --- */
a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--amber-400);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (max-width: 640px) {
  .site-nav {
    gap: var(--space-4);
  }
  .footer-top {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
