:root {
  color-scheme: dark;
  --bg: #1d2a35;
  --terminal: #1d2a35;
  --terminal-deep: #19252e;
  --line: rgba(203, 213, 225, 0.18);
  --line-strong: rgba(5, 206, 145, 0.28);
  --text: #cbd5e1;
  --muted: #b2bdcc;
  --dim: #64748b;
  --bright: #f8fafc;
  --primary: #05ce91;
  --secondary: #ff9d00;
  --cyan: #b2bdcc;
  --surface: rgba(25, 37, 46, 0.45);
  --surface-deep: rgba(16, 17, 22, 0.48);
  --surface-active: rgba(5, 206, 145, 0.055);
  --dash-line: rgba(203, 213, 225, 0.18);
  --accent-left: rgba(5, 206, 145, 0.58);
  --danger: #ff5f56;
  --warn: #ffbd2e;
  --ok: #27c93f;
  --page-bg:
    radial-gradient(circle at 18% 10%, rgba(5, 206, 145, 0.08), transparent 28rem),
    linear-gradient(145deg, #19252e 0%, #1d2a35 100%);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body[data-theme="blue-matrix"] {
  --bg: #101116;
  --terminal: #080b0d;
  --terminal-deep: #020403;
  --line: rgba(0, 255, 156, 0.22);
  --line-strong: rgba(0, 255, 156, 0.56);
  --text: #ffffff;
  --muted: #c7c7c7;
  --dim: #76ff9f;
  --primary: #00ff9c;
  --secondary: #60fdff;
  --cyan: #60fdff;
  --page-bg:
    radial-gradient(circle at 18% 10%, rgba(0, 255, 156, 0.14), transparent 28rem),
    linear-gradient(145deg, #030605 0%, #101116 100%);
}

body[data-theme="ubuntu"] {
  --bg: #2d0922;
  --terminal: #2d0922;
  --terminal-deep: #190513;
  --line: rgba(244, 120, 69, 0.28);
  --line-strong: rgba(128, 217, 50, 0.48);
  --text: #ffffff;
  --muted: #e1e9cc;
  --dim: #cdcdcd;
  --primary: #80d932;
  --secondary: #f47845;
  --cyan: #80d932;
  --page-bg:
    radial-gradient(circle at 20% 10%, rgba(244, 120, 69, 0.2), transparent 28rem),
    linear-gradient(145deg, #160310 0%, #2d0922 100%);
}

body[data-theme="espresso"] {
  --bg: #1b1918;
  --terminal: #1b1918;
  --terminal-deep: #131110;
  --line: rgba(210, 180, 140, 0.22);
  --line-strong: rgba(210, 150, 80, 0.48);
  --text: #d0c8c0;
  --muted: #c8b8a8;
  --dim: #8a7a6a;
  --primary: #d2964f;
  --secondary: #e6a85c;
  --cyan: #c8b8a8;
  --page-bg:
    radial-gradient(circle at 18% 10%, rgba(210, 150, 80, 0.12), transparent 28rem),
    linear-gradient(145deg, #131110 0%, #1b1918 100%);
}

body[data-theme="green-goblin"] {
  --bg: #0a1a0a;
  --terminal: #0a1a0a;
  --terminal-deep: #061006;
  --line: rgba(0, 255, 0, 0.18);
  --line-strong: rgba(0, 255, 0, 0.42);
  --text: #b0ffb0;
  --muted: #90dd90;
  --dim: #408040;
  --primary: #00ff00;
  --secondary: #80ff80;
  --cyan: #00ff00;
  --page-bg:
    radial-gradient(circle at 18% 10%, rgba(0, 255, 0, 0.1), transparent 28rem),
    linear-gradient(145deg, #061006 0%, #0a1a0a 100%);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #edf5f5;
  --terminal: #f8fbfb;
  --terminal-deep: #e4eeee;
  --line: rgba(31, 41, 55, 0.16);
  --line-strong: rgba(0, 119, 119, 0.5);
  --text: #1f2937;
  --muted: #405163;
  --dim: #647384;
  --bright: #111827;
  --primary: #007777;
  --secondary: #ff9d00;
  --cyan: #006d77;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-deep: rgba(247, 251, 251, 0.9);
  --surface-active: rgba(0, 119, 119, 0.12);
  --dash-line: rgba(31, 41, 55, 0.18);
  --accent-left: rgba(0, 119, 119, 0.68);
  --page-bg:
    radial-gradient(circle at 15% 10%, rgba(0, 119, 119, 0.12), transparent 30rem),
    linear-gradient(145deg, #dbe8e8 0%, #f4f8f8 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.workspace {
  min-height: 100vh;
  padding: clamp(14px, 2.5vw, 34px);
  display: grid;
  place-items: center;
}

.terminal {
  width: min(1280px, 100%);
  min-height: min(820px, calc(100vh - 28px));
  border: 1px solid rgba(203, 213, 225, 0.16);
  border-radius: 18px;
  overflow: hidden;
  background: var(--terminal);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.terminal-bar {
  height: 54px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--terminal-deep);
}

.window-controls {
  display: flex;
  gap: 8px;
}

.window-controls span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.window-controls span:nth-child(1) {
  background: var(--danger);
}

.window-controls span:nth-child(2) {
  background: var(--warn);
}

.window-controls span:nth-child(3) {
  background: var(--ok);
}

.terminal-title {
  display: flex;
  gap: 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.terminal-title strong {
  color: var(--primary);
  font-weight: 800;
}

.terminal-title span,
.terminal-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-status {
  display: flex;
  gap: 10px;
  color: var(--dim);
  font-size: 0.76rem;
}

.terminal-status span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
}

.terminal-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(min(820px, 100vh - 28px) - 54px);
}

.command-panel {
  border-right: 1px solid var(--line);
  padding: 18px;
  background:
    linear-gradient(rgba(203, 213, 225, 0.022) 1px, transparent 1px),
    var(--terminal-deep);
  background-size: 100% 28px;
}

.panel-label {
  margin: 0 0 14px;
  color: var(--secondary);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.command-panel button,
.command-panel a {
  width: 100%;
  display: block;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-deep);
  text-align: left;
  cursor: pointer;
}

.command-panel button::before,
.command-panel a::before {
  content: "$ ";
  color: var(--primary);
}

.command-panel button:hover,
.command-panel a:hover,
.command-panel button.active {
  border-color: var(--line-strong);
  color: var(--bright);
  background: var(--surface-active);
}

.screen {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  background:
    linear-gradient(rgba(203, 213, 225, 0.02) 1px, transparent 1px),
    var(--terminal);
  background-size: 100% 24px;
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    #ffffff 4px
  );
}

.output {
  position: relative;
  z-index: 1;
  height: calc(100vh - 170px);
  min-height: 612px;
  overflow-y: auto;
  padding-right: 10px;
  scroll-behavior: smooth;
}

.output::-webkit-scrollbar {
  width: 12px;
}

.output::-webkit-scrollbar-track {
  background: var(--terminal-deep);
}

.output::-webkit-scrollbar-thumb {
  background: var(--terminal-deep);
  border-radius: 6px;
}

.output::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}

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

.entry {
  margin: 0 0 20px;
  animation: entry-in 0.2s ease-out;
}

.prompt {
  margin-bottom: 8px;
  color: var(--text);
}

.host {
  color: var(--secondary);
  font-weight: 800;
}

.path {
  color: var(--primary);
  font-weight: 800;
}

.cmd {
  color: var(--bright);
}

.block {
  border-left: 2px solid var(--accent-left);
  padding-left: 16px;
  line-height: 1.62;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: start;
}

.ascii {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: clamp(0.58rem, 1vw, 0.82rem);
  line-height: 1.05;
  white-space: pre;
}

.portrait {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.05;
  white-space: pre;
}

.headline {
  margin: 0 0 8px;
  color: var(--bright);
  font-size: clamp(1.8rem, 4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.role {
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: clamp(0.95rem, 1.6vw, 1.18rem);
}

.summary {
  max-width: 840px;
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(0.9rem, 1.3vw, 1rem);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: var(--surface);
}

.metric strong {
  display: block;
  color: var(--primary);
  font-size: 1.34rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.table {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  border-bottom: 1px dashed var(--dash-line);
  padding-bottom: 8px;
}

.key {
  color: var(--secondary);
}

.value {
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.boot-cards {
  margin-top: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}

.card h3 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 1rem;
}

.card p,
.card ul {
  margin: 0;
  color: var(--text);
}

.card ul {
  padding-left: 18px;
}

.card li {
  margin: 6px 0;
}

.terminal-note {
  margin: 0;
  color: var(--text);
}

.separator {
  margin: 0.72rem 0;
  color: var(--muted);
}

.cmd-list {
  display: grid;
  gap: 0.28rem;
  margin: 0.3rem 0 1rem;
}

.cmd-list div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
}

.shortcut-list {
  display: grid;
  gap: 0.25rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline {
  display: grid;
  gap: 10px;
}

.job {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
}

.when {
  color: var(--dim);
}

.job strong {
  color: var(--bright);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.link-row a,
.link-row button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--primary);
  background: var(--surface);
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

.secondary {
  color: var(--secondary);
}

.primary {
  color: var(--primary);
}

.dim {
  color: var(--dim);
}

.prompt-line {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.hints {
  position: relative;
  z-index: 1;
  min-height: 1.4rem;
  color: var(--primary);
  font-size: 0.9rem;
}

.prompt-line label {
  flex: 0 0 auto;
}

.input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

#command-input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--bright);
  background: transparent;
  caret-color: var(--primary);
}

#command-input::placeholder {
  color: var(--dim);
}

.ghost-text {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  color: var(--dim);
  opacity: 0.45;
  white-space: pre;
  overflow: hidden;
}

.matrix-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.4s;
}

body[data-theme="blue-matrix"] .matrix-rain {
  opacity: 0.06;
}

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

  .matrix-rain {
    display: none;
  }
}

.neofetch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 24px;
}

.neofetch-logo {
  color: var(--primary);
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: pre;
}

.neofetch-info {
  display: grid;
  gap: 2px;
  font-size: 0.92rem;
  align-content: start;
}

.neofetch-info .nf-label {
  color: var(--primary);
  font-weight: 700;
}

.neofetch-colors {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.neofetch-colors span {
  width: 24px;
  height: 12px;
  border-radius: 2px;
}

.boot-line {
  color: var(--dim);
  font-size: 0.88rem;
  line-height: 1.7;
}

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

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

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.skill-tag {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text);
  font-size: 0.88rem;
  background: var(--surface);
}

.skill-tag.highlight {
  border-color: var(--line-strong);
  color: var(--primary);
}

.job-detail {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.job-detail li {
  margin: 3px 0;
}

.award-list {
  display: grid;
  gap: 6px;
}

.award-list div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .workspace {
    display: block;
    padding: 0;
  }

  .terminal {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .terminal-bar {
    grid-template-columns: auto 1fr;
  }

  .terminal-status {
    display: none;
  }

  .terminal-body {
    display: block;
  }

  .command-panel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  .panel-label {
    display: none;
  }

  .command-panel button,
  .command-panel a {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
  }

  .screen {
    padding: 14px;
  }

  .output {
    height: calc(100vh - 164px);
    min-height: 0;
    max-height: none;
  }

  .hero-grid,
  .metrics,
  .cards,
  .job,
  .row,
  .cmd-list div,
  .award-list div {
    grid-template-columns: 1fr;
  }

  .portrait {
    display: none;
  }

  .prompt-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  #command-input {
    width: 100%;
  }
}

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

  .ascii,
  .portrait {
    display: none;
  }
}

@media (max-width: 900px) {
  .command-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .command-panel::-webkit-scrollbar {
    display: none;
  }
}

@media print {
  body {
    color: #000;
    background: #fff;
  }

  .workspace {
    padding: 0;
  }

  .terminal {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .terminal-bar,
  .command-panel,
  .scanline,
  .prompt-line,
  .hints,
  .link-row {
    display: none !important;
  }

  .terminal-body {
    display: block;
  }

  .screen {
    padding: 0;
    background: #fff;
  }

  .output {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .block {
    border-left-color: #ccc;
  }

  .entry {
    break-inside: avoid;
  }

  .card {
    border-color: #ddd;
    background: #f9f9f9;
  }

  .metric {
    border-color: #ddd;
    background: #f9f9f9;
  }

  .skill-tag {
    border-color: #ddd;
    background: #f0f0f0;
  }

  .host,
  .path,
  .primary,
  .cmd {
    color: #000;
  }

  .secondary,
  .key {
    color: #555;
  }

  .muted,
  .dim,
  .when {
    color: #666;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .ascii,
  .portrait {
    display: none;
  }
}
