/* Tokyo Night visual layer for Jarod Roberts' systems engineering portfolio. */
:root {
  --tokyo-bg: #0c0c0c;
  --tokyo-surface: #24283b;
  --tokyo-text: #c0caf5;
  --tokyo-blue: #7aa2f7;
  --tokyo-cyan: #7dcfff;
  --tokyo-green: #73daca;
  --tokyo-magenta: #bb9af7;
  --tokyo-yellow: #e0af68;
  --tokyo-red: #f7768e;
  --bg-color: #111421;
  --header-bg: rgba(17, 20, 33, 0.88);
  --text-color: #c0caf5;
  --text-muted: #a9b1d6;
  --card-bg: #1a1f31;
  --accent: #7dcfff;
  --glow-soft: #bb9af7;
  --border-color: rgba(122, 162, 247, 0.22);
  --timeline-line: #2d3553;
  --scrollbar-bg: #111421;
  --scrollbar-thumb: #3b4261;
  --glass-bg: rgba(26, 31, 49, 0.66);
  --term-bg: #0c0c0c;
  --term-header-bg: #1a1b26;
  --term-border: #3b4261;
  --term-text: #c0caf5;
  --term-text-muted: #a9b1d6;
  --term-text-dim: #9aa5ce;
  --term-gray: #737aa2;
  --term-dir: #7aa2f7;
  --term-error: #f7768e;
  --term-path: #7aa2f7;
  --term-prompt-brackets: #bb9af7;
  --term-history: #737aa2;
  --term-success: #73daca;
  --term-azure: #7dcfff;
  --term-yellow: #e0af68;
  --term-magenta: #bb9af7;
  --term-shadow: rgba(0, 0, 0, 0.62);
}

body.light-mode {
  --bg-color: #f4f7fb;
  --header-bg: rgba(244, 247, 251, 0.9);
  --text-color: #1f2742;
  --text-muted: #4b5675;
  --card-bg: #ffffff;
  --accent: #2563a9;
  --glow-soft: #7c4fb3;
  --border-color: rgba(37, 99, 169, 0.22);
  --timeline-line: #d8e2f0;
  --glass-bg: rgba(255, 255, 255, 0.78);
  --scrollbar-bg: #e6edf7;
  --scrollbar-thumb: #91a6c2;
  --term-bg: #0c0c0c;
  --term-header-bg: #1a1b26;
  --term-border: #3b4261;
  --term-text: #c0caf5;
  --term-text-muted: #a9b1d6;
  --term-text-dim: #9aa5ce;
  --term-gray: #737aa2;
  --term-dir: #7aa2f7;
  --term-error: #f7768e;
  --term-path: #7aa2f7;
  --term-prompt-brackets: #bb9af7;
  --term-history: #737aa2;
  --term-success: #73daca;
  --term-azure: #7dcfff;
  --term-yellow: #e0af68;
  --term-magenta: #bb9af7;
  --term-shadow: rgba(0, 0, 0, 0.62);
}

