/* ============================================================
   DREAMERSFORGE DESIGN SYSTEM — v1.0
   Single source of truth. Every page imports this.
   Change a token here, it propagates everywhere.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --bg: #FBFBF9;
  --surface: #FFFFFF;
  --ink: #14181F;
  --ink-soft: #3D4450;
  --muted: #6B7280;
  --line: #E7E5E0;
  --line-soft: #F1EFEA;
  --ember: #E25822;
  --ember-deep: #B23A12;
  --gold: #C77B1F;
  --steel: #1E2A3A;
  --steel-soft: #2A3648;
  --success: #2F7A3D;
  --success-bg: #F1F9F1;
  --success-line: #CBE5CB;
  --warn: #8A5A00;
  --warn-bg: #FFF4E6;
  --warn-line: #F5D9B0;
  --error: #A02020;
  --error-bg: #FDECEC;
  --error-line: #F4C7C7;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  /* Space */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Radius */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;

  /* Shadow */
  --shadow-1: 0 2px 8px rgba(20,24,31,0.04);
  --shadow-2: 0 6px 24px rgba(20,24,31,0.08);
  --shadow-3: 0 12px 36px rgba(20,24,31,0.12);
  --shadow-ember: 0 10px 34px rgba(226,88,34,0.14);

  /* Layout */
  --maxw: 1200px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.h-display { font-size: 56px; line-height: 1.06; letter-spacing: -0.035em; font-weight: 800; }
.h-1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.028em; font-weight: 750; }
.h-2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
.h-3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; }
.h-4 { font-size: 16px; line-height: 1.4; letter-spacing: 0; font-weight: 700; }
.body-lg { font-size: 18px; color: var(--ink-soft); }
.body { font-size: 15px; color: var(--ink-soft); }
.small { font-size: 13.5px; color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
}
.ember-word {
  color: transparent;
  background: linear-gradient(90deg, #F7A25A, var(--ember), var(--gold));
  -webkit-background-clip: text; background-clip: text;
}
code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: rgba(20,24,31,0.05); padding: 2px 7px; border-radius: 5px;
  color: var(--ink-soft);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }
.section { padding: var(--sp-8) 0; }
.section-bordered { border-bottom: 1px solid var(--line); }
.section-surface { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--steel); color: #F2F3F5; }
.section-head { text-align: center; margin-bottom: var(--sp-7); }
.section-head .h-2 { margin-top: var(--sp-3); }
.section-head .body { margin-top: var(--sp-3); max-width: 620px; margin-left: auto; margin-right: auto; }

