@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Serif+JP:wght@400;500&display=swap");
:root {
  --paper: #f3f0e7;
  --white: #fbfaf5;
  --ink: #30362e;
  --muted: #6e7469;
  --line: #d7d9ca;
  --accent: #b84326;
  --accent-ink: #fff8ed;
  --soft: #e9eadf;
  --dark: #25342f;
  --mono: "DM Mono", monospace;
  --body: "Zen Kaku Gothic New", sans-serif;
  --serif: "Noto Serif JP", serif;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.8 var(--body);
  overflow-x: clip;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button,
.file-label {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 10px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 160ms,
    border-color 160ms;
}
button:hover:not(:disabled),
.file-label:hover {
  background: var(--soft);
  border-color: var(--muted);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  cursor: not-allowed;
  background: #eeeee5;
  color: #868c7f;
  border-style: dashed;
}
a {
  color: inherit;
  text-underline-offset: 5px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
h2 {
  font-size: 17px;
  font-weight: 500;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
.masthead,
main {
  max-width: 1424px;
  margin: auto;
  padding-inline: 48px;
}
.masthead {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font: 500 17px var(--mono);
  text-decoration: none;
}
.wordmark span {
  font: 11px var(--body);
  display: inline-block;
  margin-left: 16px;
  color: var(--muted);
}
.guide-link {
  font-size: 12px;
  text-decoration: none;
}
.guide-link span {
  margin-left: 16px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 48px 0 40px;
  gap: 25px;
}
.eyebrow {
  font: 11px var(--mono);
  color: var(--accent);
  margin-bottom: 16px;
}
h1 {
  font: 500 clamp(30px, 3.3vw, 48px)/1.55 var(--serif);
  overflow-wrap: anywhere;
  min-width: 0;
}
h1 span {
  color: var(--muted);
}
.intro-aside {
  padding-bottom: 5px;
}
.intro-aside > p:first-child {
  font-size: 15px;
  line-height: 2.1;
  margin-bottom: 15px;
}
.fine {
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
}
.workspace {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: 16px;
}
.stage-header {
  padding: 13px 24px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.stage-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  background: #8c9685;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.live {
  background: var(--accent);
}
.dataset {
  font: 10px var(--mono);
  color: var(--muted);
  align-self: center;
}
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
}
.specimen {
  padding: 20px 24px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.panel-heading > span {
  font: 10px var(--mono);
  color: var(--muted);
}
canvas {
  display: block;
  max-width: 100%;
}
#creature {
  width: 100%;
  height: 265px;
}
.stage-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 20px;
}
.label {
  font-size: 11px;
  margin-bottom: 9px;
}
.label span {
  font-size: 9px;
  color: var(--muted);
  margin-left: 10px;
}
.stimuli {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.stimuli button {
  padding: 9px 10px;
  text-align: left;
  font-size: 11px;
}
.stimuli kbd {
  font: 10px var(--mono);
  margin-right: 6px;
  color: var(--muted);
}
.stimulus-panel > .fine {
  margin-top: 8px;
  min-height: 21px;
}
.score-panel {
  padding: 20px 24px;
}
.score-caption {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  margin: 6px 0 20px;
}
#score {
  height: 182px;
  width: 100%;
  margin-top: 20px;
}
.activity-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}
.activity-heading span {
  font-size: 9px;
  color: var(--muted);
}
.activity-row {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  margin: 7px 0;
}
.activity-bar {
  height: 5px;
  background: var(--soft);
  overflow: hidden;
}
.activity-bar > i {
  height: 100%;
  display: block;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.activity-count {
  text-align: right;
  font: 10px var(--mono);
}
.score-panel > .fine {
  margin-top: 13px;
}
.transport {
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.transport-main {
  display: flex;
  gap: 9px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  min-width: 170px;
}
.primary:hover:not(:disabled) {
  background: #97381f;
  border-color: #97381f;
}
.primary span {
  margin-left: 20px;
}
.transport button:not(.primary) {
  font-size: 11px;
}
.volume {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
}
.volume input {
  width: 80px;
}
.volume output {
  min-width: 30px;
  font: 10px var(--mono);
}
input[type="range"] {
  accent-color: var(--accent);
  height: 24px;
  cursor: pointer;
}
.error {
  background: #f8e8df;
  border-top: 1px solid var(--accent);
  padding: 14px 24px;
  color: #92321d;
}
.settings-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 1fr 1fr 0.7fr;
  gap: 22px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.section-label p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.settings-row > label {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  gap: 7px;
}
.settings-row label > span {
  font: 11px var(--mono);
  color: var(--muted);
}
select,
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  padding: 9px;
  font-size: 11px;
  min-height: 40px;
}
.settings-row .checkbox {
  grid-column: 2/4;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.checkbox input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.settings-note {
  grid-column: 4/6;
  font-size: 10px;
}
.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 48px;
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--line);
}
.anatomy-panel canvas {
  width: 100%;
  height: 225px;
  margin: 18px 0;
  background: var(--dark);
  border-radius: 5px;
}
.anatomy-panel details {
  margin-top: 15px;
  font-size: 11px;
}
.neuron-list {
  max-height: 160px;
  overflow: auto;
  font: 10px/2 var(--mono);
  padding: 12px 0;
  white-space: pre-wrap;
}
.take-panel > h2 {
  font: 500 24px var(--serif);
  margin-bottom: 16px;
}
.take-panel > p:not(.eyebrow) {
  font-size: 12px;
  color: var(--muted);
}
.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 10px;
}
.export-buttons button,
.save-row button,
.file-label {
  font-size: 10px;
}
.save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.file-label {
  position: relative;
  overflow: hidden;
  display: inline-block;
}
.file-label input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  cursor: pointer;
}
.file-label:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.comparison {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.comparison p {
  margin: 8px 0 12px;
}
.comparison > button {
  font-size: 11px;
}
#comparison-result {
  font-size: 11px;
  margin-top: 12px;
}
.compare-row {
  display: grid;
  grid-template-columns: 65px minmax(0, 1fr) 85px;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.compare-row i {
  height: 6px;
  display: block;
  background: var(--accent);
}
.saved-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.saved-item button {
  padding: 5px 9px;
  font-size: 10px;
}
.guide {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 70px;
  padding: 60px 0;
}
.guide-title h2 {
  font: 500 30px/1.7 var(--serif);
}
.guide-title > p:last-child {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}
.lessons article {
  display: flex;
  align-items: start;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.lesson-number {
  font: 12px var(--mono);
  color: var(--accent);
  padding-top: 3px;
}
.lessons article p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.lessons code {
  display: block;
  font: 11px var(--mono);
  margin-top: 12px;
  background: var(--soft);
  padding: 12px;
}
.lessons details {
  font-size: 11px;
  margin-top: 12px;
}
.lessons a {
  display: inline-block;
  font-size: 11px;
  margin-top: 12px;
}
summary {
  cursor: pointer;
}
footer {
  padding: 25px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
footer > div {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.skip {
  position: absolute;
  top: -100px;
  background: var(--white);
  padding: 10px;
}
.skip:focus {
  top: 5px;
  z-index: 2;
}
@media (min-width: 1500px) {
  .intro {
    padding-top: 60px;
    padding-bottom: 48px;
  }
  #creature {
    height: 285px;
  }
}
@media (max-width: 1050px) {
  .masthead,
  main {
    padding-inline: 25px;
  }
  .intro-aside {
    max-width: 310px;
  }
  .dataset {
    display: none;
  }
  .specimen,
  .score-panel {
    padding: 18px;
  }
  .transport {
    flex-wrap: wrap;
    padding: 15px 18px;
  }
  .settings-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
  .section-label {
    grid-column: 1/-1;
  }
  .settings-row .checkbox {
    grid-column: 1/3;
  }
  .settings-note {
    grid-column: 3/5;
  }
  .insight-grid {
    gap: 28px;
  }
  .wordmark span {
    display: none;
  }
  .guide {
    gap: 35px;
  }
}
@media (max-width: 700px) {
  body {
    font-size: 13px;
  }
  .masthead,
  main {
    padding-inline: 18px;
  }
  .masthead {
    height: 68px;
  }
  .wordmark {
    font-size: 14px;
  }
  .guide-link {
    font-size: 10px;
  }
  .intro {
    display: block;
    padding: 30px 0;
  }
  h1 {
    font-size: 32px;
  }
  .intro-aside {
    margin-top: 20px;
    max-width: none;
  }
  .intro-aside > p:first-child {
    font-size: 12px;
    margin-bottom: 7px;
  }
  .intro-aside .fine {
    font-size: 9px;
  }
  .eyebrow {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .lab-grid,
  .insight-grid,
  .guide {
    grid-template-columns: minmax(0, 1fr);
  }
  .specimen {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stage-header {
    padding: 12px 16px;
  }
  .panel-heading h2 {
    font-size: 14px;
  }
  #creature {
    height: 240px;
  }
  .stage-caption {
    font-size: 8px;
  }
  .label span {
    display: none;
  }
  .transport-main {
    flex-wrap: wrap;
    width: 100%;
  }
  .transport-main .primary {
    flex: 1;
  }
  .transport button {
    padding: 10px 12px;
  }
  .volume {
    width: 100%;
    justify-content: end;
  }
  .settings-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-row .checkbox,
  .settings-note {
    grid-column: 1/-1;
  }
  .insight-grid {
    padding: 28px 0;
    gap: 30px;
  }
  .guide {
    gap: 20px;
    padding: 35px 0;
  }
  .guide-title h2 {
    font-size: 25px;
  }
  .guide-title > p:last-child {
    margin-top: 10px;
  }
  .lessons article {
    gap: 15px;
  }
  .export-buttons button {
    flex: 1;
  }
  #score {
    height: 165px;
  }
  .fine {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  button {
    transition: none;
  }
}

@media (min-width: 1000px) and (max-height: 900px) {
  .masthead {
    height: 70px;
  }
  .intro {
    padding: 22px 0 25px;
  }
  h1 {
    font-size: 36px;
    line-height: 1.4;
  }
  .intro .eyebrow {
    margin-bottom: 8px;
  }
  #creature {
    height: 178px;
  }
  #score {
    height: 135px;
    margin-top: 14px;
  }
  .score-caption {
    margin-bottom: 12px;
  }
  .specimen,
  .score-panel {
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .stage-caption {
    margin-bottom: 12px;
  }
  .transport {
    padding-block: 12px;
  }
}
