/* ==========================================================================
   Oddilo 07 — Personality Color Test (Personality Series 01)
   Warm Editorial Color Atelier Aesthetic
   ========================================================================== */

:root {
  --bg-paper: #F7F5F0;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EFECE3;
  --ink: #16161A;
  --ink-muted: #5F5E6C;
  --border-soft: #E2DDD0;
  --accent-blue: #2D5BFF;
  --accent-violet: #7C4DFF;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-tactile: 0 4px 0 #16161A;
  --shadow-tactile-sm: 0 2px 0 #16161A;
  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background-color: var(--bg-paper);
  background-image: radial-gradient(rgba(22, 22, 26, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body { display: flex; flex-direction: column; min-height: 100dvh; }

/* ---------- Topbar ---------- */
.topbar {
  width: 100%;
  border-bottom: 1.5px solid var(--border-soft);
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
}

.topbar-inner {
  max-width: 780px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

.brand-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: transparent; border: none; padding: 4px 6px 4px 2px;
  border-radius: 10px; cursor: pointer; color: var(--ink);
}

.brand-wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.18rem;
  letter-spacing: -0.03em; line-height: 1;
}

.brand-cat-tag {
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px;
  background: #F3EEFF; color: #5B21B6; border: 1px solid #7C4DFF;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--border-soft); background: var(--bg-surface);
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.14s ease, transform 0.12s ease;
}
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }

/* ---------- Main App Shell ---------- */
.app-shell {
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 20px 16px 44px; flex: 1;
  display: flex; flex-direction: column; gap: 18px;
}

/* ---------- Intro Hero Card ---------- */
.intro-card {
  background: var(--bg-surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 7px 0 #16161A;
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 20px;
  animation: popIn 0.34s cubic-bezier(0.22, 1.25, 0.36, 1) forwards;
}

.swatch-fan {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.fan-chip {
  width: 34px; height: 42px; border-radius: 9px;
  border: 2px solid var(--ink); box-shadow: 0 2px 0 #16161A;
  transition: transform 0.2s cubic-bezier(0.22, 1.4, 0.36, 1);
}
.fan-chip:hover { transform: translateY(-5px) rotate(-4deg); }

.kicker {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
}

.intro-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 2.75rem);
  letter-spacing: -0.035em; line-height: 1.04; margin: 6px 0 8px;
}

.intro-sub { margin: 0; font-size: 0.98rem; color: var(--ink-muted); line-height: 1.5; max-width: 46ch; }

.intro-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-muted);
}

/* ---------- Quiz View ---------- */
.quiz-card {
  background: var(--bg-surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 7px 0 #16161A;
  padding: 22px 22px 24px;
  display: flex; flex-direction: column; gap: 18px;
}

.quiz-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

.back-btn {
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700;
  padding: 6px 11px; border-radius: 9px;
  border: 1.5px solid var(--border-soft); background: var(--bg-paper);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.back-btn:hover:not(:disabled) { border-color: var(--ink); }
.back-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.progress-label {
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700; color: var(--ink);
}

.progress-track {
  height: 7px; width: 100%; background: var(--bg-subtle);
  border-radius: 999px; overflow: hidden; border: 1px solid var(--border-soft);
}

.progress-fill {
  height: 100%; width: 0%; background: var(--ink);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.q-body { animation: slideIn 0.24s ease forwards; }

.q-prompt {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.3rem, 3.8vw, 1.65rem);
  letter-spacing: -0.025em; line-height: 1.22; margin: 6px 0 18px;
}

.options-list { display: flex; flex-direction: column; gap: 10px; }

.option-btn {
  width: 100%; text-align: left;
  padding: 15px 16px; border-radius: 14px;
  border: 2px solid var(--border-soft); background: var(--bg-paper);
  color: var(--ink); font-family: var(--font-sans); font-size: 0.96rem;
  font-weight: 500; line-height: 1.4; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.12s ease, transform 0.1s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.option-btn:hover {
  border-color: var(--ink); background: #FFFFFF;
  transform: translateY(-1px); box-shadow: 0 3px 0 #16161A;
}

.option-btn:active { transform: translateY(1px); box-shadow: none; }

.option-btn.selected {
  border-color: var(--ink); background: var(--ink); color: #FFFFFF;
  box-shadow: 0 3px 0 rgba(22, 22, 26, 0.25);
}

.option-key {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  border: 1.5px solid var(--border-soft); background: #FFFFFF; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}

.option-btn.selected .option-key {
  background: rgba(255, 255, 255, 0.16); color: #FFFFFF; border-color: rgba(255, 255, 255, 0.35);
}

/* Mixing Transition Card */
.mixing-card {
  background: var(--bg-surface); border: 2px solid var(--ink);
  border-radius: var(--radius-lg); box-shadow: 0 7px 0 #16161A;
  padding: 56px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.mix-dots { display: flex; gap: 10px; }
.mix-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink);
  animation: bounceDot 0.6s infinite alternate;
}
.mix-dot:nth-child(2) { animation-delay: 0.12s; }
.mix-dot:nth-child(3) { animation-delay: 0.24s; }

/* ---------- Result Specimen Card ---------- */
.specimen-card {
  background: var(--bg-surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 0 #16161A;
  padding: 20px;
  display: flex; flex-direction: column; gap: 18px;
  animation: popIn 0.38s cubic-bezier(0.22, 1.25, 0.36, 1) forwards;
}

.specimen-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: var(--ink-muted);
}

.swatch-hero {
  border-radius: 18px; border: 2px solid var(--ink);
  min-height: 200px; padding: 20px;
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}

.swatch-motif-bg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0.22;
}

.swatch-hex-pill {
  align-self: flex-start;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700;
  padding: 6px 12px; border-radius: 10px;
  background: #FFFFFF; color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 0 2px 0 #16161A; position: relative; z-index: 2;
}

.swatch-title-block { position: relative; z-index: 2; }

.result-color-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 5.5vw, 2.5rem);
  letter-spacing: -0.035em; line-height: 1.04; margin: 0 0 4px;
}

