:root {
  --ink: #18222b;
  --muted: #5e6974;
  --line: #d9e1e7;
  --paper: #fbfcfb;
  --white: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --blue: #274c77;
  --amber: #bf7a19;
  --rose: #b44b5c;
  --soft: #eef5f3;
  --warm: #f7efe3;
  --shadow: 0 18px 45px rgba(24, 34, 43, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.site-hero {
  min-height: 86vh;
  position: relative;
  display: grid;
  align-items: end;
  color: white;
  background:
    linear-gradient(90deg, rgba(11, 28, 34, .88), rgba(11, 28, 34, .42)),
    url("https://images.unsplash.com/photo-1556761175-4b46a572b786?auto=format&fit=crop&w=1900&q=80") center / cover;
}

.site-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 26vh;
  background: linear-gradient(0deg, var(--paper), rgba(251, 252, 251, 0));
  pointer-events: none;
}

.site-nav, .app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  backdrop-filter: blur(16px);
  background: rgba(10, 22, 28, .46);
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.app-topbar {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-weight: 780;
  font-size: 20px;
  letter-spacing: 0;
}

.logo.dark { color: var(--ink); }

.nav-links, .app-nav, .hero-actions, .export-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links a, .app-nav a {
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
}

.app-nav a { color: var(--muted); }

.site-hero-copy {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0 130px;
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 780;
}

.site-hero .kicker { color: #9be7dd; }

h1, h2, h3, p { letter-spacing: 0; }

.site-hero h1 {
  margin: 0 0 24px;
  max-width: 900px;
  font-size: clamp(46px, 8vw, 88px);
  line-height: .94;
}

.hero-text {
  margin: 0 0 34px;
  max-width: 760px;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(19px, 2.3vw, 25px);
}

.btn, .small-btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  min-height: 42px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 720;
}

.btn { min-height: 50px; padding: 13px 20px; }
.btn.primary, .small-btn.primary { background: var(--teal); border-color: var(--teal); color: white; }
.btn.ghost { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .38); color: white; }
.icon-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 820;
}
.full-width { width: 100%; }

.proof-row {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  margin: -66px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
  box-shadow: var(--shadow);
}

.proof-row div {
  background: var(--white);
  padding: 24px;
}

.proof-row strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.proof-row span { color: var(--muted); }

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 78px 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.section h2 {
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.05;
  margin: 0;
}

.steps {
  display: grid;
  gap: 18px;
}

.steps div, .source-table div {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 22px;
}

.steps span {
  display: inline-flex;
  color: var(--amber);
  font-weight: 820;
  margin-bottom: 8px;
}

.steps strong, .source-table strong {
  display: block;
  font-size: 19px;
  margin-bottom: 8px;
}

.steps p, .source-table span { color: var(--muted); margin: 0; }

.source-band {
  background: var(--soft);
  width: 100%;
  max-width: none;
  padding-left: max(20px, calc((100% - 1120px) / 2));
  padding-right: max(20px, calc((100% - 1120px) / 2));
}

.section-head { margin-bottom: 30px; }

.source-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.cta-section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.cta-section h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  max-width: 760px;
}

.pricing-band {
  background: var(--ink);
  color: white;
  padding: 70px max(20px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.pricing-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  max-width: 760px;
}

.pricing-copy p:last-child {
  color: rgba(255, 255, 255, .78);
  max-width: 720px;
  margin: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px max(20px, calc((100% - 1120px) / 2));
  background: var(--white);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.legal-body {
  background: var(--white);
}

.legal-page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0;
}

.legal-page h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1;
  margin: 34px 0 22px;
}

.legal-page p {
  color: var(--muted);
  font-size: 18px;
}

.app-body {
  height: 100vh;
  overflow: hidden;
  background: #eef2f4;
}

.workspace {
  height: calc(100vh - 64px);
  margin-top: 64px;
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
}

.input-panel {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 22px;
  overflow: auto;
}

.panel-head h1 {
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.1;
}

.connector-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 14px;
  margin-bottom: 16px;
}

.connector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.connector-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 2px;
}

.connector-head strong {
  display: block;
  font-size: 15px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

textarea, select, input[type="file"], input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 12px;
}

textarea {
  min-height: 184px;
  resize: vertical;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.compact textarea { min-height: 80px; }

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--warm);
  padding: 11px 12px;
  font-size: 14px;
}

.status.error {
  background: #f9e8ea;
  color: #7a2431;
  border-color: #e3b4bd;
}

.results-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.tabs {
  display: flex;
  gap: 1px;
  padding: 12px 16px 0;
  background: #eef2f4;
}

.tab {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 10px 18px;
  background: #e2e8eb;
  color: var(--muted);
  cursor: pointer;
  font-weight: 720;
}

.tab.active {
  background: var(--white);
  color: var(--ink);
}

.view {
  display: none;
  min-height: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.view.active { display: block; }

#previewView { padding: 16px; }

#landingPreview {
  width: 100%;
  height: calc(100vh - 128px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

#analysisView, #exportView, #variantsView {
  height: calc(100vh - 116px);
  overflow: auto;
  padding: 20px;
}

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

.metric, .list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
}

.metric strong {
  display: block;
  color: var(--teal-dark);
  font-size: 24px;
}

.metric span, .list-item p, .list-item small { color: var(--muted); }

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

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

.variant-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 20px;
}

.variant-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.variant-card strong {
  display: block;
  font-size: 21px;
  margin-bottom: 8px;
}

.variant-card p {
  color: var(--muted);
  margin: 0;
}

.analysis-grid h2 {
  font-size: 21px;
  margin: 0 0 12px;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item strong {
  display: block;
  margin-bottom: 6px;
}

.output {
  min-height: 520px;
  margin-top: 16px;
}

@media (max-width: 980px) {
  .site-nav, .app-topbar {
    position: static;
    height: auto;
    padding: 16px 20px;
    align-items: flex-start;
    gap: 14px;
  }
  .workspace {
    height: auto;
    margin-top: 0;
    grid-template-columns: 1fr;
  }
  .app-body { height: auto; overflow: auto; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .proof-row, .two-col, .source-table, .cta-section, .pricing-band, .metrics, .analysis-grid, .variant-grid {
    grid-template-columns: 1fr;
  }
  .cta-section, .pricing-band { display: grid; }
  #landingPreview { height: 760px; }
}

@media (max-width: 620px) {
  .site-hero-copy { padding: 80px 0 110px; }
  .site-hero h1 { font-size: 42px; }
  .nav-links, .app-nav { width: 100%; }
  .control-grid { grid-template-columns: 1fr; }
}
