@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --marquee-gap: 24px;
  --font-body: "VT323", "Lucida Console", "Consolas", "SFMono-Regular",
    "Menlo", "Monaco", "Courier New", monospace;
  --font-display: "VT323", "Lucida Console", "Consolas", "SFMono-Regular",
    "Menlo", "Monaco", "Courier New", monospace;
  --color-bg: #121212;
  --color-bg-soft: #1f1f1f;
  --color-bg-mid: #2a2a2a;
  --color-border: #2b2b2b;
  --color-border-strong: #2f2f2f;
  --color-border-muted: #3a3a3a;
  --color-border-hover: #4a4a4a;
  --color-border-accent: #6f6f6f;
  --color-text: #c2c2c2;
  --color-text-strong: #e3e3e3;
  --color-text-bright: #ededed;
  --color-text-soft: #b8b8b8;
  --color-text-muted: #a6a6a6;
  --color-text-line: #c0c0c0;
  --color-text-dim: #8f8f8f;
  --color-text-weak: #9a9a9a;
  --color-text-glitch: #a2a2a2;
  --color-text-arc: #c8c8c8;
  --color-bar-fill: #7f7f7f;
  --color-bar-head: #a8a8a8;
  --color-accent-active: #ffd1a6;
  --color-brand: #c7966e;
  --color-frame: #5f4938;
  --color-console-green: #86b990;
  --audio-gradient-strong: rgba(18, 18, 18, 0.7);
  --audio-gradient-mid: rgba(18, 18, 18, 0.45);
  --glow-amber: 0 0 6px rgba(200, 200, 200, 0.12),
    0 0 10px rgba(160, 160, 160, 0.08);
  --glow-ivory: 0 0 4px rgba(230, 230, 230, 0.15),
    0 0 10px rgba(170, 170, 170, 0.08);
  --glow-depth: 0 0 14px rgba(0, 0, 0, 0.5);
  --glow-calc: 0 0 1px rgba(220, 220, 220, 0.35),
    0 0 4px rgba(170, 170, 170, 0.2),
    0 0 10px rgba(140, 140, 140, 0.16);
  --glow-glitch: 0 0 6px rgba(200, 200, 200, 0.35);
  --glow-glitch-soft: 0 0 6px rgba(200, 200, 200, 0.3);
  --flicker-duration: 16s;
  --flicker-soft: 0.018;
  --flicker-medium: 0.035;
  --flicker-peak: 0.055;
  --base-font-size: 19px;
  --scanline: repeating-linear-gradient(180deg,
      rgba(0, 0, 0, 0.35) 0 2px,
      rgba(0, 0, 0, 0) 2px 4px);
}

html.theme-light {
  color-scheme: light;
  --color-bg: #f2f2f2;
  --color-bg-soft: #e7e7e7;
  --color-bg-mid: #dadada;
  --color-border: #cfcfcf;
  --color-border-strong: #bdbdbd;
  --color-border-muted: #c6c6c6;
  --color-border-hover: #b0b0b0;
  --color-border-accent: #9a9a9a;
  --color-text: #2b2b2b;
  --color-text-strong: #1a1a1a;
  --color-text-bright: #111111;
  --color-text-soft: #3d3d3d;
  --color-text-muted: #555555;
  --color-text-line: #4a4a4a;
  --color-text-dim: #6c6c6c;
  --color-text-weak: #616161;
  --color-text-glitch: #383838;
  --color-text-arc: #2f2f2f;
  --color-bar-fill: #6a6a6a;
  --color-bar-head: #2a2a2a;
  --color-accent-active: #9a5b2e;
  --color-brand: #805034;
  --color-frame: #674936;
  --color-console-green: #347847;
  --audio-gradient-strong: rgba(242, 242, 242, 0.75);
  --audio-gradient-mid: rgba(242, 242, 242, 0.5);
  --glow-amber: 0 0 6px rgba(60, 60, 60, 0.12),
    0 0 10px rgba(80, 80, 80, 0.08);
  --glow-ivory: 0 0 4px rgba(50, 50, 50, 0.12),
    0 0 10px rgba(80, 80, 80, 0.08);
  --glow-depth: 0 0 12px rgba(0, 0, 0, 0.12);
  --glow-calc: 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 4px rgba(40, 40, 40, 0.18),
    0 0 10px rgba(20, 20, 20, 0.12);
  --glow-glitch: 0 0 6px rgba(0, 0, 0, 0.25);
  --glow-glitch-soft: 0 0 6px rgba(0, 0, 0, 0.2);
  --flicker-soft: 0.006;
  --flicker-medium: 0.012;
  --flicker-peak: 0.022;
  --scanline: repeating-linear-gradient(180deg,
      rgba(0, 0, 0, 0.08) 0 2px,
      rgba(0, 0, 0, 0) 2px 4px);
}

