:root {
  color-scheme: dark;
  --black: #000000;
  --white: #fbfff9;
  --dim: rgba(251, 255, 249, 0.7);
  --faint: rgba(251, 255, 249, 0.22);
  --ghost: rgba(251, 255, 249, 0.08);
  --glow: rgba(244, 255, 245, 0.9);
  --accent: var(--white);
  --scanline: rgba(255, 255, 255, 0.032);
  font-family:
    "SF Mono", "IBM Plex Mono", "Roboto Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--white);
  background: var(--black);
  letter-spacing: 0;
}

body.light-mode {
  color-scheme: light;
  --black: #fbfff9;
  --white: #030604;
  --dim: rgba(3, 6, 4, 0.66);
  --faint: rgba(3, 6, 4, 0.19);
  --ghost: rgba(3, 6, 4, 0.06);
  --glow: rgba(3, 6, 4, 0.42);
  --accent: var(--white);
  --scanline: rgba(0, 0, 0, 0.026);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to bottom,
      var(--scanline) 0,
      var(--scanline) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.34;
  mix-blend-mode: screen;
}

button {
  font: inherit;
}

.theme-toggle {
  position: fixed;
  top: clamp(18px, 3vw, 34px);
  right: clamp(18px, 3vw, 34px);
  z-index: 4;
  display: grid;
  width: 42px;
  height: 26px;
  padding: 0;
  place-items: center start;
  border: 1px solid var(--faint);
  color: var(--dim);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-transform: uppercase;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.72),
    0 0 18px rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.theme-toggle span {
  display: block;
  width: 12px;
  height: 12px;
  margin-left: 7px;
  border: 1px solid var(--white);
  border-radius: 999px;
  background: var(--white);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.7),
    0 0 22px rgba(255, 255, 255, 0.24);
  transition: transform 220ms ease;
}

body.light-mode .theme-toggle {
  background: rgba(255, 255, 255, 0.44);
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.16);
}

body.light-mode .theme-toggle span {
  transform: translateX(15px);
}

.terminal-shell {
  min-height: 100svh;
  padding: clamp(22px, 4vw, 58px);
}

.entry {
  min-height: calc(100svh - clamp(44px, 8vw, 116px));
  display: grid;
  align-content: center;
  gap: 18px;
  transition: min-height 900ms ease, opacity 700ms ease, transform 900ms ease;
}

body.has-entered .entry {
  min-height: 132px;
  align-content: start;
  opacity: 0.74;
  transform: translateY(-6px);
}

.system-line,
.enter-hint,
.micro-label,
.info-grid span,
.side-notes span,
.confidential-grid span,
.case-copy span {
  margin: 0;
  color: var(--dim);
  font-size: clamp(0.68rem, 1vw, 0.82rem);
  line-height: 1.6;
  text-transform: uppercase;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 0 18px rgba(255, 255, 255, 0.46),
    0 0 28px rgba(255, 255, 255, 0.14);
}

.terminal-prompt {
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  padding: 0;
  border: 0;
  color: var(--white);
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 1),
    0 0 16px rgba(255, 255, 255, 0.86),
    0 0 26px rgba(255, 255, 255, 0.28);
}

.prompt-mark {
  color: var(--accent);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  text-shadow:
    0 0 5px rgba(255, 255, 255, 1),
    0 0 22px rgba(255, 255, 255, 0.58),
    0 0 28px rgba(255, 255, 255, 0.16);
}

.typed-text {
  min-height: 1.4em;
  font-family: "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.12rem, 1.9vw, 1.72rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
}

.typed-text .glyph {
  display: inline-block;
  min-width: 0.28em;
  transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg));
  animation: glyph-swim 3.6s ease-in-out infinite alternate;
  animation-delay: var(--delay, 0ms);
}

.cursor {
  width: 0.68em;
  height: 1.08em;
  background: var(--white);
  box-shadow:
    0 0 7px rgba(255, 255, 255, 1),
    0 0 20px rgba(255, 255, 255, 0.86),
    0 0 28px rgba(255, 255, 255, 0.22);
  animation: blink 860ms steps(2, start) infinite;
}

.enter-hint {
  transition: opacity 400ms ease;
}

.mobile-hint {
  display: none;
}

body.has-entered .enter-hint {
  opacity: 0;
}

.reveal {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.84fr);
  gap: clamp(34px, 8vw, 112px);
  align-items: center;
  min-height: calc(100svh - 190px);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 900ms ease 140ms, transform 900ms ease 140ms;
}

