/* ==========================================================================
   SmartEdonic — Coming Soon
   Design tokens
   ========================================================================== */

:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --blue: #2E6FD9;
  --blue-deep: #135FC1;
  --teal: #1E93A8;
  --green: #2FB868;
  --green-deep: #1E9350;

  --grad-brand: linear-gradient(120deg, var(--blue) 0%, var(--teal) 50%, var(--green) 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 220ms;
  --dur-med: 480ms;
  --dur-slow: 900ms;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  color-scheme: dark;
}

/* ---- Dark theme (default) ---- */
:root,
[data-theme='dark'] {
  --bg: #060B14;
  --bg-1: #0A1220;
  --bg-2: #0D1526;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #EAF1FB;
  --text-secondary: #93A2BC;
  --text-tertiary: #5C6B85;
  --canvas-line: rgba(120, 160, 220, 0.16);
  --canvas-node-blue: rgba(46, 111, 217, 0.55);
  --canvas-node-green: rgba(47, 184, 104, 0.5);
  --glow-blue: rgba(46, 111, 217, 0.35);
  --glow-green: rgba(47, 184, 104, 0.28);
  --shadow-elev: 0 20px 60px -20px rgba(0, 0, 0, 0.55);
}

/* ---- Light theme ---- */
[data-theme='light'] {
  color-scheme: light;
  --bg: #F5F8FC;
  --bg-1: #FFFFFF;
  --bg-2: #ECF1F8;
  --surface: rgba(11, 23, 48, 0.035);
  --surface-strong: rgba(11, 23, 48, 0.055);
  --border: rgba(11, 23, 48, 0.09);
  --border-strong: rgba(11, 23, 48, 0.16);
  --text-primary: #0B1730;
  --text-secondary: #4C5A72;
  --text-tertiary: #7C8AA3;
  --canvas-line: rgba(19, 95, 193, 0.13);
  --canvas-node-blue: rgba(19, 95, 193, 0.4);
  --canvas-node-green: rgba(30, 147, 80, 0.38);
  --glow-blue: rgba(19, 95, 193, 0.16);
  --glow-green: rgba(30, 147, 80, 0.14);
  --shadow-elev: 0 20px 50px -24px rgba(11, 23, 48, 0.22);
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  min-height: 100svh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
ol, ul { list-style: none; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--bg-1);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Background circuit canvas
   ========================================================================== */

#circuit-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: clamp(0.9rem, 2vw, 1.4rem) 0;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 34px;
  height: auto;
  will-change: transform;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* Theme toggle */
.theme-toggle {
  border-radius: 999px;
  padding: 3px;
}

.theme-toggle-track {
  display: flex;
  align-items: center;
  width: 52px;
  height: 30px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease-out);
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transform: translateX(0);
  transition: transform var(--dur-med) var(--ease-out);
  position: relative;
}

[data-theme='light'] .theme-toggle-thumb {
  transform: translateX(22px);
}

.theme-toggle .icon {
  width: 13px;
  height: 13px;
  position: absolute;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.icon-sun { opacity: 0; transform: scale(0.6) rotate(-40deg); }
.icon-moon { opacity: 1; transform: scale(1) rotate(0); }

[data-theme='light'] .icon-sun { opacity: 1; transform: scale(1) rotate(0); }
[data-theme='light'] .icon-moon { opacity: 0; transform: scale(0.6) rotate(40deg); }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

main, .site-header, .site-footer { position: relative; z-index: 1; }

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--gutter);
}

.section-eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin-bottom: 3rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(6rem, 14vh, 8rem) var(--gutter) 3rem;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo-stage {
  position: relative;
  width: clamp(150px, 28vw, 220px);
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.hero-logo-glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, var(--glow-blue) 0%, transparent 60%);
  filter: blur(20px);
  z-index: -1;
  animation: glow-pulse 7s var(--ease-in-out) infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.06); }
}

.hero-logo {
  width: 100%;
  height: auto;
  will-change: transform, filter, opacity;
  transform: translateY(0) scale(1);
  animation: logo-float 6.5s var(--ease-in-out) infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(10px);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--glow-green);
  animation: dot-pulse 2.4s ease-out infinite;
  flex-shrink: 0;
}