html.theme-transition,
html.theme-transition * {
  transition:
    color 320ms ease,
    background-color 320ms ease,
    border-color 320ms ease,
    box-shadow 320ms ease,
    text-shadow 320ms ease,
    filter 320ms ease,
    stroke 320ms ease,
    fill 320ms ease;
}

html {
  font-size: var(--base-font-size);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  margin: 0;
  padding: 20px 32px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--color-text);
  background: var(--color-bg);
  text-shadow: var(--glow-depth);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--scanline);
  opacity: 0.35;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: #000;
  opacity: 0;
  animation: screen-flicker var(--flicker-duration) linear infinite;
}

.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;
}

[hidden] {
  display: none !important;
}

.page-status {
  margin: 24px 0;
  padding: 12px;
  border: 1px solid var(--color-border-muted);
  color: var(--color-text-muted);
}

.page-status__action {
  border: 1px solid var(--color-border-muted);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  padding: 4px 10px;
}

.page-status__action:hover,
.page-status__action:focus-visible {
  border-color: var(--color-accent-active);
  color: var(--color-accent-active);
}

.terminal {
  width: 100%;
  max-width: 1024px;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
  margin: 0 auto;
  background:
    /*#1a1a1a;*/
    transparent;
  padding: 0 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border:
    /*1px solid #2b2b2b;*/
    none;
  box-shadow:
    /*0 0 0 2px #0f0f0f, 0 0 24px rgba(0, 0, 0, 0.6);*/
    none;
}

.system-brand {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 13px 15px;
  border: 1px solid var(--color-frame);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  text-transform: uppercase;
  text-shadow: none;
  box-sizing: border-box;
  box-shadow:
    inset 0 0 0 3px var(--color-bg),
    inset 0 0 0 4px var(--color-frame);
}

.terminal .system-brand__mark {
  width: 54px;
  height: 54px;
  min-height: 54px;
  display: grid;
  place-content: center;
  border: 1px solid currentColor;
  color: var(--color-brand);
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.terminal .system-brand__mark:hover,
.terminal .system-brand__mark:focus-visible {
  color: var(--color-accent-active);
  outline: 1px solid currentColor;
  outline-offset: 3px;
  text-decoration: none;
}

.system-brand__mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg,
      currentColor 0 1px,
      transparent 1px 4px);
  opacity: 0.2;
}

.system-brand__monogram {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 0.12em;
  padding-left: 0.12em;
  text-shadow: 0 0 2px var(--color-bg);
}

.system-brand__data {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}

.system-brand__data p {
  margin: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-brand__title {
  font-size: 0.82rem;
  line-height: 1.3;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
}

.system-brand__status {
  font-size: 0.68rem;
  line-height: 1.3;
  letter-spacing: 0.12em;
  color: var(--color-text-dim);
  opacity: 0.86;
}

.system-brand__status span {
  color: var(--color-console-green);
  opacity: 0.92;
}

.system-brand__controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--color-text-muted);
}

.system-brand__date {
  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0.1em;
  white-space: nowrap;
  opacity: 0.82;
}

.system-brand__theme {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--color-brand);
  font: inherit;
  cursor: pointer;
}

.system-brand__theme:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

.system-brand__theme .lamp-icon {
  width: 24px;
  height: 24px;
  color: currentColor;
}

.system-brand__theme:hover .lamp-icon,
.system-brand__theme:focus-visible .lamp-icon {
  color: var(--color-accent-active);
  transform: scale(1.06);
}

