:root{
  --bg0: #070A12;
  --bg1: #0B1020;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --stroke: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.64);

  --a: #60A5FA;
  --b: #22C55E;
  --c: #A78BFA;
  --d: #F97316;

  --shadow: 0 22px 60px rgba(0,0,0,0.45);
  --radius: 18px;
}

:root[data-theme="light"]{
  --bg0: #F7F8FC;
  --bg1: #EEF1FB;
  --card: rgba(0,0,0,0.05);
  --card2: rgba(0,0,0,0.06);
  --stroke: rgba(0,0,0,0.10);
  --text: rgba(0,0,0,0.88);
  --muted: rgba(0,0,0,0.60);
  --shadow: 0 22px 60px rgba(15,23,42,0.18);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 10% 10%, rgba(96,165,250,0.22), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(167,139,250,0.20), transparent 60%),
    radial-gradient(900px 600px at 60% 95%, rgba(34,197,94,0.18), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.45;
}

a{ color: inherit; text-decoration: none; }
.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.muted{ color: var(--muted); }

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,12,20,0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke);
}
:root[data-theme="light"] .topbar{
  background: rgba(248,249,255,0.70);
}


.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}
.logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 45%),
    linear-gradient(135deg, rgba(96,165,250,0.95), rgba(34,197,94,0.90));
  box-shadow: 0 10px 22px rgba(0,0,0,0.30);
  position: relative;
  overflow: hidden;
}
.logo::after{
  content:"";
  position:absolute;
  inset:-40%;
  background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 60%);
  animation: shimmer 3.2s linear infinite;
  transform: rotate(10deg);
}
@keyframes shimmer{
  0%{ transform: translateX(-10%) rotate(10deg); }
  100%{ transform: translateX(30%) rotate(10deg); }
}
.brand-title{ font-weight: 740; letter-spacing: 0.2px; }
.brand-sub{ color: var(--muted); font-size: 12px; margin-top: 1px; }

.top-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.10); }
.btn:active{ transform: translateY(0px) scale(0.99); }
.btn:focus-visible{
  outline: 2px solid rgba(96,165,250,0.75);
  outline-offset: 2px;
}
.btn .btn-ico{ width: 18px; display: inline-flex; justify-content: center; }

.btn.primary{
  border-color: rgba(96,165,250,0.45);
  background: linear-gradient(135deg, rgba(96,165,250,0.92), rgba(167,139,250,0.78));
}
.btn.primary:hover{ background: linear-gradient(135deg, rgba(96,165,250,0.98), rgba(167,139,250,0.90)); }
.btn.ghost{ background: transparent; box-shadow: none; }

.hero{
  padding: 40px 18px 28px;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: stretch;
}
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .topbar{ position: relative; }
}

.hero-content{
  padding: 18px;
  border-radius: var(--radius);
}

.pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--stroke);
}
.pill .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(34,197,94,0.95);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18);
}