@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 var(--glow-green); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 42ch;
  margin-bottom: 1.6rem;
}

.hero-principles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.hero-principles .dot {
  color: var(--text-tertiary);
}

.hero-status {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

/* Waitlist form */

.waitlist-form { width: 100%; max-width: 480px; }

.waitlist-field {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.waitlist-field:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px var(--glow-blue);
}

#email-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0.75rem 0.9rem;
  font-size: 0.98rem;
  color: var(--text-primary);
}

#email-input::placeholder { color: var(--text-tertiary); }
#email-input:focus { outline: none; }

.btn-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.85rem 1.3rem;
  border-radius: calc(var(--radius-md) - 5px);
  background: var(--grad-brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
  box-shadow: 0 8px 24px -8px var(--glow-blue);
}

.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0); }

.btn-arrow { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease-out); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

.waitlist-note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
}

.form-status {
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 0.6rem;
  min-height: 1.2em;
  color: var(--green);
}
.form-status[data-error] { color: #E5674C; }

@media (max-width: 520px) {
  .waitlist-field { flex-direction: column; }
  .btn-primary { justify-content: center; }
}

/* Scroll cue */

.scroll-cue {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  width: 22px;
  height: 36px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
}

.scroll-cue-line {
  position: absolute;
  top: 6px;
  left: 50%;
  translate: -50% 0;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-secondary);
  animation: scroll-cue-move 1.8s var(--ease-in-out) infinite;
}

@keyframes scroll-cue-move {
  0% { transform: translateY(0); opacity: 1; }
  70% { opacity: 0.3; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal]:nth-child(1) { transition-delay: 0ms; }
[data-reveal]:nth-child(2) { transition-delay: 60ms; }
[data-reveal]:nth-child(3) { transition-delay: 120ms; }
[data-reveal]:nth-child(4) { transition-delay: 180ms; }
[data-reveal]:nth-child(5) { transition-delay: 240ms; }

/* ==========================================================================
   Pillars
   ========================================================================== */

.pillars { position: relative; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

.pillar-card {
  padding: 2.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
  transform-style: preserve-3d;
}

.pillar-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-elev);
}

.pillar-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--blue);
  margin-bottom: 1.4rem;
}

.pillar-card:nth-of-type(2) .pillar-icon { color: var(--teal); }
.pillar-card:nth-of-type(3) .pillar-icon { color: var(--green); }

.pillar-icon svg { width: 24px; height: 24px; }

.pillar-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.65rem;
}

.pillar-card p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.6;
}

/* ==========================================================================
   Modules
   ========================================================================== */

.modules { position: relative; }

.modules-lede {
  color: var(--text-secondary);
  max-width: 52ch;
  margin-top: -2rem;
  margin-bottom: 2.75rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 980px) {
  .module-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .module-grid { grid-template-columns: 1fr; }
}

.module-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.module-chip:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  background: var(--surface-strong);
}

.module-chip svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--teal);
}

.module-chip:nth-child(3n+1) svg { color: var(--blue); }
.module-chip:nth-child(3n+2) svg { color: var(--teal); }
.module-chip:nth-child(3n+3) svg { color: var(--green); }

.modules-note {
  margin-top: 1.75rem;
  font-size: 0.88rem;
  color: var(--text-tertiary);
  max-width: 60ch;
}

/* ==========================================================================
   Progress
   ========================================================================== */

.progress-section { position: relative; }

.progress-lede {
  color: var(--text-secondary);
  margin-top: -2rem;
  margin-bottom: 3rem;
  max-width: 44ch;
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}

.progress-track::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-track::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 5%;
  width: 48%;
  height: 2px;
  background: var(--grad-brand);
  z-index: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.4s var(--ease-out) 0.2s;
}

.progress-track.is-visible::after { transform: scaleX(1); }

.progress-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.progress-stage:nth-child(2) { align-items: center; }
.progress-stage:nth-child(3) { align-items: center; }
.progress-stage:nth-child(4) { align-items: flex-end; }

.stage-node {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-1);
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}

.progress-stage.is-complete .stage-node {
  background: var(--grad-brand);
  border-color: transparent;
}

