/* Stars fill the viewport; only the clear central stage handles rotation and zoom. */
body.is-home { background: #08090b; }
.is-home main { padding: 0 4vw; }
.brain-home { position: relative; isolation: isolate; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: 32px minmax(0, 1fr) auto; justify-content: stretch; width: 100%; }
.brain-meta { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 8px; font: 9px/1.4 Arial,sans-serif; letter-spacing: .22em; color: #94969e; }
.brain-meta #brain-state { text-align: right; color: #b5b7bf; font-size: 8px; }
.brain-stage { position: relative; width: 100%; height: 100%; min-height: 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; border-radius: 2px; }
.brain-stage.is-formed { cursor: grab; }
.brain-stage.is-dragging { cursor: grabbing; }
.brain-stage:focus-visible { outline: 1px solid #c6d2df; outline-offset: -3px; }
#brain-canvas { position: fixed; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#brain-canvas[hidden],#particles[hidden] { display: none; }
.is-home header { background: linear-gradient(#08090b9c,#08090b22); }
.is-home footer { background: #08090b66; }
.stage-corner { position: absolute; width: 13px; height: 13px; pointer-events: none; opacity: .4; }
.corner-tl { top: 22px; left: 0; border-top: 1px solid #6b7280; border-left: 1px solid #6b7280; }
.corner-br { bottom: 20px; right: 0; border-bottom: 1px solid #6b7280; border-right: 1px solid #6b7280; }
.brain-caption { padding: 0 0 18px; text-align: center; }
.brain-caption .signature { font-size: clamp(28px,min(8.5cqh,5vw),60px); line-height: 1; font-weight: 400; margin: 0; letter-spacing: .23em; padding-left: .23em; }
.brain-tagline { margin: 8px 0 12px; color: #b4b6be; font: 12px/1.5 'Assistant',Arial,sans-serif; letter-spacing: .14em; }
.brain-actions { display: flex; align-items: center; justify-content: center; gap: 18px; }
.brain-form { position: relative; display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 39px; padding: 9px 15px; border: 1px solid #ffffff38; color: #e7e8ec; font-size: 12px; letter-spacing: .03em; transition: border-color .2s,background .2s; }
.brain-form:hover { border-color: #ffffffa0; background: #ffffff08; }
.brain-form::after { content: attr(data-translation); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 2; transform: translateX(-50%); padding: 6px 10px; background: #15171df5; border: 1px solid #ffffff25; color: #e7e8ec; font: 11px/1.3 Arial,sans-serif; letter-spacing: .03em; white-space: nowrap; pointer-events: none; visibility: hidden; opacity: 0; }
.brain-form:hover::after, .brain-form:focus-visible::after { visibility: visible; opacity: 1; }
.brain-form > span:last-child { font-size: 16px; }
.brain-form #brain-action-label { font-family: 'Assistant',Arial,sans-serif; font-size: 18px; font-weight: 400; letter-spacing: .02em; min-width: 76px; }
.brain-view-controls { display: flex; align-items: center; gap: 3px; }
.brain-view-controls button { min-width: 35px; min-height: 39px; padding: 6px; font-size: 19px; font-family: Arial,sans-serif; color: #b9bec9; }
.brain-view-controls button:disabled { opacity: .3; cursor: default; }
.brain-view-controls output { min-width: 40px; text-align: center; color: #9297a2; font: 10px/1 monospace; }
.brain-view-controls #brain-reset { margin-left: 5px; border-left: 1px solid #ffffff20; padding-left: 12px; }
.brain-help { min-height: 16px; margin: 13px 0 0; color: #9498a2; font-size: 11px; line-height: 1.5; letter-spacing: .025em; }
.brain-home.is-transitioning .brain-stage { cursor: progress; }
.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; }
@media(min-width:1200px) { .brain-caption { padding-bottom: 23px; } .brain-meta { padding-top: 16px; } }
@media(max-width:600px) {
  .is-home main { padding: 0 18px; }
  .brain-home { grid-template-rows: 28px minmax(0,1fr) auto; }
  .brain-meta { font-size: 7px; letter-spacing: .15em; }
  .brain-meta #brain-state { font-size: 7px; letter-spacing: .1em; }
  .brain-caption { padding-bottom: 12px; }
  .brain-caption .signature { font-size: clamp(27px,8vw,40px); }
  .brain-tagline { font-size: 11px; margin: 7px 0 10px; }
  .brain-actions { gap: 10px; }
  .brain-form { min-height: 40px; padding: 8px 10px; gap: 12px; font-size: 11px; }
  .brain-view-controls { gap: 0; }
  .brain-view-controls button { min-width: 32px; min-height: 40px; }
  .brain-view-controls output { min-width: 33px; font-size: 9px; }
  .brain-help { font-size: 10px; margin-top: 8px; max-width: 330px; margin-left: auto; margin-right: auto; }
  .corner-tl { top: 12px; } .corner-br { bottom: 12px; }
}
/* Keep the scene useful on short phones and landscape screens; allow normal page scroll outside it. */
@media(max-height:720px) and (max-width:600px) { body.is-home { height: auto; min-height: 100dvh; grid-template-rows: auto minmax(410px,1fr) 92px; } .is-home main { min-height: 410px; } }
@media(max-height:560px) and (min-width:601px) { body.is-home { height: auto; min-height: 100dvh; grid-template-rows: auto minmax(390px,1fr) 72px; } .is-home main { min-height: 390px; } .brain-caption .signature { font-size: 30px; } .brain-tagline { margin: 6px 0 9px; } }
@media(prefers-reduced-motion:reduce) { .brain-form { transition: none; } }