.terminal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 24px;
  border: 1px solid var(--color-frame);
  background: var(--color-bg);
  box-sizing: border-box;
  box-shadow:
    inset 0 0 0 3px var(--color-bg),
    inset 0 0 0 4px var(--color-frame);
}

.menu-connector {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  opacity: 0.7;
  --connector-stroke: var(--color-border-muted);
}

.menu-connector path {
  fill: none;
  stroke: var(--connector-stroke);
  stroke-width: 1px;
  shape-rendering: crispEdges;
}

h1,
h2 {
  margin: 0 0 16px 0;
  font-weight: normal;
  color: var(--color-text-strong);
  margin-left: 5px;
  font-family: var(--font-display);
  text-shadow: var(--glow-calc);
}

h1 {
  font-size: 1.85rem;
  letter-spacing: 0.05em;
}

.lamp-icon {
  display: inline-block;
  position: relative;
  width: 1.7em;
  height: 1.7em;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: var(--color-text-bright);
  opacity: 0.9;
  box-sizing: border-box;
  transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
}

.lamp-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  line-height: 1;
  text-shadow: 0 0 6px currentColor;
}

.lamp-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 16%;
  width: 62%;
  height: 58%;
  border: 1px solid currentColor;
  border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.lamp-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 42%;
  height: 14%;
  border: 1px solid currentColor;
  border-radius: 2px;
  transform: translateX(-50%);
  box-sizing: border-box;
}

h2 {
  font-size: 1.15rem;
  color: var(--color-text-soft);
}

.project-title {
  font-size: 1.6rem;
  color: var(--color-text-bright);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: bold;
  text-shadow: var(--glow-calc);
  text-align: right;
  font-family: var(--font-display);
}

.arc {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-arc);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: right;
  gap: 12px;
  border-right: 3px solid var(--color-border-accent);
  padding-right: 10px;
  font-family: var(--font-display);
  text-shadow: var(--glow-calc);
}

.arc::before {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg,
      var(--color-border-muted) 0 8px,
      transparent 8px 14px);
}

p {
  margin: 0 0 12px 0;
  text-align: justify;
  font-size: 0.98rem;
  text-shadow: var(--glow-calc);
}

.timeline-item {
  margin: 0 0 18px 0;
}

.timeline-item summary {
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-soft);
  box-sizing: border-box;
  margin: 3px 6px 8px;
  padding-left: 20px;
  padding-right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  white-space: nowrap;
  font-family: var(--font-display);
  text-shadow: var(--glow-calc);
  z-index: 0;
  isolation: isolate;
}

.timeline-item summary .summary-type {
  color: var(--color-text-weak);
  padding: 0 6px;
  border: 1px solid var(--color-border-muted);
  border-radius: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: opacity 140ms ease;
}

.timeline-item summary .summary-fixed {
  display: inline-block;
  margin-left: 5px;
  flex: 0 0 auto;
}

.timeline-item summary .summary-move {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.timeline-item summary .summary-content {
  display: inline-block;
}

.timeline-item summary.is-overflow .summary-move {
  animation: marquee-left 10.5s linear infinite;
  animation-delay: 0.5s;
}

.timeline-item summary .summary-clip {
  display: block;
  margin-left: 3px;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.timeline-item summary .summary-clip::after {
  content: attr(data-glitch);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-text-glitch);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: var(--glow-glitch);
}

.timeline-item summary .summary-clip.glitch-on::after {
  opacity: 0.9;
  animation: glitch-flicker 240ms steps(1, end);
}

.glitch-target {
  position: relative;
}

.section-title.glitch-target {
  display: inline-block;
}

.glitch-target::after {
  content: attr(data-glitch);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  color: currentColor;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  text-align: inherit;
  text-shadow: var(--glow-glitch-soft);
}

.glitch-target.glitch-on::after {
  opacity: 0.9;
  animation: glitch-flicker 240ms steps(1, end);
}

.timeline-item summary::marker {
  color: var(--color-text-dim);
}

.timeline-item summary::-webkit-details-marker {
  display: none;
}

.timeline-item summary::before {
  content: "⟜";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-dim);
}

.timeline-item[open] summary::before {
  content: "⟟";
  color: var(--color-text-strong);
}

