/* GreenHawk AI — Base, layout, and components */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.2rem, 4.8vw, 3.75rem); font-weight: 700; }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { margin: 0 0 1em; color: var(--text-muted); }

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 12px 30px -12px var(--ring);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--glow), 0 10px 28px -10px var(--ring); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--primary); color: var(--text-strong); }

.btn-icon {
  width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Navbar Buttons ---------- */
.nav-right { display: flex; align-items: center; gap: 8px; }
.lang-btn {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.lang-btn:active {
  transform: translateY(0);
}
.lang-btn .lang-flag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 14px;
}
.lang-btn .lang-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.chip.on { color: var(--primary); border-color: color-mix(in oklab, var(--primary) 45%, transparent); background: color-mix(in oklab, var(--primary) 10%, var(--surface)); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  background: var(--glass-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav.scrolled { border-color: var(--glass-border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-strong); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand-name { font-family: var(--font-display); font-size: 1.05rem; }
.brand-name span { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 10px 14px; border-radius: 10px; font-weight: 500; font-size: 0.95rem;
  color: var(--text-muted); transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-links a:hover { color: var(--text-strong); background: var(--surface); }
.nav-links a.active { color: var(--text-strong); background: var(--surface); }

.nav-right { display: flex; align-items: center; gap: 8px; }
.lang-btn { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 0.85rem; font-weight: 600; color: var(--text); min-height: 40px; }
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }

.hamburger { display: none; }

/* Mobile menu */
.mobile-panel {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw);
  background: var(--surface); border-inline-start: 1px solid var(--border);
  transform: translateX(100%); transition: transform var(--dur-med) var(--ease);
  z-index: 70; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px;
}
[dir="rtl"] .mobile-panel { inset: 0 auto 0 0; border-inline-start: 0; border-inline-end: 1px solid var(--border); transform: translateX(-100%); }
.mobile-panel.open { transform: translateX(0); }
.mobile-panel a { padding: 12px 14px; border-radius: 10px; color: var(--text); font-weight: 500; }
.mobile-panel a:hover { background: var(--surface-2); }
.mobile-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 65;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease);
}
.mobile-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Sections ---------- */
section { padding: 96px 0; position: relative; }
section .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--primary); font-family: var(--font-mono); font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 14px;
}
section .eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--primary); display: inline-block; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p { font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 40px; position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, black 0%, black 78%, transparent 100%); mask-image: linear-gradient(to bottom, black 0%, black 78%, transparent 100%); }
.hero .grid-bg {
  position: absolute; inset: -10% 0 -10% 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 30%, black 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 30%, black 20%, transparent 78%);
  opacity: 0.5;
}
.hero .orb {
  position: absolute; z-index: 0; pointer-events: none;
  width: 520px; height: 520px; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  background: radial-gradient(circle, var(--primary), transparent 65%);
  animation: floaty 12s var(--ease) infinite alternate;
}
.hero .orb.a { top: -180px; left: -160px; }
.hero .orb.b { bottom: -260px; right: -200px; opacity: 0.32; }
@keyframes floaty { from { transform: translateY(0); } to { transform: translateY(30px); } }

.hero-inner { position: relative; z-index: 1; display: grid; gap: 28px; padding: 40px 0 64px; text-align: center; place-items: center; }
.hero h1 { max-width: 900px; }
.hero .accent { background: linear-gradient(120deg, var(--primary), var(--brand-emerald)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--text-muted); max-width: 640px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero .trust { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- About Page Hero ---------- */
.about-hero,
.about-identity,
.about-motivation,
.about-journey,
.about-developer {
  isolation: isolate;
  overflow: hidden;
}
.about-hero .orb.b { display: none; }
.about-hero .grid-bg {
  opacity: 0.18;
  filter: blur(0.5px);
  transform: scale(1.02);
}
.about-hero-decor {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  display: grid; place-items: center;
  opacity: 0.72;
}
.about-hero-inner { position: relative; z-index: 1; }
.deco-node {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: color-mix(in oklab, var(--primary) 40%, transparent);
  box-shadow: 0 0 12px color-mix(in oklab, var(--primary) 40%, transparent);
  opacity: 0.6;
}
.deco-node.n1 { top: 15%; left: 12%; animation: decoFloat 8s ease-in-out infinite; }
.deco-node.n2 { top: 20%; right: 15%; animation: decoFloat 10s ease-in-out infinite 1s; }
.deco-node.n3 { bottom: 25%; left: 18%; animation: decoFloat 9s ease-in-out infinite 2s; }
.deco-node.n4 { bottom: 20%; right: 12%; animation: decoFloat 11s ease-in-out infinite 3s; }
.deco-lines {
  position: absolute; width: 100%; height: 100%;
  display: grid; place-items: center;
}
.deco-lines svg { width: 100%; height: 100%; opacity: 0.5; }
.about-hero-badges { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.mini-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--primary) 35%, transparent);
  font-size: 0.8rem; font-weight: 500; color: var(--text-strong);
}
.mini-badge .mb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 8px color-mix(in oklab, var(--primary) 60%, transparent);
}

/* ---------- Identity / Mission ---------- */
.about-identity { position: relative; overflow: hidden; }
.about-identity::before {
  content: ""; position: absolute; inset: -12% -8% auto; height: 92%; pointer-events: none;
  background:
    radial-gradient(720px 300px at 12% 8%, color-mix(in oklab, var(--primary) 8%, transparent), transparent 62%),
    radial-gradient(780px 340px at 88% 92%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 64%);
  filter: blur(72px);
  opacity: 0.28;
  z-index: 0;
  transform: scale(1.05);
}
.about-identity > .container { position: relative; z-index: 1; }
.identity-grid { display: grid; gap: 48px; align-items: start; max-width: 1200px; margin: 0 auto; }
.identity-left { display: grid; gap: 24px; max-width: 480px; }
.identity-right { display: grid; gap: 14px; }
.identity-lead { font-size: 1.1rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 32px; }
.identity-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-card {
  padding: 20px; border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--surface-2) 80%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--primary) 20%, var(--border));
  text-align: center;
}
.stat-value {
  font-size: 2rem; font-weight: 700; color: var(--primary);
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Identity Glass Cards ---------- */
.identity-block {
  padding: 20px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 94%, transparent), var(--surface));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(140%);
}
.identity-block:has(+ .identity-divider) { margin-bottom: 16px; }
.identity-block:has(-is(-1)) { margin-bottom: 24px; }
.ib-label {
  display: block; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 12px; font-weight: 600;
}
.identity-block p {
  margin: 0; color: var(--text-muted); line-height: 1.7; font-size: 0.95rem;
}
.identity-divider {
  height: 1px; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--primary) 30%, transparent), transparent);
  opacity: 0.6;
}

