:root {
  color-scheme: light;
  --bg: #f8f1eb;
  --panel: #fffdfa;
  --text: #231712;
  --muted: #6f5c53;
  --accent: #b13c23;
  --accent-hover: #8b2d1a;
  --border: #ead8cc;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(177, 60, 35, 0.14), transparent 35%),
    radial-gradient(circle at 100% 0, rgba(221, 161, 50, 0.16), transparent 30%),
    var(--bg);
}

body.has-modal {
  overflow: hidden;
}

.ambient-art {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-art-item {
  position: absolute;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.34;
  filter: saturate(0.92);
}

.ambient-molecule {
  top: 94px;
  right: -76px;
  width: min(33vw, 500px);
  aspect-ratio: 1;
  background-image: url("./art/molecule-art.svg");
}

.ambient-helix {
  top: 176px;
  left: -84px;
  width: min(22vw, 300px);
  height: min(64vw, 760px);
  opacity: 0.22;
  background-image: url("./art/helix-art.svg");
}

.ambient-network {
  right: -110px;
  bottom: 108px;
  width: min(38vw, 620px);
  height: min(26vw, 380px);
  opacity: 0.26;
  background-image: url("./art/network-art.svg");
}

.layout {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(1720px, 100vw);
  margin: 0 auto;
  padding: clamp(12px, 2.2vw, 24px);
  display: grid;
  gap: 16px;
}

.site-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: grid;
  gap: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.brand-mark-s {
  color: #231712;
}

.brand-mark-aop {
  color: #b13c23;
  text-transform: uppercase;
}

.brand-mark-v2 {
  color: #d6921f;
  font-size: 0.62em;
  letter-spacing: -0.01em;
  transform: translateY(-0.45em);
}

.brand-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 56ch;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff7f0;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.tab-link:hover,
.tab-link.is-active {
  border-color: #a33923;
  background: linear-gradient(135deg, #a33923, #d89a23);
  color: #ffffff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(14px, 1.5vw, 18px);
}

.panel h2 {
  margin-top: 0;
}

.tab-page {
  display: grid;
  gap: 16px;
}

.tab-page[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 10px;
  color: #b13c23;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px 28px;
  align-items: start;
}

.hero-home-copy {
  display: grid;
  gap: 10px;
}

.hero-home-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.6rem);
  line-height: 1;
  max-width: 20ch;
}

.hero-lead {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  column-count: 2;
  column-gap: 32px;
  max-width: none;
}

.hero-lead p {
  margin: 0 0 14px;
  break-inside: avoid;
}

.hero-lead p:last-child {
  margin-bottom: 0;
}

.hero-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-actions .button-link {
  flex: 0 0 172px;
  min-width: 172px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.hero-actions .button-link.button {
  margin-top: 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.hero-home-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(150deg, rgba(177, 60, 35, 0.1), rgba(221, 161, 50, 0.13)),
    #fff8f0;
  padding: 18px;
  align-self: start;
}

.hero-home-panel h2 {
  margin-bottom: 12px;
}

.bullet-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.home-grid,
.secondary-about-grid,
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.info-card p:last-child,
.footer-block p:last-child,
.section-intro p:last-child,
.about-copy p:last-child {
  margin-bottom: 0;
}

.section-intro p {
  max-width: 70ch;
  color: var(--muted);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.about-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.about-side-card {
  align-self: start;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.contact-list li {
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f6;
  line-height: 1.55;
}

.contact-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.site-footer {
  background:
    linear-gradient(180deg, rgba(177, 60, 35, 0.05), rgba(221, 161, 50, 0.08)),
    #fffdfa;
}

.footer-block h2 {
  margin-bottom: 10px;
}

.footer-block p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.consent-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 27, 45, 0.6);
  backdrop-filter: blur(4px);
  z-index: 4000;
}

.consent-overlay[hidden] {
  display: none !important;
}

.consent-modal {
  width: min(100%, 560px);
  border: 1px solid rgba(220, 226, 234, 0.9);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 27, 45, 0.24);
  padding: 22px;
}

.consent-modal h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.consent-modal p:last-of-type {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.consent-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.is-hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95rem;
}

.button {
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #af3b22, #d49322);
  cursor: pointer;
}

.button:hover {
  background: linear-gradient(135deg, #922f1b, #bd7d14);
}

.secondary-button,
.icon-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff7f0;
  color: var(--text);
  cursor: pointer;
}

.secondary-button {
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: #d59a53;
  background: #fff0df;
}

.icon-button {
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  line-height: 1;
}

.suggestions-block {
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffaf4;
  padding: 10px 12px;
}

.suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suggestions-block ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow: auto;
}

.suggestion-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fffdfa;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.suggestion-button:hover {
  border-color: #d59a53;
}

.suggestions-empty {
  color: var(--muted);
  padding: 6px 2px;
}

.summary {
  color: var(--muted);
}

.caps-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffaf4;
  padding: 12px;
}

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

.caps-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.caps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
}

.status {
  min-height: 1.2rem;
  margin: 10px 0 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  font-size: 0.9rem;
  vertical-align: top;
  word-break: break-word;
}

.graph-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.graph-toolbar-field {
  width: min(100%, 240px);
}

.graph-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.graph-stage {
  position: relative;
  min-width: 0;
}

.graph-canvas {
  width: 100%;
  height: clamp(460px, 64vh, 820px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f6f9fc;
  min-width: 0;
}

.graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 360px);
  gap: 16px;
  align-items: start;
}

.node-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 14px;
  min-width: 0;
  position: sticky;
  top: 16px;
  max-height: clamp(420px, 62vh, 760px);
  overflow: auto;
}

.node-details h3 {
  margin: 0 0 12px;
}

.node-details-body {
  font-size: 0.92rem;
  color: var(--text);
}

.node-details-empty {
  color: var(--muted);
}

.node-details-title {
  margin: 0;
  font-size: 1rem;
}

.node-details-subtitle {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: capitalize;
}

.node-detail-list {
  display: grid;
  gap: 10px;
}

.node-detail-row {
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f6;
}

.node-detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.node-detail-key {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.node-detail-value {
  word-break: break-word;
  white-space: normal;
  line-height: 1.45;
}

.graph-stage:fullscreen {
  padding: 16px;
  background: #edf3f8;
}

.graph-stage:fullscreen .graph-canvas {
  height: calc(100vh - 32px);
  border-radius: 0;
}

@media (max-width: 1280px) {
  .ambient-molecule {
    right: -120px;
    width: min(40vw, 420px);
  }

  .ambient-network {
    right: -160px;
    width: min(46vw, 520px);
  }

  .hero-home,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-lead {
    column-count: 1;
  }

  .graph-layout {
    grid-template-columns: 1fr;
  }

  .node-details {
    position: static;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .ambient-helix,
  .ambient-network {
    display: none;
  }

  .ambient-molecule {
    top: 88px;
    right: -82px;
    width: min(64vw, 340px);
    opacity: 0.16;
  }

  .layout {
    padding: 14px;
  }

  .site-header {
    align-items: start;
  }

  .tab-nav {
    width: 100%;
  }

  .hero-actions .button-link {
    min-width: 0;
    width: 100%;
  }

  .tab-link {
    flex: 1 1 120px;
  }

  .graph-canvas {
    height: clamp(380px, 56vh, 560px);
  }

  .consent-modal {
    padding: 18px;
  }

  .consent-actions {
    justify-content: stretch;
  }

  .consent-actions .button,
  .consent-actions .secondary-button {
    width: 100%;
  }
}
