:root {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #a6b2c2;
  --subtle: #6f7c8f;
  --line: rgba(174, 192, 220, 0.18);
  --panel: rgba(14, 20, 32, 0.78);
  --panel-strong: #101827;
  --paper: #05070d;
  --cyan: #39d7ff;
  --mint: #69f0c8;
  --violet: #a989ff;
  --amber: #ffc857;
  --rose: #ff6b9d;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(57, 215, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 10%, rgba(169, 137, 255, 0.13), transparent 24rem),
    linear-gradient(180deg, #070a12 0%, #09101b 42%, #05070d 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(105, 240, 200, 0.5);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(57, 215, 255, 0.18), rgba(105, 240, 200, 0.12));
  color: var(--mint);
  font-size: 12px;
  box-shadow: 0 0 30px rgba(57, 215, 255, 0.2);
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--cyan);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: clamp(32px, 6vw, 86px);
  align-items: center;
  min-height: calc(100svh - 72px);
  padding: clamp(44px, 7vw, 88px) clamp(18px, 5vw, 72px) clamp(36px, 5vw, 58px);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(46px, 7.4vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(32px, 4.8vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.lede {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  color: #061018;
  box-shadow: 0 18px 50px rgba(57, 215, 255, 0.24);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.hero-stage {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 50% 42%, rgba(57, 215, 255, 0.22), transparent 24rem),
    #080d16;
  box-shadow: 0 42px 100px var(--shadow);
}

.molecule-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  background: transparent;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  min-height: 560px;
}

.hero-card {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: min(330px, calc(100% - 44px));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(7, 11, 19, 0.78);
  backdrop-filter: blur(16px);
}

.hero-card h2 {
  margin-top: 12px;
  font-size: 32px;
}

.hero-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section {
  padding: clamp(64px, 9vw, 116px) clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

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

.section-note {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.section-heading.compact {
  max-width: 780px;
}

.collection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.compact-button {
  min-height: 40px;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.registry-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px dashed rgba(174, 192, 220, 0.28);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.registry-empty[hidden] {
  display: none;
}

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

.registry-grid:empty {
  display: none;
}

.molecule-card {
  display: grid;
  grid-template-rows: 270px minmax(0, 1fr);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.86), rgba(9, 13, 22, 0.94));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.registry-card {
  min-height: 680px;
}

.card-visual {
  min-height: 270px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, rgba(57, 215, 255, 0.2), transparent 14rem),
    #090f19;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
}

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

.serial {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.status-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(105, 240, 200, 0.7);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.iupac {
  min-height: 72px;
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
}

dl {
  display: grid;
  gap: 10px;
  margin: auto 0 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

dt {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
}

dd a,
.metadata-grid a {
  color: var(--cyan);
  text-decoration: none;
}

dd a:hover,
.metadata-grid a:hover {
  text-decoration: underline;
}

.flow-section {
  background: rgba(255, 255, 255, 0.025);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow li {
  min-height: 250px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.flow span {
  display: inline-block;
  margin-bottom: 38px;
  color: var(--cyan);
  font-weight: 900;
}

.flow p,
.safety-panel p {
  margin: 12px 0 0;
  color: var(--muted);
}

.safety-panel {
  max-width: 940px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.1), rgba(255, 107, 157, 0.07)),
    var(--panel-strong);
}

.safety-panel p {
  max-width: 760px;
  font-size: 18px;
}

.generator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(28px, 6vw, 78px);
  align-items: end;
  padding: clamp(56px, 8vw, 108px) clamp(18px, 5vw, 72px) clamp(36px, 5vw, 64px);
}

.generator-copy {
  max-width: 880px;
}

.generator-controls {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.generator-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.feature-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.feature-fieldset legend {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.feature-fieldset label {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.feature-fieldset input {
  width: 15px;
  height: 15px;
  accent-color: var(--mint);
}

.generator-controls > label input,
.generator-controls select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
}

.generator-controls option {
  background: var(--panel-strong);
}

.generator-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
  padding: 0 clamp(18px, 5vw, 72px) clamp(72px, 9vw, 116px);
}

.generator-preview,
.mint-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.86), rgba(9, 13, 22, 0.94));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.generator-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  min-height: 620px;
}

.generator-stage {
  position: relative;
  min-height: 620px;
  background:
    radial-gradient(circle at 50% 45%, rgba(57, 215, 255, 0.2), transparent 20rem),
    #090f19;
}

.generator-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.generator-preview:not(.is-empty) .generator-empty {
  display: none;
}

.generator-preview.is-empty .molecule-canvas {
  opacity: 0;
}

.generator-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-left: 1px solid var(--line);
}

.generator-card h2 {
  font-size: clamp(34px, 4vw, 56px);
}

.selection-summary {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
}

.status-label.checking {
  border-color: rgba(255, 200, 87, 0.7);
  color: var(--amber);
}

.status-label.blocked {
  border-color: rgba(255, 107, 157, 0.78);
  color: var(--rose);
}

.mint-panel {
  padding: 24px;
}

.mint-panel h2 {
  font-size: 34px;
}

.mint-panel p {
  margin: 22px 0 0;
  color: var(--muted);
}

.metadata-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.metadata-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.metadata-grid span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.metadata-grid strong {
  overflow-wrap: anywhere;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 14px;
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-stage {
    min-height: 460px;
  }

  .hero-canvas {
    min-height: 460px;
  }

  .card-grid,
  .flow,
  .generator-hero,
  .generator-workspace,
  .generator-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generator-workspace,
  .generator-preview {
    grid-template-columns: 1fr;
  }

  .generator-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .generator-stage {
    min-height: 460px;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero-stage {
    min-height: 390px;
  }

  .hero-canvas {
    min-height: 390px;
  }

  .hero-card {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }

  .card-grid,
  .flow,
  .generator-hero,
  .generator-workspace,
  .generator-preview {
    grid-template-columns: 1fr;
  }

  .molecule-card {
    min-height: 560px;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .generator-stage {
    min-height: 390px;
  }

  .feature-fieldset {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 430px) {
  nav {
    gap: 10px;
    font-size: 13px;
  }

  h1 {
    font-size: 42px;
  }

  .hero,
  .section {
    padding-right: 14px;
    padding-left: 14px;
  }
}