/* ---------- Motivation / Features ---------- */
.about-motivation { padding: 96px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.feature-card {
  padding: 24px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, transparent), var(--surface));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-med) var(--ease);
  display: flex; flex-direction: column; gap: 16px;
}
.feature-card:hover {
  transform: translateY(-3px); border-color: color-mix(in oklab, var(--primary) 45%, var(--border-strong));
  box-shadow: 0 15px 40px -15px color-mix(in oklab, var(--primary) 35%, transparent);
}
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in oklab, var(--primary) 12%, var(--surface-2));
  color: var(--primary); display: grid; place-items: center;
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  box-shadow: 0 0 22px -6px color-mix(in oklab, var(--primary) 50%, transparent);
}
.feature-card h3 {
  margin: 0; font-size: 1.15rem; font-family: var(--font-display); color: var(--text-strong);
}
.feature-card p { margin: 0; color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }

/* ---------- Journey Timeline ---------- */
.about-journey { padding: 40px 0; }
.about-journey > .container { position: relative; z-index: 1; }

/* ---------- Developer Section ---------- */
.about-developer { padding: 96px 0; }
.dev-card-pro {
  display: grid; grid-template-columns: 120px 1fr; gap: 32px; align-items: center; padding: 32px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 94%, transparent), var(--surface));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-2);
  backdrop-filter: blur(14px) saturate(140%);
}
.dev-avatar-pro {
  position: relative; width: 120px; height: 120px; margin-inline: auto;
  display: grid; place-items: center;
}
.dev-avatar-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--brand-emerald));
  padding: 3px; animation: spin 12s linear infinite;
}
.dev-avatar-inner {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--surface-2);
  overflow: hidden;
}

.dev-avatar-inner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dev-info { display: grid; gap: 16px; }
.dev-info .role {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--primary);
}
.dev-info h3 {
  margin: 0; font-size: 1.5rem; font-family: var(--font-display); color: var(--text-strong);
}
.dev-info .chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.dev-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Glass Card Base (shared) ---------- */
.glass-card {
  position: relative; padding: 22px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, transparent), var(--surface));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(140%);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.card:hover { border-color: var(--border-strong); }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; }
.step {
  position: relative; padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.step .num {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--primary);
  letter-spacing: 0.16em; margin-bottom: 12px;
}
.step h3 { color: var(--text-strong); margin-bottom: 6px; }
.step p { margin: 0; font-size: 0.92rem; }
.step .icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
  color: var(--primary);
  display: grid; place-items: center; margin-bottom: 16px;
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
}

/* ---------- Upload ---------- */
.workspace { display: grid; gap: 20px; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-xl);
  padding: 48px 24px; text-align: center; background: color-mix(in oklab, var(--surface) 60%, transparent);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 6%, var(--surface)); }
.dropzone .zone-icon { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--primary); }
.dropzone h3 { color: var(--text-strong); margin-bottom: 6px; }
.dropzone small { color: var(--text-subtle); }

.upload-preview { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); align-items: center; }
.upload-preview img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); background: #000; }
.upload-preview .meta { display: grid; gap: 8px; font-size: 0.9rem; color: var(--text-muted); }
.upload-preview .meta b { color: var(--text-strong); font-weight: 600; }
.upload-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Pipeline / Progress ---------- */
.pipeline { display: grid; gap: 20px; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.pipeline .row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
}
.status-badge[data-status="queued"] { color: var(--info); border-color: color-mix(in oklab, var(--info) 40%, transparent); }
.status-badge[data-status="processing"] { color: var(--primary); border-color: color-mix(in oklab, var(--primary) 45%, transparent); background: color-mix(in oklab, var(--primary) 10%, var(--surface-2)); }
.status-badge[data-status="completed"] { color: var(--success); border-color: color-mix(in oklab, var(--success) 45%, transparent); }
.status-badge[data-status="failed"] { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }
.status-badge .dot { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.progress {
  position: relative; height: 10px; border-radius: var(--radius-pill);
  background: var(--track); overflow: hidden;
}
.progress .bar {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 0%;
  background: linear-gradient(90deg, var(--brand-emerald), var(--primary));
  transition: width var(--dur-med) var(--ease);
}
.progress .bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%);} 100% { transform: translateX(100%);} }
.progress-num { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-strong); }

.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stage {
  padding: 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; min-height: 84px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.stage .label { font-size: 0.78rem; color: var(--text-subtle); letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-mono); }
.stage .name { font-weight: 600; color: var(--text-strong); font-size: 0.95rem; }
.stage.active { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 8%, var(--surface-2)); }
.stage.done { border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.stage.done .name::after { content: " ✓"; color: var(--success); }
.pipeline-note { font-size: 0.82rem; color: var(--text-subtle); }

.error-card { padding: 18px; border-radius: var(--radius-md); border: 1px solid color-mix(in oklab, var(--danger) 45%, transparent); background: color-mix(in oklab, var(--danger) 8%, var(--surface)); color: var(--text); }
.error-card b { color: var(--danger); }

/* ---------- Comparison ---------- */
.compare-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.selectors { display: flex; gap: 10px; flex-wrap: wrap; }
.selectors label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }
.selectors select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 10px; min-height: 40px; font-weight: 500;
}
.selectors select:hover { border-color: var(--primary); }

/* ---------- Scroll to Top Button ---------- */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--dur-med) var(--ease),
              visibility var(--dur-med) var(--ease),
              transform var(--dur-med) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.scroll-to-top:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-4px);
}
.scroll-to-top:active {
  transform: translateY(0);
}
.scroll-to-top svg {
  width: 20px;
  height: 20px;
}
.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Custom Scrollbar ---------- */
/* Webkit browsers (Chrome, Edge, Opera, Safari) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--track);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
  border: 2px solid var(--track);
  transition: background var(--dur-fast) var(--ease);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--track);
}

.viewer {
  position: relative; user-select: none; overflow: hidden;
  aspect-ratio: 16 / 10; background: #000;
  border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-2);
}
.viewer .imgwrap { position: absolute; inset: 0; overflow: hidden; }
.viewer .imgwrap img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transform-origin: center center;
  transition: transform var(--dur-med) var(--ease);
}
.viewer .top { width: 50%; z-index: 2; }
.viewer .divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--primary); z-index: 3; box-shadow: 0 0 24px var(--primary); }
.viewer .handle {
  position: absolute; top: 50%; left: 50%; z-index: 4;
  width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface); border: 2px solid var(--primary); color: var(--primary);
  display: grid; place-items: center; cursor: ew-resize; box-shadow: 0 8px 24px rgba(0,0,0,0.35), var(--glow);
  touch-action: none;
}
.viewer .handle:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.viewer .tag { position: absolute; top: 14px; z-index: 3; padding: 6px 10px; border-radius: var(--radius-pill); background: rgba(0,0,0,0.55); color: #fff; font-size: 0.78rem; letter-spacing: 0.06em; font-family: var(--font-mono); border: 1px solid rgba(255,255,255,0.1); }
.viewer .tag.left { left: 14px; }
.viewer .tag.right { right: 14px; }

.viewer-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--glass-bg); backdrop-filter: blur(10px);
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 5;
}
.viewer-toolbar .btn-icon { width: 36px; height: 36px; min-height: 36px; background: transparent; border: 0; }
.viewer-toolbar .btn-icon:hover { background: var(--surface-2); color: var(--primary); }
.viewer-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; font-family: var(--font-mono); }

/* ---------- Downloads ---------- */
.downloads-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.dl-card { padding: 14px; display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; }
.dl-card img { width: 92px; height: 92px; object-fit: cover; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.dl-card .name { font-weight: 600; color: var(--text-strong); }
.dl-card .fmt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-subtle); }
.dl-card .btn { margin-top: 8px; padding: 8px 12px; min-height: 36px; font-size: 0.85rem; }
.dl-all { display: flex; justify-content: flex-end; }

