:root {
  --bg-deep: #02040c;
  --bg-mid: #07142b;
  --bg-soft: #102348;
  --line: #2f4c87;
  --line-bright: #9cc2ff;
  --text-main: #eaf1ff;
  --text-dim: #b5c7ee;
  --warn: #ffe58a;
  --selected-bg: #d7e6ff;
  --selected-text: #0f2758;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Mono", monospace;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 10%, rgba(156, 194, 255, 0.22), transparent 30%),
    radial-gradient(circle at 86% 85%, rgba(7, 30, 74, 0.55), transparent 35%),
    linear-gradient(160deg, var(--bg-deep), var(--bg-mid), var(--bg-soft));
  overflow-x: hidden;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(47, 76, 135, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 76, 135, 0.26) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  z-index: 0;
}

.ambient-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(4, 7, 18, 0.14),
    rgba(4, 7, 18, 0.14) 2px,
    transparent 2px,
    transparent 4px
  );
  animation: scan 6s linear infinite;
}

@keyframes scan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(4px);
  }
}

.boot-sequence {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.boot-window {
  width: min(900px, 100%);
  border: 2px solid var(--line-bright);
  background: rgba(3, 8, 20, 0.86);
  box-shadow: 0 0 0 1px rgba(156, 194, 255, 0.28), 0 30px 90px rgba(0, 0, 0, 0.45);
  padding: 1.5rem;
}

.boot-window h1 {
  font-family: "VT323", monospace;
  font-size: clamp(2.1rem, 5vw, 3rem);
  letter-spacing: 0.06em;
  margin: 0;
  color: #e8f0ff;
}

.boot-subtitle {
  margin-top: 0.4rem;
  margin-bottom: 1.3rem;
  color: var(--text-dim);
}

.boot-lines {
  min-height: 260px;
  max-height: 50vh;
  overflow: auto;
  border: 1px solid rgba(156, 194, 255, 0.5);
  background: rgba(2, 5, 14, 0.86);
  padding: 0.8rem;
  font-size: 0.92rem;
}

.boot-line {
  opacity: 0;
  transform: translateY(5px);
  animation: line-in 260ms ease forwards;
}

.boot-line.warn {
  color: var(--warn);
}

@keyframes line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none;
}

.grub-ui {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  gap: 0.9rem;
  animation: page-in 520ms ease;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.frame {
  border: 1px solid var(--line);
  background: rgba(5, 12, 27, 0.84);
  box-shadow: inset 0 0 0 1px rgba(156, 194, 255, 0.16);
}

.frame-header,
.frame-footer {
  padding: 0.75rem 1rem;
}

.frame-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.profile-btn {
  border: 1px solid rgba(156, 194, 255, 0.5);
  background: rgba(4, 12, 27, 0.84);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.profile-btn:hover {
  border-color: rgba(156, 194, 255, 0.8);
  background: rgba(8, 20, 40, 0.9);
}

.profile-btn:focus {
  outline: 2px solid rgba(156, 194, 255, 0.7);
  outline-offset: 2px;
}

.profile-thumbnail {
  display: block;
  font-size: 0.36rem;
  line-height: 1.1;
  color: var(--text-dim);
  white-space: pre;
  font-family: "Space Mono", monospace;
  opacity: 0;
  animation: fade-in 420ms ease 800ms forwards;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

.ascii-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
}

.ascii-modal.hidden {
  display: none;
}

.ascii-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
}

.ascii-modal-content {
  position: relative;
  z-index: 10000;
  background: rgba(5, 12, 27, 0.95);
  border: 2px solid rgba(156, 194, 255, 0.6);
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
  max-width: 90vw;
  max-height: 85vh;
  overflow: auto;
  animation: modal-in 260ms ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 140ms ease;
  z-index: 10001;
}

.modal-close:hover {
  color: rgba(156, 194, 255, 0.8);
}

.modal-close:focus {
  outline: 2px solid rgba(156, 194, 255, 0.7);
  outline-offset: 2px;
}

.ascii-art-full {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid rgba(156, 194, 255, 0.36);
  background: rgba(2, 6, 16, 0.9);
  color: var(--text-dim);
  font-family: "Space Mono", monospace;
  font-size: 0.5rem;
  line-height: 1.15;
  overflow: auto;
  white-space: pre;
}


.frame-header h2 {
  margin: 0;
  font-family: "VT323", monospace;
  font-size: clamp(1.7rem, 3.1vw, 2.4rem);
  letter-spacing: 0.09em;
}

.label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.status-pills span {
  border: 1px solid rgba(156, 194, 255, 0.4);
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
}

.layout {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1.3fr;
  gap: 0.9rem;
  flex: 1;
}

.frame-left,
.frame-center,
.frame-right {
  padding: 0.95rem;
}

h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-family: "VT323", monospace;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
}

ul {
  margin: 0;
  padding-left: 1rem;
}

ul + h3 {
  margin-top: 1rem;
}

li {
  margin-bottom: 0.38rem;
  color: var(--text-dim);
}

.grub-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(156, 194, 255, 0.35);
  background: rgba(3, 8, 21, 0.9);
}

.grub-entry {
  margin: 0;
  padding: 0.62rem 0.7rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(156, 194, 255, 0.2);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.grub-entry:last-child {
  border-bottom: 0;
}

.grub-entry.is-selected {
  color: var(--selected-text);
  background: var(--selected-bg);
}

.grub-entry:focus {
  outline: 2px solid rgba(156, 194, 255, 0.7);
  outline-offset: -2px;
}

.terminal-output {
  min-height: 170px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid rgba(156, 194, 255, 0.36);
  background: rgba(2, 6, 16, 0.9);
  padding: 0.6rem;
  margin-top: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.terminal-line {
  margin: 0.2rem 0;
  color: var(--text-dim);
}

.terminal-line.command {
  color: #e9f2ff;
}

.entry-content {
  min-height: 150px;
  border: 1px solid rgba(156, 194, 255, 0.36);
  background: rgba(4, 8, 19, 0.86);
  padding: 0.72rem;
  color: var(--text-main);
}

.entry-content p {
  margin: 0 0 0.4rem;
}

.hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 0;
}

.frame-footer p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
}

.frame-ascii {
  padding: 0.95rem;
}

.ascii-art {
  margin: 0.6rem 0 0;
  padding: 0.7rem;
  border: 1px solid rgba(156, 194, 255, 0.36);
  background: rgba(2, 6, 16, 0.9);
  color: var(--text-dim);
  font-family: "Space Mono", monospace;
  font-size: 0.56rem;
  line-height: 1.15;
  overflow: auto;
  white-space: pre;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .terminal-output {
    max-height: 200px;
  }
}
