:root {
  --ink: #171717;
  --muted: #5b6268;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #d9ddd8;
  --field: #f3f6f4;
  --charcoal: #101513;
  --charcoal-2: #19211e;
  --green: #1f7a4d;
  --green-2: #dff2e8;
  --cyan: #0d6f7c;
  --cyan-2: #d9f2f4;
  --amber: #a76516;
  --amber-2: #fff0d8;
  --red: #9c2f2f;
  --shadow: 0 18px 48px rgba(20, 28, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.compact-header {
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16, 21, 19, 0.15);
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #23443a;
  background: var(--charcoal);
  color: #f4fff9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  color: var(--muted);
  font-weight: 680;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--green);
}

.hero {
  position: relative;
  min-height: calc(86vh - 72px);
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(52px, 9vw, 96px) clamp(18px, 4vw, 56px);
  background: var(--charcoal);
  color: #f7fff9;
  isolation: isolate;
}

.brand-hero {
  background:
    linear-gradient(90deg, rgba(16, 21, 19, 0.94), rgba(16, 21, 19, 0.74) 54%, rgba(16, 21, 19, 0.62)),
    url("/assets/brand/deo-background.svg") center / cover no-repeat,
    var(--charcoal);
}

.brand-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(16, 21, 19, 0.08), rgba(16, 21, 19, 0.5));
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: #2b3a34;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(3rem, 9vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-deic h1 {
  font-size: clamp(3.4rem, 9vw, 8.8rem);
}

.hero-deic .hero-copy,
.hero-deic .lede {
  max-width: 560px;
}

.lede {
  max-width: 760px;
  margin: 24px 0 0;
  color: #d6e5dd;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #83dbad;
}

.byline {
  margin: 22px 0 0;
  color: #aebbb4;
  font-weight: 650;
}

.hero-actions,
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 760;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button-primary {
  background: #f7fff9;
  color: var(--charcoal);
}

.button-primary:hover {
  background: #dff2e8;
}

.button-secondary {
  background: transparent;
  color: inherit;
  border-color: #64736b;
}

.button-secondary:hover {
  border-color: #d6e5dd;
}

.evidence-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.85;
  background:
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(255, 255, 255, 0.04) 55px 56px),
    repeating-linear-gradient(0deg, transparent 0 54px, rgba(255, 255, 255, 0.035) 55px 56px);
}

.evidence-scene::before,
.evidence-scene::after {
  content: "";
  position: absolute;
  height: 2px;
  background: #3f6654;
  transform-origin: left center;
}

.evidence-scene::before {
  left: 58%;
  top: 28%;
  width: 28%;
  transform: rotate(22deg);
}

.evidence-scene::after {
  left: 56%;
  top: 62%;
  width: 34%;
  transform: rotate(-18deg);
}

.scene-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid #78a68f;
  background: rgba(16, 21, 19, 0.88);
  color: #dff2e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

.node-a { right: 30%; top: 18%; }
.node-b { right: 13%; top: 27%; }
.node-c { right: 22%; top: 48%; }
.node-d { right: 7%; top: 61%; }
.node-e { right: 36%; top: 68%; }

.scene-table {
  position: absolute;
  right: clamp(20px, 8vw, 110px);
  bottom: 12%;
  display: grid;
  gap: 6px;
  width: min(360px, 38vw);
  padding: 16px;
  border: 1px solid #40524b;
  background: rgba(11, 16, 14, 0.72);
  color: #d6e5dd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.scene-table span {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #31423b;
  padding-bottom: 6px;
}

.tool-surface-preview {
  position: absolute;
  right: clamp(18px, 7vw, 112px);
  bottom: 11%;
  z-index: 1;
  width: min(530px, 42vw);
  min-height: 330px;
  border: 1px solid #51635a;
  background: rgba(251, 250, 247, 0.92);
  color: var(--ink);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.32);
}

.preview-toolbar {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.preview-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr;
  gap: 12px;
  padding: 18px;
}

.preview-line {
  min-height: 38px;
  background: var(--field);
  border: 1px solid var(--line);
}

.preview-line.wide {
  grid-column: span 2;
}

.preview-line.good {
  background: var(--green-2);
  border-color: #9ecfb6;
}

.preview-line.warn {
  background: var(--amber-2);
  border-color: #dfbd87;
}

.preview-result {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 18px 18px;
  padding: 18px;
  background: var(--charcoal);
  color: #f7fff9;
}

.preview-result strong {
  font-size: 3rem;
  line-height: 1;
}

.section {
  padding: clamp(58px, 9vw, 112px) clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 790px;
  margin-bottom: 34px;
}

.section-heading h2,
.section-heading h1,
.split h2,
.instructions-layout h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.section-heading p:not(.eyebrow),
.split p,
.instructions-layout p {
  color: var(--muted);
  font-size: 1.06rem;
}

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

.model-tile,
.workflow-step,
.control-panel,
.data-panel,
.results-panel,
.screenshot-grid figure {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(20, 28, 24, 0.04);
}

.model-tile {
  min-height: 270px;
  padding: 22px;
}

