:root {
  color-scheme: dark;
  --background: #070b08;
  --foreground: #a5ff8c;
  --muted: #8de67e;
  --border: #77ba66;
  --amber: #f8d679;
  --terminal-ink: #204e29;
  --mono: "Consolas", "Lucida Console", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--mono); font-size: 15px; line-height: 1.45; }
button, input, textarea { font: inherit; border-radius: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 5px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
button:hover, .primary-link:hover { background: var(--foreground); color: var(--background); }
a:hover { color: #c5ffb6; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--amber); outline-offset: 5px; }
button, .primary-link { transition: background-color .16s ease, color .16s ease; }
.page-shell { width: min(1400px, calc(100% - 9%)); margin: 0 auto; }
.skip-link { position: absolute; top: -80px; left: 1rem; z-index: 10; padding: .75rem 1rem; background: var(--foreground); color: var(--background); }
.skip-link:focus { top: 10px; }
.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; }

.site-header { min-height: 47px; display: flex; gap: 40px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); font-size: 14px; letter-spacing: .025em; }
.site-name { text-decoration: none; margin-right: auto; }
.site-header nav { display: flex; gap: 26px; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
.motion-button { border: 1px solid var(--border); color: var(--foreground); padding: 3px 16px; background: transparent; font-size: 13px; white-space: nowrap; }

.hero { display: grid; grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); gap: 60px; padding: 15px 28px 19px; scroll-margin-top: 10px; }
.hero-copy { min-width: 0; }
h1 { width: max-content; max-width: 100%; margin: 2px 0 0 -5px; font-family: "Impact", "Arial Narrow", "Arial", sans-serif; font-weight: 400; font-size: clamp(58px, 7.85vw, 120px); line-height: 1.02; letter-spacing: .01em; white-space: nowrap; transform: scaleX(1.17); transform-origin: left center; }
.hero-subtitle { margin: 0; font-size: clamp(20px, 3.2vw, 49px); line-height: 1.15; letter-spacing: .105em; white-space: nowrap; }
.hero-caption { margin: 4px 0 18px; font-size: 19px; letter-spacing: .105em; color: var(--amber); }
.intro { max-width: 675px; margin: 0 0 17px; font-size: 21px; line-height: 1.25; letter-spacing: .025em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; }
.primary-link { display: inline-flex; align-items: center; gap: 12px; justify-content: center; min-height: 50px; padding: 8px 29px; background: var(--foreground); color: var(--background); font-size: 20px; font-weight: 700; letter-spacing: .015em; text-decoration: none; }
.primary-link:hover { background: #c5ffb6; color: var(--background); }
.primary-link span, .text-link span { font-size: 29px; line-height: .8; }
.text-link { font-size: 19px; letter-spacing: .025em; white-space: nowrap; }
.terminal-art { position: relative; overflow: hidden; min-height: 348px; border: 1px solid var(--border); display: grid; place-items: center; }
.binary-rain { position: absolute; top: 15px; left: 20px; margin: 0; font-size: 15px; line-height: 1.62; letter-spacing: 1px; color: var(--terminal-ink); user-select: none; }
.terminal-title { position: relative; display: grid; place-items: center; margin-top: -19px; padding: 0 16px; background: var(--background); }
.terminal-title strong { font-family: "Consolas", "Courier New", monospace; font-size: 98px; font-weight: 700; line-height: 1; letter-spacing: -3px; color: var(--background); -webkit-text-stroke: 2px var(--foreground); }
.terminal-title span { font-size: 27px; letter-spacing: .21em; }
.terminal-caption { position: absolute; bottom: 13px; width: 100%; margin: 0; text-align: center; font-size: 14px; }
.ticker { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 32px; display: flex; justify-content: center; align-items: center; gap: 9px; font-size: 14px; letter-spacing: .01em; }

h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: .03em; }
.research-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.research-section { padding: 12px 26px 13px 12px; }
.research-links { margin-top: 4px; }
.research-link { display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.4fr) 26px; align-items: center; gap: 28px; min-height: 66px; padding: 8px 13px 8px 0; text-decoration: none; border-bottom: 1px solid var(--border); }
.research-link:last-child { border-bottom: 0; }
.research-link h3 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.35; letter-spacing: .01em; }
.research-link p { margin: 0; padding-left: 28px; border-left: 1px solid var(--border); font-size: 15px; line-height: 1.3; }
.research-link > span[aria-hidden] { font-size: 29px; justify-self: end; }
.research-link:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.notebook-section { padding: 12px 14px 14px 30px; border-left: 1px solid var(--border); }
.notebook-section ol { margin: 16px 0 34px; padding-left: 38px; }
.notebook-section li { padding-left: 2px; margin-bottom: 17px; font-size: 15px; }
.collection-status { color: var(--amber); font-size: 16px; letter-spacing: .025em; margin: 0 5px; }

