@font-face {
  font-family: "Manrope";
  src: url("/fonts/Manrope/Manrope-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 800;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/Bricolage_Grotesque/BricolageGrotesque-VariableFont_opsz,wdth,wght.ttf") format("truetype");
  font-weight: 200 800;
}

:root {
  --bg: #f2efe8;
  --bg-panel: rgba(255, 252, 247, 0.84);
  --ink: #172224;
  --muted: #5f6d70;
  --line: rgba(23, 34, 36, 0.1);
  --surface-strong: #fffdf9;
  --accent: #c46c44;
  --accent-strong: #a3532b;
  --ok: #1f7c5c;
  --warn: #ae7520;
  --bad: #bf4d42;
  --shadow-lg: 0 30px 80px rgba(46, 33, 18, 0.12);
  --shadow-md: 0 18px 42px rgba(46, 33, 18, 0.08);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background-image:
    radial-gradient(circle at top left, rgba(196, 108, 68, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(38, 75, 75, 0.1), transparent 24%),
    url("/bg.webp");
  background-position: top left, top right, center;
  background-size: auto, auto, cover;
  background-repeat: no-repeat;
  background-attachment: scroll, scroll, fixed;
}

button,
input {
  font: inherit;
}

input[type="file"] {
  padding: 0.9rem 1rem;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  backdrop-filter: blur(22px) saturate(145%);
  box-shadow: var(--shadow-lg);
}

.hero {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.hero-main,
.hero-copy {
  display: grid;
  gap: 1rem;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  margin-inline: auto;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 24px rgba(46, 33, 18, 0.06);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 14px;
}

.hero-card,
.result {
  overflow: hidden;
  padding: 1.5rem;
}

.hero-card {
  position: relative;
  width: min(100%, 1040px);
  justify-self: center;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-card::before {
  inset: -16% auto auto -6%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(196, 108, 68, 0.2), transparent 68%);
}

.hero-card::after {
  right: -120px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(38, 75, 75, 0.18), transparent 68%);
}

.hero-layout,
.result-shell,
.result-grid {
  position: relative;
  z-index: 1;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.hero-main {
  display: grid;
  gap: 1.15rem;
  justify-items: center;
}

.hero-background-word {
  position: absolute;
  inset: 1.4rem auto auto 50%;
  transform: translateX(-50%);
  font-family:
    "Bricolage Grotesque",
    Inter,
    sans-serif;
  font-size: clamp(2.8rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: rgba(255, 255, 255, 0.38);
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.hero-copy {
  display: grid;
  gap: 0.75rem;
  width: min(100%, 1040px);
  justify-items: center;
  text-align: center;
}

.eyebrow,
.hero-note,
.panel-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  font-size: 0.76rem;
  color: var(--ink);
}

.hero-note {
  color: var(--accent-strong);
}

h1,
h2,
.score,
.target,
.stat-value {
  font-family:
    "Bricolage Grotesque",
    "Manrope",
    sans-serif;
}

h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-align: center;
}

.subtitle,
.summary,
.check-impact,
.check-details p,
.finding-block p,
.finding-block li,
.sql-note,
.lead-modal__copy {
  color: var(--muted);
}

.subtitle {
  margin: 0;
  max-width: 62ch;
  line-height: 1.7;
  font-size: 1.05rem;
}

.scan-form {
  display: grid;
  gap: 1rem;
  width: min(100%, 1040px);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field-block {
  display: grid;
  gap: 0.65rem;
}

.schema-inline {
  display: grid;
  grid-template-columns: auto minmax(220px, 280px) auto;
  gap: 0.75rem;
  align-items: center;
  justify-content: end;
}

.schema-inline label {
  white-space: nowrap;
}

.schema-inline input {
  min-height: 56px;
}

.scan-form label,
.muted,
.check-subtitle,
.stat-label {
  color: var(--muted);
}

.scan-form label {
  font-size: 0.93rem;
  font-weight: 600;
}

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

input {
  flex: 1;
  min-width: 0;
  min-height: 60px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(23, 34, 36, 0.08);
}

input:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(196, 108, 68, 0.16),
    inset 0 0 0 1px rgba(196, 108, 68, 0.3);
}

button {
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.row button,
.schema-inline button {
  min-height: 60px;
  padding: 0 1.35rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 18px 36px rgba(164, 83, 43, 0.26);
}

.tool-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.tool-pill {
  padding: 0.8rem 1rem;
  border: 1px solid rgba(23, 34, 36, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.tool-pill.is-active {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: white;
  box-shadow: 0 18px 36px rgba(164, 83, 43, 0.2);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.trust-item,
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(23, 34, 36, 0.06);
  box-shadow: 0 12px 24px rgba(23, 34, 36, 0.04);
  font-size: 0.88rem;
}

.meta-pill[data-tone="good"] {
  background: rgba(31, 124, 92, 0.12);
  color: var(--ok);
}

.meta-pill[data-tone="mid"] {
  background: rgba(174, 117, 32, 0.12);
  color: var(--warn);
}

.meta-pill[data-tone="bad"] {
  background: rgba(191, 77, 66, 0.12);
  color: var(--bad);
}

.hidden {
  display: none;
}

.result {
  margin-top: 1.1rem;
}

.result-head,
.result-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.target {
  margin: 0.2rem 0 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.04;
}

.score-box {
  min-width: 140px;
  padding: 1rem 1.2rem;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid rgba(23, 34, 36, 0.08);
  text-align: right;
}

.score {
  margin: 0.3rem 0 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
}

.score.good {
  color: var(--ok);
}

.score.mid {
  color: var(--warn);
}

.score.bad {
  color: var(--bad);
}

.summary {
  font-size: 1rem;
  line-height: 1.7;
}

.result-meta {
  margin-top: 1rem;
  align-items: flex-start;
  justify-content: flex-start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.9rem;
  margin-top: 1.3rem;
}

.stat-card,
.checks-block,
.result-cta,
.findings-panel,
.sql-panel {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(23, 34, 36, 0.06);
  box-shadow: var(--shadow-md);
}

.stat-card,
.checks-block,
.result-cta,
.findings-panel,
.sql-panel {
  padding: 1.15rem;
}

.stat-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  margin: 0.55rem 0 0;
  font-size: 1.3rem;
}

.result-grid {
  display: block;
  margin-top: 1.4rem;
}

.verdict-card {
  margin-top: 1rem;
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(23, 34, 36, 0.08);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-md);
}

.verdict-card[data-tone="good"] {
  border-color: rgba(31, 124, 92, 0.22);
}

.verdict-card[data-tone="mid"] {
  border-color: rgba(174, 117, 32, 0.22);
}

.verdict-card[data-tone="bad"] {
  border-color: rgba(191, 77, 66, 0.22);
}

.verdict-card h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.verdict-card .summary {
  margin: 0.35rem 0 0;
  line-height: 1.24;
}

.verdict-reason {
  margin: 0.12rem 0 0;
  color: var(--muted);
  line-height: 1.24;
}

.result-grid:has(.findings-panel) {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 1rem;
}

.result-main {
  display: grid;
  gap: 1rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.checks {
  display: grid;
  gap: 0.85rem;
}

.check {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 34, 36, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

.check.pass {
  border-color: rgba(31, 124, 92, 0.18);
}

.check.warn {
  border-color: rgba(174, 117, 32, 0.18);
}

.check.fail {
  border-color: rgba(191, 77, 66, 0.18);
}

.check.info {
  border-color: rgba(95, 109, 112, 0.18);
}

.check-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.check-summary h3,
.finding-block h3 {
  margin: 0;
  font-size: 1rem;
}

.check-subtitle {
  margin: 0.22rem 0 0;
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.pass {
  background: rgba(31, 124, 92, 0.12);
  color: var(--ok);
}

.badge.warn {
  background: rgba(174, 117, 32, 0.12);
  color: var(--warn);
}

.badge.fail {
  background: rgba(191, 77, 66, 0.12);
  color: var(--bad);
}

.badge.info {
  background: rgba(95, 109, 112, 0.12);
  color: var(--muted);
}

.check-impact,
.rec,
.raw,
.result-notice,
.checks-empty {
  margin: 0.85rem 0 0;
}

.check-impact {
  display: flex;
  gap: 0.55rem;
  line-height: 1.6;
  align-items: flex-start;
}

.check-impact .arrow {
  flex: none;
  color: var(--accent-strong);
  font-weight: 700;
}

.check-details {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.check-details summary {
  cursor: pointer;
  width: fit-content;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}

.check-details summary::-webkit-details-marker {
  display: none;
}

.check-details summary::after {
  content: " +";
  color: var(--muted);
}

.check-details[open] summary::after {
  content: " -";
}

.check-details p {
  margin: 0.65rem 0 0;
  line-height: 1.6;
}

.rec,
.raw {
  font-size: 0.92rem;
}

.raw code {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.5rem 0.62rem;
  border: 1px solid rgba(23, 34, 36, 0.08);
  border-radius: 10px;
  background: #f7f2ea;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.findings {
  display: grid;
  gap: 1rem;
}

.finding-block ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.finding-block p,
.finding-block li {
  line-height: 1.6;
}

.result-cta {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
}

.cta-copy {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.cta-button,
.lead-cta-button,
.lead-form__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #f08a47, #e05b58 55%, #ec8ca8);
  box-shadow: 0 16px 30px rgba(224, 91, 88, 0.2);
}

.cta-button:hover,
.lead-cta-button:hover,
.lead-form__button:hover {
  box-shadow: 0 18px 34px rgba(224, 91, 88, 0.24);
}

.sql-panel {
  margin-top: 1.1rem;
}

.sql-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sql-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sql-note {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.secondary-button {
  min-height: 56px;
  padding: 0 1.2rem;
  border: 1px solid rgba(23, 34, 36, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(46, 33, 18, 0.08);
}

.secondary-button:disabled {
  opacity: 0.55;
}

.sql-output {
  overflow: auto;
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #192424;
  color: #f4efe6;
  font-family:
    "SFMono-Regular",
    ui-monospace,
    "Cascadia Code",
    "Source Code Pro",
    Menlo,
    monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre;
}

.result-notice {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(191, 77, 66, 0.1);
  color: var(--bad);
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.lead-modal.hidden {
  display: none;
}

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 34, 36, 0.42);
  backdrop-filter: blur(6px);
}

.lead-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  display: grid;
  gap: 0.85rem;
  padding: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.95), rgba(251, 243, 238, 0.93)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 80px rgba(46, 33, 18, 0.2);
}

.lead-modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  min-height: 40px;
  width: 40px;
  padding: 0;
  border-radius: 999px;
  background: rgba(23, 34, 36, 0.06);
  color: var(--ink);
  box-shadow: none;
}

.lead-modal__close:hover {
  box-shadow: none;
}

.lead-modal__title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.lead-form {
  display: grid;
  gap: 0.75rem;
}

.lead-form label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 960px) {
  .result-grid:has(.findings-panel) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app {
    width: min(100vw - 1rem, 100%);
    padding: 0.8rem 0 2rem;
  }

  .hero-card,
  .result {
    padding: 1rem;
  }

  .row,
  .result-head,
  .result-meta,
  .sql-head,
  .sql-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .score-box {
    text-align: left;
  }

  .schema-inline {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .row button,
  input,
  .schema-inline button,
  .secondary-button,
  .lead-cta-button,
  .cta-button {
    width: 100%;
  }

  .tool-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