/* ---------- History ---------- */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.history-item { padding: 8px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.history-item img { aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.history-item .h-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-subtle); padding: 8px 4px 4px; font-family: var(--font-mono); }
.history-empty { padding: 30px; text-align: center; color: var(--text-subtle); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.faq-item summary, .faq-q {
  list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 600;
  color: var(--text-strong); display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 44px;
}
.faq-q .chev { transition: transform var(--dur-fast) var(--ease); color: var(--primary); }
.faq-item[data-open="true"] .chev { transform: rotate(180deg); }
.faq-a { padding: 0 20px 18px; color: var(--text-muted); font-size: 0.95rem; display: none; }
.faq-item[data-open="true"] .faq-a { display: block; animation: fadein var(--dur-med) var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.footer { padding: 60px 0 24px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr; gap: 32px; }
.footer h4 { font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 14px; font-weight: 600; }
.footer a { color: var(--text-muted); display: block; padding: 4px 0; font-size: 0.92rem; }
.footer a:hover { color: var(--primary); }

.footer .brand-block p { max-width: 340px; font-size: 0.92rem; margin-top: 12px; }
.tech-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-badges .chip { font-size: 0.75rem; padding: 4px 10px; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 24px; margin-top: 32px; border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 0.82rem; flex-wrap: wrap; gap: 8px; }
.footer-bottom .attribution { margin-top: 8px; font-size: 0.75rem; line-height: 1.5; color: var(--text-subtle); opacity: 0.7; }
.footer-bottom .attribution a { color: var(--text-muted); transition: color var(--dur-fast) var(--ease); }
.footer-bottom .attribution a:hover { color: var(--primary); }

/* ---------- Footer connect icons ---------- */
/* Theme-aware SVG icons: Dark/ variants are white (#ffffff) for dark backgrounds,
   Light/ variants are black (#000000) for light backgrounds. JS swaps the src
   on theme toggle (see theme.js). No CSS filters needed. */
footer .footer-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}
footer .footer-link:hover { color: var(--primary); }

footer .footer-link-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

footer .footer-link-icon img {
    display: block;
    width: 16px;
    height: 16px;
    margin-bottom: 3px;
    object-fit: contain;
}

footer .footer-link-text {
    display: inline-block;
}

/* ---------- Footer connect icons - RTL/LTR direction ---------- */
html[dir="ltr"] footer .footer-link {
    direction: ltr;
}

html[dir="rtl"] footer .footer-link {
    direction: rtl;
}

/* ---------- HuggingFace Spaces badge ---------- */
.tech-badge-link { text-decoration: none; }
.tech-badge-link .chip {
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}
.tech-badge-link:hover .chip {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 14px color-mix(in oklab, var(--primary) 35%, transparent);
}

/* ---------- Journey timeline (About) ---------- */
.journey { display: grid; gap: 14px; max-width: 720px; }
.journey .j-step { position: relative; padding: 18px 20px 18px 52px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
[dir="rtl"] .journey .j-step { padding: 18px 52px 18px 20px; }
.journey .j-step::before { content: ""; position: absolute; left: 22px; top: 24px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
[dir="rtl"] .journey .j-step::before { left: auto; right: 22px; }
.journey .j-step::after { content: ""; position: absolute; left: 26px; top: 40px; bottom: -14px; width: 2px; background: linear-gradient(var(--primary), transparent); }
[dir="rtl"] .journey .j-step::after { left: auto; right: 26px; }
.journey .j-step:last-child::after { display: none; }
.journey h3 { margin-bottom: 4px; }
.journey p { margin: 0; font-size: 0.95rem; }

/* ---------- Developer card ---------- */
.dev-card { display: grid; grid-template-columns: 140px 1fr; gap: 22px; align-items: center; padding: 24px; }
.dev-avatar { width: 140px; height: 140px; border-radius: 50%; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); border: 2px solid var(--primary); display: grid; place-items: center; color: var(--primary); font-family: var(--font-display); font-size: 3rem; font-weight: 700; }
.dev-card .role { color: var(--primary); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dev-card h3 { margin: 4px 0 10px; font-size: 1.5rem; }
.dev-card .chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.dev-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Models page ---------- */
.model-block { display: grid; grid-template-columns: 200px 1fr; gap: 26px; padding: 28px; align-items: stretch; }
.model-block .m-side {
  display: flex; flex-direction: column; align-self: stretch;
  justify-content: flex-start;
  text-align: center;
}
.model-block .model-actions {
  margin-top: auto; margin-bottom: auto; width: 100%;
  display: flex; justify-content: center;
}
@media (max-width: 1023px) {
  .model-block .model-actions { margin-top: 15px; }
}
.model-block .m-side .badge {
  flex-shrink: 0;
  width: 100%; padding: 20px; border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--primary) 10%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
}
.model-block .m-side .badge h3 { color: var(--primary); font-size: 1.05rem; margin: 0; }
.model-block .m-side .badge span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.06em; }
@media (max-width: 768px) {
  .model-block {
    display: flex; flex-direction: column; gap: 0;
  }
  .model-block .m-side { display: contents; }
  .model-block .badge { order: 1; margin-bottom: 20px; }
  .model-block > div:not(.m-side) { order: 2; }
  .model-block .model-actions {
    order: 3;
    margin-top: 24px;
    margin-bottom: 0;
    justify-content: center;
  }
}
.attrs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.attrs .kv { padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.attrs .kv b { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); display: block; margin-bottom: 4px; font-family: var(--font-mono); }
.attrs .kv p { margin: 0; font-size: 0.9rem; color: var(--text); }

.pipeline-diagram {
  display: grid; grid-template-columns: 1fr; gap: 16px; padding: 32px;
  border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface);
  text-align: center;
}
.pipeline-diagram .node {
  display: inline-block; padding: 12px 20px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 600; color: var(--text-strong);
}
.pipeline-diagram .node.brand { color: var(--primary); border-color: var(--primary); background: color-mix(in oklab, var(--primary) 10%, var(--surface-2)); }
.pipeline-diagram .arrow { color: var(--text-subtle); font-family: var(--font-mono); }
.pipeline-diagram .branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.compare-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.compare-table th, .compare-table td { padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.compare-table th { background: var(--surface-2); color: var(--text-strong); font-weight: 600; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:hover { background: color-mix(in oklab, var(--primary) 4%, transparent); }

/* =========================================================
   ABOUT PAGE — premium redesign (Lovablesource)
   ========================================================= */

/* Hero */
.about-hero { padding-bottom: 24px; }
.about-hero-inner { padding: 56px 0 40px; gap: 22px; }
.about-hero-inner h1 { max-width: 900px; }
.about-hero-decor {
  position: absolute; inset: 0; pointer-events: none;
  color: var(--brand-emerald);
  opacity: 0.75;
  z-index: 0;
}
.about-hero-decor .deco-lines {
  position: absolute; inset: 0; width: 100%; height: 100%;
  animation: aboutLineFloat 14s ease-in-out infinite alternate;
}
.about-hero-decor .deco-node {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-emerald);
  box-shadow: 0 0 16px var(--brand-emerald), 0 0 4px #fff inset;
  opacity: 0.85;
  animation: aboutNodePulse 3.6s ease-in-out infinite;
}
.about-hero-decor .n1 { top: 22%; left: 8%; animation-delay: 0s; }
.about-hero-decor .n2 { top: 68%; left: 18%; animation-delay: 0.6s; }
.about-hero-decor .n3 { top: 30%; right: 12%; animation-delay: 1.2s; }
.about-hero-decor .n4 { top: 74%; right: 22%; animation-delay: 1.8s; }
@keyframes aboutNodePulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.4); opacity: 1; }
}
@keyframes aboutLineFloat {
  from { transform: translateY(-6px); }
  to   { transform: translateY(6px); }
}
.about-hero-badges {
  display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 6px;
}
.mini-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-family: var(--font-mono, var(--font-body));
  letter-spacing: 0.06em;
  color: var(--text-strong);
}
.mini-badge .mb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-emerald);
  box-shadow: 0 0 10px var(--brand-emerald);
}