h1{
  margin: 14px 0 10px;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.07;
  letter-spacing: -0.4px;
}
.grad{
  background: linear-gradient(90deg, rgba(96,165,250,1), rgba(34,197,94,1), rgba(249,115,22,1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead{
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15.5px;
  max-width: 65ch;
}

.hero-cards{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 980px){
  .hero-cards{ grid-template-columns: 1fr; }
}

.card{
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before{
  content:"";
  position:absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(96,165,250,0.14), transparent 55%),
    radial-gradient(circle at 70% 30%, rgba(167,139,250,0.12), transparent 50%),
    radial-gradient(circle at 55% 80%, rgba(34,197,94,0.10), transparent 55%);
  filter: blur(2px);
  pointer-events: none;
}
.card > *{ position: relative; }

.card h3{ margin: 0 0 8px; font-size: 16px; }
.card p{ margin: 0; color: var(--muted); font-size: 13.5px; }
.badge{
  display:inline-block;
  margin-top: 10px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
}

.hero-cta{
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.hint{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.hero-visual{
  padding: 18px;
}
.glass{
  height: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visual-tabs{
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
}
.tab{
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.tab.is-active{
  background: rgba(255,255,255,0.10);
  color: var(--text);
  border-color: var(--stroke);
}

.panel{ display: none; }
.panel.is-active{ display: block; }

.panel-caption{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.statusline{
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
.status-pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
}
.status-text{ color: var(--muted); font-size: 12.5px; }

/* ADN helix */
.helix{
  height: 300px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(700px 300px at 50% 20%, rgba(96,165,250,0.14), transparent 55%),
    radial-gradient(700px 280px at 50% 90%, rgba(34,197,94,0.10), transparent 60%),
    rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}
.strand{
  position: absolute;
  top: 18px;
  bottom: 18px;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(96,165,250,0.85), rgba(167,139,250,0.75));
  opacity: 0.9;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.25));
}
.strand.left{ left: 30%; animation: swayL 2.7s ease-in-out infinite; }
.strand.right{ right: 30%; animation: swayR 2.7s ease-in-out infinite; }

@keyframes swayL{
  0%,100%{ transform: translateX(-10px); opacity: 0.85; }
  50%{ transform: translateX(14px); opacity: 1; }
}
@keyframes swayR{
  0%,100%{ transform: translateX(10px); opacity: 0.85; }
  50%{ transform: translateX(-14px); opacity: 1; }
}

.rungs{
  position: absolute;
  inset: 0;
}
.rung{
  position: absolute;
  left: 50%;
  width: 62%;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.18));
  animation: rungDepth 2.7s ease-in-out infinite;
}
@keyframes rungDepth{
  0%,100%{ opacity: 0.85; transform: translateX(-50%) scaleX(0.95); }
  50%{ opacity: 1; transform: translateX(-50%) scaleX(1.05); }
}
.base{
  width: 22px;
  height: 22px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 720;
  font-size: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.07);
}
.base[data-b="A"]{ box-shadow: 0 0 0 6px rgba(96,165,250,0.12); }
.base[data-b="T"]{ box-shadow: 0 0 0 6px rgba(249,115,22,0.12); }
.base[data-b="C"]{ box-shadow: 0 0 0 6px rgba(34,197,94,0.12); }
.base[data-b="G"]{ box-shadow: 0 0 0 6px rgba(167,139,250,0.12); }
.link{
  flex: 1;
  height: 2px;
  margin: 0 10px;
  background: linear-gradient(90deg, rgba(96,165,250,0.7), rgba(34,197,94,0.65), rgba(167,139,250,0.70));
  opacity: 0.85;
  border-radius: 999px;
}

/* ARN visual */
.rna{
  height: 300px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(700px 320px at 55% 30%, rgba(249,115,22,0.10), transparent 60%),
    radial-gradient(700px 300px at 45% 90%, rgba(167,139,250,0.12), transparent 60%),
    rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}
.backbone{
  position: absolute;
  left: 50%;
  top: -10%;
  width: 14px;
  height: 120%;
  transform: translateX(-50%) rotate(6deg);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(34,197,94,0.80), rgba(96,165,250,0.75));
  opacity: 0.9;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.22));
}
.bases{
  position: absolute;
  inset: 0;
}
.rna-base{
  position: absolute;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translateX(calc(-50% + 38px)) rotate(6deg);
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.07);
  display: grid;
  place-items: center;
  font-weight: 740;
  font-size: 12px;
  animation: drift 3.2s linear infinite;
}
@keyframes drift{
  0%{ transform: translateX(calc(-50% + 38px)) translateY(0px) rotate(6deg); opacity: 0.0; }
  10%{ opacity: 1; }
  90%{ opacity: 1; }
  100%{ transform: translateX(calc(-50% + 38px)) translateY(320px) rotate(6deg); opacity: 0.0; }
}
.rna-base[data-b="A"]{ box-shadow: 0 0 0 6px rgba(96,165,250,0.12); }
.rna-base[data-b="U"]{ box-shadow: 0 0 0 6px rgba(249,115,22,0.12); }
.rna-base[data-b="C"]{ box-shadow: 0 0 0 6px rgba(34,197,94,0.12); }
.rna-base[data-b="G"]{ box-shadow: 0 0 0 6px rgba(167,139,250,0.12); }

