@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Space+Mono:ital@0;1&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:         #07080c;
  --bg-card:    #101019;
  --bg-card2:   #16172234;
  --border:     rgba(255,255,255,.07);
  --border2:    rgba(255,255,255,.14);
  --text:       #eef1f7;
  --text-muted: #939bb0;
  --text-dim:   #555c70;
  --gold:       #f5b942;
  --red:        #e85d6c;
  --violet:     #9b5de5;
  --cyan:       #34d8e0;
  --green:      #56cfa1;
  --radius:     14px;
  --radius-sm:  7px;
  --font:       'Space Grotesk', system-ui, sans-serif;
  --font-mono:  'Space Mono', monospace;
  --nav-h:      62px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: normal; background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.skip-link {
  position: absolute; top: -100%; left: 1rem; background: var(--cyan); color: #000;
  padding: .4rem .8rem; border-radius: var(--radius-sm); font-size: .85rem; z-index: 999;
}
.skip-link:focus { top: 1rem; }

/* Orbs */
body::before, body::after {
  content: ''; position: fixed; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(130px);
}
body::before { width: 620px; height: 620px; top: -18%; left: -12%; background: rgba(52,216,224,.09); }
body::after  { width: 520px; height: 520px; bottom: -12%; right: -10%; background: rgba(155,93,229,.10); }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: rgba(7,8,12,.82); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em;
}
.nav-brand span {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-logo { display: block; flex: none; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a {
  font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
#lang-select {
  background: var(--bg-card); border: 1px solid var(--border2); color: var(--text-muted);
  font-family: var(--font); font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  padding: .3rem .5rem; border-radius: var(--radius-sm); cursor: pointer;
}
#lang-select:hover { color: var(--text); border-color: var(--cyan); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font-family: var(--font); font-weight: 700; letter-spacing: .02em;
  padding: .8rem 1.4rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: all .2s; font-size: .92rem;
}
.btn-primary { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #06070b; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary { background: transparent; border-color: var(--border2); color: var(--text); }
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.to-prompt { margin-left: auto; border-color: var(--violet); color: var(--violet); text-decoration: none; }
.to-prompt:hover { background: var(--violet); border-color: var(--violet); color: #fff; }
@media (max-width: 600px) { .to-prompt { margin-left: 0; width: 100%; justify-content: center; } }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--red); }
.sm { padding: .55rem .95rem; font-size: .8rem; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(4.5rem, 11vw, 8rem) clamp(1.25rem, 4vw, 3rem) clamp(3rem, 5vw, 4.5rem);
  display: flex; flex-direction: column; gap: 1.6rem; position: relative; z-index: 1;
  max-width: 880px;
}
.hero-label, .section-label {
  font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); letter-spacing: .04em;
}
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.8rem); line-height: 1.08; font-weight: 800; letter-spacing: -.03em; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.18rem); color: var(--text-muted); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .4rem; }

/* ─── How ────────────────────────────────────────────────────────────────── */
.how-section, .canvas-section {
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  position: relative; z-index: 1; border-top: 1px solid var(--border);
}
.how-section h2, .canvas-head h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; margin: .4rem 0 1.8rem;
}
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.how-step {
  display: flex; gap: 1rem; padding: 1.4rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.how-num { font-family: var(--font-mono); color: var(--violet); font-size: 1.1rem; font-weight: 700; }
.how-step strong { display: block; margin-bottom: .3rem; font-size: 1.05rem; }
.how-step p { color: var(--text-muted); font-size: .92rem; }

/* ─── Canvas ─────────────────────────────────────────────────────────────── */
.canvas-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.canvas-sub { color: var(--text-muted); font-size: .95rem; max-width: 560px; }
.ai-note { color: var(--text-muted); font-size: .82rem; line-height: 1.55; max-width: 620px; margin-top: .5rem; opacity: .9; }
.ai-note strong { color: var(--text); font-weight: 600; }
.model-input {
  background: var(--bg-card); border: 1px solid var(--border2); color: var(--text);
  font-family: var(--font-mono); font-size: .82rem; padding: .55rem .8rem;
  border-radius: var(--radius-sm); min-width: 170px;
}
.model-input:focus { outline: none; border-color: var(--cyan); }

/* Mode toggle */
.mode-toggle {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem;
}
.mode-label {
  font-family: var(--font-mono); font-size: .74rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .06em; margin-right: .3rem;
}
.mode-btn {
  background: var(--bg-card); border: 1px solid var(--border2); color: var(--text-muted);
  font-family: var(--font); font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: .4rem .9rem; border-radius: var(--radius-sm); transition: all .2s;
}
.mode-btn:hover { color: var(--text); border-color: var(--cyan); }
.mode-btn.active {
  background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #06070b;
  border-color: transparent;
}
.mission-intro {
  font-size: .88rem; color: var(--green); background: rgba(86,207,161,.07);
  border: 1px solid rgba(86,207,161,.2); border-radius: var(--radius-sm);
  padding: .7rem .9rem; margin-bottom: 1.2rem;
}

/* Info accordion */
.info-block { margin-bottom: 1.6rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.info-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: none; color: var(--text); cursor: pointer;
  font-family: var(--font); font-size: .95rem; font-weight: 700; padding: .9rem 1.1rem;
}
.info-toggle .chevron { transition: transform .2s; color: var(--cyan); }
.info-toggle.open .chevron { transform: rotate(180deg); }
.info-body { padding: 0 1.1rem 1.1rem; background: var(--bg-card); }
.info-intro { color: var(--text-muted); font-size: .9rem; margin-bottom: 1rem; }
.info-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .6rem 1.4rem; }
.info-row { font-size: .85rem; line-height: 1.5; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.info-row strong { color: var(--text); margin-right: .4rem; }
.info-row span { color: var(--text-muted); }
.info-order {
  margin-top: 1.1rem; font-size: .85rem; color: var(--text-dim);
  font-family: var(--font-mono); line-height: 1.6;
}

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.6rem; }