.timeline-item[open] summary {
  color: var(--color-text-strong);
}

.timeline-item summary:hover,
.timeline-item summary:focus-visible {
  color: var(--color-accent-active);
}

.timeline-item summary::after {
  content: "";
  position: absolute;
  inset: -3px -6px;
  border: 1px solid var(--color-border-muted);
  border-radius: 0;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0ms linear, border-color 40ms linear;
  z-index: -1;
}

.timeline-item summary:hover::after,
.timeline-item summary:focus-visible::after {
  border-color: var(--color-accent-active);
  background: var(--color-bg-mid);
  opacity: 1;
}

.timeline-item[open] summary::after {
  border-color: var(--color-border-muted);
  background: var(--color-bg-soft);
  opacity: 0.55;
}

.timeline-item[open] summary:hover,
.timeline-item[open] summary:focus-visible {
  color: var(--color-accent-active);
}

.timeline-item[open] summary:hover::after,
.timeline-item[open] summary:focus-visible::after {
  border-color: var(--color-accent-active);
  background: var(--color-bg-mid);
  opacity: 1;
}

.timeline-item summary:hover::before,
.timeline-item summary:focus-visible::before,
.timeline-item summary:hover .summary-type,
.timeline-item summary:focus-visible .summary-type {
  border-color: var(--color-accent-active);
  color: var(--color-accent-active);
}

.timeline-item .content {
  margin-top: 6px;
}

.video {
  margin: 8px 0 20px 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 8px;
}

.video--plain {
  border: 0;
  background: transparent;
  padding: 0;
}

.video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0 6px;
}

.media-gallery__item {
  margin: 0;
  border: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.media-gallery__item img,
.media-gallery__item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.audio-player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  background: linear-gradient(90deg,
      var(--audio-gradient-strong) 0%,
      var(--audio-gradient-mid) 50%,
      var(--audio-gradient-strong) 100%);
  position: relative;
}

.audio-player::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--scanline);
  opacity: 0.35;
}

.audio-toggle {
  width: 32px;
  height: 28px;
  border: 1px solid var(--color-border-muted);
  background: var(--color-bg);
  color: var(--color-text-soft);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  text-align: center;
}

.audio-toggle::before {
  display: block;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
}

.audio-toggle[data-state="play"]::before {
  content: "▶";
  transform: translateX(1px);
}

.audio-toggle[data-state="pause"]::before {
  content: "❚❚";
  font-size: 0.6rem;
}

.audio-toggle:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-strong);
}

.audio-bar {
  position: relative;
  height: 6px;
  background: var(--color-bg-mid);
  border: 1px solid var(--color-border-strong);
  cursor: pointer;
  overflow: hidden;
}

.audio-bar-fill {
  position: absolute;
  inset: 0;
  background: var(--color-bar-fill);
  transform-origin: left;
  transform: scaleX(0);
  opacity: 0.7;
}

.audio-bar-head {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 12px;
  background: var(--color-bar-head);
  border: 1px solid var(--color-border);
  transform: translateX(-50%);
}

.audio-time {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.audio-element {
  display: none;
}

.line {
  color: var(--color-text-line);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.type-section {
  position: relative;
}

.typewriter-ready [data-typewriter-show] {
  transition: opacity 160ms ease;
}

.typewriter-ready [data-typewriter-show].typewriter-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 16px;
  border: 1px solid var(--color-border-muted);
  color: var(--color-text-soft);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-family: inherit;
}

.section-icon::before {
  content: "[ ]";
}

.type-section.is-typing .section-icon::before {
  animation: decompress-icon 5s steps(1, end) infinite;
}

.type-section.is-typing .section-icon--loop::before {
  animation: loop-arrows 1.1s steps(1, end) infinite;
}

.type-section.is-loaded .section-icon::before {
  content: "[OK]";
}

.type-section.is-loaded .section-icon--loop::before {
  content: "[>>>]";
  animation: none;
}

.section-icon--loop::before {
  content: "[>>>]";
  animation: none;
}

.name-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  min-height: 36px;
  margin-bottom: 16px;
  width: 100%;
}