/* Grid helpers */
.grid { display: grid; gap: var(--sp-5); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-6 { grid-template-columns: repeat(6, 1fr); }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.hidden { display: none !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-weight: 600; font-size: 14.5px;
  padding: 10px 18px; border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  text-decoration: none; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-ember { background: var(--ember); color: #fff; }
.btn-ember:hover { background: var(--ember-deep); }
.btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: var(--steel); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-ghost-dark { border-color: rgba(255,255,255,0.28); color: #F2F3F5; background: rgba(255,255,255,0.02); }
.btn-ghost-dark:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); }
.btn-lg { padding: 14px 24px; font-size: 15.5px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--sp-2); color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.input, .textarea, .select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: 15px; font-family: inherit;
  background: var(--bg); color: var(--ink);
}
.input:focus, .textarea:focus, .select:focus {
  outline: 2px solid var(--ember); outline-offset: 1px; border-color: transparent;
}
.textarea { min-height: 100px; resize: vertical; }

/* ============================================================
   CARDS & DOORS
   ============================================================ */
.card {
  background: var(--surface); border: none; box-shadow: 0 0 0 1px rgba(20,24,31,0.06);
  border-radius: var(--r-lg); padding: var(--sp-6);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 0 0 1px rgba(20,24,31,0.09), var(--shadow-2); }

.door {
  background: var(--surface); border: none; box-shadow: 0 0 0 1px rgba(20,24,31,0.06);
  border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.door:hover { box-shadow: 0 0 0 1px rgba(20,24,31,0.09), var(--shadow-2); transform: translateY(-2px); }
.door-img { width: 100%; aspect-ratio: 4/5; background-size: cover; background-position: center; }
.door-body { padding: var(--sp-5); display: flex; flex-direction: column; flex: 1; }
.door-body .h-3 { margin-bottom: var(--sp-2); }
.door-body .body { flex: 1; margin-bottom: var(--sp-5); }
.door-foot { display: flex; align-items: center; justify-content: space-between; }
.door-link { font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.door-link:after { content: " →"; color: var(--ember); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  border: none; color: var(--muted); background: rgba(20,24,31,0.05);
}
.badge-free { background: rgba(47,122,61,0.10); color: #2F7A3D; box-shadow: 0 0 0 1px rgba(47,122,61,0.12); }
.badge-member { background: rgba(199,123,31,0.10); color: var(--gold); box-shadow: 0 0 0 1px rgba(199,123,31,0.14); }
.badge-pro { background: rgba(178,58,18,0.08); color: var(--ember-deep); box-shadow: 0 0 0 1px rgba(178,58,18,0.14); }
.badge-new { background: var(--steel); color: #fff; }
.badge-soon { background: rgba(30,42,58,0.06); color: var(--ink-soft); box-shadow: 0 0 0 1px rgba(30,42,58,0.10); }

/* ---- Capability badges ----
   Every tool states plainly what it actually does. No one should be able to
   feel misled by a tool after paying for it. */
.cap {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 6px;
  border: none; white-space: nowrap;
}
.cap-generates { background: rgba(36,112,74,0.09); color: #24704A; box-shadow: 0 0 0 1px rgba(36,112,74,0.12); }
.cap-prompt    { background: rgba(44,91,143,0.08); color: #2C5B8F; box-shadow: 0 0 0 1px rgba(44,91,143,0.12); }
.cap-external  { background: rgba(138,90,0,0.08); color: #8A5A00; box-shadow: 0 0 0 1px rgba(138,90,0,0.12); }
.cap-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--sp-3); }

/* ============================================================
   PRICING TIERS
   ============================================================ */
.tier {
  border: none; box-shadow: 0 0 0 1px rgba(20,24,31,0.06);
  border-radius: var(--r-lg); padding: var(--sp-6);
  background: var(--bg); display: flex; flex-direction: column;
}
.tier.featured { box-shadow: 0 0 0 1.5px var(--ember), var(--shadow-ember); background: #fff; position: relative; }
.tier.featured::before {
  content: "Most popular"; position: absolute; top: -12px; left: var(--sp-6);
  background: var(--ember); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.05em; text-transform: uppercase;
}
.tier-name { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.tier-price { font-size: 42px; font-weight: 800; letter-spacing: -0.03em; margin: var(--sp-3) 0 2px; }
.tier-price span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tier-desc { font-size: 14px; color: var(--muted); margin-bottom: var(--sp-5); }
.tier ul { list-style: none; margin-bottom: var(--sp-6); flex: 1; }
.tier li {
  font-size: 14.5px; color: var(--ink-soft); padding: 8px 0 8px 26px;
  position: relative; border-bottom: 1px solid var(--line-soft);
}
.tier li:last-child { border-bottom: none; }
.tier li::before { content: "\2713"; position: absolute; left: 2px; color: var(--ember); font-weight: 700; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 13px 17px; border-radius: var(--r-md); font-size: 14px;
  border: none; margin-bottom: var(--sp-4);
}
.alert-info { background: rgba(30,42,58,0.045); color: var(--ink-soft); box-shadow: 0 0 0 1px rgba(30,42,58,0.07); }
.alert-success { background: rgba(47,122,61,0.07); color: #2F7A3D; box-shadow: 0 0 0 1px rgba(47,122,61,0.10); }
.alert-warn { background: rgba(138,90,0,0.07); color: #8A5A00; box-shadow: 0 0 0 1px rgba(138,90,0,0.10); }
.alert-error { background: rgba(160,32,32,0.06); color: #A02020; box-shadow: 0 0 0 1px rgba(160,32,32,0.10); }
.alert-ember { background: rgba(178,58,18,0.06); color: var(--ember-deep); box-shadow: 0 0 0 1px rgba(178,58,18,0.10); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,249,0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
  font-size: 14.5px; color: var(--ink-soft); font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--ember); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 16px; cursor: pointer;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { padding: var(--sp-8) 0 var(--sp-6); border-top: 1px solid var(--line); background: var(--bg); }
.footer-grid { display: flex; justify-content: space-between; gap: var(--sp-6); flex-wrap: wrap; }
.footer-col { min-width: 140px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: var(--sp-3); font-weight: 700; }
.footer-col a { display: block; font-size: 14.5px; color: var(--ink-soft); padding: 4px 0; cursor: pointer; }
.footer-col a:hover { color: var(--ember-deep); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); font-weight: 700; }
.footer-brand img { width: 26px; height: 26px; border-radius: 6px; }
.footer-base {
  margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3);
  font-size: 13px; color: var(--muted);
}

/* ============================================================
   HERO + SECTION BACKDROP PATTERN
   ============================================================ */
.hero {
  position: relative; min-height: 620px; overflow: hidden;
  background: var(--steel); display: flex; align-items: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.95);
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20,24,31,0.30) 0%, rgba(20,24,31,0.10) 40%, rgba(20,24,31,0.55) 100%),
    radial-gradient(ellipse at 50% 40%, rgba(20,24,31,0) 0%, rgba(20,24,31,0.35) 70%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding: 100px 0 88px; text-align: center; color: #F2F3F5; }
.hero-inner h1 {
  font-size: 56px; line-height: 1.06; letter-spacing: -0.035em; font-weight: 800;
  max-width: 820px; margin: 0 auto var(--sp-5);
  text-shadow: 0 2px 40px rgba(0,0,0,0.35);
}
.hero-inner .sub {
  font-size: 19px; color: #D8DBE1; max-width: 640px; margin: 0 auto var(--sp-6);
  text-shadow: 0 1px 20px rgba(0,0,0,0.4);
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: var(--sp-5); font-size: 13.5px; color: #A9B2C0; }

/* Compact hero for category landing pages */
.hero-compact { min-height: 340px; }
.hero-compact .hero-inner { padding: 72px 0 60px; }
.hero-compact .hero-inner h1 { font-size: 44px; }
.hero-compact .hero-inner .sub { font-size: 17px; }

/* Molten seam divider */
.seam-divider {
  height: 90px;
  background-size: cover; background-position: center;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* Dark CTA panel with art backdrop */
.cta-panel {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl); min-height: 320px;
  display: flex; align-items: center;
  color: #EDEFF3; border: 1px solid var(--steel-soft);
}
.cta-panel-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cta-panel-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20,24,31,0.85) 0%, rgba(20,24,31,0.55) 55%, rgba(20,24,31,0.10) 100%);
}
.cta-panel-inner { position: relative; z-index: 2; padding: 48px 52px; max-width: 620px; }

/* ============================================================
   TOOL PAGE SHELL
   Every rewritten Forge tool wraps its UI in this.
   ============================================================ */
.tool-shell { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.tool-header {
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3);
}
.tool-title { display: flex; align-items: center; gap: 12px; }
.tool-title-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--steel); position: relative; overflow: hidden;
}
.tool-title-mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--ember-deep), var(--ember), var(--gold));
}
.tool-title-name { font-weight: 700; font-size: 15px; }
.tool-title-sub { font-size: 12.5px; color: var(--muted); }
.tool-meta { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--muted); }
.credit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #FAF6EE; border: 1px solid #E4D9C8; color: var(--gold);
  font-size: 12.5px; font-weight: 700;
}
.tool-body { padding: var(--sp-6); }

