* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #10161d;
  --panel-2: #0b1016;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #3fb950;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --yellow: #d29922;
  --red: #f85149;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, rgba(88, 166, 255, 0.07), transparent 38%),
    var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
}

a {
  color: var(--blue);
}

.terminal-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 24px;
}

.terminal-window {
  min-height: 76vh;
  overflow: hidden;
  background: rgba(11, 16, 22, 0.97);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.015) inset;
}

.terminal-titlebar {
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: #161b22;
  border-bottom: 1px solid #252d36;
}

.window-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.window-dot.red {
  background: #ff5f57;
}

.window-dot.yellow {
  background: #febc2e;
}

.window-dot.green {
  background: #28c840;
}

.terminal-title {
  color: #9aa4af;
  font-size: 0.78rem;
  text-align: center;
}

.terminal-home-link {
  justify-self: end;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.terminal-home-link:hover {
  color: #56d364;
}

.terminal-output {
  min-height: calc(76vh - 96px);
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 22px 22px 8px;
  scrollbar-width: thin;
  scrollbar-color: #30363d transparent;
}

.terminal-output::-webkit-scrollbar {
  width: 10px;
}

.terminal-output::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 999px;
}

.output-line {
  margin: 0 0 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.52;
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
}

.output-line.command {
  margin-top: 10px;
  color: #c9d1d9;
}

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

.output-line.green {
  color: var(--green);
}

.output-line.blue {
  color: var(--blue);
}

.output-line.purple {
  color: var(--purple);
}

.output-line.yellow {
  color: var(--yellow);
}

.output-line.red {
  color: var(--red);
}

.output-line.bold {
  color: #f0f6fc;
  font-weight: 700;
}

.output-line a {
  color: var(--blue);
  text-decoration: none;
}

.output-line a:hover {
  text-decoration: underline;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 22px 14px;
}

.terminal-prompt {
  flex: 0 0 auto;
  color: var(--green);
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
}

.terminal-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  color: #f0f6fc;
  background: transparent;
  border: 0;
  outline: 0;
  caret-color: var(--green);
  font: inherit;
  font-size: clamp(0.78rem, 1.1vw, 0.92rem);
}

.terminal-hint {
  margin-top: 12px;
  color: #6e7681;
  font-size: 0.74rem;
  text-align: center;
}

.terminal-hint code {
  color: #9aa4af;
}

.neofetch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  margin: 10px 0 8px;
}

.neofetch-logo {
  color: var(--green);
  white-space: pre;
  line-height: 1.15;
}

.neofetch-info {
  min-width: 0;
}

.neofetch-info div {
  margin-bottom: 3px;
}

.neofetch-label {
  color: var(--blue);
  font-weight: 700;
}

.matrix-line {
  color: var(--green);
  opacity: 0.9;
  letter-spacing: 0.08em;
}

@media (max-width: 700px) {
  .terminal-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .terminal-titlebar {
    grid-template-columns: auto 1fr auto;
    padding: 0 10px;
  }

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

  .terminal-output {
    min-height: calc(78vh - 96px);
    max-height: calc(100vh - 150px);
    padding: 16px 14px 6px;
  }

  .terminal-input-row {
    padding: 8px 14px 12px;
    gap: 7px;
  }

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

  .neofetch-logo {
    font-size: 0.72rem;
  }
}

/* =========================================================
   Workstation scene
   Keeps the real interactive terminal positioned on the
   monitor while the desk, keyboard and trinkets are artwork.
   ========================================================= */

body.rl-has-site-nav {
  background: #080d13;
}

.terminal-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.terminal-workstation {
  position: relative;
  width: min(100%, 1600px);
  aspect-ratio: 1536 / 964;
  margin: 0 auto;
  overflow: hidden;
  background-image: url('/assets/terminal-workstation.webp');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
}

.terminal-workstation .terminal-window {
  position: absolute;
  left: 20.25%;
  top: 5.55%;
  width: 62.1%;
  height: 54.2%;
  min-height: 0;
  border-radius: 9px;
  border-color: rgba(48, 54, 61, 0.76);
  background: rgba(8, 14, 20, 0.975);
  box-shadow: none;
}

.terminal-workstation .terminal-titlebar {
  height: 7.7%;
  min-height: 34px;
  padding: 0 14px;
  background: rgba(22, 27, 34, 0.98);
}

.terminal-workstation .terminal-output {
  position: absolute;
  inset: 7.7% 0 8.8% 0;
  min-height: 0;
  max-height: none;
  padding: clamp(12px, 1.35vw, 22px) clamp(12px, 1.35vw, 22px) 6px;
}

.terminal-workstation .terminal-input-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0;
  height: 8.8%;
  padding: 4px clamp(12px, 1.35vw, 22px) 7px;
}

