/* Quiet controls on the page. The operator channel is entirely opt-in. */
.system-sr-only {
   position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   overflow: hidden;
   clip-path: inset(50%);
   white-space: nowrap;
}
.system-dialog[hidden], .system-dialog [hidden], .system-toast[hidden],
.construct-exit[hidden], .spoon-exit[hidden] { display: none !important; }
.system-dialog button, .system-toast button, .construct-exit, .spoon-exit {
   border-radius: 3px;
   font: 13px/1.5 'Courier New', monospace;
   letter-spacing: 0;
   text-transform: none;
}
.system-dialog button:focus-visible, .system-toast button:focus-visible,
.construct-exit:focus-visible, .spoon-exit:focus-visible,
.identity-scan:focus-visible,
.skill-pulse-trigger:focus-visible, .trail-rabbit:focus-visible {
   outline: 2px solid #a7fff0;
   outline-offset: 5px;
}
#about .identity-scan:focus-visible, #resume .skill-pulse-trigger:focus-visible { outline: 2px solid #a7fff0; outline-offset: 5px; }
.matrix-trigger { touch-action: manipulation; }

/* Identity scan: fixed geometry, with readouts kept outside the body copy. */
#about .identity-scan {
   all: unset;
   position: relative;
   display: block;
   width: 120px;
   height: 120px;
   border-radius: 50%;
   cursor: default;
}
#about .identity-scan .profile-pic { display: block; width: 100%; height: 100%; margin: 0; }
.scan-frame {
   position: absolute;
   inset: -9px;
   overflow: hidden;
   border: 1px solid transparent;
   border-radius: 5px;
   pointer-events: none;
}
.scan-frame::after {
   content: '';
   position: absolute;
   left: 0;
   right: 0;
   top: 0;
   height: 2px;
   background: #a7fff0;
   box-shadow: 0 0 15px #64f5cf;
   opacity: 0;
}
.is-scanning .scan-frame { border-color: #5d9d91; }
.is-scanning .scan-frame::after { animation: identity-sweep 850ms ease-in-out; }
.is-verified .scan-frame { border-color: #a7fff0; }
.scan-readout {
   position: absolute;
   top: 145px;
   left: -4px;
   width: 208px;
   box-sizing: border-box;
   padding: 9px;
   border: 1px solid #34564f;
   border-radius: 3px;
   background: #071318f2;
   color: #b6ffec;
   opacity: 0;
   pointer-events: none;
   font: 10px/1.9 'Courier New', monospace;
   letter-spacing: .04em;
}
.is-verified .scan-readout { opacity: 1; }
@keyframes identity-sweep {
   0% { transform: translateY(0); opacity: 0; }
   10%, 85% { opacity: 1; }
   100% { transform: translateY(136px); opacity: 0; }
}

/* Skill circuits are invisible until a group receives attention. */
#resume .skill-pulse-trigger {
   all: unset;
   display: inline-block;
   font: inherit;
   color: inherit;
   cursor: default;
}
#resume .skill-group .skills { position: relative; padding-left: 18px; }
.skill-group .skills::before {
   content: '';
   position: absolute;
   left: 2px;
   top: 0;
   bottom: 8px;
   width: 1px;
   background: var(--accent-light);
   opacity: 0;
   transform-origin: top;
}
.skill-group li { position: relative; }
.skill-group li::before {
   content: '';
   position: absolute;
   left: -18px;
   top: .65em;
   width: 5px;
   height: 5px;
   border-radius: 50%;
   background: var(--accent-light);
   opacity: 0;
}
.skill-group.is-pulsing .skills::before { animation: circuit-line 1700ms ease-out both; }
.skill-group.is-pulsing li::before { animation: circuit-node 1100ms var(--pulse-delay) ease-out both; }
@keyframes circuit-line {
   0% { transform: scaleY(0); opacity: .8; }
   45% { transform: scaleY(1); opacity: .6; }
   100% { transform: scaleY(1); opacity: 0; }
}
@keyframes circuit-node {
   0%, 100% { opacity: 0; box-shadow: none; }
   25%, 55% { opacity: 1; box-shadow: 0 0 10px var(--accent-light); }
}

/* Finish the packet transmission before initiating the PDF download. */
#resume-download { position: relative; }
#resume-download[aria-busy="true"] { cursor: progress; }
.transfer-track { position: absolute; left: 12px; right: 12px; bottom: -7px; height: 1px; background: var(--accent-light); opacity: 0; }
.transfer-track span { position: absolute; top: -2px; left: 0; width: 10px; height: 5px; background: #e8fff3; box-shadow: 0 0 9px var(--accent-light); }
.transfer-active .transfer-track { opacity: .8; }
.transfer-active .transfer-track span { animation: data-transfer 1100ms ease-in-out forwards; }
.transmission-status { display: block; min-height: 20px; margin-top: 12px; color: var(--accent-light); font: 10px/20px 'Courier New', monospace; }
@keyframes data-transfer { from { left: 0; } to { left: calc(100% - 10px); } }

/* Three signals appear only after the operator terminal has been discovered. */
.rabbit-anchor { position: relative; }
.trail-rabbit {
   all: unset;
   position: absolute;
   right: 0;
   top: -8px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 44px;
   height: 44px;
   color: var(--accent-light);
   opacity: .38;
   cursor: pointer;
}
.trail-rabbit svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.trail-rabbit:hover, .trail-rabbit:focus-visible { opacity: 1; }
.trail-rabbit.is-found { opacity: .8; color: #b7ffda; }
.trail-rabbit.is-found::after { content: '+'; position: absolute; right: 2px; top: 0; font: 12px monospace; }
.footer-copyright.rabbit-anchor { width: fit-content; margin-left: auto; margin-right: auto; }
.footer-copyright .trail-rabbit { right: -48px; top: -11px; }

/* The small status panel never steals focus or covers the navigation. */
.system-toast {
   position: fixed;
   right: 20px;
   bottom: 20px;
   z-index: 9500;
   box-sizing: border-box;
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 10px 16px;
   width: min(440px, calc(100vw - 40px));
   padding: 18px;
   border: 1px solid #34564f;
   border-radius: 5px;
   background: #0b1718;
   color: #d5fff2;
   box-shadow: 0 8px 40px #0005;
   font: 12px/1.7 'Courier New', monospace;
}
.system-toast > span { flex: 1 1 100%; }
.system-toast button { padding: 6px 8px; margin: 0; color: #b7ffda; background: transparent; border: 1px solid #34564f; }
.system-toast .system-toast-close { margin-left: auto; color: #b4cbc4; border-color: transparent; }

/* Operator terminal and network recovery share a modal shell. */
.system-dialog {
   position: fixed;
   inset: 0;
   z-index: 10000;
   box-sizing: border-box;
   overflow: auto;
   overscroll-behavior: contain;
   padding: 88px 32px 40px;
   background: #020806;
   color: #b7ffda;
   text-align: left;
}
.system-dialog-close { position: fixed; z-index: 1; top: 20px; right: 24px; margin: 0; padding: 8px 12px; background: #07110c; border: 1px solid #34564f; color: #b7ffda; }
.system-dialog .system-dialog-close:hover { background: #10251b; }
.system-dialog button:hover, .system-dialog button:focus { background: #153021; color: #e8fff3; }
.system-dialog .system-action:hover, .system-dialog .system-action:focus { background: #dbffeb; color: #072213; }
.system-eyebrow { color: #75ab91; font: 11px/1.7 'Courier New', monospace; letter-spacing: .14em; margin: 0 0 28px; }
.matrix-terminal { background: #000; }
.terminal-panel { width: min(880px, 100%); margin: 0 auto; }
.matrix-terminal .matrix-terminal-output { font: 16px/1.9 'Courier New', monospace; letter-spacing: .01em; color: #67ff98; text-shadow: 0 0 8px #00ff4120; }
.matrix-terminal .matrix-terminal-cursor { width: .65em; height: .8em; background: #67ff98; }
.terminal-skip { background: transparent; border: 1px solid #1b3d28; color: #8bbd99; padding: 7px 10px; margin: 24px 0; }
.terminal-log { max-height: 38vh; overflow: auto; scrollbar-color: #285239 #000; margin-top: 24px; overflow-wrap: anywhere; }
.terminal-log pre { margin: 0 0 14px; padding: 0; border: 0; background: transparent; white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; font: 14px/1.7 'Courier New', monospace; }
.terminal-command { color: #739982; }
.terminal-response { color: #b7ffda; }
.terminal-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 18px 0 0; border-top: 1px solid #15341e; padding-top: 20px; }
.terminal-form label { width: auto; float: none; color: #67ff98; font: 14px/24px 'Courier New', monospace; }
.terminal-form input[type="text"] { flex: 1 1 160px; width: 0; min-width: 0; max-width: 100%; box-sizing: border-box; margin: 0; padding: 7px 5px; background: #030a05; border: 1px solid #285239; border-radius: 2px; color: #e0ffe9; caret-color: #67ff98; font: 16px/24px 'Courier New', monospace; }
.terminal-form input:focus { outline: 1px solid #67ff98; outline-offset: 3px; }
.terminal-run { background: #102a19; color: #b7ffda; padding: 8px 16px; margin: 0; }

/* A short, untimed puzzle built from real connected circuit ports. */
.network-panel { width: min(560px, 100%); margin: 0 auto; }
.network-panel h2 { color: #edfff5; font: 28px/1.3 'opensans-semibold', sans-serif; margin-bottom: 14px; }
.network-instructions { color: #b8d8c7; font: 14px/1.7 'opensans-regular', sans-serif; }
.network-rack { position: relative; padding: 0 24px; max-width: 408px; margin: 28px auto; }
.network-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.network-tile { box-sizing: border-box; display: block; aspect-ratio: 1; width: 100%; padding: 0; margin: 0; border: 1px solid #294537; border-radius: 5px; background: #0b1912; color: #446d58; }
.network-tile svg { display: block; width: 100%; height: 100%; fill: #0b1912; stroke: currentColor; stroke-width: 5; stroke-linecap: round; }
.network-tile.is-powered { color: #9dffca; border-color: #65b383; background: #10251a; }
.network-tile.is-powered svg { filter: drop-shadow(0 0 4px #67ff9840); }
.network-tile:hover { background: #153021; color: #b7ffda; }
.network-endpoint { position: absolute; top: calc(50% - 10px); color: #82c59e; font: 10px/20px 'Courier New', monospace; }
.network-in { left: 0; color: #b7ffda; }
.network-out { right: 0; }
.is-restored .network-out { color: #b7ffda; text-shadow: 0 0 9px #67ff98; }
.network-status { min-height: 28px; color: #b7ffda; text-align: center; font: 13px/1.8 'Courier New', monospace; margin-bottom: 10px; }
.network-keyboard-hint { color: #8caf9b; font: 11px/1.7 'Courier New', monospace; text-align: center; }
.network-reward { padding: 20px; border: 1px solid #3b7552; background: #0c2014; margin: 22px 0; }
.network-reward p { color: #c6ecd5; font: 14px/1.7 'opensans-regular', sans-serif; margin-bottom: 16px; }
.system-action { padding: 10px 18px; background: #b7ffda; color: #072213; margin: 0; }
.network-reset { display: block; margin: 24px auto 0; padding: 7px 12px; color: #9cbaa8; background: transparent; border: 1px solid #294537; }

footer .footer-identity a { color: inherit; }

/* Wireframe geometry is created only after the secret command or puzzle reward. */
:root.construct-mode {
   --accent: #166b70 !important;
   --accent-hover: #10525a !important;
   --accent-light: #8bfaf4 !important;
   --surface-page: #07181d !important;
   --surface-about: #09191e !important;
   --surface-resume: #051115 !important;
   --surface-footer: #07181d !important;
   --surface-nav: #0a252c !important;
}
.construct-mode .scene-layer { filter: grayscale(1) brightness(.55); }
.construct-mesh { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; display: none; opacity: .5; }
.construct-mode .construct-mesh { display: block; }
#quotes .text-container { position: relative; z-index: 1; }
.construct-exit, .spoon-exit { position: fixed; z-index: 9400; right: 20px; top: 64px; margin: 0; padding: 9px 12px; border: 1px solid #4b9c99; background: #06191df2; color: #b3fff8; font-size: 11px; }
.spoon-exit { top: auto; right: auto; left: 20px; bottom: 20px; color: #e3ffe8; }
.spoon-exit { display: flex; align-items: center; gap: 10px; }
.spoon-exit svg { width: 28px; height: 28px; fill: #b7ffda; stroke: #b7ffda; stroke-width: 2; }
.spoon-exit svg path { fill: none; }
.spoon-mode, .spoon-mode * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cellipse cx='9' cy='8' rx='5' ry='7' fill='%23b7ffda' stroke='%23092416'/%3E%3Cpath d='M10 14c0 9 15 1 14 14' fill='none' stroke='%23092416' stroke-width='5'/%3E%3Cpath d='M10 14c0 9 15 1 14 14' fill='none' stroke='%23b7ffda' stroke-width='3'/%3E%3C/svg%3E") 9 8, auto !important; }

/* The Hackers homage starts transparent, letting its fire consume the page. */
.system-dialog.crashandburn-scene { padding: 0; overflow: hidden; background: transparent; }
.crashandburn-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crashandburn-toolbar {
   position: absolute;
   z-index: 1;
   left: 24px;
   right: 24px;
   bottom: max(20px, env(safe-area-inset-bottom));
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
}
.crashandburn-scene button { min-height: 44px; margin: 0; padding: 9px 13px; border: 1px solid #965c39; background: #100c16e8; color: #ffe8bf; }
.crashandburn-scene button:hover, .crashandburn-scene button:focus { background: #342018; color: #fff1d8; }
.crashandburn-scene button:focus-visible { outline-color: #ffe2a4; }

@media (max-width: 900px) {
   #about .identity-scan { width: 114px; height: 114px; margin-left: 12px; }
   .scan-readout { width: 170px; font-size: 9px; }
}
@media (max-width: 767px) {
   #about .identity-scan { display: none; }
   .system-dialog { padding: 80px 24px 28px; }
   .system-dialog-close { right: 16px; top: 16px; }
   .terminal-form label { flex-basis: 100%; }
   .terminal-form input[type="text"] { flex-basis: 120px; }
   .terminal-log { max-height: 34vh; }
   .matrix-terminal .matrix-terminal-output { font-size: 15px; }
   .network-panel h2 { font-size: 24px; }
   .network-rack { padding: 0 20px; }
   .network-board { gap: 6px; }
   .system-toast { right: 12px; bottom: 12px; width: calc(100vw - 24px); padding: 14px; }
   .construct-exit { top: 64px; right: 12px; }
   .spoon-exit { left: 12px; bottom: 12px; }
   .crashandburn-toolbar { left: 12px; right: 12px; flex-wrap: wrap; gap: 10px; }
   .crashandburn-control { font-size: 11px !important; }
}
@media (prefers-reduced-motion: reduce) {
   .is-scanning .scan-frame::after, .skill-group.is-pulsing .skills::before,
   .skill-group.is-pulsing li::before, .transfer-active .transfer-track span { animation: none; }
   .skill-group.is-pulsing .skills::before, .skill-group.is-pulsing li::before { opacity: .75; }
   .transfer-active .transfer-track span { left: calc(100% - 10px); }
}