.tile-kicker {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.model-tile h3,
.workflow-step h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.model-tile p,
.workflow-step p {
  margin: 0;
  color: var(--muted);
}

.band {
  background: #eef2ef;
  border-block: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 430px);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.metric-stack {
  display: grid;
  gap: 10px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 78px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.metric-row span {
  color: var(--muted);
  font-weight: 700;
}

.metric-row strong {
  color: var(--green);
  font-size: 1.7rem;
  white-space: nowrap;
}

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

.workflow-step {
  min-height: 220px;
  padding: 22px;
}

.workflow-step span {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 900;
}

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

.screenshot-grid figure {
  margin: 0;
}

.screenshot-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--field);
  border-bottom: 1px solid var(--line);
}

.screenshot-grid figcaption {
  padding: 14px 16px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.instructions-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
}

.instruction-list {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 1rem;
}

.instruction-list li {
  margin-bottom: 16px;
  padding-left: 8px;
}

.instruction-list strong {
  color: var(--ink);
}

code {
  padding: 0.08rem 0.28rem;
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: 4px;
  background: rgba(223, 242, 232, 0.55);
  color: #24473a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.code-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1fr);
  gap: 18px;
}

.code-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.code-card h3 {
  margin: 0 0 14px;
  font-size: 1.08rem;
}

.code-card pre,
.local-service-preview pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.55;
}

.code-card pre {
  overflow-x: auto;
  padding: 16px;
  background: #101513;
  color: #dff2e8;
}

.code-card code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.local-service-preview {
  display: grid;
  grid-template-rows: auto 1fr;
}

.local-service-preview pre {
  align-self: stretch;
  padding: 22px;
  color: #dff2e8;
  background: #101513;
  font-size: 0.88rem;
}

.tools-hero .hero-copy {
  max-width: 900px;
}

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

.tool-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 390px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(20, 28, 24, 0.04);
}

.featured-tool {
  border-color: rgba(31, 122, 77, 0.38);
  background: linear-gradient(180deg, #ffffff, #f2faf5);
}

.tool-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}

.language-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 820;
}

.language-pill {
  color: var(--green);
  background: var(--green-2);
  border-color: #b8dcc9;
}

.status-pill {
  color: #47504b;
  background: #f5f6f2;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.12;
}

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

.object-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.object-list div {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.object-list dt {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 840;
  text-transform: uppercase;
}

.object-list dd {
  margin: 0;
  color: var(--muted);
}

.source-note {
  font-size: 0.92rem;
}

.inline-link {
  align-self: end;
  color: var(--green);
  font-weight: 820;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.object-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.object-map span {
  display: grid;
  min-height: 76px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--charcoal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 850;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.tool-page {
  background: #f4f6f3;
}

.tool-shell {
  padding: 22px clamp(14px, 3vw, 36px) 42px;
}

.tool-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 24px;
  background: var(--charcoal);
  color: #f7fff9;
}

.tool-intro h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  line-height: 1;
}

.tool-intro p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: #d6e5dd;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(310px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.control-panel,
.data-panel,
.results-panel {
  padding: 18px;
}

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

.panel-heading h2,
.empty-state h2 {
  margin: 0;
  font-size: 1.2rem;
}

#engine-status {
  padding: 4px 8px;
  background: var(--green-2);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #38413c;
  font-size: 0.88rem;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd4cf;
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}

input,
select {
  min-height: 42px;
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(31, 122, 77, 0.16);
  border-color: var(--green);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.file-control input {
  padding: 8px;
}

.data-panel {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
}

textarea {
  min-height: 440px;
  resize: vertical;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-weight: 780;
}

.results-panel {
  margin-top: 18px;
  min-height: 220px;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.summary-card {
  min-height: 112px;
  padding: 16px;
  background: #f8faf7;
  border: 1px solid var(--line);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1;
}

.stage-chart {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.stage-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) 76px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.stage-track {
  height: 14px;
  background: #e5eae5;
  border: 1px solid var(--line);
}

.stage-bar {
  height: 100%;
  min-width: 2px;
  background: var(--green);
}

.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 16px 0 10px;
}

.result-toolbar h2 {
  margin: 0;
  font-size: 1.15rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 0.88rem;
}

th,
td {
  max-width: 260px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #eef2ef;
  color: #36413b;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: #36413b;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.score-pill {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 3px 8px;
  background: var(--green-2);
  color: var(--green);
  font-weight: 900;
}

.status-error {
  background: #f9e2df !important;
  color: var(--red) !important;
}

.muted {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 1100px) {
  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow,
  .screenshot-grid,
  .summary-grid,
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-surface-preview,
  .scene-table {
    opacity: 0.24;
  }

  .hero-deic .hero-copy,
  .hero-deic .lede {
    max-width: 850px;
  }

  .tool-grid,
  .instructions-layout,
  .split,
  .code-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .tool-intro,
  .result-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 78vh;
  }

  .model-grid,
  .workflow,
  .screenshot-grid,
  .summary-grid,
  .tools-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .scene-node,
  .scene-table,
  .tool-surface-preview {
    display: none;
  }

  .stage-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  textarea {
    min-height: 320px;
  }
}