/* Lab section */
.lab{
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 18px 50px;
}
.section-title{
  margin: 6px 0 14px;
}
.section-title h2{ margin: 0; font-size: 26px; }
.section-title p{ margin: 6px 0 0; color: var(--muted); }

.lab-grid{
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.9fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 1120px){
  .lab-grid{ grid-template-columns: 1fr; }
}

.card.big{ padding: 14px; }
.panel-head{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.panel-actions{ display:flex; gap: 8px; }
.mode{ display:flex; gap: 8px; align-items:center; }

.chip{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.chip.is-active{
  background: rgba(255,255,255,0.10);
  color: var(--text);
}

.field{ display:block; margin-top: 10px; }
.label{ display:block; font-weight: 720; margin-bottom: 8px; }
textarea{
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
}
textarea:focus{
  border-color: rgba(96,165,250,0.55);
  box-shadow: 0 0 0 4px rgba(96,165,250,0.14);
}
.help{ display:block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.controls{
  margin-top: 10px;
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.range{
  display:flex;
  gap: 10px;
  align-items: center;
}
input[type="range"]{
  width: 240px;
  accent-color: rgba(96,165,250,0.95);
}
.buttons{ display:flex; gap: 10px; align-items:center; }

.ops{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mini{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kv{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 10px;
}
.k{ font-size: 12px; color: var(--muted); }
.v{ margin-top: 6px; font-weight: 740; }

.output{
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  padding: 10px;
  min-height: 150px;
}
pre{
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.translator{
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  padding: 12px;
}
.translator-head{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.translator h4{ margin: 0; font-size: 14px; }
.legend{ display:flex; gap: 10px; color: var(--muted); font-size: 12px; align-items:center; }
.legend-item{ display:flex; gap: 6px; align-items:center; }
.swatch{
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
}
.swatch.is-codon{ background: rgba(96,165,250,0.22); }
.swatch.is-stop{ background: rgba(249,115,22,0.22); }

.codon-strip, .aa-strip{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.token{
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  font-weight: 760;
  font-size: 12px;
}
.token.codon{ background: rgba(96,165,250,0.14); }
.token.stop{ background: rgba(249,115,22,0.14); }
.token.active{
  box-shadow: 0 0 0 4px rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.45);
  transform: translateY(-1px);
}

.note{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.steps{
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.steps b{ color: var(--text); }

.quiz{
  margin-top: 14px;
  border-top: 1px dashed var(--stroke);
  padding-top: 12px;
}
.quiz-q{ font-weight: 760; margin-bottom: 8px; }
.quiz-input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
}
.quiz-input:focus{
  border-color: rgba(96,165,250,0.55);
  box-shadow: 0 0 0 4px rgba(96,165,250,0.14);
}
.quiz-actions{
  display:flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.quiz-result{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.quiz-result.good{ color: rgba(34,197,94,0.95); }
.quiz-result.bad{ color: rgba(249,115,22,0.95); }

.bullets{
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.deploy{
  margin-top: 14px;
  border-top: 1px dashed var(--stroke);
  padding-top: 12px;
}
.deploy-title{ font-weight: 760; margin-bottom: 10px; }
.deploy-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.deploy-item{
  display:flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 10px;
}
.deploy-ico{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display:grid;
  place-items:center;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  font-weight: 800;
}
.deploy-h{ font-weight: 760; font-size: 13px; }
.deploy-p{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.footer{
  padding: 26px 18px 40px;
  border-top: 1px solid var(--stroke);
  background: rgba(255,255,255,0.02);
}
.footer-inner{
  max-width: 1180px;
  margin: 0 auto;
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items:center;
  flex-wrap: wrap;
}
