/* style.css — MyNextMove */

/* ── Reset + Variables ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #F7F5F2;
  --surface:     #FFFFFF;
  --surface-alt: #F2F0EB;
  --primary:     #1C2E1C;
  --primary-mid: #2D4A2D;
  --accent:      #B07D4B;
  --accent-light:#F2E8D6;
  --accent-mid:  #8A5F35;
  --text:        #1A1A18;
  --text-muted:  #6B6855;
  --text-light:  #9A9880;
  --border:      #E5E2D8;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 12px 32px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.05);
  --radius:      12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --transition:  0.2s ease;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app { min-height: 100vh; }

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); font-weight: 600; }
p  { max-width: 62ch; }

/* ── Layout Containers ──────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.container--wide {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ── Nav Bar ────────────────────────────────────────────────────────────────── */
.nav {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand span {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-lang {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.btn-lang:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--text-light);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover { background: var(--accent-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface-alt); color: var(--text); border-color: var(--text-light); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.875rem;
}
.btn-ghost:hover { color: var(--text); }

.btn-lg { padding: 18px 36px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* ── Landing Page ───────────────────────────────────────────────────────────── */
.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 80px 24px 60px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  margin-bottom: 16px;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  max-width: 50ch;
  margin: 0 auto 10px;
  line-height: 1.5;
}

.hero-subtext {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0 auto 40px;
  max-width: 44ch;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ── Mode Cards ─────────────────────────────────────────────────────────────── */
.mode-section {
  padding: 0 24px 80px;
}

.mode-section-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 24px;
}

.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.mode-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.mode-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mode-card--practical:hover { border-color: var(--primary); }
.mode-card--symbolic:hover  { border-color: var(--accent); }

.mode-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.mode-badge--practical { background: #E8F0E8; color: var(--primary); }
.mode-badge--symbolic  { background: var(--accent-light); color: var(--accent-mid); }

.mode-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}

.mode-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: none;
}

/* ── Input Flow ─────────────────────────────────────────────────────────────── */
.input-page {
  flex: 1;
  padding: 40px 0 80px;
}

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 48px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.step-title {
  margin-bottom: 8px;
  color: var(--primary);
}

.step-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 36px;
  max-width: none;
}

/* ── Area Grid ──────────────────────────────────────────────────────────────── */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 40px;
}

.area-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.area-card:hover, .area-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-mid);
}

.area-icon {
  font-size: 1.1rem;
  margin-bottom: 6px;
  display: block;
}

/* ── Textarea ───────────────────────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

textarea, input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
  transition: var(--transition);
  outline: none;
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 125, 75, 0.12);
}

textarea { min-height: 160px; }

.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* ── Chip Grid ──────────────────────────────────────────────────────────────── */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover { border-color: var(--accent); color: var(--accent-mid); }

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Risk Options ───────────────────────────────────────────────────────────── */
.risk-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.risk-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  color: var(--text);
}

.risk-card:hover, .risk-card.selected {
  border-color: var(--primary);
  background: #EEF2EE;
  color: var(--primary);
}

/* ── Step Navigation ────────────────────────────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.step-nav-skip {
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: var(--font-sans);
}
.step-nav-skip:hover { color: var(--text-muted); }

/* ── Processing ─────────────────────────────────────────────────────────────── */
.processing-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  padding: 60px 24px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.processing-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Result Page ────────────────────────────────────────────────────────────── */
.result-page {
  flex: 1;
  padding: 48px 0 80px;
}

.result-header {
  text-align: center;
  margin-bottom: 48px;
}

.result-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.result-move-type {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-mid);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.result-title {
  margin-bottom: 8px;
  color: var(--primary);
}

.result-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Result Sections ────────────────────────────────────────────────────────── */
.result-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.result-card--accent {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.result-card--accent .section-label { color: rgba(255,255,255,0.55); }
.result-card--accent p { color: rgba(255,255,255,0.92); max-width: none; }
.result-card--accent .section-title { color: #fff; }

.result-card--warm {
  background: var(--accent-light);
  border-color: rgba(176, 125, 75, 0.2);
}

.result-card--warn {
  background: #FFF8F0;
  border-color: rgba(176, 125, 75, 0.25);
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.35;
}

.result-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: none;
}

.bias-name {
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 12px;
  display: block;
}

.action-text {
  font-size: 1rem;
  color: var(--text);
  font-weight: 450;
  line-height: 1.75;
  max-width: none;
}

.result-card--accent .action-text { color: rgba(255,255,255,0.95); font-weight: 400; }

/* ── Section G ──────────────────────────────────────────────────────────────── */
.section-g-card {
  background: var(--surface-alt);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  text-align: center;
  border: 1px solid var(--border);
}

.section-g-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── Share Card ─────────────────────────────────────────────────────────────── */
.share-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.share-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 20px;
}