/* ============================================================
   MODAL (login / signup)
   ============================================================ */
.modal-veil {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(20,24,31,0.55);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-veil.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 420px;
  padding: 36px 34px; box-shadow: 0 24px 60px rgba(20,24,31,0.30);
}
.modal-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4); font-weight: 700; font-size: 15px; }
.modal-brand img { width: 26px; height: 26px; border-radius: 6px; }
.modal h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: var(--sp-2); }
.modal p { font-size: 14px; color: var(--muted); margin-bottom: var(--sp-5); }
.modal .btn { width: 100%; margin-top: var(--sp-2); }
.modal-alt { text-align: center; margin-top: var(--sp-4); font-size: 13.5px; color: var(--muted); }
.modal-alt a { color: var(--ember-deep); font-weight: 600; cursor: pointer; }
.modal-msg { font-size: 13.5px; margin-top: var(--sp-3); text-align: center; color: var(--ember-deep); min-height: 18px; }
.modal-close {
  float: right; background: none; border: none; font-size: 20px; color: var(--muted);
  cursor: pointer; margin: -10px -6px 0 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .g-3, .g-4, .g-6 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner h1 { font-size: 44px; }
  .hero-inner { padding: 80px 0 72px; }
  .hero-compact .hero-inner h1 { font-size: 34px; }
}
@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; align-items: flex-start; }
  .nav-links a { padding: 10px 0; width: 100%; }
  .menu-toggle { display: block; }
  .g-2, .g-3, .g-4, .g-6 { grid-template-columns: 1fr; }
  .hero { min-height: 520px; }
  .hero-inner { padding: 60px 0 56px; }
  .hero-inner h1 { font-size: 32px; }
  .hero-inner .sub { font-size: 16px; }
  .section { padding: 60px 0; }
  .cta-panel-inner { padding: 32px 28px; }
  .cta-panel-scrim {
    background: linear-gradient(180deg, rgba(20,24,31,0.65) 0%, rgba(20,24,31,0.85) 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
