:root {
  color-scheme: light dark;
  --bg: #F2F6F6;
  --fg: #0F2A2F;
  --muted: #567175;
  --card: #ffffff;
  --border: #d4e0e2;
  --accent: #024B56;
  --accent-light: #6FC3CD;
  --accent-soft: #e3f2f4;
  --green: #18845a;
  --green-soft: #e6f5ed;
  --orange: #e09821;
  --error: #D23F48;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1618;
    --fg: #e0ecee;
    --muted: #7fa5aa;
    --card: #121f22;
    --border: #1e3336;
    --accent: #6FC3CD;
    --accent-light: #8fd9e1;
    --accent-soft: #0f2628;
    --green: #3dba7a;
    --green-soft: #142e20;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* ── Hero ───────────────────── */

.hero {
  background: linear-gradient(135deg, #012830 0%, #024B56 40%, #0a6e7a 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(111,195,205,0.2) 0%, transparent 60%);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .hero {
    background: linear-gradient(135deg, #060f11 0%, #0b2227 40%, #0f3038 100%);
  }
}

.hero-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 60px 28px 52px;
}

.hero-badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(111,195,205,0.2);
  border: 1px solid rgba(111,195,205,0.3);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #b0e8ef;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero-title span {
  color: var(--accent-light);
}

.hero-subtitle {
  max-width: 56ch;
  margin: 0;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: rgba(255,255,255,0.8);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 28px;
  border-radius: 10px;
  background: var(--accent-light);
  color: #012830;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.hero-cta:hover {
  background: #8fd9e1;
  transform: translateY(-1px);
}

/* ── Page & Sections ────────── */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 28px 48px;
}

.section {
  margin-bottom: 44px;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Catalog Cards ──────────── */

.catalog {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.catalog-sm {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(2, 75, 86, 0.08);
  transform: translateY(-3px);
}

@media (prefers-color-scheme: dark) {
  .card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  }
}

.card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-body strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-meta {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 2px;
}

/* ── Features Grid ──────────── */

.features {
  margin-top: 8px;
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
}

.features-title {
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ── Footer ─────────────────── */

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ── Shared simulation styles ─ */

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s;
}

.back:hover { color: var(--accent-light); }

.stage {
  margin-top: 16px;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.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;
}

/* ── Steps ──────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.step {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ── Chat Panel ─────────────── */

.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
}

.chat-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.chat-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-messages {
  flex: 1;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

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

.chat-msg-ai {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}

.chat-msg-ai.is-loading {
  opacity: 0.6;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input {
  flex: 1;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  resize: none;
}

.chat-input:focus {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
  border-color: var(--accent);
}

.chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chat-send:hover { background: #036370; }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (prefers-color-scheme: dark) {
  .chat-send:hover { background: #5ab8c3; }
}

/* ── Mobile ─────────────────── */

@media (max-width: 600px) {
  .hero-inner {
    padding: 40px 20px 36px;
  }

  .page {
    padding: 24px 18px 36px;
  }

  .catalog {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

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