body.has-entered .reveal {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.confidential-section,
.case-section,
.contact-section {
  max-width: 1180px;
  margin: clamp(96px, 14vw, 180px) 0 0;
  padding-bottom: clamp(28px, 5vw, 70px);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 900ms ease 280ms, transform 900ms ease 280ms;
}

body.has-entered .confidential-section,
body.has-entered .case-section,
body.has-entered .contact-section {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.confidential-section h2,
.case-section h2,
.contact-section h2 {
  max-width: 680px;
  margin: 0 0 30px;
  color: var(--white);
  font-size: clamp(1.8rem, 3.2vw, 3.6rem);
  font-weight: 420;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.84),
    0 0 28px rgba(255, 255, 255, 0.18);
}

.confidential-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--faint);
  border-left: 1px solid var(--faint);
}

.confidential-grid article {
  min-height: 178px;
  padding: 20px;
  border-right: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  background: transparent;
}

.confidential-grid p {
  margin: 38px 0 0;
  color: rgba(246, 247, 243, 0.67);
  font-size: 0.88rem;
  line-height: 1.65;
}

body.light-mode .confidential-grid p,
body.light-mode .info-grid p,
body.light-mode .side-notes p,
body.light-mode .thesis-copy,
body.light-mode .case-copy p {
  color: rgba(3, 6, 4, 0.68);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--faint);
  background: var(--faint);
}

.case-card {
  display: grid;
  grid-template-rows: 220px 1fr;
  background: var(--black);
}

.case-visual {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--faint);
}

.case-visual span {
  position: absolute;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.32);
}

body.light-mode .case-visual span {
  border-color: rgba(0, 0, 0, 0.72);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.16);
}

.case-visual span:nth-child(1) {
  inset: 34px 18% auto 18%;
  height: 1px;
}

.case-visual span:nth-child(2) {
  width: 46%;
  height: 46%;
  left: 27%;
  top: 27%;
  transform: rotate(45deg);
}

.case-visual span:nth-child(3) {
  width: 1px;
  height: 72%;
  left: 50%;
  top: 14%;
}

.case-visual span:nth-child(4) {
  width: 58%;
  height: 1px;
  left: 21%;
  bottom: 36px;
}

.case-visual-alt span:nth-child(1) {
  inset: 26px auto auto 14%;
  width: 72%;
}

.case-visual-alt span:nth-child(2) {
  width: 62%;
  height: 36%;
  left: 19%;
  top: 32%;
  transform: skewX(-18deg);
}

.case-visual-alt span:nth-child(3) {
  width: 1px;
  height: 82%;
  left: 34%;
  top: 9%;
}

.case-visual-alt span:nth-child(4) {
  width: 1px;
  height: 82%;
  left: 66%;
  bottom: 9%;
}

.case-copy {
  padding: 22px;
}

.case-copy h3 {
  margin: 42px 0 16px;
  color: var(--white);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 420;
  line-height: 1.15;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.7),
    0 0 22px rgba(255, 255, 255, 0.18);
}

.case-copy p {
  margin: 0;
  color: rgba(246, 247, 243, 0.67);
  font-size: 0.9rem;
  line-height: 1.72;
}

.thesis-block {
  max-width: 780px;
}

.micro-label {
  margin-bottom: 24px;
  color: var(--accent);
}

h1 {
  margin: 0 0 28px;
  max-width: 680px;
  color: var(--white);
  font-size: clamp(2.2rem, 4.8vw, 5.35rem);
  font-weight: 420;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.96),
    0 0 18px rgba(255, 255, 255, 0.72),
    0 0 30px rgba(255, 255, 255, 0.18);
}

.thesis-copy {
  max-width: 660px;
  margin: 0 0 42px;
  color: rgba(246, 247, 243, 0.78);
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  line-height: 1.7;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.4),
    0 0 26px rgba(255, 255, 255, 0.14);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--faint);
  border-left: 1px solid var(--faint);
}

.info-grid article {
  min-height: 218px;
  padding: 20px;
  border-right: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  background: transparent;
}

.info-grid h2 {
  margin: 40px 0 14px;
  font-size: clamp(1rem, 1.42vw, 1.28rem);
  font-weight: 440;
  line-height: 1.2;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.75),
    0 0 18px rgba(255, 255, 255, 0.18);
}

.info-grid p {
  margin: 0;
  color: rgba(246, 247, 243, 0.64);
  font-size: 0.88rem;
  line-height: 1.65;
}

.polyhedron-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(calc(100svh - 210px), 780px);
  perspective: 1000px;
}

.polyhedron {
  display: block;
  width: min(100%, 780px);
  height: min(calc(100svh - 220px), 790px);
  border: 0;
}

.side-notes {
  position: absolute;
  right: 0;
  bottom: 8%;
  display: grid;
  gap: 10px;
  width: min(270px, 72%);
  padding: 16px;
  border: 1px solid var(--faint);
  background: rgba(0, 0, 0, 0.48);
}

body.light-mode .side-notes {
  background: rgba(255, 255, 255, 0.48);
}