.share-card {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: white;
  margin-bottom: 16px;
}

.share-card-type {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.share-card-move {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 20px;
  display: block;
}

.share-card-tagline {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}

.share-card-brand {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
}

.share-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Reveal Mode ────────────────────────────────────────────────────────────── */
.reveal-page {
  flex: 1;
  padding: 48px 0 80px;
}

.reveal-header {
  margin-bottom: 40px;
}

.reveal-q-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.reveal-q-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

.reveal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.reveal-opt {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
}
.reveal-opt:hover, .reveal-opt.selected { border-color: var(--accent); background: var(--accent-light); color: var(--accent-mid); }

.reveal-field { margin-bottom: 28px; }
.reveal-field textarea { min-height: 100px; }

/* ── Reveal Result ──────────────────────────────────────────────────────────── */
.reveal-result-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 32px;
}

/* ── Start Over ─────────────────────────────────────────────────────────────── */
.start-over-wrap {
  text-align: center;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.footer-fsc {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 6px;
  max-width: none;
}

.footer-fsc-cta {
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: var(--font-sans);
}

.footer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.6;
  max-width: none;
}

.footer-privacy {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 8px;
  max-width: none;
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.fade-in {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 56px 24px 40px; }
  .hero-system { right: 16px; top: 28px; width: 92px; opacity: 0.42; }
  .mode-cards,
  .mode-cards--three { grid-template-columns: 1fr; }
  button.mode-card { min-height: 220px; }
  .option-grid { grid-template-columns: 1fr; }
  .option-set { padding: 22px; }
  .tool-workbench { width: calc(100% - 32px); padding: 32px 0 60px; }
  .tool-toolbar { justify-content: stretch; }
  .tool-toolbar .btn { flex: 1 1 auto; }
  .tool-toolbar .btn:first-child { margin-right: 0; }
  .tool-grid--triz,
  .tool-grid--models,
  .tool-result-grid { grid-template-columns: 1fr; }
  .result-footer-actions--split { flex-direction: column; }
  .area-grid { grid-template-columns: 1fr 1fr; }
  .result-card { padding: 24px 22px; }
  .share-card { padding: 22px 20px; }
  .nav { padding: 14px 16px; }
  .container, .container--wide { padding: 0 16px; }
  .step-nav { flex-wrap: wrap; gap: 10px; }
  .share-actions { flex-direction: column; }
  .result-header { margin-bottom: 32px; }
  .result-page, .reveal-page { padding: 32px 0 60px; }
}

@media (max-width: 380px) {
  .area-grid { grid-template-columns: 1fr; }
}

/* ── Focus styles (keyboard navigation) ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible, .mode-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
textarea:focus-visible {
  outline: none; /* uses border+shadow instead (defined above) */
}

/* ── App.js class bridge — CSS was written with different names than app.js uses.
   These aliases map the generated HTML classes to their styled equivalents.  ── */

/* Navigation */
.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.lang-toggle:hover { background: var(--surface-alt); color: var(--text); border-color: var(--text-light); }

/* Main content area */
.main { flex: 1; display: flex; flex-direction: column; }

/* Footer text classes */
.disclaimer { font-size: 0.78rem; color: var(--text-light); line-height: 1.6; max-width: none; }
.privacy    { font-size: 0.75rem; color: var(--text-light); margin-top: 8px; max-width: none; }
.footer     { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 24px; margin-top: auto; max-width: none; }
.footer p   { max-width: none; }