.name-row h1 {
  margin: 0;
  margin-left: 5px;
  flex: 0 1 auto;
}

.name-menu {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.65rem;
  font-family: var(--font-display);
  color: var(--color-text-soft);
  text-shadow: var(--glow-calc);
}

.name-menu__items {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 28px;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border-muted);
  border-radius: 2.5px;
  color: inherit;
  cursor: pointer;
  align-self: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.menu-toggle {
  color: var(--color-accent-active);
  border-color: var(--color-accent-active);
  text-shadow: 0 0 8px currentColor;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  filter: drop-shadow(0 0 4px currentColor);
  opacity: 0.85;
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.name-menu__item {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.lamp-toggle {
  align-items: center;
  align-self: center;
}

.name-menu__item:focus-visible {
  outline: 1px solid var(--color-border-accent);
  outline-offset: 3px;
}

.name-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--color-text-soft);
  font-size: 0.95rem;
  line-height: 1;
}

.name-icon::before {
  content: "|";
  display: inline-block;
  animation: name-spin 20s steps(4, end) infinite;
  transform-origin: center;
}

.project-title .name-icon {
  margin-left: 12px;
}

.nav-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-soft);
  text-shadow: var(--glow-calc);
}

.nav-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-hint {
  display: grid;
  grid-template-columns: repeat(3, 18px);
  grid-template-rows: repeat(2, 18px);
  gap: 6px;
  align-items: center;
  justify-items: center;
  color: var(--color-text-soft);
  text-shadow: var(--glow-calc);
}

.nav-hint .nav-key,
.nav-key--enter {
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border-muted);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  background: var(--color-bg);
  color: var(--color-text-soft);
}

.nav-key--enter {
  width: 54px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.nav-hint .nav-key:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.nav-hint .nav-key:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.nav-hint .nav-key:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.nav-hint .nav-key:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.section-line {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  text-shadow: var(--glow-calc);
}

.section-title {
  text-decoration: underline;
  text-decoration-thickness: 0.1px;
  text-underline-offset: 6px;
}

.section-title--reset {
  cursor: pointer;
}

.section-title--reset:hover,
.section-title--reset:focus-visible {
  color: var(--color-accent-active);
  outline: none;
}

.section-line .line-fill {
  opacity: 0.6;
}

.text-index-control {
  position: relative;
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  width: fit-content;
  margin-left: -3px;
  color: var(--color-text-soft);
}

.text-index-control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 7px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
  transform-origin: center;
  transition: transform 160ms ease, color 160ms ease;
}

.text-index-control:has(.text-index-select:open)::after {
  color: var(--color-text-strong);
  transform: translateY(-30%) rotate(225deg);
}

.text-index-select {
  width: auto;
  height: 34px;
  padding: 4px 20px 4px 6px;
  border: 1px solid var(--color-border-muted);
  border-radius: 0;
  background: var(--color-bg);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-bg-soft);
  appearance: none;
  field-sizing: content;
  transition: border-color 120ms ease, color 120ms ease;
}

.text-index-select:hover,
.text-index-select:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-text-strong);
  outline: none;
}

.text-index-select option {
  min-height: 30px;
  padding: 6px 10px;
  background-color: var(--color-bg);
  color: var(--color-text-soft);
  font-weight: 600;
  line-height: 1.45;
}

.text-index-select option:checked {
  background-color: var(--color-bg-soft);
  color: var(--color-text-strong);
}

.text-index-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 24px;
}

.text-index-list__group {
  min-width: 0;
}

.text-index-list__heading {
  margin: 0 0 6px;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.text-index-list__item {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--color-border-muted);
  border-radius: 0;
  background: var(--color-bg-soft);
  color: var(--color-text-soft);
  font: inherit;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.text-index-list__item:hover,
.text-index-list__item:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-text-strong);
  outline: none;
}

.text-index-list__icon {
  color: var(--color-brand);
  font-size: 1rem;
  line-height: 1;
  transition: color 120ms ease;
}

.text-index-list__item:hover .text-index-list__icon,
.text-index-list__item:focus-visible .text-index-list__icon {
  color: var(--color-accent-active);
}

.text-essay {
  margin-top: 0;
}

