/* ============================================================
   TONOS DESIGN SYSTEM
   A custom design language — no frameworks, no component libraries.
   Built for a voice profile API that should feel premium, warm,
   and unmistakably not-AI-generated.
   ============================================================ */

/* --- Fonts --- */
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@200,300,400,500,600,700&f[]=general-sans@200,300,400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

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

/* --- Design Tokens --- */
:root {
  /* Typography */
  --font-display: 'Clash Display', 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --text-5xl: 4rem;

  /* Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Colors — warm palette, no purple, no generic blue */
  --color-bg: #FAF8F5;
  --color-bg-alt: #F3F0EB;
  --color-surface: #FFFFFF;
  --color-surface-raised: #FFFFFF;
  --color-text: #1A1614;
  --color-text-secondary: #5C5650;
  --color-text-muted: #8A8578;
  --color-text-faint: #B8B2A8;

  /* Brand */
  --color-primary: #1A5C53;
  --color-primary-hover: #14493F;
  --color-primary-light: #E8F2F0;
  --color-primary-subtle: #D1E8E4;
  --color-accent: #D4912B;
  --color-accent-hover: #BF7F1F;
  --color-accent-light: #FDF3E3;

  /* Semantic */
  --color-success: #2D7A4F;
  --color-success-light: #E6F4EC;
  --color-warning: #B8860B;
  --color-warning-light: #FFF8E7;
  --color-error: #C0392B;
  --color-error-light: #FDECEB;

  /* Borders */
  --color-border: #E5E0D9;
  --color-border-light: #EEEAE5;
  --color-border-focus: var(--color-primary);

  /* Shadows — layered for depth */
  --shadow-xs: 0 1px 2px rgba(26, 22, 20, 0.04);
  --shadow-sm: 0 1px 3px rgba(26, 22, 20, 0.06), 0 1px 2px rgba(26, 22, 20, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 22, 20, 0.06), 0 1px 4px rgba(26, 22, 20, 0.04);
  --shadow-lg: 0 8px 24px rgba(26, 22, 20, 0.08), 0 2px 8px rgba(26, 22, 20, 0.04);
  --shadow-xl: 0 16px 48px rgba(26, 22, 20, 0.1), 0 4px 16px rgba(26, 22, 20, 0.04);
  --shadow-glow: 0 0 20px rgba(26, 92, 83, 0.12);
  --shadow-glow-accent: 0 0 20px rgba(212, 145, 43, 0.15);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --container-max: 960px;
  --container-wide: 1200px;
  --container-narrow: 480px;
  --nav-height: 64px;
}


/* ============================================================
   BASE ELEMENTS
   ============================================================ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); margin-bottom: var(--space-6); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--color-primary-hover);
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-alt);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}

hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

::selection {
  background: var(--color-primary-subtle);
  color: var(--color-text);
}


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--container-narrow);
}

main {
  padding-top: calc(var(--nav-height) + var(--space-10));
  padding-bottom: var(--space-20);
  min-height: calc(100vh - var(--nav-height));
}

.page-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(250, 248, 245, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  letter-spacing: -0.03em;
  text-decoration: none;
  text-transform: uppercase;
  position: relative;
}

.nav-brand::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out);
}

.nav-brand:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-auth {
  display: flex;
  align-items: center;
  flex: 1;
  margin-left: var(--space-8);
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* --- Credit Pill (navbar) --- */
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-subtle);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  height: 34px;
}

.credit-pill:hover {
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
}

.credit-pill-count {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  line-height: 1;
}

.credit-pill-label {
  font-size: var(--text-xs);
  color: var(--color-primary);
  opacity: 0.7;
  line-height: 1;
}

.credit-pill-upgrade {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-surface);
  background: var(--color-primary);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  line-height: 1.2;
  margin-left: var(--space-1);
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary */
.btn-primary,
.btn-primary:visited,
.btn-primary:link {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Accent */
.btn-accent {
  background: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
}

.btn-accent:hover:not(:disabled) {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow-accent);
}