.canvas-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem;
}
.field-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem;
  position: relative; overflow: hidden; transition: border-color .2s;
}
.field-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; opacity: .85;
}
.accent-gold::before   { background: var(--gold); }
.accent-red::before    { background: var(--red); }
.accent-violet::before { background: var(--violet); }
.accent-cyan::before   { background: var(--cyan); }
.accent-green::before  { background: var(--green); }
.field-card:focus-within { border-color: var(--border2); }
.field-card.generating { border-color: var(--cyan); }
.field-card.generating::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(52,216,224,.08), transparent);
  animation: sweep 1.1s linear infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* span: 6-col grid → full=6, half=3, third=2 */
.col-full  { grid-column: span 6; }
.col-half  { grid-column: span 3; }
.col-third { grid-column: span 2; }

.field-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.field-titles h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.field-hint { font-size: .78rem; color: var(--text-dim); margin-top: .1rem; }
.ai-btn {
  flex-shrink: 0; background: var(--bg-card2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); width: 30px; height: 30px; cursor: pointer;
  font-size: .95rem; line-height: 1; transition: all .2s;
}
.ai-btn:hover:not(:disabled) { border-color: var(--cyan); transform: scale(1.08); }
.ai-btn:disabled { opacity: .4; cursor: progress; }
.field-input {
  width: 100%; min-height: 92px; resize: vertical; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: .9rem; line-height: 1.5; padding: .65rem .75rem;
}
.field-input:focus { outline: none; border-color: var(--cyan); }
.field-input::placeholder { color: var(--text-dim); }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(150%);
  background: var(--bg-card); border: 1px solid var(--border2); color: var(--text);
  padding: .7rem 1.2rem; border-radius: var(--radius-sm); font-size: .88rem;
  z-index: 500; transition: transform .3s; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem); border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: .85rem; position: relative; z-index: 1;
}