.text-essay p:last-child {
  margin-bottom: 0;
}

.information-copy {
  font-size: 0.88rem;
  line-height: 1.55;
}

.note-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-soft);
  text-align: left;
}

.note-label__icon {
  color: inherit;
  font-size: 1rem;
  line-height: 1;
}

.text-attribution {
  text-align: right;
}

html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]),
html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]) body {
  height: 100%;
  overflow: hidden;
}

html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]) .terminal {
  height: calc(100dvh - 40px);
  min-height: 0;
}

html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]) .terminal-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]) #cabecera {
  flex: 0 0 auto;
}

html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]) [data-page-container] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.indexed-page {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.indexed-page .text-section-line {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-bottom: 24px;
}

.indexed-page .text-content-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.indexed-page .text-content-scroll > [data-text-view],
.indexed-page .text-content-scroll > .text-index-list {
  box-sizing: border-box;
  padding: 0 4px 18px;
}

.indexed-page .text-content-scroll.has-scrollbar > [data-text-view],
.indexed-page .text-content-scroll.has-scrollbar > .text-index-list {
  padding-right: 28px;
}

.indexed-page .text-content-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.indexed-page .text-scrollbar {
  position: absolute;
  right: 0;
  display: flex;
  width: 12px;
  min-height: 56px;
  flex-direction: column;
  align-items: stretch;
  color: var(--color-brand);
  touch-action: none;
  z-index: 1;
}

.indexed-page .text-scrollbar__button {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.indexed-page .text-scrollbar__button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.indexed-page .text-scrollbar__button--up::before {
  transform: translate(-50%, -50%) rotate(225deg);
}

.indexed-page .text-scrollbar__button--down::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.indexed-page .text-scrollbar__button:hover,
.indexed-page .text-scrollbar__button:focus-visible {
  color: var(--color-accent-active);
  outline: none;
}

.indexed-page .text-scrollbar__button:disabled {
  color: var(--color-text-dim);
  cursor: default;
  opacity: 0.55;
}

.indexed-page .text-scrollbar__track {
  position: relative;
  min-height: 28px;
  flex: 1 1 auto;
  cursor: pointer;
  outline: none;
}

.indexed-page .text-scrollbar__thumb {
  position: absolute;
  top: 0;
  left: 2px;
  width: 8px;
  min-height: 28px;
  border: 1px solid var(--color-bg);
  border-radius: 0;
  background: var(--color-brand);
  box-shadow: inset 0 0 0 1px var(--color-border-accent);
  box-sizing: border-box;
  pointer-events: auto;
  transform: translateY(0);
}

.indexed-page .text-scrollbar__track:hover .text-scrollbar__thumb,
.indexed-page .text-scrollbar__track:focus-visible .text-scrollbar__thumb {
  background: var(--color-accent-active);
}

.indexed-page [data-text-view] p {
  font-size: 0.88rem;
  line-height: 1.55;
}

.section-line--spaced {
  margin-bottom: 24px;
}

.prompt {
  color: var(--color-text-soft);
  margin-right: 8px;
  text-shadow: var(--glow-calc);
}

.line-fill {
  flex: 1;
  height: 10px;
  border-radius: 0;
  background: repeating-linear-gradient(90deg,
      var(--color-bg-soft) 0 10px,
      var(--color-bg-mid) 10px 16px);
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  opacity: 0.7;
}

.terminal a {
  color: var(--color-text-soft);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.terminal a:hover,
.terminal a:focus-visible {
  color: var(--color-text-strong);
}

.terminal .name-menu__item {
  text-decoration: none;
}

.terminal .name-menu__item.is-active {
  color: var(--color-accent-active);
  text-shadow: 0 0 8px currentColor;
  position: relative;
}

.terminal .name-menu__item.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  opacity: 0.9;
}

.terminal .name-menu__item.lamp-toggle:hover .lamp-icon,
.terminal .name-menu__item.lamp-toggle:focus-visible .lamp-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px currentColor);
}

.new-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  color: var(--color-accent-active);
  font-size: 0.75em;
  line-height: 1;
  box-sizing: border-box;
  letter-spacing: 0;
  text-shadow: 0 0 8px currentColor;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
  animation: new-flag-pulse 2.6s ease-in-out infinite;
}