/* Hero */
.hero--systems {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(28,46,28,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,46,28,0.055) 1px, transparent 1px);
  background-size: 34px 34px;
}
.hero--systems::before {
  content: "THINK";
  position: absolute;
  left: max(20px, 8vw);
  top: 22px;
  z-index: -1;
  font-family: var(--font-sans);
  font-size: clamp(5rem, 18vw, 12rem);
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(28,46,28,0.045);
  line-height: 1;
}
.hero-sub { font-size: 0.95rem; color: var(--text-light); margin: 0 auto 16px; max-width: 54ch; text-align: center; }
.hero-micro {
  margin: 0 auto;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.hero-system {
  position: absolute;
  right: 8vw;
  top: 46px;
  width: 140px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  opacity: 0.68;
  pointer-events: none;
}
.hero-system span {
  position: absolute;
  border: 1px solid rgba(176,125,75,0.34);
  border-radius: 999px;
  animation: ringPulse 4s ease-in-out infinite;
}
.hero-system span:nth-child(1) { width: 38%; height: 38%; }
.hero-system span:nth-child(2) { width: 66%; height: 66%; animation-delay: 0.45s; }
.hero-system span:nth-child(3) { width: 94%; height: 94%; animation-delay: 0.9s; }
@keyframes ringPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.36; }
  50% { transform: scale(1.04); opacity: 0.78; }
}
.btn--hero {
  background: var(--primary); color: #fff;
  padding: 18px 36px; font-size: 1.05rem; border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.btn--hero:hover { background: var(--primary-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Buttons */
.btn--ghost {
  background: none; border: none; color: var(--text-muted);
  padding: 8px 12px; font-size: 0.875rem; font-family: var(--font-sans); cursor: pointer;
}
.btn--ghost:hover { color: var(--text); }

/* Mode section title */
.section-title {
  text-align: center; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 24px;
}
.mode-section--front { padding-bottom: 88px; }
.mode-cards--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 980px;
}

/* Mode cards — now <button> elements, reset default button styles */
button.mode-card {
  all: unset;
  box-sizing: border-box;
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
  width: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 0;
  isolation: isolate;
}
button.mode-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
button.mode-card h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--text); }
button.mode-card p  { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; max-width: none; }
.mode-index {
  position: absolute;
  right: 20px;
  top: 18px;
  font-family: var(--font-serif);
  font-size: 2.8rem;
  line-height: 1;
  color: rgba(28,46,28,0.06);
}
.mode-badge--triz { background: #E7EEF6; color: #24516E; }
.mode-badge--models { background: #EEE9F6; color: #59467A; }
.mode-badge--symbolic { background: var(--accent-light); color: var(--accent-mid); }
.mode-demo {
  margin-top: auto;
  height: 78px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.mode-demo--practical {
  display: flex;
  align-items: end;
  gap: 8px;
}
.mode-demo--practical span {
  flex: 1;
  height: 28px;
  background: var(--primary);
  opacity: 0.2;
  animation: barBreathe 2.4s ease-in-out infinite;
}
.mode-demo--practical span:nth-child(2) { height: 48px; animation-delay: 0.2s; }
.mode-demo--practical span:nth-child(3) { height: 36px; animation-delay: 0.4s; }
.mode-demo--triz {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.mode-demo--triz span {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(36,81,110,0.18);
  color: #24516E;
  background: rgba(231,238,246,0.82);
  border-radius: 8px;
  font-size: 1rem;
  animation: symbolLift 3s ease-in-out infinite;
}
.mode-demo--triz span:nth-child(2n) { color: var(--accent-mid); background: var(--accent-light); animation-delay: 0.25s; }
.mode-demo--triz span:nth-child(3n) { color: #59467A; background: #EEE9F6; animation-delay: 0.5s; }
.mode-demo--models {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: center;
}
.mode-demo--models span {
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(89,70,122,0.22);
  position: relative;
  animation: modelPulse 2.8s ease-in-out infinite;
}
.mode-demo--models span::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  background: rgba(89,70,122,0.16);
}
.mode-demo--models span:nth-child(2) { animation-delay: 0.25s; }
.mode-demo--models span:nth-child(3) { animation-delay: 0.5s; }
.mode-demo--models span:nth-child(4) { animation-delay: 0.75s; }
@keyframes barBreathe {
  0%, 100% { transform: scaleY(0.72); opacity: 0.16; }
  50% { transform: scaleY(1); opacity: 0.42; }
}
@keyframes symbolLift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes modelPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.42; }
  50% { transform: scale(1); opacity: 0.86; }
}

/* Step progress bar */
.step-progress { margin-bottom: 40px; }
.step-bar      { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.step-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }

/* Step section padding */
.step-section { padding: 40px 0 32px; }

/* Area buttons */
.area-btn {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; transition: var(--transition); text-align: left;
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500; color: var(--text);
  line-height: 1.4; width: 100%;
}
.area-btn:hover        { border-color: var(--accent); background: var(--accent-light); color: var(--accent-mid); }
.area-btn--active      { border-color: var(--accent); background: var(--accent-light); color: var(--accent-mid); }

/* Textarea class (CSS targets element; app.js uses class) */
.textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; font-family: var(--font-sans);
  font-size: 0.95rem; color: var(--text); line-height: 1.6; resize: vertical;
  transition: var(--transition); outline: none; min-height: 140px;
}
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176, 125, 75, 0.12); }

