@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --line: #dddddd;
  --font: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

/* —— Home: typewriter quite centered in viewport —— */
.page-home {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  width: min(36rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
}

.type-line {
  margin: 0 auto;
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  min-height: 3.5em;
  white-space: pre-wrap;
  text-align: center;
}

.cursor {
  display: inline-block;
  margin-left: 1px;
  color: var(--fg);
  animation: blink 1.05s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

/* —— Burger (bottom-right) —— */
.burger-wrap {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.burger-btn {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.burger-btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.burger-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 1.15rem;
}

.burger-bars span {
  display: block;
  height: 2px;
  background: var(--fg);
}

.burger-btn[aria-expanded="true"] .burger-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger-btn[aria-expanded="true"] .burger-bars span:nth-child(2) {
  opacity: 0;
}
.burger-btn[aria-expanded="true"] .burger-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.burger-bars span {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .burger-bars span { transition: none; }
}

.burger-panel {
  width: min(16rem, calc(100vw - 2.5rem));
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--fg);
  background: var(--bg);
  text-align: left;
}

.burger-panel[hidden] { display: none; }

.burger-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.burger-list li { margin: 0; }

.burger-list a {
  display: block;
  padding: 0.55rem 0;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.burger-list a:hover,
.burger-list a:focus-visible {
  text-decoration: underline;
}

.burger-list a[aria-current="page"] {
  font-weight: 500;
}

.burger-note {
  margin: 0.85rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.burger-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: transparent;
}

.burger-backdrop[hidden] { display: none; }

/* —— Legal pages —— */
.page-legal {
  padding: 2rem 1.25rem 6rem;
}

.legal-top {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}

.legal-top h1 {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.back {
  color: var(--fg);
  font-size: 0.9rem;
}

.legal-body {
  max-width: 36rem;
  margin: 0 auto;
  font-size: 0.95rem;
}

.legal-body p { margin: 0 0 1rem; }

.placeholder {
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 0.75rem;
}

.mono { word-break: break-all; }
.muted { color: var(--muted); font-size: 0.85rem; }

.legal-body h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1rem;
  font-weight: 500;
}

.legal-body a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover,
.legal-body a:focus-visible {
  text-decoration-thickness: 2px;
}

.legal-body strong { font-weight: 500; }

.type-line .is-scrambling {
  opacity: 0.55;
  letter-spacing: 0.02em;
}

/* —— Network architecture background (full viewport, behind content) —— */
.network-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.page-home .stage {
  position: relative;
  z-index: 1;
}

/* Burger already z-index 40; backdrop 30 — stays above canvas */