.hero-summary {
  max-width: 62ch;
  margin: 4px 0 2px;
  color: var(--text-muted);
  font-size: clamp(1.5rem, 2vw, 1.8rem);
  line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Platform rail under the hero CTAs. Fills the space the terminal leaves empty
   below 900px, and gives the fold some scannable keywords. */
.hero-stack {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hero-stack li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--card-bg), transparent 30%);
  box-shadow: inset 0 0 0 1px var(--border-color);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-muted);
  transition: color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.hero-stack li > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-stack svg.icon {
  width: 1.8rem;
  height: 1.8rem;
  flex-shrink: 0;
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .hero-stack li:hover {
    color: var(--text-color);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 55%);
    transform: translateY(-3px);
  }
}
.cta-secondary { background: transparent; color: var(--text-color); border-color: var(--border-color); }
.hero-terminal { background: #0c0c0c; border-color: #3b4261; }
.hero-terminal-body { color: var(--tokyo-text); }
.omp-prompt { margin-bottom: 18px; font-family: "JetBrains Mono", Consolas, "Cascadia Code", monospace; font-size: 1.16rem; line-height: 1.8; }
.omp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--tokyo-text); }
.omp-corner { color: var(--tokyo-magenta); }
.omp-user { color: #0c0c0c; background: var(--tokyo-blue); padding: 0 7px; border-radius: 3px; font-weight: 700; }
.omp-label { color: var(--term-gray); }
.omp-path { color: var(--tokyo-blue); font-weight: 700; }
.omp-git { color: var(--tokyo-magenta); }
.omp-azure { color: #0c0c0c; background: var(--tokyo-cyan); padding: 0 7px; border-radius: 3px; font-weight: 700; }
.omp-chevron { color: var(--tokyo-yellow); font-weight: 700; }
.hero-key { display: inline-block; min-width: 52px; color: var(--tokyo-magenta); }
.status-ok { color: #0c0c0c; background: var(--tokyo-green); padding: 2px 6px; border-radius: 3px; font-weight: 700; margin-right: 6px; }

.system-avatar { background: linear-gradient(145deg, #1a1b26, #24283b); display: grid; place-items: center; color: var(--tokyo-cyan); position: relative; }
.system-avatar svg { width: 58%; height: 58%; stroke-width: 1.4; }
.system-avatar span { position: absolute; right: 8px; bottom: 6px; font-family: "JetBrains Mono", monospace; font-size: 1.1rem; color: var(--tokyo-green); }
.bento-bio-text strong { color: var(--text-color); font-weight: 600; }

/* PowerShell Format-List output: key column, aligned colons, then the value -
   the <dl> had no styles at all, so dt/dd were stacking. */
.ps-format-list { display: grid; gap: 1px; }
.ps-format-list > div {
  display: grid;
  grid-template-columns: 5.4em 1fr;
  align-items: baseline;
  gap: 0 6px;
}
.ps-format-list dt {
  position: relative;
  padding-right: 0.9em;
  color: var(--tokyo-blue);
  font-weight: 700;
}
.ps-format-list dt::after { content: ":"; position: absolute; right: 0.2em; color: var(--term-gray); }
.ps-format-list dd { margin: 0; min-width: 0; color: var(--tokyo-text); }

.project-visual { background: radial-gradient(circle at 50% 45%, rgba(125, 207, 255, 0.17), transparent 48%), linear-gradient(145deg, #151827, #24283b); }
.project-emblem { width: 150px; height: 150px; border: 1px solid rgba(122, 162, 247, 0.38); border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--tokyo-text); box-shadow: inset 0 0 30px rgba(122, 162, 247, 0.08), 0 18px 38px rgba(0, 0, 0, 0.32); transform: translateZ(20px); transition: transform 0.25s ease-out; }
.project-emblem svg { width: 34px; height: 34px; color: var(--tokyo-cyan); }
.project-emblem strong { font-family: "JetBrains Mono", monospace; font-size: 2.5rem; line-height: 1; color: var(--tokyo-green); }
.project-emblem span { font-family: "JetBrains Mono", monospace; font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tokyo-blue); }
.project-item.is-front .project-emblem { transform: translateZ(55px) scale(1.08); }
body.light-mode .project-visual { background: radial-gradient(circle at 50% 45%, rgba(37, 99, 169, 0.12), transparent 48%), linear-gradient(145deg, #eef4fb, #dce8f6); }

.contact-text-link { width: auto; min-width: 190px; gap: 8px; padding: 0 18px; border-radius: 14px; font-family: "JetBrains Mono", monospace; font-size: 1.15rem; }
.contact-text-link span { white-space: nowrap; }
.social-icons { align-items: center; }

@media (max-width: 767px) {
  /* The hero terminal is hidden below 900px; centre the copy so the leftover
     viewport height is shared top and bottom instead of pooling under the fold. */
  #home .home { justify-content: center; }
  .hero-summary { max-width: calc(100vw - 40px); }
  .hero-actions { display: grid; grid-template-columns: 1fr; width: calc(100% - 20px); }
  .hero-actions .cta { width: 100%; min-width: 0; margin-top: 0; text-align: center; padding: 13px 18px; }
  .hero-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); width: calc(100% - 20px); gap: 9px; }
  .hero-stack li { padding: 14px 13px; font-size: 1.2rem; }
  /* footer.min.css forces repeat(3, max-content) here, which overflows with wide
     text chips. Contact has one icon button + two text links, so lay it out as
     [copy][email] / [github]. */
  .social-icons {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    justify-content: stretch;
    gap: 12px;
    width: 100%;
  }
  .social-icons .glass-social-link { width: 100%; }
  .contact-text-link { min-width: 0; max-width: none; min-height: 52px; padding: 0 14px; }
  .contact-text-link span { overflow: hidden; text-overflow: ellipsis; }
  .social-icons > :nth-child(n + 3) { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .project-emblem { transition: none; }
  .hero-stack li { transition: none; }
}

/* Docked state: the live terminal sits inline in the hero column. It is the
   same node as the overlay window, so only layout differs here. */
.terminal-window.is-docked {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: clamp(300px, 38vh, 380px);
  display: flex;
  flex-direction: column;
  transform: none;
  margin: 0 auto;
}
.terminal-window.is-docked .terminal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  font-size: 1.12rem;
}
.terminal-window.is-docked #terminal-input { font-size: 1.12rem; }
/* A docked terminal cannot be closed or minimised - it is part of the page.
   Maximise becomes "pop out". */
.terminal-window.is-docked #close-terminal,
.terminal-window.is-docked #minimize-terminal { display: none; }
.hero-terminal-wrap:has(.terminal-window.is-docked) { perspective: none; }
/* Signal that the docked terminal is live. (::after is the spotlight glow.) */
.terminal-window.is-docked { cursor: text; }
.terminal-window.is-docked::before {
  content: "click to type";
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(122, 162, 247, 0.16);
  color: #a9b1d6;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 1rem;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.terminal-window.is-docked:focus-within::before { opacity: 0; }

/* Interactive PowerShell / Oh My Posh terminal */
#terminal-overlay { width: min(92vw, 760px); height: min(66vh, 500px); }
.terminal-window { background: #0c0c0c; border: 1px solid #3b4261; border-radius: 12px; box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(125, 207, 255, 0.06); }
/* Windows Terminal window chrome: tab strip on the left, window controls on the
   right. Shared by the interactive overlay and the decorative hero window. */
.terminal-header,
.hero-terminal-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  min-height: 34px;
  padding: 0;
  background: #1a1b26;
  border-bottom: 1px solid #292e42;
}
.wt-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 4px 4px 0; min-width: 0; }
.wt-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  min-width: 0;
  border-radius: 6px 6px 0 0;
  background: #0c0c0c;
  box-shadow: inset 0 2px 0 var(--accent);
}
.wt-tab-icon {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: #7dcfff; stroke-width: 2.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.terminal-title,
.hero-terminal-title {
  margin: 0;
  font-family: "JetBrains Mono", Consolas, "Cascadia Code", monospace;
  font-size: 1.05rem;
  color: #c0caf5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wt-newtab {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 30px;
  color: #737aa2; font-size: 1.5rem; line-height: 1;
}
.wt-controls { display: flex; align-items: stretch; flex-shrink: 0; }
.wt-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; min-height: 34px; padding: 0;
  border: 0; background: transparent; color: #c0caf5;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.wt-btn svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.1; fill: none; }
.wt-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hero-terminal-header .wt-btn { cursor: default; }

@media (hover: hover) and (pointer: fine) {
  .wt-btn:hover { background: rgba(192, 202, 245, 0.1); }
  .wt-close:hover { background: #c42b1c; color: #fff; }
  .hero-terminal-header .wt-btn:hover { background: transparent; color: #c0caf5; }
}
.terminal-body, #terminal-input, .cmd-line, .hero-terminal, .hero-terminal-body { font-family: "JetBrains Mono", Consolas, "Cascadia Code", "Symbols Nerd Font", monospace; }
.terminal-body { padding: 16px 18px 22px; color: #c0caf5; font-size: 1.22rem; line-height: 1.65; background: #0c0c0c; }
#terminal-history { width: 100%; margin-bottom: 14px; }
/* The Oh My Posh prompt is two lines. Render line 1 as its own block and let
   line 2 share a flex row with the input, so the caret lands directly after the
   chevron instead of in a fixed 250px column. */
.terminal-active-line { display: block; }
#terminal-prompt-label { white-space: nowrap; line-height: 1.45; }
.terminal-prompt-row { display: flex; align-items: baseline; gap: 8px; line-height: 1.45; }
#terminal-prompt-tail { flex: 0 0 auto; white-space: nowrap; }
/* Unfocused, the input shows no native caret, so the terminal reads as a
   screenshot. Draw a blinking block after the chevron until focus takes over. */
.terminal-window:not(:focus-within) #terminal-prompt-tail::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  margin-left: 0.45em;
  vertical-align: -0.18em;
  background: #e0af68;
  animation: term-caret 1.06s steps(1) infinite;
}
@keyframes term-caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
/* Paused animations can freeze mid-blink on the invisible half. */
body.motion-reduced .terminal-window:not(:focus-within) #terminal-prompt-tail::after,
body.pause-animations .terminal-window:not(:focus-within) #terminal-prompt-tail::after {
  animation: none;
  opacity: 1;
}
#terminal-input { flex: 1 1 auto; width: auto; min-width: 0; color: #c0caf5 !important; caret-color: #e0af68; font-size: 1.22rem; line-height: 1.45; }
.term-segment { display: inline-block; padding: 0 6px; border-radius: 3px; color: #0c0c0c; font-weight: 700; }
.term-user { background: #7aa2f7; }
.term-azure { background: #7dcfff; }
.term-corner, .term-git { color: #bb9af7; }
.term-label, .term-muted { color: #9aa5ce; }
.term-path { color: #7aa2f7; font-weight: 700; }
.term-chevron, .term-yellow { color: #e0af68; font-weight: 700; }
.term-success { color: #73daca; }
.term-error { color: #f7768e; }
.term-heading { color: #7dcfff; font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; }
.term-banner { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 6px; padding-bottom: 7px; color: #73daca; border-bottom: 1px solid #292e42; }
.term-welcome, .term-response, .term-command-row { margin-bottom: 13px; }
.term-tip { margin-top: 10px; }
.term-list { display: grid; gap: 3px; }
.term-list > div { display: grid; grid-template-columns: minmax(112px, 0.34fr) 1fr; gap: 12px; }
.term-list > div > span:first-child { color: #7aa2f7; font-weight: 700; }
.term-list a { color: #7dcfff; text-decoration: underline; text-underline-offset: 3px; }
.term-command-echo { color: #737aa2; line-height: 1.45; }
.term-command-echo > span:last-child { color: #a9b1d6; }
.term-prompt-muted { opacity: 0.58; filter: saturate(0.7); }
.term-index { display: inline-block; width: 26px; color: #bb9af7; }
/* docker CLI output: monospace columns, scrolls rather than wrapping. */
.term-table { margin: 0; font-family: inherit; font-size: inherit; line-height: 1.55; white-space: pre; overflow-x: auto; }
.term-table-head { color: #737aa2; }

@media (max-width: 860px) {
  .terminal-prompt-row { flex-wrap: wrap; }
  .term-list > div { grid-template-columns: 105px 1fr; }
}