/* Identity / Mission */
.about-identity { padding: 40px 0 20px; }
.identity-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: start;
}
.identity-left .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.identity-left .eyebrow::before {
  width: 26px;
  opacity: 0.85;
}
.identity-left h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 12px 0 14px;
  max-width: 520px;
}
.identity-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 24px;
}
.identity-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 520px;
}
.stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.stat-card::after {
  content: ""; position: absolute; inset: -1px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--brand-emerald) 30%, transparent), transparent 60%);
  opacity: 0; transition: opacity var(--dur-med) var(--ease);
  pointer-events: none; border-radius: inherit;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--brand-emerald) 45%, var(--border));
  box-shadow: 0 12px 30px -18px var(--ring);
}
.stat-card:hover::after { opacity: 0.35; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-emerald);
  line-height: 1;
}
.stat-label {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.identity-right { padding: 22px; gap: 14px; }
.identity-block {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 94%, transparent), var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(140%);
}
.identity-block .ib-label {
  font-family: var(--font-mono, var(--font-body));
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-emerald);
  margin-bottom: 7px;
}
.identity-block p { margin: 0; }
.identity-divider {
  height: 1px;
  margin: 10px 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
@media (max-width: 900px) {
  .identity-grid { grid-template-columns: 1fr; gap: 28px; }
  .identity-stats { max-width: none; }
}

/* Motivation feature cards */
.about-motivation { padding: 40px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature-card {
  padding: 24px;
  transition: transform var(--dur-med) var(--ease),
              border-color var(--dur-med) var(--ease),
              box-shadow var(--dur-med) var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--brand-emerald) 45%, var(--border));
  box-shadow: 0 18px 42px -22px var(--ring);
}
.feature-card .feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--brand-emerald) 14%, transparent);
  color: var(--brand-emerald);
  border: 1px solid color-mix(in oklab, var(--brand-emerald) 30%, var(--border));
  box-shadow: 0 0 20px -8px var(--brand-emerald);
  margin-bottom: 14px;
}
.feature-card h3 { margin-bottom: 8px; color: var(--text-strong); }
.feature-card p { margin: 0; }
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* Timeline */
.about-journey { padding: 40px 0; }
.about-journey > .container { position: relative; z-index: 1; }
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  display: grid;
  gap: 20px;
  max-width: 880px;
  margin-inline: auto;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--brand-emerald) 60%, transparent),
    color-mix(in oklab, var(--primary) 40%, transparent),
    transparent);
  border-radius: 2px;
}
[dir="rtl"] .timeline::before {
  left: auto;
  right: 27px;
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: start;
}
.tl-node {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--brand-emerald) 50%, var(--border));
  box-shadow: 0 0 0 6px color-mix(in oklab, var(--brand-emerald) 8%, transparent),
              0 0 24px -6px var(--brand-emerald);
  z-index: 1;
}
.tl-node::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--brand-emerald), transparent 60%, var(--brand-emerald));
  opacity: 0.35;
  animation: tlSpin 6s linear infinite;
  z-index: -1;
  filter: blur(2px);
}
@keyframes tlSpin { to { transform: rotate(360deg); } }
.tl-num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brand-emerald);
  letter-spacing: 0.02em;
}
.tl-card {
  padding: 18px 20px;
  position: relative;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tl-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--brand-emerald) 40%, var(--border));
}
.tl-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand-emerald);
  background: color-mix(in oklab, var(--brand-emerald) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand-emerald) 22%, var(--border));
}
[dir="rtl"] .tl-icon {
  right: auto;
  left: 18px;
}
.tl-card h3 {
  margin: 0 0 6px;
  padding-right: 44px;
}
[dir="rtl"] .tl-card h3 {
  padding-right: 0;
  padding-left: 44px;
}
.tl-card p {
  margin: 0;
}
@media (max-width: 640px) {
  .tl-item {
    grid-template-columns: 44px 1fr;
    gap: 12px;
  }
  .tl-node {
    width: 44px;
    height: 44px;
  }
  .timeline::before {
    left: 21px;
  }
  [dir="rtl"] .timeline::before {
    right: 21px;
    left: auto;
  }
}

