/* ==========================================================================
   styles.css — the whole look & feel

   Colors, fonts and spacing live in the :root variables at the top.
   Change a value there and it updates everywhere it's used — the easiest
   way to re-theme the whole site.
   ========================================================================== */

:root {
  --bg: #0a0f0b;            /* terminal black (green-tinted) */
  --panel: #0f1712;         /* cards, chips, rows            */
  --line: #1f2e24;          /* borders                       */
  --text: #d8e6dc;          /* phosphor white                */
  --text-2: #9fb8a8;        /* body copy                     */
  --muted: #5f7a6a;         /* dim text                      */
  --accent: #3ce07f;        /* terminal green                */
  --accent-soft: rgba(60, 224, 127, 0.12);
  --green: #3ce07f;         /* "open to work" dot            */
  --red: #ff5f57;           /* window-control dots           */
  --yellow: #febc2e;
  --green-light: #28c840;
  --font-body: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---------- basics ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; } /* nav links glide instead of jump */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #04120b; }

a { color: inherit; }

.mono { font-family: var(--font-mono); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 64px; /* room so the fixed status bar never covers content */
}

/* ---------- decorative background layers ---------- */

/* faint grid, faded out toward the bottom of the page */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.16;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
}

/* soft purple light that follows the cursor (moved by script.js) */
.glow {
  position: fixed;
  z-index: -1;
  left: 0;
  top: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  pointer-events: none; /* never blocks clicks */
  transition: transform 0.18s ease-out;
}

/* CRT scanlines — a subtle horizontal-line overlay across the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
}

/* ---------- top nav (the "title bar" of our terminal window) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 24px;
  background: rgba(10, 15, 11, 0.8);
  backdrop-filter: blur(12px); /* frosted-glass effect */
  border-bottom: 1px solid var(--line);
}

.nav-left { display: flex; align-items: center; gap: 14px; }
.nav-right { display: flex; align-items: center; gap: 18px; }

/* the three window-control dots */
.lights { display: flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.lights i:nth-child(1) { background: var(--red); }
.lights i:nth-child(2) { background: var(--yellow); }
.lights i:nth-child(3) { background: var(--green-light); }

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.logo .logo-dot { color: var(--accent); }

.nav-title { color: var(--muted); font-size: 0.8rem; }

.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 6px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- hero ---------- */
.hero { padding: 108px 0 78px; }

/* the green prompt bits ("brandon@owchy:~$", "$", etc.) */
.prompt { color: var(--accent); text-shadow: 0 0 16px rgba(60, 224, 127, 0.35); }

.kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  text-shadow: 0 0 16px rgba(60, 224, 127, 0.4);
}

.name {
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  text-shadow: 0 0 34px rgba(60, 224, 127, 0.22);
}

.caret {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.typing {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 18px;
  min-height: 1.7em; /* reserves space so the page doesn't jump while typing */
}
.typed { color: var(--text); font-family: var(--font-mono); font-size: 1rem; }

.tagline {
  max-width: 54ch;
  color: var(--text-2);
  font-size: 1.05rem;
  margin: 0 0 26px;
}
.tagline strong { color: var(--text); }

/* status pills */
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 6px;
}
.dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

/* buttons */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04120b; font-weight: 700; }
.btn.primary:hover { box-shadow: 0 8px 30px rgba(60, 224, 127, 0.35); }
.btn.ghost { color: var(--text-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- content sections (about / stack / projects / contact) ---------- */
.section { padding: 56px 0; border-top: 1px solid var(--line); }

.section h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}
.section .cmd {
  color: var(--accent);
  font-size: 1rem;
  text-shadow: 0 0 14px rgba(60, 224, 127, 0.4);
}

.section-body p,
.section-intro { color: var(--text-2); max-width: 62ch; margin: 0 0 14px; }
.section-intro { color: var(--muted); }
.section-body p strong { color: var(--text); }
.section-body p em { font-style: italic; color: var(--accent); }
.section-body .dim { color: var(--muted); }
.prompt-inline { color: var(--accent); }
.section-body a { color: var(--accent); }

/* the little fact list in the about section */
.facts {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 8px;
  max-width: 46ch;
}
.facts li { color: var(--text-2); }
.facts strong { color: var(--text); }
.facts em { font-style: italic; color: var(--accent); }

/* tech stack chips */
.stack-group { margin-bottom: 20px; }
.stack-group:last-child { margin-bottom: 0; }
.stack-group h3 {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 6px 12px;
  border-radius: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip em { font-style: normal; font-size: 0.8em; color: var(--muted); }

/* project cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }
.card-link {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.card-link:hover { color: var(--accent); border-color: var(--accent); transform: rotate(45deg); }
.card-chips .chip { font-size: 0.72rem; padding: 4px 9px; }

.more-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.15s;
}
.more-link:hover { color: var(--accent); }

/* contact list */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  gap: 10px;
  max-width: 520px;
}
.contact-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 13px 16px;
  border-radius: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.contact-list a:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-list .mono { color: var(--accent); font-size: 0.78rem; min-width: 78px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 36px;
  text-align: center;
}
.peace {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.egg {
  background: none;
  border: 0;
  padding: 2px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s;
}
.egg:hover { transform: rotate(-14deg) scale(1.2); }
.egg:active { transform: scale(0.9); }
.tiny { color: #525b6e; font-size: 0.78rem; margin: 0; }

/* ---------- toast (the egg's little message box) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 70px; /* floats just above the pinned status bar */
  z-index: 50;
  max-width: min(90vw, 480px);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 11px 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.confetti {
  position: fixed;
  z-index: 60;
  font-size: 15px;
  pointer-events: none;
}

/* ---------- scroll-reveal (only active when JS is on — see .js in script.js) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- scrollbar (a small flourish) ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #24352b; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2f4a3a; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .nav-title { display: none; } /* not enough room for the window title */
}
@media (max-width: 600px) {
  .nav-links { display: none; } /* hero + sections still say hi */
  .hero { padding: 72px 0 56px; }
  .section { padding: 44px 0; }
}

/* ==========================================================================
   v2 — the CRT "desktop": a bento grid of terminal panels
   ========================================================================== */

/* --- the bento grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  padding-top: 26px;
}
.panel-hero     { grid-column: span 4; }
.panel-status   { grid-column: span 2; }
.panel-about    { grid-column: span 2; }
.panel-stack    { grid-column: span 2; }
.panel-projects { grid-column: span 2; }
.panel-contact  { grid-column: span 6; }

/* --- a panel = a little terminal window --- */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(60, 224, 127, 0.45);
  box-shadow: 0 0 0 1px rgba(60, 224, 127, 0.12), 0 14px 40px rgba(0, 0, 0, 0.4);
}
.panel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.75rem;
  color: var(--muted);
}
.bar-dots { display: flex; gap: 5px; }
.bar-dots i { width: 9px; height: 9px; border-radius: 50%; background: #26382d; display: block; }
.bar-title { color: var(--text-2); }
.bar-cmd { margin-left: auto; color: var(--accent); opacity: 0.75; }
.panel-body { padding: 18px 20px 20px; flex: 1; }
.panel-body p { color: var(--text-2); margin: 0 0 12px; }
.panel-body p strong { color: var(--text); }
.panel-body p em { font-style: italic; color: var(--accent); }
.panel-body a { color: var(--accent); }
.panel-body .dim { color: var(--muted); }
.panel-body > .prompt-inline { display: block; margin-bottom: 12px; }

/* panel-specific tweaks */
.panel-hero .panel-body { padding: 24px 28px 26px; }

/* the "sys -info" key/value rows */
.kv { margin: 14px 0 0; }
.kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 0.8rem; }
.kv dd { margin: 0; color: var(--text-2); font-size: 0.88rem; }
.kv dd.ok { color: var(--accent); }