.terminal-workstation .output-line,
.terminal-workstation .terminal-prompt,
.terminal-workstation .terminal-input {
  font-size: clamp(0.64rem, 0.82vw, 0.88rem);
}

.terminal-workstation .terminal-hint {
  position: absolute;
  left: 20.25%;
  top: 58.9%;
  width: 62.1%;
  margin: 0;
  color: rgba(205, 214, 224, 0.68);
  font-size: clamp(0.58rem, 0.68vw, 0.73rem);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

@media (max-width: 900px) {
  .terminal-shell {
    width: min(100% - 18px, 1180px);
    margin: 0 auto;
    padding: 12px 0 18px;
  }

  .terminal-workstation {
    aspect-ratio: auto;
    min-height: calc(100vh - 88px);
    overflow: visible;
    background-image: none;
  }

  .terminal-workstation .terminal-window {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 76vh;
    border-radius: 14px;
    box-shadow:
      0 28px 80px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.015) inset;
  }

  .terminal-workstation .terminal-titlebar {
    height: 48px;
  }

  .terminal-workstation .terminal-output {
    position: relative;
    inset: auto;
    min-height: calc(76vh - 96px);
    max-height: calc(100vh - 190px);
    padding: 16px 14px 6px;
  }

  .terminal-workstation .terminal-input-row {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    height: auto;
    min-height: 48px;
    padding: 8px 14px 12px;
  }

  .terminal-workstation .output-line,
  .terminal-workstation .terminal-prompt,
  .terminal-workstation .terminal-input {
    font-size: clamp(0.78rem, 1.1vw, 0.92rem);
  }

  .terminal-workstation .terminal-hint {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin-top: 12px;
    font-size: 0.74rem;
  }
}

/* =========================================================
   Workstation scene sizing pass v1.1
   Enlarges the artwork to fill the viewport below navigation
   and aligns the live terminal more tightly to the monitor.
   ========================================================= */
@media (min-width: 901px) {
  .terminal-shell {
    height: calc(100vh - 54px);
    min-height: 720px;
    overflow: hidden;
  }

  .terminal-workstation {
    width: 100vw;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
    background-size: cover;
    background-position: center top;
  }

  .terminal-workstation .terminal-window {
    left: 26.55%;
    top: 5.25%;
    width: 48.45%;
    height: 61.35%;
  }

  .terminal-workstation .terminal-titlebar {
    height: 7.45%;
  }

  .terminal-workstation .terminal-output {
    inset: 7.45% 0 7.75% 0;
    padding: clamp(10px, 0.9vw, 18px) clamp(12px, 1vw, 20px) 5px;
  }

  .terminal-workstation .terminal-input-row {
    height: 7.75%;
    padding: 3px clamp(12px, 1vw, 20px) 5px;
  }

  .terminal-workstation .output-line,
  .terminal-workstation .terminal-prompt,
  .terminal-workstation .terminal-input {
    font-size: clamp(0.68rem, 0.73vw, 0.88rem);
  }

  .terminal-workstation .terminal-hint {
    left: 26.55%;
    top: 65.1%;
    width: 48.45%;
  }
}

/* =========================================================
   Workstation scene alignment pass v1.2
   Fits the live terminal to the monitor's inner display and
   locks the desktop scene to the viewport (no page scrolling).
   ========================================================= */
@media (min-width: 901px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .terminal-shell {
    height: calc(100vh - 54px);
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .terminal-workstation {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .terminal-workstation .terminal-window {
    left: 19.65%;
    top: 5.75%;
    width: 62.75%;
    height: 57.65%;
    border-radius: 10px;
  }

  .terminal-workstation .terminal-titlebar {
    height: 8.4%;
  }

  .terminal-workstation .terminal-output {
    inset: 8.4% 0 8.6% 0;
    padding: clamp(10px, 0.85vw, 17px) clamp(14px, 1.05vw, 21px) 5px;
  }

  .terminal-workstation .terminal-input-row {
    height: 8.6%;
    padding: 3px clamp(14px, 1.05vw, 21px) 5px;
  }

  .terminal-workstation .terminal-hint {
    left: 19.65%;
    top: 61.55%;
    width: 62.75%;
  }
}

/* =========================================================
   Workstation scene alignment pass v1.3
   Extends the live terminal slightly downward so it covers
   the baked-in helper text at the bottom of the monitor art.
   ========================================================= */
@media (min-width: 901px) {
  .terminal-workstation .terminal-window {
    height: 60.45%;
    z-index: 3;
  }

  .terminal-workstation .terminal-hint {
    top: 62.15%;
    z-index: 4;
  }
}