/* Developer card */
.about-developer { padding: 40px 0 80px; }
.dev-card-pro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.dev-card-pro::before {
  content: "";
  position: absolute; inset: -1px;
  background:
    radial-gradient(400px 200px at 0% 0%, color-mix(in oklab, var(--brand-emerald) 18%, transparent), transparent 60%),
    radial-gradient(400px 200px at 100% 100%, color-mix(in oklab, var(--primary) 14%, transparent), transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}
.dev-avatar-pro {
  position: relative;
  width: 180px; height: 180px;
  display: grid; place-items: center;
  margin: 0 auto;
}
.dev-avatar-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    var(--brand-emerald),
    color-mix(in oklab, var(--primary) 70%, transparent),
    transparent 55%,
    var(--brand-emerald));
  animation: tlSpin 10s linear infinite;
  filter: blur(1px);
  opacity: 0.9;
}
.dev-avatar-inner {
  position: relative;
  width: 156px; height: 156px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2, var(--surface)), var(--surface-3, var(--surface)));
  display: grid; place-items: center;
  color: var(--brand-emerald);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  border: 1px solid color-mix(in oklab, var(--brand-emerald) 30%, var(--border));
  box-shadow: inset 0 0 24px -8px var(--brand-emerald);
}
.dev-info .role {
  color: var(--brand-emerald);
  font-family: var(--font-mono, var(--font-body));
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dev-info h3 { margin: 6px 0 10px; font-size: 1.6rem; }
.dev-info p { margin: 0 0 14px; max-width: 640px; }
.dev-info .chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.dev-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .dev-card-pro { grid-template-columns: 1fr; text-align: center; padding: 24px; }
  .dev-info .chip-row, .dev-actions { justify-content: center; }
  .dev-info p { margin-inline: auto; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.stack-16 { display: grid; gap: 16px; }
.stack-24 { display: grid; gap: 24px; }
.row-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================================
   Premium AI Processing Pipeline (models.html)
   ============================================================ */
.pipeline-section { position: relative; overflow: hidden; }
.pipeline-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 15% 10%, color-mix(in oklab, var(--primary) 10%, transparent), transparent 60%),
    radial-gradient(700px 340px at 85% 90%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%);
  z-index: 0;
}
.pipeline-section > .container { position: relative; z-index: 1; }

.pipeline-flow { display: grid; gap: 28px; margin-top: 8px; }
.flow-step { display: grid; gap: 14px; }

.step-tag {
  display: inline-flex; align-items: center; gap: 10px; align-self: start;
  padding: 6px 12px 6px 6px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
}
.step-tag .step-num {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px;
  border-radius: var(--radius-pill); background: color-mix(in oklab, var(--primary) 18%, var(--surface-2));
  color: var(--primary); font-weight: 700;
}

/* Glass card base */
.glass-card {
  position: relative; padding: 22px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, transparent), var(--surface));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(140%);
}

/* ---------- STEP 1: INPUT ---------- */
.input-card {
  display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center;
  box-shadow: var(--shadow-1), 0 0 0 1px color-mix(in oklab, var(--primary) 12%, transparent),
              0 30px 80px -30px color-mix(in oklab, var(--primary) 30%, transparent);
}
.input-frame {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong); background: #000;
}
.grayscale-thumb { position: absolute; inset: 0; filter: grayscale(1) contrast(1.05); }
.input-frame::before, .input-frame::after {
  content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--primary);
  opacity: 0.9; pointer-events: none;
}
.input-frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.input-frame::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 18px 2px color-mix(in oklab, var(--primary) 60%, transparent);
  animation: scan 2.6s var(--ease) infinite;
}
@keyframes scan { 0%{top:0;opacity:0} 10%{opacity:1} 90%{opacity:1} 100%{top:100%;opacity:0} }
.ai-badge {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill); font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.14em; color: var(--primary);
  background: color-mix(in oklab, var(--primary) 12%, rgba(0,0,0,0.5));
  border: 1px solid color-mix(in oklab, var(--primary) 40%, transparent);
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 var(--primary); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in oklab, var(--primary) 60%, transparent)}
  70%{box-shadow:0 0 0 10px transparent} 100%{box-shadow:0 0 0 0 transparent} }
.meta-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text-strong); margin-bottom: 12px; }
.meta-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.meta-list li { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.88rem; }
.meta-list li span { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.meta-list li b { color: var(--text); font-weight: 600; }
.meta-list li b.ok { color: var(--primary); }

/* ---------- Connectors ---------- */
.flow-connector { position: relative; height: 44px; display: flex; justify-content: center; align-items: center; }
.flow-connector .line {
  width: 2px; height: 100%; background: linear-gradient(180deg,
    color-mix(in oklab, var(--primary) 60%, transparent), color-mix(in oklab, var(--primary) 10%, transparent));
  border-radius: 2px; box-shadow: 0 0 12px color-mix(in oklab, var(--primary) 40%, transparent);
}
.flow-connector .pkt {
  position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 14px 2px var(--primary); animation: pktDrop 2.2s var(--ease) infinite;
}
@keyframes pktDrop { 0%{top:-4px;opacity:0} 20%{opacity:1} 80%{opacity:1} 100%{top:100%;opacity:0} }

.flow-connector.fan { height: 80px; }
.flow-connector.fan svg { width: 100%; height: 100%; overflow: visible; }
.branch-line {
  fill: none; stroke: color-mix(in oklab, var(--primary) 55%, transparent); stroke-width: 1.6;
  stroke-dasharray: 4 6; animation: flow 1.8s linear infinite;
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--primary) 40%, transparent));
}
@keyframes flow { to { stroke-dashoffset: -20; } }

/* ---------- STEP 2: ENGINE ---------- */
.engine-core {
  position: relative; margin: 0 auto; width: min(520px, 100%); aspect-ratio: 16 / 10;
  border-radius: 28px; padding: 32px;
  background:
    radial-gradient(60% 60% at 50% 45%, color-mix(in oklab, var(--primary) 18%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--primary) 30%, var(--border-strong));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 12%, transparent),
              0 40px 120px -40px color-mix(in oklab, var(--primary) 50%, transparent);
  overflow: hidden;
  display: grid; place-items: center;
}
.engine-core::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in oklab, var(--primary) 18%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--primary) 18%, transparent) 1px, transparent 1px);
  background-size: 28px 28px; opacity: 0.14; mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
}
.engine-rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.engine-rings .ring {
  position: absolute; border-radius: 50%; border: 1px solid color-mix(in oklab, var(--primary) 40%, transparent);
  box-shadow: 0 0 30px color-mix(in oklab, var(--primary) 25%, transparent) inset;
}
.ring.r1 { width: 130px; height: 130px; animation: spin 14s linear infinite; }
.ring.r2 { width: 200px; height: 200px; border-style: dashed; animation: spin 22s linear infinite reverse; opacity: 0.7; }
.ring.r3 { width: 280px; height: 280px; opacity: 0.4; animation: spin 30s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.engine-particles { position: absolute; inset: 0; pointer-events: none; }
.engine-particles span {
  position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 10px var(--primary); opacity: 0.7;
}
.engine-particles span:nth-child(1){ left:12%; top:22%; animation: floaty 5s ease-in-out infinite; }
.engine-particles span:nth-child(2){ left:82%; top:30%; animation: floaty 6s ease-in-out infinite .4s; }
.engine-particles span:nth-child(3){ left:20%; top:78%; animation: floaty 7s ease-in-out infinite .8s; }
.engine-particles span:nth-child(4){ left:70%; top:74%; animation: floaty 5.5s ease-in-out infinite 1.2s; }
.engine-particles span:nth-child(5){ left:50%; top:12%; animation: floaty 6.5s ease-in-out infinite 1.5s; }
.engine-particles span:nth-child(6){ left:44%; top:88%; animation: floaty 8s ease-in-out infinite 2s; }
@keyframes floaty { 0%,100%{transform: translateY(0); opacity:.35} 50%{transform: translateY(-14px); opacity:.9} }
.engine-inner { position: relative; text-align: center; z-index: 1; color: var(--text-strong); max-width: 380px; }
.engine-icon { color: var(--primary); filter: drop-shadow(0 0 12px color-mix(in oklab, var(--primary) 60%, transparent)); margin-bottom: 12px; }
.engine-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.engine-sub { margin-top: 8px; color: var(--text-muted); font-size: 0.92rem; }

/* ---------- STEP 3: MODEL CARDS ---------- */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.model-card {
  position: relative; padding: 22px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface), color-mix(in oklab, var(--surface-2) 70%, var(--surface)));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  transition: transform var(--dur-med) var(--ease), border-color var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
  overflow: hidden;
}
.model-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, transparent 40%, color-mix(in oklab, var(--primary) 40%, transparent), transparent 70%);
  opacity: 0; transition: opacity var(--dur-med) var(--ease);
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.model-card:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--primary) 45%, var(--border-strong));
  box-shadow: var(--shadow-2), 0 30px 60px -30px color-mix(in oklab, var(--primary) 35%, transparent); }