.result-archetype {
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  color: var(--ink-muted); margin: 0 0 12px;
}

.kw-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kw-pill {
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
  background: var(--bg-paper); border: 1.5px solid var(--ink);
}

.result-quote {
  margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  line-height: 1.4; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-paper); border-left: 4px solid var(--ink);
}

.result-desc { margin: 0; font-size: 0.94rem; line-height: 1.58; color: var(--ink); }

.traits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trait-box {
  background: var(--bg-paper); border: 1.5px solid var(--border-soft);
  border-radius: 14px; padding: 14px;
}
.trait-box h3 {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; color: var(--ink-muted);
}
.trait-box ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; line-height: 1.45; }

/* Pairings */
.pairings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair-card {
  text-align: left; background: var(--bg-paper); border: 1.5px solid var(--border-soft);
  border-radius: 14px; padding: 13px; cursor: pointer; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.14s ease, transform 0.12s ease;
}
.pair-card:hover { border-color: var(--ink); transform: translateY(-1px); }

.pair-head { display: flex; align-items: center; gap: 10px; }
.pair-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--ink); flex-shrink: 0;
}
.pair-kicker { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700; color: var(--ink-muted); display: block; }
.pair-name { font-family: var(--font-display); font-weight: 700; font-size: 0.96rem; }
.pair-note { margin: 0; font-size: 0.8rem; line-height: 1.42; color: var(--ink-muted); }

/* Action Buttons */
.share-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }

.btn-primary {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  height: 54px; padding: 0 22px; border-radius: var(--radius-md);
  border: 2px solid var(--ink); background: var(--ink); color: #FFFFFF;
  box-shadow: var(--shadow-tactile); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.14s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #16161A; background: #2D5BFF; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #16161A; }

.btn-secondary {
  height: 54px; padding: 0 18px; border-radius: var(--radius-md);
  border: 2px solid var(--ink); background: var(--bg-surface); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  box-shadow: var(--shadow-tactile-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary:hover { background: var(--bg-subtle); transform: translateY(-1px); }

.result-footer-links {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1.5px dashed var(--border-soft);
}

.text-link-btn {
  background: none; border: none; padding: 0;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700;
  color: var(--ink-muted); text-decoration: underline; cursor: pointer;
}
.text-link-btn:hover { color: var(--ink); }

/* Below-Fold Info */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-card {
  background: var(--bg-surface); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md); padding: 16px 18px;
}
.info-card h2 { font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; margin: 0 0 6px; }
.info-card p { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--ink-muted); }

/* Modals & Toast */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22, 22, 26, 0.48);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 60;
}
.modal-card {
  width: 100%; max-width: 440px; max-height: 85dvh; overflow-y: auto;
  background: var(--bg-surface); border: 2px solid var(--ink);
  border-radius: var(--radius-lg); box-shadow: 0 8px 0 #16161A; padding: 20px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin: 0; }

.palette-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.palette-item {
  border: 1.5px solid var(--border-soft); border-radius: 12px; padding: 10px;
  background: var(--bg-paper); display: flex; align-items: center; gap: 9px;
  cursor: pointer; text-align: left; color: var(--ink);
}
.palette-item:hover { border-color: var(--ink); }
.palette-swatch { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--ink); flex-shrink: 0; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #FFFFFF; font-family: var(--font-display); font-weight: 600; font-size: 0.86rem;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(22, 22, 26, 0.25);
  opacity: 0; pointer-events: none; z-index: 80; transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.96) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideIn {
  0% { opacity: 0; transform: translateX(10px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes bounceDot {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

@media (max-width: 580px) {
  .topbar-inner { padding: 8px 12px; }
  .brand-cat-tag { display: none; }
  .app-shell { padding: 14px 12px 32px; gap: 14px; }
  .intro-card, .quiz-card, .specimen-card { padding: 18px 16px; }
  .traits-grid, .pairings-grid, .share-actions, .info-grid { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: 1fr; }
}

/* Existing Oddilo directory presentation. */
.lab-list { display: flex; flex-direction: column; gap: 8px; }
.lab-item {
  width: 100%; text-align: left; padding: 11px 13px; border-radius: 12px;
  border: 1.5px solid var(--border-soft); background: var(--bg-paper);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; color: var(--ink);
}
.lab-item.live { background: #FFFFFF; border-color: var(--ink); }
.lab-item-name { font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; display: block; }
.lab-item-desc { font-size: 0.76rem; color: var(--ink-muted); }
.lab-pill { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.lab-pill.live { background: #E6F8F2; color: #007A57; border: 1px solid #00A878; }
.lab-pill.launched { background: #EBF0FF; color: #1D4ED8; border: 1px solid #2D5BFF; }

