@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap');

/* ===========================================================
   DESIGN TOKENS — edit these to re-theme the whole site
   =========================================================== */
:root {
  --bg: #0c0b09;           /* near-black, warm not navy */
  --surface: #151310;
  --surface-2: #1c1915;
  --border: #322c23;
  --text: #ece5d8;         /* warm off-white */
  --text-dim: #948a78;
  --accent: #ff6a1a;       /* hot orange — links, highlights, primary */
  --accent-2: #ff9240;     /* lighter orange, for hover/glow states */
  --accent-dim: #7a3814;
  --warn: #e0b84e;         /* gold — medium difficulty */
  --danger: #e2503a;       /* red — hard difficulty */
  --insane: #b05ccf;       /* violet — insane difficulty, kept distinct from accent */
  --ok: #8fbf6a;           /* green — easy, linux tag */
  --cyber-cyan: #38bdf8;   /* electric cyan for binary font streams */
  --cyber-green: #4ade80;  /* matrix neon green */

  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --font-binary: 'Share Tech Mono', 'VT323', ui-monospace, monospace;

  --radius: 3px;
  --maxw: 880px;
}

body[data-terminal="off"] { --maxw: 1060px; }

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { font-family: var(--mono); font-weight: 600; margin: 0; color: #f6efe2; }

/* ===========================================================
   NAV
   =========================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 11, 9, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.nav-prompt { color: var(--text); }
.nav-prompt:hover { text-decoration: none; }
.nav-sep { color: var(--accent); }
.cursor { animation: blink 1.1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-dim); font-size: 0.88rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-recruiter {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  color: var(--text) !important;
  transition: all 0.2s ease;
}
.nav-recruiter:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}
.nav-recruiter.active,
body[data-recruiter="1"] .nav-recruiter,
body[data-terminal="off"] .nav-recruiter {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: rgba(255, 106, 26, 0.08);
}

.nav-controls { display: flex; align-items: center; gap: 12px; }

/* Recruiter Mode Toggle Button */
.recruiter-toggle,
.term-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 5px 10px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.recruiter-toggle:hover,
.term-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}
.recruiter-toggle[aria-checked="true"],
.term-toggle[aria-checked="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 106, 26, 0.08);
}
.recruiter-toggle-track,
.term-toggle-track {
  position: relative;
  width: 32px;
  height: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.recruiter-toggle-knob,
.term-toggle-knob {
  position: absolute;
  top: 1px; left: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.recruiter-toggle[aria-checked="true"] .recruiter-toggle-track,
.term-toggle[aria-checked="true"] .term-toggle-track {
  border-color: var(--accent);
  background: rgba(255, 106, 26, 0.2);
}
.recruiter-toggle[aria-checked="true"] .recruiter-toggle-knob,
.term-toggle[aria-checked="true"] .term-toggle-knob {
  transform: translateX(16px);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 106, 26, 0.7);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    gap: 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ===========================================================
   HERO / TERMINAL
   =========================================================== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 20px 48px;
}
.hero-inner { display: flex; flex-direction: column; gap: 28px; }

.terminal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 106, 26, 0.08), 0 20px 60px -30px rgba(0,0,0,0.6);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-r { background: #e8716f; }
.dot-y { background: #f3b562; }
.dot-g { background: #7fd08a; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.term-skip-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(148, 138, 120, 0.25);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}
.term-skip-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 106, 26, 0.08);
}
.terminal-body {
  position: relative;
  padding: 22px 20px 26px;
  font-family: var(--mono);
  font-size: 0.95rem;
  min-height: 160px;
  overflow-y: auto;
  max-height: 380px;
  background: radial-gradient(circle at 50% 20%, rgba(35, 27, 20, 0.5) 0%, rgba(21, 19, 16, 0.98) 100%);
}
.terminal-body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 1;
}
.terminal-body > * {
  position: relative;
  z-index: 2;
}
.terminal-body p { margin: 0 0 6px; }
.prompt { color: var(--accent); margin-right: 6px; }
.prompt-inline { color: var(--accent); font-family: var(--mono); }
.out { color: var(--text); margin-bottom: 14px !important; }
.out.err { color: var(--danger); }