.model-card:hover::before { opacity: 1; }
.model-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.model-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--primary); background: color-mix(in oklab, var(--primary) 12%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  box-shadow: 0 0 24px -8px color-mix(in oklab, var(--primary) 60%, transparent);
}
.model-head h3 { margin: 0; font-size: 1.05rem; font-family: var(--font-display); color: var(--text-strong); }
.model-tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.model-desc { color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; margin: 0 0 14px; }
.badge-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge-list li {
  font-size: 0.76rem; padding: 5px 10px 5px 22px; border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--primary) 8%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--primary) 22%, var(--border));
  color: var(--text); position: relative;
}
.badge-list li::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 8px; transform: translateY(-50%);
  background: var(--primary); clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 20%, 84% 8%, 40% 68%);
}

/* ---------- STEP 4: COMPARISON STUDIO ---------- */
.studio-panel {
  padding: 22px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #0a1611, #060f0b);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.04);
}
:root[data-theme="light"] .studio-panel { background: linear-gradient(180deg, #F5F8F6, #EAF1EC); }
.studio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.studio-head h3 { margin: 0 0 4px; font-family: var(--font-display); color: var(--text-strong); font-size: 1.15rem; }
.studio-head p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.studio-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.s-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  background: color-mix(in oklab, var(--primary) 14%, var(--surface-2));
  color: var(--primary); border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer;
}
.s-btn.ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.studio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.studio-tile {
  display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--primary) 6%, var(--surface-2));
  border: 1px solid var(--border);
}
.studio-tile span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); text-align: center; }
.tile-thumb, .result-thumb { aspect-ratio: 4 / 3; border-radius: 10px; position: relative; overflow: hidden;
  background: #1a2620 center/cover; border: 1px solid var(--border); }
.tile-thumb.gray  { background-image: linear-gradient(135deg, #2b332f, #0f1613); }
.tile-thumb.zhang { background-image: linear-gradient(135deg, #6b7c5c, #a8955a, #4d5e4a); }
.tile-thumb.deold { background-image: linear-gradient(135deg, #8b5a3c, #c8926a, #5a3a2a); }
.tile-thumb.flux  { background-image: linear-gradient(135deg, #2a8a5a, #66d99a, #1e6a48); }

/* ---------- STEP 5: RESULTS ---------- */
.results-panel {
  padding: 22px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
}
.results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.results-head h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.15rem; color: var(--text-strong); }
.results-head p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.result-card { border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease); }
.result-card:hover { transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px color-mix(in oklab, var(--primary) 30%, transparent); }
.result-thumb.zhang { background-image: linear-gradient(135deg, #6b7c5c, #a8955a, #4d5e4a); }
.result-thumb.deold { background-image: linear-gradient(135deg, #8b5a3c, #c8926a, #5a3a2a); }
.result-thumb.flux  { background-image: linear-gradient(135deg, #2a8a5a, #66d99a, #1e6a48); }
.q-badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary-contrast); background: var(--primary); }
.result-body { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.r-title { font-weight: 600; color: var(--text-strong); }
.btn.sm { padding: 7px 12px; font-size: 0.82rem; }

/* Responsive */
@media (max-width: 900px) {
  .model-grid, .results-grid, .studio-grid { grid-template-columns: 1fr 1fr; }
  .input-card { grid-template-columns: 1fr; }
  .input-frame { max-width: 320px; margin: 0 auto; }
}
@media (max-width: 600px) {
  .model-grid, .results-grid, .studio-grid { grid-template-columns: 1fr; }
  .engine-core { padding: 22px; aspect-ratio: 5 / 4; }
  .ring.r3 { display: none; }
  .flow-connector.fan { height: 60px; }
}

/* ============================================================
   Polish pass — How it works, empty state, history cards, lang
   ============================================================ */

/* Language switcher — compact flag + code */
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  min-height: 40px; line-height: 1;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.lang-btn:hover {
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
  color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 12%, transparent);
}
.lang-btn .lang-flag { font-size: 1rem; line-height: 1; }
.lang-btn .lang-code {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--text-strong);
}
.lang-btn:hover .lang-code { color: var(--primary); }

/* ---------- How it works — premium refinement ---------- */
.steps { gap: 20px; }
.step {
  padding: 26px 22px;
  transition:
    transform var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-med) var(--ease),
    background var(--dur-fast) var(--ease);
  overflow: hidden;
  isolation: isolate;
}
.step::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 80% at 100% 0%,
      color-mix(in oklab, var(--primary) 14%, transparent) 0%,
      transparent 55%);
  opacity: 0; transition: opacity var(--dur-med) var(--ease);
  pointer-events: none; z-index: 0;
}
.step > * { position: relative; z-index: 1; }
.step:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
  box-shadow:
    0 10px 30px -14px color-mix(in oklab, var(--primary) 35%, transparent),
    0 0 0 1px color-mix(in oklab, var(--primary) 22%, transparent) inset;
}
.step:hover::before { opacity: 1; }
.step:hover .icon {
  color: var(--text-strong);
  background: color-mix(in oklab, var(--primary) 55%, var(--surface));
  border-color: color-mix(in oklab, var(--primary) 65%, transparent);
  box-shadow: 0 0 22px -4px color-mix(in oklab, var(--primary) 55%, transparent);
}

.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.step .icon { margin: 0; width: 44px; height: 44px; transition: all var(--dur-fast) var(--ease); }
.step .num { margin: 0; }

/* Connector line between steps (desktop) */
.steps[data-connected="true"] { position: relative; }
.steps[data-connected="true"]::before {
  content: "";
  position: absolute;
  left: 6%; right: 6%; top: 46px; height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    color-mix(in oklab, var(--primary) 45%, transparent) 12%,
    color-mix(in oklab, var(--primary) 45%, transparent) 88%,
    transparent 100%);
  z-index: 0;
  pointer-events: none;
}
[dir="rtl"] .steps[data-connected="true"]::before {
  background: linear-gradient(
    to left,
    transparent 0%,
    color-mix(in oklab, var(--primary) 45%, transparent) 12%,
    color-mix(in oklab, var(--primary) 45%, transparent) 88%,
    transparent 100%);
}
@media (max-width: 1023px) {
  .steps[data-connected="true"]::before { display: none; }
}

/* ---------- History — empty state + rich cards ---------- */
.history-empty {
  display: grid; place-items: center; text-align: center;
  gap: 10px; padding: 56px 24px;
  border: 1px dashed color-mix(in oklab, var(--primary) 30%, var(--border-strong));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(60% 60% at 50% 0%,
      color-mix(in oklab, var(--primary) 8%, transparent) 0%,
      transparent 70%),
    var(--surface);
}
.history-empty .empty-illus {
  width: 88px; height: 88px; border-radius: 22px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  color: var(--primary);
  box-shadow: 0 0 30px -8px color-mix(in oklab, var(--primary) 40%, transparent);
  margin-bottom: 6px;
}
.history-empty h3 { color: var(--text-strong); margin: 0; font-size: 1.15rem; }
.history-empty p { color: var(--text-muted); margin: 0; max-width: 460px; }
.history-empty .btn { margin-top: 12px; }

/* History cards */
.history-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.history-item {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-med) var(--ease);
}
.history-item:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
  box-shadow: 0 10px 24px -14px color-mix(in oklab, var(--primary) 40%, transparent);
}
.history-item .h-thumb { display: block; aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden; }
.history-item .h-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: auto; border-radius: 0; }
.history-item .h-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.history-item .h-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-subtle); letter-spacing: 0.04em; }
.history-item .h-models { display: flex; flex-wrap: wrap; gap: 6px; }
.history-item .h-chip {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 12%, var(--surface-2));
  color: var(--primary);
  border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
}
.history-item .h-open {
  margin-top: 2px; font-size: 0.85rem; font-weight: 600; color: var(--primary);
}
.history-item .h-open:hover { text-decoration: underline; }