/* Char count warn state */
.char-count--warn { color: #c0392b; }

/* Chip active state */
.chip--active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Risk cards container + active state */
.risk-cards    { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.risk-card--active { border-color: var(--primary); background: #EEF2EE; color: var(--primary); }

/* Three-button step nav (step 5) */
.step-nav--three { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.step-nav--three .btn { margin-left: auto; }

/* Processing section */
.processing-section {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 24px; padding: 60px 24px; text-align: center;
}
.processing-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* Result section */
.result-section { flex: 1; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 20px; max-width: 720px; margin: 0 auto; width: 100%; }

/* Result card label */
.result-card-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.result-card--accent .result-card-label { color: rgba(255,255,255,0.55); }
.result-card--warn .result-card-label   { color: var(--accent-mid); }

/* Result card CTA variant */
.result-card--cta { background: var(--primary); color: #fff; border-color: transparent; }
.result-card--cta .result-card-label { color: rgba(255,255,255,0.55); }
.result-card--cta p { color: rgba(255,255,255,0.88); max-width: none; }
.result-card--cta .btn { margin-top: 16px; background: #fff; color: var(--primary); border: none; }
.result-card--cta .btn:hover { background: var(--accent-light); color: var(--primary); }

/* Move type badge */
.move-type-badge {
  display: inline-block; background: var(--accent-light); color: var(--accent-mid);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px; margin-top: 12px;
}

/* Move action text */
.move-action { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.7; color: var(--text); max-width: none; }

.option-set {
  background: #0f1713;
  color: #F7F5F2;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-md);
}
.option-set .result-card-label { color: rgba(247,245,242,0.48); }
.option-set-header h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: 18px;
}
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.option-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-radius: 10px;
  background: rgba(247,245,242,0.055);
  border: 1px solid rgba(247,245,242,0.1);
}
.option-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(72% 0.18 45 / 0.18);
  color: oklch(82% 0.16 45);
  font-size: 1rem;
  font-family: var(--font-serif);
}
.option-card:nth-child(2) .option-symbol { background: oklch(72% 0.14 210 / 0.18); color: oklch(82% 0.13 210); }
.option-card:nth-child(3) .option-symbol { background: oklch(72% 0.13 285 / 0.18); color: oklch(82% 0.12 285); }
.option-card:nth-child(4) .option-symbol { background: oklch(72% 0.14 145 / 0.18); color: oklch(82% 0.13 145); }
.option-card h4 {
  font-size: 0.92rem;
  line-height: 1.35;
  margin-bottom: 6px;
  color: #fff;
  font-family: var(--font-sans);
}
.option-card p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(247,245,242,0.72);
  max-width: none;
}

/* Direct TRIZ / Thinking Tools workbench */
.tool-workbench {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 80px;
}
.tool-header {
  text-align: center;
  margin: 0 auto 28px;
  max-width: 720px;
}
.tool-header .section-title {
  display: block;
  margin-bottom: 12px;
}
.tool-header h2 {
  color: var(--primary);
  margin-bottom: 10px;
}
.tool-header p {
  color: var(--text-muted);
  max-width: none;
}
.tool-issue {
  max-width: 760px;
  display: block;
  margin: 0 auto 18px;
}
.tool-toolbar {
  max-width: 760px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tool-toolbar .btn:first-child { margin-right: auto; }
.tool-grid {
  display: grid;
  gap: 12px;
}
.tool-grid--triz { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tool-grid--models { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tool-card {
  min-width: 0;
  min-height: 172px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card--active {
  border-color: var(--primary);
  background: #EEF2EE;
}
.tool-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-mid);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1;
  flex: 0 0 auto;
}
.tool-card--active .tool-symbol {
  background: var(--primary);
  color: #fff;
}
.tool-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
}
.tool-prompt {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.tool-result-section {
  max-width: 980px;
}
.tool-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.tool-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.tool-result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.tool-result-head h3 {
  font-family: var(--font-sans);
  color: var(--text);
  font-size: 1rem;
}
.tool-result-card p {
  max-width: none;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.tool-result-card ul {
  margin: 16px 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}
.tool-result-card li + li { margin-top: 8px; }
.tool-test {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-weight: 600;
  color: var(--primary) !important;
}
.result-footer-actions--split {
  justify-content: space-between;
  gap: 12px;
}

/* Result footer actions */
.result-footer-actions { display: flex; justify-content: center; padding: 8px 0 40px; }

/* Share section title */
.share-section-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 16px;
}

/* Share card extras */
.share-card-unlock { font-size: 0.88rem; color: rgba(255,255,255,0.65); line-height: 1.5; margin-bottom: 20px; max-width: none; }
.share-card-footer { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.share-card-built  { font-size: 0.72rem; color: rgba(255,255,255,0.35); }

/* Reveal section */
.reveal-section { flex: 1; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 32px; max-width: 720px; margin: 0 auto; width: 100%; }
.reveal-question { display: flex; flex-direction: column; gap: 12px; }

/* Flash message */
.flash-msg {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--primary); color: #fff;
  padding: 12px 24px; border-radius: 8px; font-size: 0.9rem;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 999; white-space: nowrap;
  max-width: 90vw; text-align: center;
}
.flash-msg--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