/* Secondary / Ghost */
.btn-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--color-text);
  background: var(--color-bg-alt);
  border-color: var(--color-border);
  transform: translateY(-1px);
}

/* Ghost (no border) */
.btn-ghost,
.btn-ghost:visited,
.btn-ghost:link {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
  padding: var(--space-2) var(--space-3);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--color-error);
  border-color: var(--color-error);
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-error);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Size variants */
.btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}

.btn-lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* Icon button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}


/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  letter-spacing: 0.01em;
}

.form-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.5;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: all var(--duration-normal) var(--ease-out);
  outline: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-faint);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--color-text-muted);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8578' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

/* Input group (input + button side by side) */
.input-group {
  display: flex;
  gap: var(--space-2);
}

.input-group .form-input {
  flex: 1;
}

.input-group .btn {
  flex-shrink: 0;
}

/* Switch / Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.toggle-wrap input[type="checkbox"] {
  appearance: none;
  width: 40px;
  height: 22px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
}

.toggle-wrap input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--duration-normal) var(--ease-spring);
  box-shadow: var(--shadow-xs);
}

.toggle-wrap input[type="checkbox"]:checked {
  background: var(--color-primary);
}

.toggle-wrap input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

.card-elevated:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-spotlight {
  --spotlight-x: 50%;
  --spotlight-y: 50%;
  --spotlight-opacity: 0;
}

.card-spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--spotlight-x) var(--spotlight-y),
    rgba(26, 92, 83, 0.06),
    transparent 60%
  );
  opacity: var(--spotlight-opacity);
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
  z-index: 0;
}

.card-spotlight > * {
  position: relative;
  z-index: 1;
}

/* Compact card variant */
.card-compact {
  padding: var(--space-4) var(--space-5);
}

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}


/* ============================================================
   AUTH PAGES (Login / Register)
   ============================================================ */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - var(--nav-height));
  padding: var(--space-8) var(--space-6);
  box-sizing: border-box;
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-10);
}

.auth-title {
  font-size: var(--text-3xl);
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.auth-footer a {
  font-weight: var(--weight-medium);
}

/* OAuth buttons */
.oauth-btn {
  width: 100%;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.oauth-btn:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.oauth-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* ============================================================
   ALERTS & NOTICES
   ============================================================ */

.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  line-height: 1.5;
}

.alert-error {
  background: var(--color-error-light);
  color: var(--color-error);
  border: 1px solid rgba(192, 57, 43, 0.15);
}

.alert-success {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid rgba(45, 122, 79, 0.15);
}

.alert-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid rgba(184, 134, 11, 0.15);
}

.alert-info {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(26, 92, 83, 0.15);
}

/* New key reveal */
.key-reveal {
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.key-reveal p {
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}

.key-reveal code {
  display: block;
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-primary-subtle);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  word-break: break-all;
  color: var(--color-text);
  user-select: all;
}


/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: var(--color-bg-alt);
}

th {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(250, 248, 245, 0.5);
}


/* ============================================================
   BADGES & TAGS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-accent {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.badge-muted {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error);
}

/* Dot indicator before badge text */
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}


/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  margin-bottom: var(--space-8);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-title {
  font-size: var(--text-xl);
  margin-bottom: 0;
}

.section-desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}


/* ============================================================
   PROFILE PAGE — Zoned layout
   Top zone: profile results (style + summary)
   Bottom zone: sample management (add form + list)
   ============================================================ */

/* Widen the container for the profile page */
.profile-page {
  max-width: var(--container-wide);
  margin: 0 auto;
}

.page-content:has(.profile-page) {
  max-width: var(--container-wide);
}

.profile-header {
  margin-bottom: var(--space-6);
}

/* Top zone: profile results in a 2-col grid */
.profile-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-10);
}

/* Visual separator between zones */
.profile-divider {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 0 0 var(--space-8) 0;
}

