/* ============================================================
   MUHAMMAD BILAL ZEESHAN — PORTFOLIO
   "The Lab Notebook" — a security researcher's field log.
   Hand-written CSS. No frameworks.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0d12;
  --bg-2: #0d1219;
  --surface: #121822;
  --surface-2: #161e2b;
  --border: #26303f;
  --border-soft: #1c2431;
  --text: #e9edf3;
  --muted: #9aa5b5;
  --faint: #67717f;
  --accent: #f0a93b;          /* lab amber */
  --accent-soft: rgba(240, 169, 59, 0.12);
  --accent-border: rgba(240, 169, 59, 0.35);
  --blue: #5b8def;
  --green: #3ecf8e;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --nav-h: 68px;
  --max-w: 1120px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1.02rem;
  overflow-x: hidden;
  /* faint blueprint grid + soft glows */
  background-image:
    radial-gradient(900px 480px at 12% -4%, rgba(240, 169, 59, 0.07), transparent 60%),
    radial-gradient(800px 520px at 95% 12%, rgba(91, 141, 239, 0.08), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); }
ul { list-style: none; }

::selection { background: var(--accent); color: #0a0d12; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #0a0d12;
  padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
  font-family: var(--font-mono); font-size: 0.85rem; z-index: 200;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.92rem; font-weight: 500;
  padding: 0.8rem 1.35rem; border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #0a0d12; font-weight: 600;
  box-shadow: 0 6px 24px rgba(240, 169, 59, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(240, 169, 59, 0.35); }
.btn-ghost {
  border-color: var(--border); color: var(--text); background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: var(--accent-border); background: var(--accent-soft); transform: translateY(-2px); }
.btn-resume {
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--accent); padding: 0.55rem 1rem; font-size: 0.85rem;
}
.btn-resume:hover { background: var(--accent); color: #0a0d12; }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100;
  background: rgba(10, 13, 18, 0.78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  max-width: var(--max-w); height: 100%; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  font-family: var(--font-mono); font-size: 1.15rem; font-weight: 500;
  color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 0.15rem;
}
.brand-prompt { color: var(--accent); }
.brand-name { letter-spacing: 0.02em; }
.brand-caret {
  width: 9px; height: 1.15em; background: var(--accent); margin-left: 3px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a:not(.btn) {
  color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 0.5rem 0.75rem; border-radius: 8px; transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:not(.btn):hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a:not(.btn).active { color: var(--accent); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 44px; height: 44px; cursor: pointer; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--nav-h) + 3rem) 0 4rem; position: relative;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; align-items: center; width: 100%;
}
.eyebrow {
  font-size: 0.85rem; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 1.1rem;
}
.eyebrow-slash { color: var(--accent); margin-right: 0.5rem; }
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 5.4vw, 4.2rem); line-height: 1.04; letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}
.hero-title-accent {
  background: linear-gradient(100deg, var(--accent) 10%, #f6c667 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; color: var(--text); margin-bottom: 0.9rem; }
.hero-sub { color: var(--muted); max-width: 34rem; margin-bottom: 1.8rem; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.8rem; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 1.4rem;
}
.hero-meta li { display: flex; align-items: center; gap: 0.5rem; }
.hero-meta i { color: var(--accent); font-size: 0.8rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.hero-social { display: flex; gap: 0.7rem; }
.hero-social a {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 1.15rem;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.hero-social a:hover { color: var(--accent); border-color: var(--accent-border); transform: translateY(-2px); }

/* terminal */
.hero-terminal { min-width: 0; }
.terminal-window {
  background: #0d1117; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(240, 169, 59, 0.06);
}
.terminal-bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border-soft);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-red { background: #ff5f57; } .t-amber { background: #febc2e; } .t-green { background: #28c840; }
.terminal-title { margin-left: 0.6rem; font-size: 0.78rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terminal-body {
  padding: 1.2rem 1.25rem; font-size: 0.86rem; line-height: 1.75; color: #c9d4e3;
  min-height: 300px; white-space: pre-wrap; word-break: break-word;
}
.term-caret { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.t-green-t { color: var(--green); } .t-amber-t { color: var(--accent); } .t-dim { color: var(--faint); }
.terminal-caption { margin-top: 0.7rem; font-size: 0.75rem; color: var(--faint); text-align: right; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  color: var(--faint); font-size: 1rem; animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; scroll-margin-top: calc(var(--nav-h) + 12px); }
.section-eyebrow { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.9rem; }
.sec-num {
  display: inline-block; color: var(--accent); border: 1px solid var(--accent-border);
  border-radius: 6px; padding: 0.1rem 0.5rem; margin-right: 0.7rem; font-size: 0.78rem;
  background: var(--accent-soft);
}
.section-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.12; margin-bottom: 1rem;
}
.section-sub { color: var(--muted); max-width: 44rem; margin-bottom: 2.8rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr 0.85fr 0.9fr; gap: 3rem; align-items: start; }
.about-photo { margin: 0; }
.teach-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: start; }
.teach-layout .teach-grid { grid-template-columns: 1fr; }
.teach-photo { margin: 0; }
.contact-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: start; margin-top: 2.5rem; }
.contact-layout .contact-card { max-width: none; }
.contact-photo { margin: 0; }
.photo-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.photo-tag { display: flex; align-items: center; gap: 0.55rem; margin: 0; padding: 0.7rem 1rem; font-size: 0.75rem; letter-spacing: 0.08em; color: var(--accent); border-bottom: 1px solid var(--border-soft); }
.photo-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }
.photo-card img { display: block; width: 100%; height: auto; }
.about-copy p { color: var(--muted); margin-bottom: 1.1rem; }
.about-copy strong { color: var(--text); }
.about-facts { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.about-facts > div { padding: 0.95rem 1.25rem; border-bottom: 1px solid var(--border-soft); display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; }
.about-facts > div:last-child { border-bottom: none; }
.about-facts dt { font-size: 0.78rem; color: var(--accent); }
.about-facts dd { font-size: 0.95rem; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.about-facts dd a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-border); text-underline-offset: 3px; }
.about-facts dd a:hover { color: var(--accent); }

/* ---------- Timeline / experience ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 1.6rem; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; width: 2px;
  background: linear-gradient(var(--accent), var(--border) 70%); border-radius: 2px; opacity: 0.7;
}
.log-entry { position: relative; padding-left: 3rem; }
.log-rail { position: absolute; left: 0; top: 26px; width: 24px; display: flex; justify-content: center; }
.log-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--bg);
  border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(240, 169, 59, 0.12);
}
.log-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; transition: border-color 0.2s ease, transform 0.2s ease;
}
.log-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.log-id { font-size: 0.76rem; color: var(--faint); margin-bottom: 0.5rem; letter-spacing: 0.03em; }
.log-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin-bottom: 0.15rem; }
.log-org { color: var(--muted); font-size: 0.98rem; }
.log-loc { color: var(--faint); }
.log-date { font-size: 0.82rem; color: var(--accent); margin: 0.35rem 0 1rem; }
.log-list { margin-bottom: 1.1rem; }
.log-list li { position: relative; padding-left: 1.3rem; margin-bottom: 0.6rem; color: var(--muted); font-size: 0.97rem; }
.log-list li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.log-list strong { color: var(--text); font-weight: 600; }

.chip {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 999px; padding: 0.18rem 0.65rem; color: var(--muted);
  background: rgba(255, 255, 255, 0.02); vertical-align: middle;
}
.chip-live { color: var(--green); border-color: rgba(62, 207, 142, 0.4); background: rgba(62, 207, 142, 0.08); }
.chip-dev { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-row li {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.28rem 0.6rem;
  background: rgba(255, 255, 255, 0.02);
}
.mono-inline { font-family: var(--font-mono); font-size: 0.88em; background: rgba(255,255,255,0.06); border-radius: 5px; padding: 0.1em 0.35em; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.35rem; display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover { border-color: var(--accent-border); transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.project-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.74rem; color: var(--faint); }
.project-card h3 { font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; }
.project-card p { color: var(--muted); font-size: 0.94rem; }
.project-card p strong { color: var(--text); font-weight: 600; }
.project-q { border-left: 2px solid var(--accent); padding-left: 0.8rem; }
.project-r { color: var(--text); }
.card-dev { border-style: dashed; }
.card-link {
  margin-top: auto; padding-top: 0.6rem; display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); text-decoration: none; font-weight: 500;
}
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.more-code { margin-top: 2rem; font-size: 0.9rem; color: var(--faint); }
.more-code a { color: var(--accent); text-decoration: none; }
.more-code a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Teaching ---------- */
.teach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.teach-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; transition: border-color 0.2s ease, transform 0.2s ease;
}
.teach-card:hover { border-color: var(--accent-border); transform: translateY(-3px); }
.teach-card h3 { font-family: var(--font-display); font-size: 1.35rem; margin: 0.5rem 0 1.1rem; }
.teach-card > p:last-child { color: var(--muted); font-size: 0.96rem; }
.teach-stats { display: flex; gap: 2.2rem; margin-bottom: 1.1rem; }
.stat-num { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; }
.skill-group {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem; transition: border-color 0.2s ease;
}
.skill-group:hover { border-color: var(--accent-border); }
.skill-group h3 { font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.9rem; font-weight: 500; }
.skill-group h3 i { margin-right: 0.5rem; }
.skill-group ul { display: flex; flex-direction: column; gap: 0.45rem; }
.skill-group li { color: var(--muted); font-size: 0.95rem; padding-left: 1rem; position: relative; }
.skill-group li::before { content: "·"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- Education ---------- */
.edu-list { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 1.6rem; }
.edu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  transition: border-color 0.2s ease;
}
.edu-card:hover { border-color: var(--accent-border); }
.edu-card h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 0.25rem; }
.edu-school { color: var(--muted); }
.edu-detail { color: var(--faint); font-size: 0.92rem; margin-top: 0.35rem; }
.edu-side { text-align: right; font-size: 0.85rem; color: var(--muted); }
.edu-grades { margin-top: 0.4rem; color: var(--faint); }
.edu-grades strong { color: var(--accent); letter-spacing: 0.08em; }
.edu-note { font-size: 0.85rem; color: var(--faint); }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-width: 720px;
}
.contact-row {
  display: flex; align-items: center; gap: 1.1rem; padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--text);
  transition: background 0.15s ease;
}
.contact-row:last-child { border-bottom: none; }
a.contact-row:hover { background: var(--accent-soft); }
.contact-static { cursor: default; }
.contact-icon {
  width: 46px; height: 46px; flex: 0 0 46px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 11px; color: var(--accent); font-size: 1.15rem;
  background: rgba(240, 169, 59, 0.06);
}
.contact-text { display: flex; flex-direction: column; min-width: 0; }
.contact-label { font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-value { font-size: 1rem; overflow-wrap: anywhere; }
.contact-go { margin-left: auto; color: var(--faint); font-size: 0.9rem; flex: 0 0 auto; }
a.contact-row:hover .contact-go { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); padding: 2rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { font-size: 0.82rem; color: var(--faint); }
.footer-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.footer-badges li {
  font-size: 0.72rem; color: var(--faint); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: 0.25rem 0.6rem; text-transform: uppercase; letter-spacing: 0.06em;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 1.4rem; bottom: 1.4rem; width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent);
  font-size: 1.05rem; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.15s ease; z-index: 90;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--accent-border); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.8rem; }
  .hero { padding-top: calc(var(--nav-h) + 2rem); }
  .terminal-body { min-height: 0; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .teach-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); right: 0; left: 0;
    background: rgba(10, 13, 18, 0.97); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0; padding: 0.6rem 1.2rem 1.2rem;
    transform: translateY(-130%); transition: transform 0.28s ease;
  }
  .nav-links.open { transform: none; }
  .nav-links li { width: 100%; }
  .nav-links a:not(.btn) { display: block; padding: 0.85rem 0.4rem; font-size: 1.02rem; border-bottom: 1px solid var(--border-soft); border-radius: 0; }
  .nav-links .btn-resume { margin-top: 0.9rem; justify-content: center; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .section { padding: 4.2rem 0; }
  .project-grid { grid-template-columns: 1fr; }
  .teach-grid { grid-template-columns: 1fr; }
  .log-entry { padding-left: 2.4rem; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .scroll-cue { display: none; }
  .edu-side { text-align: left; }
  .about-facts > div { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (max-width: 520px) {
  body { font-size: 0.98rem; }
  .container { padding: 0 1.1rem; }
  .hero-title { font-size: 2.5rem; }
  .terminal-body { font-size: 0.78rem; padding: 1rem; }
  .log-card { padding: 1.3rem 1.2rem; }
  .contact-value { font-size: 0.9rem; }
  .to-top { right: 1rem; bottom: 1rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 404 page ---------- */
.page-404 { min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center; }
.page-404 .code { font-family: var(--font-display); font-size: clamp(5rem, 18vw, 9rem); font-weight: 700; color: var(--accent); line-height: 1; }
.page-404 h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 1rem 0 0.6rem; }
.page-404 p { color: var(--muted); margin-bottom: 1.8rem; }
