/* ========================================
   Design Tokens Generator — Landing
   ======================================== */

/* Font: Geist (local) */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GeistMono';
  src: url('../fonts/GeistMono[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GeistPixel';
  src: url('../fonts/GeistPixel-Triangle.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   Color tokens (light / dark)
   ======================================== */
:root {
  color-scheme: light;
  --bg:             #FAF9F5;
  --text:           #141413;
  --text-secondary: #3a3a3a;
  --text-muted:     #6b6b6b;
  --text-em:        #171717;
  --border:         #e8e8e8;
  --link-line:      #b0b0b0;
  --dot:            225, 209, 199;
  --dot-base:       0.18;

  /* Wizard accent */
  --accent:  #141413;
  --accent-subtle: rgba(20, 20, 19, 0.06);
  --surface: rgba(255, 255, 255, 0.80);
  --surface-hover: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:             #111110;
    --text:           #ECEAE3;
    --text-secondary: #B5B2AA;
    --text-muted:     #6E6B64;
    --text-em:        #F0EDE6;
    --border:         #252420;
    --link-line:      #454340;
    --dot:            96, 90, 78;
    --dot-base:       0.04;

    --accent:  #ECEAE3;
    --accent-subtle: rgba(236, 234, 227, 0.06);
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:             #111110;
  --text:           #ECEAE3;
  --text-secondary: #B5B2AA;
  --text-muted:     #6E6B64;
  --text-em:        #F0EDE6;
  --border:         #252420;
  --link-line:      #454340;
  --dot:            96, 90, 78;
  --dot-base:       0.04;

  --accent:  #ECEAE3;
  --accent-subtle: rgba(236, 234, 227, 0.06);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========================================
   Custom cursor
   ======================================== */
@media (pointer: fine) {
  html, * { cursor: none !important; }

  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    scale: 1;
    transition: opacity 0.25s ease, background 0.15s ease, border-color 0.15s ease;
    will-change: transform;
  }

  .cursor--visible { opacity: 1; }
  .cursor--hover   { background: var(--text-secondary); border-color: transparent; }
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

#dot-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background-color: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.866rem;
  border-radius: 4px;
  z-index: 100;
}

.skip-link:focus { top: 16px; }

/* ========================================
   Theme toggle
   ======================================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease;
  z-index: 10;
}

.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }

.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 6px;
}

.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: flex; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: flex; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: flex; }

/* ========================================
   Layout
   ======================================== */
main {
  position: relative;
  z-index: 1;
  width: min(800px, 100% - 48px);
  margin: 0 auto;
  padding: 80px 0 80px;
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Hero / Intro
   ======================================== */
.hero {
  margin-bottom: 56px;
}

h1 {
  font-family: 'GeistPixel', 'Geist', sans-serif;
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 560px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-tag {
  font-family: 'GeistMono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.02em;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ========================================
   Section headings (same as portfolio h2)
   ======================================== */
.section-label {
  font-family: 'GeistMono', 'Geist', monospace;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

/* ========================================
   Mode selector
   ======================================== */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.mode-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--surface);
  user-select: none;
}

.mode-card:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.mode-card[data-active="true"] {
  border-color: var(--text);
  background: var(--surface-hover);
}

.mode-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
}

.mode-card-desc {
  font-size: 0.833rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.mode-card-badge {
  display: inline-block;
  font-family: 'GeistMono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 10px;
}

/* ========================================
   Wizard panel
   ======================================== */
.wizard-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 720px) {
  .wizard-wrap { grid-template-columns: 1fr; }
  .wizard-aside { order: 2; }
  .mode-selector { grid-template-columns: 1fr; }
}

.wizard-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.wizard-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.wizard-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}

.wizard-subtitle {
  font-size: 0.833rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.progress-wrap { margin-top: 16px; }

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-step {
  font-family: 'GeistMono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-mode {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.progress-bar {
  height: 2px;
  width: 100%;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--progress, 4%);
  border-radius: 999px;
  background: var(--text);
  transition: width 0.3s ease;
}

/* ========================================
   Step body / form
   ======================================== */
.wizard-body {
  padding: 20px;
  min-height: 320px;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 20px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  appearance: none;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 10px 18px;
  font-family: 'Geist', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  background: var(--accent-subtle);
  border-color: var(--text-muted);
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn.primary:hover {
  opacity: 0.85;
}

.btn.outline {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

.btn.outline:hover {
  background: var(--accent-subtle);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ========================================
   Form elements
   ======================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field:last-child { margin-bottom: 0; }

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.field-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

textarea {
  min-height: 80px;
  resize: vertical;
  font-family: 'GeistMono', monospace;
  font-size: 0.8rem;
}

input[type="checkbox"] {
  accent-color: var(--text);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Color preview swatch inline */
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.color-input-wrap input { flex: 1; }

/* ========================================
   Choice cards (mode/option cards)
   ======================================== */
.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.choice-card {
  flex: 1 1 200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--surface);
}

.choice-card:hover { background: var(--surface-hover); }

.choice-card[data-active="true"] {
  border-color: var(--text);
  background: var(--surface-hover);
}

.choice-card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--text);
}

.choice-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========================================
   Chips
   ======================================== */
.chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chip:hover { background: var(--surface-hover); border-color: var(--text-muted); }

.chip[data-on="true"] {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface-hover);
}

/* ========================================
   Checkbox groups (aspect ratios, breakpoints)
   ======================================== */
.check-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--surface);
}

.check-item:hover { background: var(--surface-hover); }

.check-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.check-item-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.check-item-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================
   Inline confirm blocks (no-input steps)
   ======================================== */
.info-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  margin-bottom: 14px;
}

.info-block-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.info-list {
  list-style: none;
  padding: 0;
}

.info-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 3px 0;
  line-height: 1.5;
  font-family: 'GeistMono', monospace;
}

/* ========================================
   Error
   ======================================== */
.error-box {
  display: none;
  margin-bottom: 14px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
  color: #b91c1c;
  font-size: 0.833rem;
  font-weight: 500;
  line-height: 1.4;
}

[data-theme="dark"] .error-box { color: #fca5a5; }

/* ========================================
   Aside / sidebar
   ======================================== */
.wizard-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 80px;
}

.aside-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}

.aside-title {
  font-family: 'GeistMono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.aside-tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aside-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================
   Output card
   ======================================== */
.output-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
  background: var(--surface);
}

.output-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.output-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.output-system-name {
  font-family: 'GeistMono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

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

.output-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg);
}

.output-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'GeistMono', monospace;
}

.output-stat-value {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.output-breakdown {
  margin-bottom: 20px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.833rem;
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-key {
  font-family: 'GeistMono', monospace;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.breakdown-val {
  font-family: 'GeistMono', monospace;
  font-weight: 600;
  color: var(--text);
  font-size: 0.78rem;
}

.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.output-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.output-details summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.833rem;
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-details summary::after {
  content: '↓';
  font-size: 0.7rem;
  color: var(--text-muted);
}

.output-details[open] summary::after { content: '↑'; }

.json-area {
  width: 100%;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: 'GeistMono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
  max-height: 400px;
  outline: none;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.assumptions-list {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  list-style: none;
}

.assumptions-list li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 3px 0;
  line-height: 1.5;
}

.assumptions-list li::before {
  content: '— ';
  color: var(--border);
}

/* ========================================
   Toast
   ======================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 100;
  white-space: nowrap;
}

/* ========================================
   Responsive
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 540px) {
  main { padding: 56px 0 60px; }
  h1   { font-size: 1.8rem; }
  hr   { margin: 36px 0; }
}
