:root {
  color-scheme: dark;
  --ink: #f3efe2;
  --muted: #9fb1a8;
  --green: #0a241e;
  --deep: #03120f;
  --panel: rgba(8, 33, 27, 0.86);
  --line: rgba(184, 224, 199, 0.16);
  --acid: #b8e654;
  --acid-dark: #18290a;
  --blue: #67d8ef;
  --yellow: #ffbf43;
  --radius: 22px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 5%, rgba(42, 111, 81, 0.2), transparent 28rem),
    linear-gradient(145deg, #061813, var(--deep) 48%, #061813);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; text-decoration: none; letter-spacing: -.06em; }
.element-tile {
  position: relative;
  width: 54px;
  height: 61px;
  display: grid;
  place-items: center;
  background: var(--acid);
  color: var(--acid-dark);
  box-shadow: 8px 8px 0 rgba(184, 230, 84, .11);
}
.element-tile strong { font: 800 28px/1 Georgia, serif; }
.element-tile .atomic, .element-tile .mass { position: absolute; font-size: 7px; font-weight: 800; letter-spacing: 0; }
.element-tile .atomic { top: 5px; left: 6px; }
.element-tile .mass { right: 5px; bottom: 4px; }
.wordmark { font: 300 31px/1 Georgia, serif; margin-left: 6px; }
.wordmark span { color: var(--acid); font-style: italic; }

nav { display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }
.language-switch { border: 0; background: transparent; cursor: pointer; padding: 9px; color: #6f837a; letter-spacing: .06em; }
.language-switch .active { color: var(--acid); }

.hero { padding: 50px 0 110px; }
.intro { max-width: 720px; margin-bottom: 38px; }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--acid); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow > span:first-child { width: 32px; height: 1px; background: currentColor; }
h1 { margin: 8px 0 10px; font: 500 clamp(50px, 7vw, 82px)/.92 Georgia, serif; letter-spacing: -.065em; }
.lede { max-width: 630px; margin: 18px 0 0; color: #b8c5be; font-size: clamp(18px, 1.7vw, 21px); font-weight: 350; }

.lab-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); gap: 32px; align-items: start; }
.glass-panel {
  padding: 28px;
  background: linear-gradient(155deg, rgba(15, 50, 41, .92), rgba(5, 27, 22, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.panel-heading, .result-topline, .result-topline > div { display: flex; align-items: center; }
.panel-heading { gap: 15px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.step { color: var(--acid); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.kicker { margin: 0 0 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.panel-heading h2, .result-topline h2 { margin: 0; font-size: 16px; letter-spacing: .02em; }
.status-light { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--acid); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.status-light i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 14px var(--acid); animation: pulse 2s infinite; }

fieldset { min-width: 0; margin: 28px 0 0; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 13px; color: #d8e0dc; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
legend > span:first-child { margin-right: 10px; color: #57736a; font-family: ui-monospace, monospace; }
.age-fieldset legend { text-align: center; color: var(--muted); }
.age-control { display: flex; justify-content: center; align-items: center; gap: 20px; }
.age-control label { display: grid; justify-items: center; gap: 8px; }
#age {
  width: 150px;
  min-width: 0;
  padding: 0 4px 7px;
  border: 0;
  border-bottom: 1px solid rgba(184, 230, 84, .55);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
  font: 500 72px/.95 Georgia, serif;
  font-variant-numeric: lining-nums tabular-nums;
  text-align: center;
  -webkit-appearance: none;
  appearance: textfield;
}
#age::-webkit-outer-spin-button, #age::-webkit-inner-spin-button { appearance: none; margin: 0; }
#age:focus-visible { outline: 2px solid var(--acid); outline-offset: 7px; border-radius: 4px; }
.age-control small { color: var(--muted); font-size: 11px; line-height: 1; letter-spacing: .1em; text-transform: uppercase; }
.age-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.03); color: var(--acid); cursor: pointer; font-size: 24px; transform: translateY(-8px); }
.age-button:hover { background: var(--acid); color: var(--acid-dark); }

.option-grid { display: grid; gap: 10px; }
.option-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-card {
  min-height: 74px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.option-card:hover { transform: translateY(-1px); border-color: rgba(184,230,84,.4); }
.option-card:has(input:checked) { border-color: var(--acid); background: rgba(184, 230, 84, .075); box-shadow: inset 0 0 0 1px rgba(184,230,84,.12); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.option-card strong, .option-card small { display: block; }
.option-card strong { font-size: 13px; letter-spacing: .07em; text-transform: uppercase; }
.option-card small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.option-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; }
.bacon-icon { border-radius: 45% 55% 48% 52%; background: repeating-linear-gradient(90deg, #8e2b24 0 7px, #e39a7c 7px 10px, #b84232 10px 16px); transform: rotate(-7deg); }
.leaf-icon { border: 1px solid var(--acid); border-radius: 70% 10% 70% 10%; color: var(--acid); font-size: 25px; transform: rotate(-12deg); }
.compact .option-card { min-height: 60px; }

.actions { margin-top: 32px; }
.actions .button { width: 100%; }
.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 12px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; transition: transform .2s, filter .2s, background .2s; }
.button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.button.primary { background: var(--acid); color: var(--acid-dark); }
.button.secondary { border-color: var(--line); background: transparent; }
.button.ghost { border-color: var(--line); background: rgba(255,255,255,.02); }

.result-column { position: sticky; top: 24px; }
.result-topline { justify-content: space-between; margin: 0 4px 14px; }
.result-topline > div { gap: 12px; }
.purity { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 700 9px/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.purity i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.canvas-shell { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.14); background: #0b211c; box-shadow: var(--shadow); aspect-ratio: 1; }
canvas { display: block; width: 100%; height: 100%; }
.canvas-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: #09211a; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; transition: opacity .35s; }
.canvas-loading.hidden { opacity: 0; pointer-events: none; }
.canvas-loading span:first-child { width: 15px; height: 15px; border: 2px solid rgba(184,230,84,.2); border-top-color: var(--acid); border-radius: 50%; animation: spin .8s linear infinite; }
.result-caption { margin: 17px 2px 0; color: var(--ink); font: italic 500 17px/1.4 Georgia, serif; text-align: center; }
.result-message { min-height: 20px; margin: 5px 2px 12px; color: var(--muted); font: 600 11px/1.5 ui-monospace, monospace; text-align: center; }
.result-actions { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.privacy-note { margin: 14px 0 0; color: #6e857b; font-size: 10px; letter-spacing: .04em; text-align: center; }
.privacy-note span:first-child { color: var(--acid); }
.canvas-shell.cooked { animation: cook .65s ease; }

.story { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 64px; align-items: center; padding: 90px 0; border-top: 1px solid var(--line); }
.story-number { position: absolute; top: 48px; right: -10px; color: rgba(184,230,84,.09); font: 700 150px/1 Georgia, serif; pointer-events: none; }
.story-image { position: relative; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); box-shadow: var(--shadow); transform: rotate(-1deg); }
.story-image img { display: block; width: 100%; height: auto; border-radius: 11px; }
.story-image figcaption { padding: 12px 4px 2px; color: var(--muted); font: 700 11px/1.4 ui-monospace, monospace; letter-spacing: .07em; text-transform: uppercase; }
.story-copy { position: relative; }
.story h2 { margin: 12px 0 0; font: 500 clamp(32px, 4vw, 52px)/1.03 Georgia, serif; letter-spacing: -.04em; }
.story-copy > p:last-child { margin-top: 25px; color: #aab9b2; font-size: 17px; }
footer { min-height: 90px; display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: #71867c; font-size: 11px; }
footer p { margin-right: auto; }
footer a { text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }

.legal-main { padding: 72px 0 110px; }
.legal-intro { max-width: 760px; margin-bottom: 32px; }
.legal-intro h1 { margin-bottom: 18px; }
.legal-intro > p:last-child { margin: 0; color: var(--muted); font-size: 18px; }
.legal-card {
  max-width: 820px;
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(15, 50, 41, .92), rgba(5, 27, 22, .9));
  box-shadow: var(--shadow);
}
.legal-card section + section { margin-top: 38px; padding-top: 36px; border-top: 1px solid var(--line); }
.legal-card h2 { margin: 0 0 16px; color: var(--acid); font: 700 13px/1.3 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.legal-card p { margin: 0; color: #c4d0ca; font-size: 17px; }
.legal-card p + p { margin-top: 14px; }
.legal-card address { color: var(--ink); font-size: 18px; font-style: normal; line-height: 1.65; }
.legal-card a { color: var(--acid); text-underline-offset: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cook { 25% { transform: scale(.985); filter: saturate(1.25) brightness(1.1); } }

@media (max-width: 900px) {
  .lab-layout { grid-template-columns: 1fr; }
  .result-column { position: static; grid-row: 1; }
  .controls { grid-row: 2; }
  .result-column { max-width: 680px; width: 100%; margin-inline: auto; }
  .story { grid-template-columns: 1fr; gap: 36px; }
  .story-image { max-width: 680px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 75px; }
  nav a { display: none; }
  .element-tile { width: 46px; height: 52px; }
  .wordmark { font-size: 27px; }
  .hero { padding: 44px 0 80px; }
  .legal-main { padding: 50px 0 80px; }
  .intro { margin-bottom: 32px; }
  h1 { font-size: clamp(54px, 19vw, 80px); }
  .lede { font-size: 18px; }
  .glass-panel { padding: 20px 16px; }
  .panel-heading { align-items: flex-start; }
  .status-light { margin-top: 4px; }
  #age { width: 150px; font-size: 64px; }
  .age-control { gap: 12px; }
  .option-grid.two { grid-template-columns: 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .result-actions .ghost { grid-row: 2; }
  .story { gap: 30px; padding: 70px 0; }
  .story-number { top: 42px; right: 0; font-size: 84px; }
  footer { flex-wrap: wrap; gap: 14px; padding: 28px 0; }
  footer p { flex-basis: 100%; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