/* ---------- FAQ — align with other sections + subtitle spacing ---------- */
.faq { max-width: 820px; margin: 0; }
#faq .section-head { margin-bottom: 32px; }
#faq .section-head p { margin-top: 8px; }

/* ---------- Lovable pipeline timeline ---------- */
.pipeline-v2 {
  position: relative;
  background:
    radial-gradient(1200px 300px at 50% -20%, color-mix(in oklab, var(--primary) 14%, transparent), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.pipeline-v2::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(transparent 95%, color-mix(in oklab, var(--primary) 10%, transparent) 100%) 0 0/100% 28px,
    linear-gradient(90deg, transparent 95%, color-mix(in oklab, var(--primary) 10%, transparent) 100%) 0 0/28px 100%;
  opacity: 0.35; pointer-events: none; mask-image: radial-gradient(circle at 50% 40%, black, transparent 78%);
}
.pipeline-v2 > * { position: relative; z-index: 1; }
.pipeline-v2 .progress { height: 6px; }
.pipeline-v2 .progress .bar { box-shadow: 0 0 20px color-mix(in oklab, var(--primary) 60%, transparent); }

.stages-timeline {
  list-style: none; margin: 0; padding: 6px 4px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch; gap: 10px;
}
.stages-timeline .stage {
  position: relative;
  padding: 18px 14px 16px; min-height: 132px;
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface-2) 90%, transparent), color-mix(in oklab, var(--surface) 90%, transparent));
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-start;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-med) var(--ease);
  overflow: hidden;
}
.stages-timeline .stage::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(220px 80px at 20% 0%, color-mix(in oklab, var(--primary) 22%, transparent), transparent 70%);
  opacity: 0; transition: opacity var(--dur-med) var(--ease); pointer-events: none;
}
.stages-timeline .stage .stage-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-med) var(--ease);
}
.stages-timeline .stage .stage-icon svg { width: 20px; height: 20px; }
.stages-timeline .stage .label { font-size: 0.72rem; color: var(--text-subtle); letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--font-mono); margin-top: 4px; }
.stages-timeline .stage .name { font-weight: 600; color: var(--text-strong); font-size: 0.98rem; letter-spacing: 0.01em; }
.stages-timeline .stage .stage-status { margin-top: auto; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); }
.stages-timeline .stage .stage-status::before { content: var(--pipe-status-idle, "idle"); }

.stages-timeline .stage.active {
  border-color: color-mix(in oklab, var(--primary) 55%, transparent);
  box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--primary) 45%, transparent), inset 0 0 0 1px color-mix(in oklab, var(--primary) 20%, transparent);
  background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 10%, var(--surface-2)), var(--surface));
}
.stages-timeline .stage.active::before { opacity: 1; }
.stages-timeline .stage.active .stage-icon {
  color: var(--primary); border-color: color-mix(in oklab, var(--primary) 55%, transparent);
  background: color-mix(in oklab, var(--primary) 10%, var(--surface));
  animation: stage-icon-pulse 2s var(--ease) infinite;
}
.stages-timeline .stage.active .stage-status { color: var(--primary); }
.stages-timeline .stage.active .stage-status::before { content: var(--pipe-status-processing, "processing"); }
.stages-timeline .stage.active .stage-status::after {
  content: ""; display: inline-block; width: 22px; height: 6px; margin-inline-start: 8px;
  vertical-align: middle; border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes stage-icon-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--primary) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in oklab, var(--primary) 0%, transparent); }
}