/* Binary Font & Cyber Styling */
.font-binary {
  font-family: var(--font-binary);
  letter-spacing: 0.08em;
  color: var(--cyber-cyan);
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}
.font-binary-green {
  font-family: var(--font-binary);
  letter-spacing: 0.08em;
  color: var(--cyber-green);
  text-shadow: 0 0 6px rgba(74, 222, 128, 0.35);
}
.font-binary-accent {
  font-family: var(--font-binary);
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(255, 106, 26, 0.4);
}
.bin-tag {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 2px;
  font-family: var(--font-binary);
  font-size: 0.74rem;
  color: var(--cyber-cyan);
  margin-right: 6px;
  vertical-align: middle;
}
.bin-stream {
  font-family: var(--font-binary);
  font-size: 0.78rem;
  color: rgba(255, 106, 26, 0.85);
  letter-spacing: 0.12em;
  word-break: break-all;
}
.scramble-char {
  color: var(--accent);
  font-family: var(--font-binary);
  font-weight: 600;
  display: inline-block;
}
.ascii-banner {
  font-family: var(--font-binary);
  font-size: 0.68rem;
  line-height: 1.15;
  color: var(--accent);
  white-space: pre;
  margin: 6px 0 12px;
  text-shadow: 0 0 8px rgba(255, 106, 26, 0.5);
  overflow-x: auto;
}
.diag-line {
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 4px !important;
}
.type-cursor {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 18px;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  caret-color: var(--accent);
}
.terminal-input::placeholder { color: var(--text-dim); }

.hero-hint {
  margin: 14px 2px 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.hero-hint code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
  color: var(--accent);
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #1c1006;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost {
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ===========================================================
   SECTIONS (shared)
   =========================================================== */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 20px;
  border-top: 1px solid var(--border);
}

/* ===========================================================
   VIEWPORT / DASHBOARD
   The space under the terminal. #panel-dashboard is the resting
   state; JS toggles [hidden] on the others when a command runs.
   =========================================================== */
.fetch {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fetch-glyph {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  padding-top: 4px;
}
.fetch-info {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
}
.fetch-info div { display: contents; }
.fetch-info dt {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: right;
}
.fetch-info dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text);
}
.fetch-status { color: var(--ok); }

@media (max-width: 560px) {
  .fetch { flex-direction: column; gap: 16px; }
  .fetch-info dt { text-align: left; }
}

.resume-box {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.resume-box code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
}
.section-head {
  font-size: 1.15rem;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.section-sub {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0 0 28px;
}

/* ===========================================================
   ABOUT
   =========================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  margin-top: 28px;
}
.about-text p { margin: 0 0 14px; color: var(--text); max-width: 62ch; }
.about-text strong { color: #f6efe2; }

.skills-label {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.tag-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-list li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 10px;
  border-radius: var(--radius);
}
.tag-list-sm li { font-size: 0.72rem; padding: 4px 8px; color: var(--text-dim); }

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ===========================================================
   PROJECTS
   =========================================================== */
.card-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--accent-dim); }
.card h3 { font-size: 1rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.9rem; flex-grow: 1; }
.card-links { display: flex; gap: 16px; font-family: var(--mono); font-size: 0.8rem; }

/* ===========================================================
   WRITEUPS TABLE
   =========================================================== */