.name-menu .new-flag {
  margin-left: -6px;
  text-decoration: none;
}

.page-section.is-active-page .text-index-control {
  color: var(--color-accent-active);
  text-shadow: 0 0 8px currentColor;
}

.page-section.is-active-page .text-index-select {
  border-color: var(--color-accent-active);
}

.home-menu__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.terminal .home-menu__item {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--color-border-muted);
  color: var(--color-text-soft);
  background: var(--color-bg-soft);
  text-decoration: none;
  box-sizing: border-box;
  font-family: var(--font-display);
  text-shadow: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
  transition:
    border-color 120ms ease,
    color 120ms ease,
    background-color 120ms ease;
}

.terminal .home-menu__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scanline);
  opacity: 0.16;
  pointer-events: none;
}

.terminal .home-menu__item:hover,
.terminal .home-menu__item:focus-visible {
  border-color: var(--color-accent-active);
  color: var(--color-accent-active);
  background: var(--color-bg-mid);
  outline: none;
}

.home-menu__label {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.home-menu__icon {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 19px;
  height: 19px;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.72;
  transition: transform 120ms ease, opacity 120ms ease, filter 120ms ease;
}

.home-menu__item:hover .home-menu__icon,
.home-menu__item:focus-visible .home-menu__icon {
  opacity: 1;
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 0 3px currentColor);
}

@keyframes new-flag-pulse {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px currentColor);
  }

  55% {
    opacity: 0.5;
    filter: drop-shadow(0 0 1px currentColor);
  }
}



@media (max-width: 640px) {
  :root {
    --base-font-size: 17px;
  }

  body {
    padding: 12px 0;
  }

  html:is([data-active-page="archivos"], [data-active-page="proyectos-musicales"]) .terminal {
    height: calc(100dvh - 24px);
  }

  .terminal {
    max-width: 100%;
    min-height: calc(100vh - 24px);
    min-height: calc(100dvh - 24px);
    padding: 0 10px;
    background: transparent;
  }

  .system-brand {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 9px;
    margin-bottom: 0;
    padding: 4px 4px 12px;
    border: 0;
    border-bottom: 3px double var(--color-frame);
    box-shadow: none;
  }

  .terminal .system-brand__mark {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .system-brand__monogram {
    font-size: 1.05rem;
  }

  .system-brand__title {
    font-size: 0.68rem;
  }

  .system-brand__status {
    font-size: 0.56rem;
  }

  .system-brand__controls {
    grid-column: 3;
    justify-content: flex-end;
    gap: 8px;
  }

  .system-brand__date {
    font-size: 0.56rem;
  }

  .system-brand__theme {
    width: 24px;
    height: 24px;
  }

  .system-brand__theme .lamp-icon {
    width: 20px;
    height: 20px;
  }

  .terminal-body {
    padding: 12px 4px 0;
    border: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 1.6rem;
    letter-spacing: 0.04em;
  }

  h2 {
    font-size: 1.05rem;
  }

  .project-title {
    font-size: 1.35rem;
    letter-spacing: 0.12em;
  }

  .arc {
    gap: 8px;
    border-right: 2px solid var(--color-border-accent);
  }

  .line {
    gap: 8px;
  }

  .text-section-line {
    flex-wrap: nowrap;
  }

  .text-section-line .line-fill {
    min-width: 24px;
  }

  .text-index-control {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .text-index-select {
    height: 32px;
    font-size: 0.72rem;
  }

  .text-index-list {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .section-icon {
    width: 40px;
    font-size: 0.65rem;
  }

  .name-row {
    gap: 12px;
    align-items: center;
    min-height: 32px;
  }

  .name-menu {
    gap: 10px;
    font-size: 0.6rem;
    align-items: center;
    align-self: center;
    position: relative;
  }

  .menu-toggle {
    display: inline-flex;
    width: 2em;
    height: 2em;
    align-self: center;
  }

  .menu-toggle span {
    width: 14px;
  }

  .lamp-toggle {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
  }

  .lamp-icon {
    width: 1.9em;
    height: 1.9em;
  }

  .name-menu__items {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    margin-top: 0;
    padding: 8px 10px;
    border: 1px solid var(--color-border-muted);
    background: var(--color-bg-soft);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
    z-index: 2;
  }

  .name-menu__item {
    justify-content: flex-start;
    text-align: left;
  }

  .menu-open .name-menu__items {
    display: flex;
  }

  .menu-open .name-menu__item {
    align-items: center;
  }

  .menu-open .name-menu .new-flag {
    align-self: center;
  }

  .name-icon {
    width: 16px;
    height: 16px;
    font-size: 0.85rem;
  }

  .nav-hint {
    grid-template-columns: repeat(3, 16px);
    grid-template-rows: repeat(2, 16px);
    gap: 4px;
  }

  .nav-hint .nav-key,
  .nav-key--enter {
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
  }

  .nav-key--enter {
    width: 46px;
    font-size: 0.65rem;
  }

  .nav-controls {
    gap: 8px;
  }

  .nav-label {
    font-size: 0.65rem;
  }

  .line-fill {
    height: 8px;
  }

  .terminal .home-menu__item {
    min-height: 50px;
    padding: 8px 11px;
  }

  .home-menu__grid {
    grid-template-columns: 1fr;
  }

  .home-menu__label {
    font-size: 0.92rem;
    letter-spacing: 0.12em;
  }

  .timeline-item summary {
    font-size: 1rem;
    text-align: left;
    position: relative;
    padding-right: 10px;
  }

  .timeline-item summary .summary-clip {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .timeline-item summary .summary-move {
    display: inline-flex;
    padding-right: 24px;
  }

  .audio-player {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
  }

  .audio-time {
    grid-column: auto;
    text-align: right;
    font-size: 0.8rem;
  }
}

@keyframes marquee-left {
  0% {
    transform: translateX(0);
  }

  6.98% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-1 * var(--marquee-distance)));
  }
}

@keyframes glitch-flicker {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }

  20% {
    opacity: 0.9;
    transform: translate(1px, -1px);
  }

  40% {
    opacity: 0.4;
    transform: translate(-1px, 1px);
  }

  60% {
    opacity: 0.8;
    transform: translate(2px, 0);
  }

  100% {
    opacity: 0;
    transform: translate(0, 0);
  }
}