.guestbook-section { padding: 12px 12px 18px; }
.guestbook-explainer { margin: 5px 0 16px; }
#guestbook-form { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr) minmax(210px, .55fr); gap: 24px; align-items: start; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 3px; font-size: 14px; line-height: 1.2; }
input, textarea { border: 1px solid var(--foreground); background: transparent; color: var(--foreground); width: 100%; padding: 8px 10px; line-height: 1.3; min-width: 0; }
input { height: 39px; }
textarea { resize: vertical; min-height: 77px; }
.guestbook-actions { padding-top: 17px; display: grid; gap: 13px; justify-items: center; }
.save-button { background: transparent; color: var(--foreground); border: 1px solid var(--foreground); width: 100%; min-height: 39px; font-size: 15px; letter-spacing: .03em; }
.clear-button { border: 0; background: transparent; color: var(--foreground); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 3px; }
.clear-button:hover { background: transparent; color: #c5ffb6; }
.form-status { min-height: 0; margin: 0; color: var(--amber); }
.form-status:not(:empty) { margin-top: 12px; }
.guestbook-empty { margin: 18px 0 0; }
.guestbook-entries { margin: 14px 0 0; padding: 0; list-style: none; }
.guestbook-entries:empty { display: none; }
.guestbook-entry { padding: 10px 0; border-top: 1px dashed var(--border); }
.guestbook-entry strong { color: var(--amber); overflow-wrap: anywhere; }
.guestbook-entry p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.guestbook-entry time { color: var(--muted); font-size: 12px; }
.site-footer { min-height: 70px; padding: 14px 8px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 14px; }
.site-footer p { margin: 0; }
.privacy-stamp { border: 1px solid var(--border); padding: 5px 20px; white-space: nowrap; }
.motion-on .binary-rain { animation: drift 12s linear infinite alternate; }
@keyframes drift { to { transform: translateY(-12px); } }

@media (max-width: 1250px) {
  .hero { gap: 32px; padding-inline: 14px; }
  h1 { font-size: 8.35vw; }
  .hero-subtitle { font-size: 3.05vw; }
  .hero-caption { font-size: 15px; }
  .intro { font-size: 18px; }
  .hero-actions { gap: 20px; }
  .primary-link { font-size: 16px; padding-inline: 18px; }
  .text-link { font-size: 15px; }
  .terminal-art { min-height: 300px; }
  .research-link { gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) 20px; }
  .research-link h3 { font-size: 16px; }
  .research-link p { padding-left: 16px; font-size: 13px; }
  .notebook-section { padding-left: 22px; }
  .notebook-section li { font-size: 14px; }
  .notebook-section ol { padding-left: 24px; }
  h2 { font-size: 21px; }
}

@media (max-width: 820px) {
  .page-shell { width: calc(100% - 32px); }
  .site-header { min-height: 86px; flex-wrap: wrap; column-gap: 16px; row-gap: 0; padding-block: 10px; }
  .site-name { width: 100%; }
  .site-header nav { gap: 20px; margin-right: auto; }
  .motion-button { padding-inline: 9px; font-size: 12px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 24px 0; }
  h1 { font-size: clamp(50px, 12.15vw, 100px); margin-left: -2px; }
  .hero-subtitle { font-size: clamp(18px, 4.45vw, 36px); letter-spacing: .115em; }
  .hero-caption { font-size: 13px; margin: 10px 0 18px; line-height: 1.6; }
  .intro { max-width: 590px; font-size: 18px; line-height: 1.5; }
  .hero-actions { gap: 20px 24px; }
  .primary-link { font-size: 16px; }
  .terminal-art { min-height: 260px; }
  .terminal-title strong { font-size: 89px; }
  .binary-rain { line-height: 1.5; left: 18px; }
  .ticker { font-size: 11px; gap: 6px; text-align: center; padding: 8px 3px; flex-wrap: wrap; }
  .research-layout { grid-template-columns: 1fr; }
  .research-section { padding: 18px 0; }
  .research-link { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) 20px; gap: 15px; min-height: 80px; }
  .research-link h3 { font-size: 15px; }
  .research-link p { font-size: 13px; }
  .notebook-section { border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 22px; }
  .notebook-section ol { margin-bottom: 24px; }
  .notebook-section li { font-size: 15px; }
  .guestbook-section { padding: 18px 0 24px; }
  .guestbook-explainer { margin-top: 10px; }
  #guestbook-form { grid-template-columns: 1fr; gap: 18px; }
  .guestbook-actions { padding-top: 0; grid-template-columns: 1fr 1fr; gap: 16px; }
  .site-footer { padding: 18px 0; font-size: 12px; align-items: start; }
  .site-footer p { max-width: 260px; line-height: 1.8; }
  .privacy-stamp { padding-inline: 12px; }
}

@media (max-width: 380px) {
  .site-header nav { gap: 13px; font-size: 12px; }
  .motion-button { font-size: 11px; }
  .hero-caption { font-size: 11px; }
  .text-link { font-size: 13px; }
  h2 { font-size: 19px; }
  .research-link { grid-template-columns: minmax(0, 1fr) 20px; gap: 4px; }
  .research-link h3 { grid-row: 1; }
  .research-link p { grid-row: 2; border-left: 0; padding-left: 0; }
  .research-link > span[aria-hidden] { grid-column: 2; grid-row: 1 / 3; }
  .guestbook-actions { grid-template-columns: 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
