:root {
  --navy-900: #0f2238;
  --navy-700: #1f3b5b;
  --navy-500: #33587e;
  --sage-500: #52b788;
  --sage-300: #8ed1b3;
  --cream-50: #fffdf7;
  --cream-100: #f8f7f2;
  --slate-50: #f3f7fb;
  --slate-100: #e5edf4;
  --slate-300: #bfd0de;
  --text: #1a2d3f;
  --muted: #4d6176;
  --danger: #9f2f2f;
  --shadow-soft: 0 16px 44px rgba(15, 34, 56, 0.08);
  --shadow-card: 0 10px 24px rgba(15, 34, 56, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, #ffffff 0%, transparent 42%),
    linear-gradient(155deg, var(--cream-50) 0%, var(--slate-50) 48%, #e8f4ee 100%);
  min-height: 100vh;
  line-height: 1.55;
  padding-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.page-shell {
  padding-bottom: 72px;
}

.top-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  background: rgba(248, 251, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--slate-100);
}

.top-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: fit-content;
}

.brand-main {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy-900);
}

.brand-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy-900);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  border: 0;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-1px);
}

.cta-primary {
  background: linear-gradient(135deg, var(--sage-500), #6cc69d);
  color: #072219;
  box-shadow: 0 8px 20px rgba(82, 183, 136, 0.35);
}

.cta-secondary {
  background: #ffffff;
  border: 1px solid var(--slate-300);
  color: var(--navy-900);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 16px;
}

.hero-copy h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--navy-900);
}

.hero-copy p {
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 58ch;
}

.hero-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.88), rgba(242, 251, 246, 0.85)),
    linear-gradient(135deg, var(--slate-100), #d6ebe1);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.kpi {
  border: 1px solid var(--slate-100);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.kpi strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--navy-900);
  font-size: 1.15rem;
}

.kpi span {
  color: var(--muted);
  font-size: 0.85rem;
}

.section {
  margin-top: 56px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 10px;
  color: var(--navy-900);
}

.section-sub {
  margin: 0;
  color: var(--muted);
}

.cards-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-card);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  inset: auto -20% -70% 10%;
  height: 120px;
  background: radial-gradient(circle, rgba(82, 183, 136, 0.15), transparent 70%);
}

.card-icon {
  font-size: 1.4rem;
}

.card h3 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 12px 0 8px;
  color: var(--navy-900);
  font-size: 1.08rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.card a {
  margin-top: 14px;
  display: inline-flex;
  font-weight: 700;
  color: var(--navy-700);
}

.page-header {
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--navy-900);
}

.page-header p {
  margin-top: 10px;
  color: var(--muted);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.flow-step {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.flow-step strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--navy-900);
}

.flow-step span {
  color: var(--muted);
  font-size: 0.9rem;
}

.embed-wrap {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.panel h3 {
  margin: 0 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--navy-900);
  font-size: 1.06rem;
}

.panel p,
.panel li {
  color: var(--muted);
}

.hidden {
  display: none;
}

.sidebar-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
}

.sidebar {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.sidebar h3 {
  margin: 0 0 10px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--navy-900);
}

.client-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--slate-100);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  cursor: pointer;
}

.client-item strong {
  display: block;
  color: var(--navy-900);
}

.client-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.client-item.active {
  border-color: var(--sage-500);
  box-shadow: inset 0 0 0 1px var(--sage-500);
  background: #f5fcf9;
}

.brief {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.brief h2 {
  margin: 0 0 12px;
  font-family: 'Space Grotesk', sans-serif;
}

.brief section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
}

.brief h4 {
  margin: 0 0 6px;
  color: var(--navy-700);
  font-size: 0.95rem;
}

.brief p,
.brief li {
  margin: 0;
  color: var(--muted);
}

.warning-banner {
  border: 1px solid #f5c4c4;
  background: #fff6f6;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.92rem;
  margin: 14px 0;
}

.record-wrap {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.api-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.api-key-row input {
  flex: 1 1 280px;
  min-height: 42px;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

.record-btn {
  width: 100%;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-700));
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  padding: 22px;
}

.record-btn.recording {
  background: linear-gradient(145deg, #8a1f1f, #bb3f3f);
}

.meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.output-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.output-panel {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 180px;
}

.output-panel h3 {
  margin: 0 0 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.output-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'DM Sans', sans-serif;
  color: var(--muted);
}

.toolbar {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.flow-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.flow-card {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.flow-card h3 {
  margin: 0 0 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline li {
  position: relative;
  margin-top: 14px;
  padding-left: 24px;
  color: var(--muted);
}

.timeline li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--sage-500);
  box-shadow: 0 0 0 7px rgba(82, 183, 136, 0.15);
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0.2); }
  70% { box-shadow: 0 0 0 10px rgba(82, 183, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0); }
}

.log {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.log h3 {
  margin: 0 0 10px;
  font-family: 'Space Grotesk', sans-serif;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.log-list li {
  margin-top: 10px;
  color: var(--muted);
}

.site-footer {
  margin-top: 54px;
  border-top: 1px solid var(--slate-100);
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1024px) {
  .hero,
  .sidebar-layout,
  .panel-grid,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .top-nav .container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    gap: 12px;
  }

  .cards-grid,
  .flow {
    grid-template-columns: 1fr;
  }

}