.progress-stage.is-current .stage-node {
  background: var(--bg-1);
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--glow-blue);
  animation: dot-pulse 2.4s ease-out infinite;
}

.stage-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 12ch;
}

.progress-stage.is-current .stage-label,
.progress-stage.is-complete .stage-label {
  color: var(--text-primary);
}

@media (max-width: 700px) {
  .progress-track {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .progress-track::before,
  .progress-track::after {
    top: 0; bottom: 0; left: 9px; right: auto;
    width: 2px; height: auto;
    transform: scaleY(0);
    transform-origin: top;
  }
  .progress-track::before { transform: none; }
  .progress-track.is-visible::after { transform: scaleY(1); }
  .progress-stage,
  .progress-stage:nth-child(2),
  .progress-stage:nth-child(3),
  .progress-stage:nth-child(4) {
    flex-direction: row;
    align-items: center;
  }
  .stage-label { max-width: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-mark { width: 26px; height: auto; opacity: 0.9; }

.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.footer-tagline a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-tagline a:hover { color: var(--teal); }

.footer-social {
  display: flex;
  gap: 0.6rem;
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.social-link:hover {
  color: var(--blue);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.social-link svg { width: 16px; height: 16px; }

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  width: 100%;
  order: 3;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
  .footer-copy { width: auto; order: 0; border-top: none; padding-top: 0; }
}

/* ==========================================================================
   AI Chat Widget
   ========================================================================== */

.chat-widget {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 200;
}

.chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px -10px var(--glow-blue), var(--shadow-elev);
  transition: transform var(--dur-fast) var(--ease-out);
  position: relative;
}

.chat-toggle:hover { transform: translateY(-2px) scale(1.03); }
.chat-toggle:active { transform: translateY(0) scale(0.98); }

.chat-toggle-icon {
  width: 24px;
  height: 24px;
  position: absolute;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.icon-close { opacity: 0; transform: scale(0.6) rotate(-30deg); }
.icon-chat { opacity: 1; transform: scale(1) rotate(0); }

.chat-toggle[aria-expanded='true'] .icon-chat { opacity: 0; transform: scale(0.6) rotate(30deg); }
.chat-toggle[aria-expanded='true'] .icon-close { opacity: 1; transform: scale(1) rotate(0); }

.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 1rem);
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-med) var(--ease-out);
}

.chat-panel.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 480px) {
  .chat-panel {
    position: fixed;
    right: 0.75rem;
    left: 0.75rem;
    bottom: 5.25rem;
    width: auto;
    height: min(72vh, 560px);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-header-mark { width: 22px; height: auto; flex-shrink: 0; }

.chat-header-text { flex: 1; min-width: 0; }

.chat-header-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
}

.chat-header-sub {
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.chat-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.chat-close:hover { background: var(--surface-strong); }
.chat-close svg { width: 15px; height: 15px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overscroll-behavior: contain;
}

.chat-bubble {
  max-width: 84%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.87rem;
  line-height: 1.55;
}

.chat-bubble.from-bot {
  align-self: flex-start;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.from-user {
  align-self: flex-end;
  background: var(--grad-brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble p + p { margin-top: 0.5rem; }

.chat-bubble.is-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.85rem 0.9rem;
}

.chat-bubble.is-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typing-bounce 1.1s ease-in-out infinite;
}
.chat-bubble.is-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble.is-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.1rem 0.9rem;
  flex-shrink: 0;
}

.chat-suggestions .chip {
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.chat-suggestions .chip:hover { border-color: var(--border-strong); color: var(--text-primary); }

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.87rem;
  color: var(--text-primary);
}
#chat-input::placeholder { color: var(--text-tertiary); }
#chat-input:focus { outline: none; border-color: var(--border-strong); }

.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}
.chat-send:hover { transform: scale(1.05); }
.chat-send svg { width: 16px; height: 16px; }

/* ==========================================================================
   Ultra-wide
   ========================================================================== */

@media (min-width: 1600px) {
  :root { --container: 1400px; }
  .hero-title { font-size: clamp(3.2rem, 5vw, 5.4rem); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-logo, .hero-logo-glow, .eyebrow-dot, .scroll-cue-line, .progress-stage.is-current .stage-node {
    animation: none !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