.writeup-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wt-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 13px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
}
a.wt-row:hover { background: var(--surface); text-decoration: none; }
.wt-row:last-child { border-bottom: none; }
.wt-head {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--surface-2);
  text-transform: lowercase;
}
.wt-name { font-family: var(--mono); color: #f6efe2; }
.wt-date { color: var(--text-dim); font-family: var(--mono); font-size: 0.82rem; }

.os-tag, .diff-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.os-linux { color: var(--ok); border-color: var(--accent-dim); }
.os-windows { color: #8fa8c9; border-color: #35405a; }
.diff-easy { color: var(--ok); }
.diff-medium { color: var(--warn); }
.diff-hard { color: var(--danger); }
.diff-insane { color: var(--insane); }

@media (max-width: 640px) {
  .wt-row { grid-template-columns: 1.4fr 1fr 1fr; font-size: 0.8rem; }
  .wt-date { display: none; }
  .wt-head span:last-child { display: none; }
}

/* ===========================================================
   CONTACT
   =========================================================== */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
.contact-link {
  font-family: var(--mono);
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  background: var(--surface);
}
.contact-link:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.contact-link span { color: var(--text-dim); font-size: 0.8rem; }
.contact-link:hover span { color: var(--accent); }

/* ===========================================================
   AMBIENT MITRE ATT&CK FEED (decorative, fixed-position)
   =========================================================== */
.ambient-term,
.threat-feed {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 260px;
  background: rgba(21, 19, 16, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 30;
  box-shadow: 0 16px 40px -20px rgba(0,0,0,0.7);
}
.ambient-term-bar,
.threat-feed-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.ambient-term-bar .dot,
.threat-feed-bar .dot { width: 7px; height: 7px; }
.ambient-term-title,
.threat-feed-title {
  margin-left: 4px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-dim);
}
.ambient-term-body,
.threat-feed-body {
  height: 150px;
  overflow: hidden;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}
.ambient-term-body p,
.threat-feed-body p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: feedIn 0.4s ease both;
}
.ambient-term-body .feed-id,
.threat-feed-body .feed-id { color: var(--accent); }

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

body[data-terminal="off"] .ambient-term,
body[data-terminal="off"] .threat-feed,
body[data-terminal="off"] .hero { display: none; }

@media (max-width: 768px) {
  .ambient-term,
  .threat-feed { display: none; }
}

/* ===========================================================
   RECRUITER PANEL
   =========================================================== */
.recruiter-head { color: var(--text); }
.recruiter-box {
  margin-top: 20px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
}
.recruiter-box p {
  margin: 0 0 22px;
  color: var(--text);
  font-size: 1rem;
  max-width: 62ch;
}
.recruiter-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0 0 24px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}
.recruiter-facts dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.recruiter-facts dd { margin: 0; font-size: 0.92rem; }
.recruiter-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 640px) {
  .recruiter-facts { grid-template-columns: 1fr; }
}

/* ===========================================================
   NORMAL-WEBSITE MODE (terminal toggled off)
   All panels become plain stacked sections, reclaiming the
   vertical space the terminal used to occupy.
   =========================================================== */
body[data-terminal="off"] #viewport {
  padding-top: 56px;
}
body[data-terminal="off"] #viewport .panel {
  border-top: 1px solid var(--border);
  padding: 44px 0;
}
body[data-terminal="off"] #panel-recruiter,
body[data-terminal="off"] #viewport .panel:not([hidden]):first-of-type,
body[data-terminal="off"] #panel-about:first-of-type {
  border-top: none;
  padding-top: 0;
}

body[data-terminal="off"] .nav-recruiter {
  border-color: var(--accent);
  color: var(--accent) !important;
}

/* ===========================================================
   ANIMATIONS
   One job each: panel switches acknowledge the command that
   triggered them; nothing animates just by existing on scroll.
   =========================================================== */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel:not([hidden]) { animation: panelIn 0.32s ease both; }
/* normal-website mode reveals every panel at once on load — that's
   a stacked page, not a triggered action, so it shouldn't animate */
body[data-terminal="off"] .panel { animation: none; }

@keyframes toggleFlash {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 26, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(255, 106, 26, 0); }
}
.recruiter-toggle-knob.flash,
.term-toggle-knob.flash { animation: toggleFlash 0.5s ease-out; }

.hero { transition: opacity 0.25s ease; }

@media (prefers-reduced-motion: reduce) {
  .panel:not([hidden]) { animation: none; }
  .ambient-term-body p { animation: none; }
}

/* ===========================================================
   FOOTER
   =========================================================== */
.footer {
  text-align: center;
  padding: 32px 20px 48px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
}