.contact-section {
  padding-bottom: clamp(42px, 7vw, 92px);
}

.contact-section a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--white);
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  text-decoration: none;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.7),
    0 0 18px rgba(255, 255, 255, 0.18);
}

.side-notes p {
  margin: 0;
  color: rgba(246, 247, 243, 0.68);
  font-size: 0.78rem;
  line-height: 1.55;
}

.side-notes span {
  display: block;
  color: var(--white);
  text-transform: none;
}

@keyframes blink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes glyph-swim {
  from {
    transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg));
  }

  to {
    transform:
      translateY(calc(var(--lift, 0) + var(--swim, 0.03em)))
      rotate(calc(var(--tilt, 0deg) * -0.35));
  }
}

@media (prefers-reduced-motion: reduce) {
  .typed-text .glyph,
  .cursor,
  .polyhedron {
    animation: none;
  }
}

@media (max-width: 980px) {
  .reveal {
    grid-template-columns: 1fr;
    gap: clamp(42px, 8vw, 72px);
    min-height: auto;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .confidential-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .polyhedron-stage {
    width: min(100%, 640px);
    margin: 0 auto;
    min-height: auto;
  }
}

@media (max-width: 680px) {
  body::before {
    opacity: 0.2;
  }

  .terminal-shell {
    padding: 16px;
  }

  .theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 24px;
  }

  .entry {
    gap: 11px;
    min-height: calc(100svh - 32px);
  }

  body.has-entered .entry {
    min-height: 62px;
    margin-bottom: 22px;
  }

  .system-line,
  .enter-hint,
  .micro-label,
  .info-grid span,
  .side-notes span,
  .confidential-grid span,
  .case-copy span {
    font-size: 0.58rem;
  }

  .typed-text {
    font-size: clamp(1rem, 5.6vw, 1.32rem);
  }

  .desktop-hint {
    display: none;
  }

  .mobile-hint {
    display: inline;
  }

  .reveal {
    gap: 24px;
  }

  .thesis-block {
    display: block;
  }

  .micro-label {
    margin-bottom: 12px;
  }

  h1 {
    max-width: 11.8ch;
    margin: 0 0 16px;
    font-size: clamp(1.55rem, 8.3vw, 2.18rem);
    line-height: 1.06;
  }

  .thesis-copy {
    margin: 0 0 24px;
    font-size: 0.78rem;
    line-height: 1.62;
  }

  .polyhedron-stage {
    position: relative;
    display: grid;
    width: min(100%, 340px);
    margin: 4px auto 68px;
  }

  .polyhedron {
    width: 100%;
    height: min(78vw, 300px);
  }

  .side-notes {
    position: absolute;
    right: 0;
    bottom: -58px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    width: min(270px, 86%);
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.54);
  }

  body.light-mode .side-notes {
    background: rgba(255, 255, 255, 0.58);
  }

  .side-notes p {
    min-width: 0;
    padding: 8px 7px 9px;
    font-size: 0.52rem;
    line-height: 1.4;
    overflow-wrap: break-word;
  }

  .side-notes p + p {
    border-left: 1px solid var(--faint);
  }

  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .info-grid article {
    min-height: auto;
    padding: 12px 9px 13px;
  }

  .info-grid span {
    display: block;
  }

  .info-grid h2 {
    margin: 24px 0 9px;
    font-size: clamp(0.72rem, 3.3vw, 0.88rem);
  }

  .info-grid p {
    font-size: 0.6rem;
    line-height: 1.48;
  }

  .confidential-section,
  .case-section,
  .contact-section {
    margin-top: 56px;
    padding-bottom: 18px;
  }

  .confidential-section h2,
  .case-section h2,
  .contact-section h2 {
    margin-bottom: 20px;
    font-size: clamp(1.22rem, 6.5vw, 1.72rem);
    line-height: 1.1;
  }

  .confidential-grid article {
    min-height: auto;
    padding: 13px 12px 14px;
  }

  .confidential-grid p {
    margin-top: 16px;
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .case-card {
    grid-template-rows: 112px 1fr;
  }

  .case-copy {
    padding: 13px 12px 16px;
  }

  .case-copy h3 {
    margin: 22px 0 10px;
    font-size: clamp(0.96rem, 4.8vw, 1.22rem);
  }

  .case-copy p {
    font-size: 0.72rem;
    line-height: 1.58;
  }

  .contact-section {
    padding-bottom: 48px;
  }

  .contact-section a {
    font-size: 0.86rem;
  }
}

@media (max-width: 370px) {
  .terminal-shell {
    padding: 14px;
  }

  .side-notes p {
    padding-inline: 6px;
    font-size: 0.48rem;
  }

  .info-grid article {
    padding-inline: 7px;
  }

  .info-grid p {
    font-size: 0.56rem;
  }
}