@keyframes screen-flicker {

  0%,
  100% {
    opacity: 0;
  }

  2% {
    opacity: var(--flicker-soft);
  }

  2.6% {
    opacity: 0;
  }

  8% {
    opacity: var(--flicker-medium);
  }

  8.6% {
    opacity: 0;
  }

  18% {
    opacity: var(--flicker-soft);
  }

  18.6% {
    opacity: 0;
  }

  44% {
    opacity: var(--flicker-peak);
  }

  44.7% {
    opacity: 0;
  }

  62% {
    opacity: var(--flicker-medium);
  }

  62.6% {
    opacity: 0;
  }

  81% {
    opacity: var(--flicker-soft);
  }

  81.6% {
    opacity: 0;
  }
}

@keyframes decompress-icon {
  0% {
    content: "[ ]";
  }

  20% {
    content: "[> ]";
  }

  40% {
    content: "[>>]";
  }

  60% {
    content: "[>>>]";
  }

  80% {
    content: "[>>]";
  }

  100% {
    content: "[> ]";
  }
}

@keyframes loop-arrows {
  0% {
    content: "[>  ]";
  }

  33% {
    content: "[>> ]";
  }

  66% {
    content: "[>>>]";
  }

  100% {
    content: "[>> ]";
  }
}

@keyframes name-spin {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(90deg);
  }

  50% {
    transform: rotate(180deg);
  }

  75% {
    transform: rotate(270deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .text-index-control::after,
  .text-index-select,
  .home-menu__icon {
    transition: none;
  }

  .timeline-item summary .summary-move {
    animation: none;
  }

  .section-icon::before,
  .section-icon--loop::before,
  .name-icon::before {
    animation: none;
  }

  body::after {
    animation: none;
  }

  .new-flag,
  .glitch-target::after,
  .summary-clip::after {
    animation: none;
  }

  html.theme-transition,
  html.theme-transition * {
    transition: none;
  }
}