.stages-timeline .stage.done {
  border-color: color-mix(in oklab, var(--success) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in oklab, var(--success) 6%, var(--surface-2)), var(--surface));
}
.stages-timeline .stage.done .stage-icon {
  color: var(--success); border-color: color-mix(in oklab, var(--success) 50%, transparent);
  background: color-mix(in oklab, var(--success) 12%, var(--surface));
  animation: stage-check-pop 420ms var(--ease) 1;
}
.stages-timeline .stage.done .stage-status { color: var(--success); }
.stages-timeline .stage.done .stage-status::before { content: var(--pipe-status-complete, "complete"); }
.stages-timeline .stage.done .stage-status::after { content: "\2713"; margin-inline-start: 8px; font-weight: 700; }
.stages-timeline .stage.done .name::after { content: none; }
@keyframes stage-check-pop {
  0% { transform: scale(0.7); }
  55% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.stages-timeline .stage-link { align-self: center; min-width: 24px; height: 2px; display: flex; align-items: center; }
.stages-timeline .stage-link .stage-link-inner { position: relative; height: 2px; width: 100%; background: color-mix(in oklab, var(--border) 100%, transparent); border-radius: 2px; overflow: hidden; }
.stages-timeline .stage-link .stage-link-inner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  transform: translateX(-100%); animation: link-flow 1.8s linear infinite;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease);
}
.stages-timeline .stage.active + .stage-link .stage-link-inner,
.stages-timeline .stage.done + .stage-link .stage-link-inner { background: color-mix(in oklab, var(--primary) 40%, var(--border)); }
.stages-timeline .stage.active + .stage-link .stage-link-inner::before { opacity: 1; }
.stages-timeline .stage.done + .stage-link .stage-link-inner { background: color-mix(in oklab, var(--success) 55%, var(--border)); }
@keyframes link-flow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
html[dir="rtl"] .progress .bar { background: linear-gradient(270deg, var(--brand-emerald), var(--primary)); }
html[dir="rtl"] .progress .bar::after,
html[dir="rtl"] .stages-timeline .stage.active .stage-status::after,
html[dir="rtl"] .stages-timeline .stage-link .stage-link-inner::before {
  animation-direction: reverse;
}
html[dir="rtl"] .stages-timeline .stage.active .stage-status::after {
  background: linear-gradient(270deg, transparent, var(--primary), transparent);
}
html[dir="rtl"] .stages-timeline { direction: rtl; }
html[dir="rtl"] .stages-timeline .stage { direction: rtl; align-items: flex-start; }
html[dir="rtl"] .stages-timeline .stage::before {
  background: radial-gradient(220px 80px at 80% 0%, color-mix(in oklab, var(--primary) 22%, transparent), transparent 70%);
}
html[dir="rtl"] .stages-timeline .stage .stage-status { text-transform: none; letter-spacing: 0; }
html[dir="rtl"] .status-badge [data-label] { text-transform: none; letter-spacing: 0; }
.pipeline-v2 .pipeline-note {
  text-align: center; font-size: 0.88rem; color: var(--text-muted);
  padding: 12px 16px; border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--surface-2) 70%, transparent);
  border: 1px solid var(--border); align-self: center; justify-self: center;
  max-width: 640px; margin: 4px auto 0;
}
@media (max-width: 1023px) {
  .stages-timeline { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stages-timeline .stage-link { display: none; }
  .stages-timeline .stage { min-height: 112px; }
}
@media (max-width: 560px) {
  .stages-timeline { grid-template-columns: 1fr; }
}

/* ---------- Lovable comparison studio polish ---------- */
.compare-head {
  padding: 14px; margin-bottom: 18px; border-radius: 14px;
  background: color-mix(in oklab, var(--surface-2) 80%, transparent);
  border: 1px solid var(--border); backdrop-filter: blur(6px);
}
.selectors { gap: 14px; }
.selectors label {
  flex: 1 1 240px; position: relative; display: flex; flex-direction: column; gap: 6px;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-subtle); font-family: var(--font-mono);
}
.selectors label > span::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-inline-end: 8px; vertical-align: middle; box-shadow: 0 0 8px var(--primary);
}
.selectors select {
  appearance: none; -webkit-appearance: none; padding: 12px 40px 12px 14px;
  border-radius: 12px; min-height: 46px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, transparent), color-mix(in oklab, var(--surface-2) 92%, transparent));
  border: 1px solid var(--border); color: var(--text-strong); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0; text-transform: none; font-family: inherit; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
[dir="rtl"] .selectors select { padding: 12px 14px 12px 40px; background-position: 20px 50%, 14px 50%; }
.selectors select:hover { border-color: color-mix(in oklab, var(--primary) 60%, transparent); transform: translateY(-1px); }
.selectors select:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent); }

.viewer {
  border-radius: 18px; border: 1px solid color-mix(in oklab, var(--primary) 18%, var(--border));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px color-mix(in oklab, var(--primary) 10%, transparent) inset;
  background: radial-gradient(600px 200px at 50% -10%, color-mix(in oklab, var(--primary) 18%, transparent), transparent 60%), #050708;
}
.viewer::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55); z-index: 3; }
.viewer .divider {
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, color-mix(in oklab, var(--primary) 90%, white) 15%, var(--primary) 50%, color-mix(in oklab, var(--primary) 90%, white) 85%, transparent 100%);
  box-shadow: 0 0 12px var(--primary), 0 0 32px color-mix(in oklab, var(--primary) 60%, transparent);
}
.viewer .handle {
  width: 48px; height: 48px; background: color-mix(in oklab, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px); border: 1.5px solid color-mix(in oklab, var(--primary) 80%, transparent); color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 6px color-mix(in oklab, var(--primary) 12%, transparent), 0 0 24px color-mix(in oklab, var(--primary) 45%, transparent);
  transition: transform 120ms var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.viewer .handle:hover { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 0 8px color-mix(in oklab, var(--primary) 16%, transparent), 0 0 30px color-mix(in oklab, var(--primary) 60%, transparent); }
.viewer .handle:active { transform: translate(-50%, -50%) scale(0.96); }
html[dir="rtl"] .viewer .handle:active { transform: translate(-50%, -50%) scale(0.96); }
.viewer .tag {
  top: 16px; padding: 7px 12px; background: rgba(8, 12, 14, 0.65); backdrop-filter: blur(10px);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, rgba(255, 255, 255, 0.08));
  font-weight: 600; font-size: 0.72rem; letter-spacing: 0.14em; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.viewer .tag::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary); margin-inline-end: 8px; vertical-align: middle; }
.viewer .tag.left { left: 16px; }
.viewer .tag.right { right: 16px; }
.viewer .tag.left::before { background: #cfd6dc; box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }
.viewer-toolbar { bottom: 18px; padding: 6px; background: rgba(10, 14, 16, 0.55); border: 1px solid color-mix(in oklab, var(--primary) 20%, rgba(255, 255, 255, 0.06)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.viewer-toolbar .btn-icon { color: #dbe3ea; border-radius: 10px; }
.viewer-toolbar .btn-icon:hover { background: color-mix(in oklab, var(--primary) 22%, transparent); color: #fff; }
.viewer-toolbar .btn-icon:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.viewer-meta { padding: 12px 14px; margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in oklab, var(--surface-2) 70%, transparent); justify-content: space-between; }
.viewer-meta > span { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 767px) {
  .selectors label { flex-basis: 100%; }
  .viewer .handle { width: 44px; height: 44px; }
  .viewer .tag { font-size: 0.68rem; padding: 6px 10px; }
}

/* ---------- Comparison control and viewport fixes ---------- */
.compare-head {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 12px;
  margin-bottom: 16px;
}
.selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
}
.selectors label {
  min-width: 0;
  margin: 0;
}
.selectors select {
  width: 100%;
  color-scheme: dark;
  background-color: var(--surface-2);
  color: var(--text-strong);
}
.selectors select option,
.selectors select optgroup {
  background-color: var(--surface-2);
  color: var(--text-strong);
}
.selectors select option:checked,
.selectors select option:hover {
  background-color: color-mix(in oklab, var(--primary) 26%, var(--surface-2));
  color: var(--text-strong);
}

/* Both image layers remain viewport-sized; only the upper layer is clipped. */
.viewer .imgwrap,
.viewer .imgwrap.top {
  width: 100%;
  height: 100%;
}
.viewer .imgwrap.top {
  clip-path: inset(0 50% 0 0);
}
.viewer .imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 680px) {
  .selectors { grid-template-columns: 1fr; }
}