/* Bottom zone: sample management in a 2-col grid */
.profile-samples {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* Onboarding single-column (no profile yet) */
.profile-onboarding {
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .profile-results {
    grid-template-columns: 1fr;
  }

  .profile-samples {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   VOICE PROFILE — Dimension Bars
   ============================================================ */

.dimension-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dimension-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: var(--space-4);
}

.dimension-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}

.dimension-bar {
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.dimension-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
  min-width: 4px;
}

.dimension-value {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  min-width: 40px;
  text-align: right;
}

/* Confidence indicator */
.confidence {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.confidence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.confidence-high .confidence-dot { background: var(--color-success); }
.confidence-medium .confidence-dot { background: var(--color-warning); }
.confidence-low .confidence-dot { background: var(--color-error); }

.confidence-high { color: var(--color-success); }
.confidence-medium { color: var(--color-warning); }
.confidence-low { color: var(--color-error); }


/* ============================================================
   SAMPLES
   ============================================================ */

.sample-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  position: relative;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  line-height: 1.6;
  transition: all var(--duration-normal) var(--ease-out);
}

.sample-card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}

.sample-card.low-value {
  opacity: 0.6;
  border-color: rgba(192, 57, 43, 0.12);
  border-style: dashed;
}

.sample-card .sample-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.sample-delete {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  transition: all var(--duration-fast) var(--ease-out);
  padding: 0;
  line-height: 1;
}

.sample-delete:hover {
  color: var(--color-error);
  background: var(--color-error-light);
}

/* Sample list header & actions */
.sample-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.sample-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* Scrollable sample list — caps height and scrolls internally */
.sample-scroll {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  padding-right: var(--space-2);
}

.sample-scroll::-webkit-scrollbar {
  width: 4px;
}

.sample-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.sample-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* Sample counter */
.sample-counter {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Extraction progress */
.extraction-progress {
  display: none;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  margin-bottom: var(--space-5);
}

.extraction-progress.active {
  display: block;
}

.progress-bar {
  height: 4px;
  background: var(--color-primary-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  animation: progress-shimmer 2s ease-in-out infinite, progress-indeterminate 2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% { width: 0%; margin-left: 0%; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

@keyframes progress-shimmer {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.progress-status {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}

/* --- Generate Profile Action --- */
.generate-action {
  width: 100%;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.generate-action .btn-block {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-6);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
}

.generate-options {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-3);
  gap: var(--space-3);
}

/* --- Info Tooltips --- */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-1);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: var(--weight-bold);
  font-style: normal;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  cursor: help;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
  padding-top: 1px;
}

.info-icon:hover {
  background: var(--color-primary);
  color: white;
}

.info-tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  font-style: normal;
  line-height: 1.5;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 240px;
  text-align: left;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out), visibility 0s var(--duration-fast);
}

.info-tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-text);
}

.info-tooltip:hover .info-tooltip-text,
.info-icon:focus + .info-tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out), visibility 0s 0s;
}

/* Platform export buttons */
.platform-exports {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-body);
}

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

.platform-icon {
  font-size: var(--text-base);
}


/* ============================================================
   CHAT / DRAFTING
   ============================================================ */

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6) 0;
}

.chat-message {
  max-width: 80%;
  padding: var(--space-4) var(--space-5);
  line-height: 1.6;
  white-space: pre-wrap;
  font-size: var(--text-sm);
  position: relative;
  animation: message-in var(--duration-normal) var(--ease-out);
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  align-self: flex-end;
  background: var(--color-primary);
  color: #FFFFFF;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

/* Streaming cursor */
.streaming-cursor::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursor-blink 0.8s ease-in-out infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-body);
}

.chat-message:hover .copy-btn {
  opacity: 1;
}

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

/* Mode toggle pills */
.mode-toggle {
  display: flex;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border-light);
}

.mode-toggle button {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  background: transparent;
  color: var(--color-text-muted);
}

.mode-toggle button[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.mode-toggle button[aria-pressed="false"] {
  background: transparent;
  color: var(--color-text-muted);
}

.mode-toggle button[aria-pressed="false"]:hover {
  color: var(--color-text-secondary);
}

/* Draft form */
.draft-form {
  margin-bottom: var(--space-6);
}

/* Refine input bar */
.refine-bar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border-light);
}

.refine-bar .form-input {
  flex: 1;
}