/* ─── Next-Best-Action strip ─────────────────────────────────────────────── */
.nba-strip {
  max-width: 1100px; margin: 0 auto; padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 1rem;
}
.nba-label {
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 1rem;
}
.nba-cards {
  display: flex; flex-wrap: wrap; gap: 14px;
}
.nba-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border: 1px solid var(--border2); border-radius: 14px; text-decoration: none;
  color: var(--text); background: var(--bg-card); min-width: 220px; flex: 1;
  transition: border-color .15s, transform .15s, background .15s;
}
.nba-card:hover {
  border-color: var(--cyan); transform: translateY(-2px);
  background: var(--bg-card2);
}
.nba-emoji { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.nba-text { display: flex; flex-direction: column; gap: 2px; }
.nba-text strong { font-size: .9rem; font-weight: 600; }
.nba-text em { font-size: .76rem; opacity: .6; font-style: normal; }

/* ─── Print / PDF export ─────────────────────────────────────────────────── */
@media print {
  nav, .hero, .how-section, .toolbar, .mode-toggle, .info-block,
  .mission-intro, .canvas-head p.canvas-sub, #model-input,
  .ai-btn, .nba-strip, footer, #toast { display: none !important; }

  body { background: #fff; color: #111; }
  .canvas-section { padding: 0; }
  .canvas-head { padding: 1.5rem 1.5rem .5rem; }
  .canvas-head h2 { font-size: 1.3rem; color: #111; }

  .canvas-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px; padding: 0 1.5rem 1.5rem;
  }
  .col-full  { grid-column: span 3 !important; }
  .col-half  { grid-column: span 2 !important; }
  .col-third { grid-column: span 1 !important; }

  .field-card {
    border: 1px solid #ddd; border-radius: 6px; background: #fff;
    break-inside: avoid; padding: .7rem;
  }
  .field-card h3 { font-size: .8rem; color: #333; margin-bottom: .25rem; }
  .field-hint { display: none; }
  .field-input {
    border: none; resize: none; font-size: .8rem; color: #111;
    min-height: unset; height: auto; overflow: visible;
    white-space: pre-wrap; word-break: break-word;
  }

  .canvas-section::after {
    content: 'MatchYourBusinessModel — matchyourbusinessmodel.vercel.app';
    display: block; text-align: center; font-size: .7rem; color: #999;
    padding: 1rem 0 .5rem; border-top: 1px solid #eee; margin-top: 1rem;
  }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .canvas-grid { grid-template-columns: repeat(2, 1fr); }
  .col-full, .col-half, .col-third { grid-column: span 2; }
}
@media (max-width: 560px) {
  .nav-links { gap: .9rem; }
  .canvas-grid { grid-template-columns: 1fr; }
  .col-full, .col-half, .col-third { grid-column: span 1; }
}

/* ─── Mission/Business explainer cards (above the mode toggle) ─────────────── */
.mode-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.mode-explain-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.mode-explain-card.accent { border-color: rgba(155,93,229,.4); }
.mode-explain-card strong { display: block; font-size: .92rem; margin-bottom: 5px; }
.mode-explain-card.accent strong { color: var(--violet); }
.mode-explain-card span { font-size: .82rem; color: var(--text-muted); line-height: 1.45; }
@media (max-width: 560px) { .mode-explain { grid-template-columns: 1fr; } }

/* ─── napkin (one-shot idea → canvas) ─────────────────────────────────────── */
.napkin {
  margin-top: 1.4rem; max-width: 620px;
  background: var(--bg-card); border: 1px dashed var(--border2);
  border-radius: var(--radius); padding: 1.2rem 1.3rem;
  transform: rotate(-.4deg);
}
.napkin-title {
  font-family: var(--font-mono); font-size: .85rem; color: var(--gold);
  margin: 0 0 .6rem;
}
.napkin-input {
  width: 100%; resize: vertical; min-height: 96px;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 1.05rem; line-height: 1.5;
}
.napkin-input::placeholder { color: var(--text-dim); }
.napkin-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-top: .8rem;
}
.napkin-note {
  margin: .7rem 0 0; font-size: .75rem; color: var(--text-dim);
}

/* one-shot reveal: blocks land one at a time */
.field-card.revealed { animation: reveal .5s ease both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* home subscribe CTA (MailerLite) */
.home-cta { max-width: 620px; margin: 2.5rem auto 0; padding: 2rem 0; border-top: 1px solid var(--border); }
.home-cta .ml-slot { margin: 1rem 0; }
.home-cta .sub-privacy { font-size: .78rem; color: var(--text-dim); }

/* ── premium unlock (js/premium.js) ─────────────────────────────────────────── */
.premium-box { margin-top: 1.5rem; }
.premium { padding: 1rem 1.25rem; border: 1px solid rgba(120,120,255,.35); border-radius: 12px;
  background: rgba(120,120,255,.06); }
.premium-badge { display:inline-block; font-size:.8rem; font-weight:700; border:1px solid rgba(120,120,255,.5);
  border-radius:999px; padding:2px 10px; margin-bottom:.6rem; }
.premium-teaser { margin:0 0 .8rem; opacity:.9; }
.premium-redeem { display:flex; gap:.5rem; margin-top:.8rem; flex-wrap:wrap; }
.premium-redeem input { flex:1; min-width:180px; padding:8px 10px; border-radius:8px;
  border:1px solid rgba(0,0,0,.15); background:#fff; color:inherit; }
.premium-msg { margin:.5rem 0 0; font-size:.85rem; opacity:.8; }
.premium-msg.error { color:#d33; opacity:1; }
.premium-out { margin-top:1rem; padding:1rem; border-radius:8px; background:rgba(0,0,0,.04);
  white-space:pre-wrap; line-height:1.5; max-height:60vh; overflow:auto; }