/* the ascii "(empty)" box in the projects panel */
.ascii {
  margin: 4px 0 14px;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1.35;
  opacity: 0.85;
  text-shadow: 0 0 12px rgba(60, 224, 127, 0.35);
}
.ascii span { display: block; }

/* contact: one wide panel — copy left, links right */
.contact-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.contact-copy { flex: 1 1 280px; max-width: 420px; }
.panel .contact-list { flex: 1 1 300px; margin: 0; max-width: 520px; }

/* --- extra CRT tube physics --- */
/* the darkening at the edges, like looking at a curved glass tube */
.crt-vignette {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 45%, transparent 58%, rgba(0, 0, 0, 0.45) 100%);
}
/* a slow bright band that sweeps down the screen */
.crt-sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: -25%;
  height: 140px;
  z-index: 72;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(60, 224, 127, 0.05), transparent);
  animation: sweep 8s linear infinite;
}
@keyframes sweep { to { transform: translateY(150vh); } }

/* chromatic aberration on the big name (classic RGB fringe on old tubes) */
.name {
  text-shadow:
    -1.5px 0 0 rgba(255, 70, 90, 0.35),
    1.5px 0 0 rgba(70, 220, 255, 0.35),
    0 0 34px rgba(60, 224, 127, 0.22);
}

/* --- the tmux-style status bar (footer) — pinned to the bottom, like a taskbar --- */
.statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999; /* above detached windows — the taskbar is always on top */
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  padding: 0;
  text-align: left;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  color: var(--muted);
}
.sb-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-right: 1px solid var(--line);
}
/* the "active pane" cell — inverted, like the focused pane in tmux */
.sb-cell.sb-active { background: var(--accent); color: #04120b; font-weight: 700; }
.sb-right { margin-left: auto; border-right: 0; border-left: 1px solid var(--line); color: var(--text-2); }

/* --- staggered panel reveals --- */
.js .grid .panel:nth-child(2) { transition-delay: 0.07s; }
.js .grid .panel:nth-child(3) { transition-delay: 0.14s; }
.js .grid .panel:nth-child(4) { transition-delay: 0.21s; }
.js .grid .panel:nth-child(5) { transition-delay: 0.28s; }
.js .grid .panel:nth-child(6) { transition-delay: 0.35s; }

/* --- the grid collapsing on smaller screens --- */
@media (max-width: 980px) {
  .panel-hero { grid-column: span 6; }
  .panel-status { grid-column: span 3; }
  .panel-about { grid-column: span 3; }
  .panel-stack { grid-column: span 3; }
  .panel-projects { grid-column: span 3; }
  .panel-contact { grid-column: span 6; }
}
@media (max-width: 640px) {
  .grid { gap: 12px; }
  .grid > * { grid-column: span 6; }
  .hide-sm { display: none; }
  .contact-body { flex-direction: column; align-items: flex-start; }
  main { padding-bottom: 96px; } /* the bar may wrap to two lines on phones */
}

/* --- draggable windows (grab any panel by its title bar) --- */
.panel-bar { cursor: grab; user-select: none; touch-action: none; }
.panel-bar:active { cursor: grabbing; }
/* .detached = pulled out of the grid, pinned where you dropped it */
.panel.detached { position: fixed; }
/* .dragging = in the middle of a drag (lifted look, no transitions) */
.panel.dragging {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(60, 224, 127, 0.25);
  transition: none;
}
.bar-reset {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.bar-reset:hover { color: var(--accent); border-color: var(--line); }

/* ---------- honor "reduce motion" in the OS settings ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .caret, .dot-green { animation: none; }
  .crt-sweep { animation: none; }
}