/* Hide elements with data-mode that don't match active mode */
[data-mode="draft"] { display: none; }
[data-mode="rewrite"] { display: none; }
.mode-draft [data-mode="draft"] { display: block; }
.mode-rewrite [data-mode="rewrite"] { display: block; }

/* No profile state */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.empty-state p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}


/* ============================================================
   SETTINGS
   ============================================================ */

.settings-section {
  margin-bottom: var(--space-10);
}

.settings-section .card {
  padding: var(--space-8);
}

.settings-email {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.settings-email strong {
  color: var(--color-text);
}


/* ============================================================
   PLAN PAGE
   ============================================================ */

.plan-page {
  max-width: var(--container-max);
  margin: 0 auto;
}

/* Current plan card */
.plan-current {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-10);
  box-shadow: var(--shadow-sm);
}

.plan-current-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.plan-tier-badge {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.plan-tier-trial { background: var(--color-bg-alt); color: var(--color-text-muted); }
.plan-tier-starter { background: var(--color-primary-light); color: var(--color-primary); }
.plan-tier-pro { background: var(--color-accent-light); color: var(--color-accent); }
.plan-tier-business { background: #1a1a2e; color: #e0e0e0; }

/* Usage bar */
.plan-usage {
  margin-bottom: var(--space-6);
}

.plan-usage-bar {
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.plan-usage-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.plan-usage-stats {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.plan-usage-remaining {
  color: var(--color-text);
}

.plan-usage-remaining strong {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
}

.plan-usage-total {
  color: var(--color-text-muted);
}

/* Credit cost table */
.plan-cost-table {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-5);
}

.plan-cost-grid {
  display: grid;
  grid-template-columns: 1fr repeat(3, 80px);
  gap: 0;
  font-size: var(--text-sm);
}

.plan-cost-row {
  display: contents;
}

.plan-cost-row > span {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

.plan-cost-row:last-child > span {
  border-bottom: none;
}

.plan-cost-header > span {
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-cost-row:not(.plan-cost-header) > span:not(:first-child) {
  font-family: var(--font-mono);
  text-align: center;
  color: var(--color-text-secondary);
}

/* Tier comparison cards */
.plan-tiers {
  margin-bottom: var(--space-10);
}

.plan-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.plan-tier-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: all var(--duration-fast) var(--ease-out);
}

.plan-tier-card:hover {
  border-color: var(--color-primary-subtle);
  box-shadow: var(--shadow-md);
}

.plan-tier-card.recommended {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.plan-tier-card.current {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.plan-tier-badge-popular {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.plan-tier-card-header {
  margin-bottom: var(--space-4);
}

.plan-tier-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.plan-tier-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.plan-tier-price-amount {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: 1;
}

.plan-tier-price-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.plan-tier-card-credits {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}

.plan-tier-credit-count {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
}

.plan-tier-credit-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.plan-tier-models {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.plan-tier-features {
  list-style: none;
  flex: 1;
  margin-bottom: var(--space-5);
}

.plan-tier-features li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.plan-tier-features li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-right: var(--space-3);
  vertical-align: middle;
}

.plan-tier-features li:last-child {
  border-bottom: none;
}

.plan-tier-card-action {
  margin-top: auto;
}

.plan-tier-current-label {
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-primary);
  padding: var(--space-3);
}

@media (max-width: 768px) {
  .plan-tier-grid {
    grid-template-columns: 1fr;
  }

  .plan-current-header {
    flex-direction: column;
    gap: var(--space-3);
  }

  .plan-cost-grid {
    grid-template-columns: 1fr repeat(3, 60px);
  }
}


/* ============================================================
   DIALOGS / MODALS
   ============================================================ */

dialog {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 0;
  max-width: 480px;
  width: calc(100% - var(--space-8));
  background: var(--color-surface);
  animation: modal-in var(--duration-normal) var(--ease-out);
  margin: auto;
  position: fixed;
  inset: 0;
  height: fit-content;
}

dialog::backdrop {
  background: rgba(26, 22, 20, 0.4);
  backdrop-filter: blur(4px);
  animation: backdrop-in var(--duration-normal) var(--ease-out);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  padding: var(--space-8);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.modal-header .modal-icon {
  font-size: var(--text-2xl);
}

.modal-header strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  transition: all var(--duration-fast) var(--ease-out);
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}


/* ============================================================
   PAGE ENTRANCE ANIMATIONS
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger > .reveal:nth-child(2) { transition-delay: 60ms; }
.stagger > .reveal:nth-child(3) { transition-delay: 120ms; }
.stagger > .reveal:nth-child(4) { transition-delay: 180ms; }
.stagger > .reveal:nth-child(5) { transition-delay: 240ms; }
.stagger > .reveal:nth-child(6) { transition-delay: 300ms; }
.stagger > .reveal:nth-child(7) { transition-delay: 360ms; }
.stagger > .reveal:nth-child(8) { transition-delay: 420ms; }

/* Slide from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up from small */
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger lines — for mock content that appears line by line */
.stagger-lines.visible .stagger-line {
  opacity: 1;
  transform: translateY(0);
}

.stagger-lines .stagger-line {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.stagger-lines .stagger-line:nth-child(1) { transition-delay: 100ms; }
.stagger-lines .stagger-line:nth-child(2) { transition-delay: 200ms; }
.stagger-lines .stagger-line:nth-child(3) { transition-delay: 300ms; }
.stagger-lines .stagger-line:nth-child(4) { transition-delay: 400ms; }
.stagger-lines .stagger-line:nth-child(5) { transition-delay: 500ms; }
.stagger-lines .stagger-line:nth-child(6) { transition-delay: 600ms; }

/* Code typewriter — lines appear with stagger */
.reveal-code.visible .code-line {
  opacity: 1;
  transform: translateX(0);
}

.reveal-code .code-line {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.reveal-code .code-line:nth-child(1) { transition-delay: 200ms; }
.reveal-code .code-line:nth-child(2) { transition-delay: 350ms; }
.reveal-code .code-line:nth-child(3) { transition-delay: 500ms; }
.reveal-code .code-line:nth-child(4) { transition-delay: 650ms; }
.reveal-code .code-line:nth-child(5) { transition-delay: 800ms; }
.reveal-code .code-line:nth-child(6) { transition-delay: 950ms; }

/* Chat messages — slide in from sides */
.reveal-chat.visible .landing-mock-msg.user {
  opacity: 1;
  transform: translateX(0);
}

.reveal-chat.visible .landing-mock-msg.assistant {
  opacity: 1;
  transform: translateX(0);
}

.reveal-chat .landing-mock-msg.user {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
  transition-delay: 100ms;
}

.reveal-chat .landing-mock-msg.assistant {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
  transition-delay: 500ms;
}

/* Page load animation */
.page-enter {
  animation: page-in var(--duration-slow) var(--ease-out) both;
}

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


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --text-4xl: 2.25rem;
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
    --nav-height: 56px;
  }

  .page-content {
    padding: 0 var(--space-4);
  }

  .nav-inner {
    padding: 0 var(--space-4);
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: var(--space-2);
    font-size: var(--text-xs);
  }

  .card {
    padding: var(--space-5);
  }

  .auth-card {
    padding: var(--space-6);
  }

  .settings-section .card {
    padding: var(--space-5);
  }

  .dimension-item {
    grid-template-columns: 100px 1fr auto;
    gap: var(--space-3);
  }

  .chat-message {
    max-width: 90%;
  }

  h1 {
    font-size: var(--text-3xl);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-group {
    flex-direction: column;
  }

  .refine-bar {
    flex-direction: column;
  }

  .table-wrap {
    font-size: var(--text-xs);
  }
}

@media (max-width: 480px) {
  :root {
    --text-4xl: 1.85rem;
    --text-3xl: 1.5rem;
  }

  .nav-brand {
    font-size: var(--text-base);
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: var(--space-1) var(--space-2);
    font-size: 0.7rem;
  }

  .btn-ghost.btn-sm {
    font-size: 0.7rem;
    padding: var(--space-1) var(--space-2);
  }

  .dimension-item {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .dimension-label {
    margin-bottom: 0;
  }

  .auth-page {
    padding: var(--space-4);
  }

  .auth-card {
    padding: var(--space-5);
  }

  .confidence {
    font-size: var(--text-xs);
  }
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.hidden { display: none; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ============================================================
   LANDING PAGE
   Editorial layout, no template energy.
   ============================================================ */

/* --- Landing base --- */
.landing {
  --landing-max: 1120px;
  overflow-x: hidden;
}

/* --- Depth / parallax layers --- */
.landing-depth {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.landing-depth > * {
  position: absolute;
  will-change: transform;
}

/* Concentric rings */
.depth-ring {
  border: 2px solid var(--color-border);
  border-radius: 50%;
  opacity: 0.5;
}

.depth-ring-1 {
  width: 600px;
  height: 600px;
  top: 3%;
  right: -10%;
}

.depth-ring-2 {
  width: 380px;
  height: 380px;
  top: 9%;
  right: -1%;
  opacity: 0.35;
}

/* Giant quotation marks */
.depth-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(10rem, 22vw, 20rem);
  line-height: 0.6;
  color: var(--color-border);
  opacity: 0.3;
  user-select: none;
}

.depth-quote-1 {
  top: 14%;
  left: 3%;
}

.depth-quote-2 {
  top: 68%;
  right: 5%;
}

/* Mini bar clusters */
.depth-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0.25;
}

.depth-bars span {
  display: block;
  height: 5px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.depth-bars-1 {
  width: 100px;
  top: 40%;
  left: 5%;
}

.depth-bars-2 {
  width: 70px;
  top: 75%;
  right: 7%;
}

/* Waveform SVG */
.depth-wave {
  color: var(--color-border);
  opacity: 0.4;
}

.depth-wave-1 {
  width: 50vw;
  height: 60px;
  top: 50%;
  left: -5%;
}

/* Curly braces */
.depth-brace {
  font-family: var(--font-mono);
  font-size: clamp(5rem, 12vw, 10rem);
  line-height: 1;
  color: var(--color-border);
  opacity: 0.2;
  user-select: none;
}

.depth-brace-1 {
  top: 58%;
  left: 10%;
}

.depth-brace-2 {
  top: 60%;
  left: 16%;
}

/* Watermark words */
.depth-word {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(8rem, 18vw, 16rem);
  color: var(--color-border);
  opacity: 0.45;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.depth-word-1 {
  top: 26%;
  right: -2%;
}

.depth-word-2 {
  top: 53%;
  left: -3%;
}

/* Ensure content sits above depth layers */
.landing > *:not(.landing-depth) {
  position: relative;
  z-index: 1;
}

/* --- Nav --- */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  background: rgba(250, 248, 245, 0.85);
  border-bottom: 1px solid var(--color-border-light);
}

.landing-nav-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.landing-nav-actions .btn {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
}

/* --- Hero --- */
.landing-hero {
  position: relative;
  padding: calc(var(--nav-height) + var(--space-24)) var(--space-6) var(--space-16);
  overflow: hidden;
}

/* Grain texture overlay — tactile, anti-digital feel */
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 0;
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--landing-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-12);
  align-items: center;
}

.landing-hero-text {
  max-width: 800px;
}

/* --- Hero product card --- */
.landing-hero-visual {
  display: flex;
  justify-content: flex-end;
}

.landing-hero-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  width: 100%;
  transform: perspective(800px) rotateY(-4deg);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.landing-hero-card:hover {
  transform: perspective(800px) rotateY(0deg) translateY(-3px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.landing-hero-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.landing-hero-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
}

.landing-hero-card-name {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--color-text);
}

.landing-hero-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 2px;
}

.landing-hero-card-badge {
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  color: var(--color-success);
  background: var(--color-success-light);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.landing-hero-card-samples {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.landing-hero-card-dims {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.landing-hero-card-dim {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  align-items: center;
  gap: var(--space-2);
}

.landing-hero-card-dim span:first-child {
  font-size: 0.7rem;
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.landing-hero-card-dim span:last-child {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-align: right;
}

.landing-hero-card-bar {
  height: 5px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.landing-hero-card-bar div {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.landing-hero-card-traits {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.landing-trait {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-medium);
}

.landing-h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  max-width: none;
}

.landing-h1-accent {
  color: var(--color-primary);
}

.landing-sub {
  font-size: var(--text-xl);
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin-bottom: var(--space-8);
}

.landing-hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.landing-hero-note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Comparison section --- */
.landing-compare {
  padding: var(--space-8) var(--space-6) var(--space-20);
}

.landing-compare-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.landing-compare-card {
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  position: relative;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.landing-compare-card.generic {
  background: var(--color-bg-alt);
  opacity: 0.75;
}

.landing-compare-card.tonos {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-primary-subtle);
}

.landing-compare-card.tonos:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.landing-compare-tag {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.landing-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.landing-tag-dot.generic { background: var(--color-text-faint); }
.landing-tag-dot.tonos { background: var(--color-primary); }

.landing-compare-body {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.landing-compare-card.tonos .landing-compare-body {
  color: var(--color-text);
}

.landing-compare-caption {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

/* --- Shared section styles --- */
.landing-section {
  padding: var(--space-24) var(--space-6);
}

.landing-section-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
}

.landing-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.landing-h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(1.8rem, 4vw, var(--text-4xl));
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.landing-section-sub {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-12);
}

/* --- Voice profile section --- */
.landing-voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.landing-voice-left .landing-section-sub {
  margin-bottom: var(--space-8);
}

.landing-voice-traits {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.landing-voice-trait-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

.landing-voice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.landing-trait {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border-light);
}

.landing-voice-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.landing-phrase {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* Voice dimension card */
.landing-voice-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.landing-voice-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.landing-voice-card-title {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.landing-voice-card-score {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.landing-voice {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.landing-dims {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.landing-dim-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.landing-dim-name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.landing-dim-val {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.landing-dim-track {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.landing-dim-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-out);
}

.landing-dim-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
  font-size: 0.7rem;
  color: var(--color-text-faint);
  text-transform: lowercase;
}

.landing-dim-note {
  margin-top: var(--space-10);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

/* --- How it works: Steps --- */
.landing-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.landing-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.landing-step.reverse {
  direction: rtl;
}

.landing-step.reverse > * {
  direction: ltr;
}

.landing-step-num {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  font-weight: var(--weight-medium);
}

.landing-step-text h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.landing-step-text p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 420px;
}

/* --- Mockup visuals (inline product previews) --- */
.landing-step-visual {
  display: flex;
  justify-content: center;
}

.landing-mock-textarea {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.landing-mock-topbar {
  display: flex;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

.landing-mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}

.landing-mock-lines {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing-mock-lines span {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.landing-mock-profile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.landing-mock-dim {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.landing-mock-dim span {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.landing-mock-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.landing-mock-bar div {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.landing-mock-chat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.landing-mock-msg {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 85%;
}

.landing-mock-msg.user {
  background: var(--color-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.landing-mock-msg.assistant {
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* --- Developer section --- */
.landing-dev {
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 0;
}

.landing-dev .landing-eyebrow {
  color: var(--color-accent);
}

.landing-dev .landing-h2 {
  color: var(--color-bg);
}

.landing-dev .landing-section-sub {
  color: var(--color-text-faint);
}

.landing-code-block {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow-x: auto;
  max-width: 100%;
}

.landing-code-block pre,
.landing-code-block code {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-bg-alt);
  background: transparent;
}

.landing-code-block .code-line {
  display: block;
}

/* --- Pricing --- */
.landing-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.landing-tier {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.landing-tier:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.landing-tier.popular {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-primary-subtle);
}

.landing-tier-badge {
  position: absolute;
  top: calc(var(--space-4) * -1);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.landing-tier-name {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.landing-tier-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.landing-tier-amount {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
}

.landing-tier-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.landing-tier-credits {
  font-size: var(--text-sm);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.landing-tier-models {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.landing-tier-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing-tier-features li {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding-left: var(--space-5);
  position: relative;
}

.landing-tier-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary-subtle);
}

/* --- Final CTA --- */
.landing-cta {
  text-align: center;
  padding: var(--space-24) var(--space-6) var(--space-20);
}

.landing-cta-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
}

.landing-cta .landing-h2 {
  margin-bottom: var(--space-3);
}

.landing-cta p {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
}

/* --- Footer --- */
.landing-footer {
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

.landing-footer-inner {
  max-width: var(--landing-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-footer-links {
  display: flex;
  gap: var(--space-6);
}

.landing-footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.landing-footer-links a:hover {
  color: var(--color-text);
}


/* ============================================================
   LEGAL PAGES (Terms, Privacy)
   ============================================================ */

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-8) 0 var(--space-24);
}

.legal-page h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
}

.legal-updated {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-10);
}

.legal-page h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.legal-page h3 {
  font-size: var(--text-base);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.legal-page p {
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-4);
}

.legal-page ul {
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.legal-page li {
  margin-bottom: var(--space-2);
}

.legal-page a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  color: var(--color-primary-hover);
}

.landing-footer-brand {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--color-text);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.landing-footer-copy {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}


/* --- Landing responsive --- */
@media (max-width: 768px) {
  .landing-hero {
    padding-top: calc(var(--nav-height) + var(--space-16));
    padding-bottom: var(--space-12);
  }

  .landing-depth {
    display: none;
  }

  .landing-hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .landing-hero-visual {
    justify-content: center;
  }

  .landing-hero-card {
    max-width: 340px;
    transform: none;
  }

  .landing-h1 {
    font-size: clamp(2rem, 7vw, 3.2rem);
  }

  .landing-sub {
    font-size: var(--text-base);
  }

  .landing-section {
    padding: var(--space-16) var(--space-5);
  }

  .landing-compare {
    padding: var(--space-6) var(--space-5) var(--space-16);
  }

  .landing-voice-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .landing-compare-inner {
    grid-template-columns: 1fr;
  }

  .landing-section-sub {
    margin-bottom: var(--space-8);
  }

  .landing-step {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .landing-step.reverse {
    direction: ltr;
  }

  .landing-step-visual {
    order: -1;
  }

  .landing-step-text h3 {
    font-size: var(--text-xl);
  }

  .landing-mock-textarea,
  .landing-mock-profile,
  .landing-mock-chat {
    max-width: 100%;
  }

  .landing-dev {
    padding: var(--space-16) var(--space-5);
  }

  .landing-code-block {
    padding: var(--space-4);
  }

  .landing-code-block pre {
    font-size: var(--text-xs);
  }

  .landing-tier-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .landing-tier {
    padding: var(--space-6);
  }

  .landing-steps {
    gap: var(--space-16);
  }

  .landing-cta {
    padding: var(--space-16) var(--space-5);
  }
}

@media (max-width: 480px) {
  .landing-h1 {
    font-size: 1.85rem;
    letter-spacing: -0.03em;
  }

  .landing-h2 {
    font-size: 1.5rem;
  }

  .landing-hero {
    padding: calc(var(--nav-height) + var(--space-12)) var(--space-4) var(--space-10);
  }

  .landing-hero-cta {
    flex-direction: column;
  }

  .landing-hero-cta .btn {
    width: 100%;
    text-align: center;
  }

  .landing-compare {
    padding: var(--space-4) var(--space-4) var(--space-12);
  }

  .landing-compare-card {
    padding: var(--space-4) var(--space-5);
  }

  .landing-section {
    padding: var(--space-12) var(--space-4);
  }

  .landing-nav-inner {
    padding: 0 var(--space-4);
  }

  .landing-eyebrow {
    font-size: 0.65rem;
  }

  .landing-dim-name {
    font-size: var(--text-xs);
  }

  .landing-mock-lines span {
    font-size: var(--text-xs);
  }

  .landing-mock-msg {
    font-size: var(--text-xs);
  }

  .landing-footer-inner {
    padding: 0;
  }
}
