/* =========================================================
   Tokens
   ========================================================= */
:root {
  --bg:        #0B0D10;
  --surface:   #14171C;
  --ink:       #ECEDEE;
  --muted:     #8B93A0;
  --line:      rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --accent:    #E3B341;   /* terminal amber */
  --accent-ink:#EFC876;
  --accent-bg: rgba(227, 179, 65, 0.10);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-w: 1080px;
  --radius: 10px;
  --header-h: 68px;
  --footer-h: 38px;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;           /* the page itself never scrolls */
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, dt { font-family: var(--font-mono); margin: 0; }
p { margin: 0; }

.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

.dim { color: var(--muted); font-weight: 400; }
.accent { color: var(--accent-ink); }
.accent-text { color: var(--accent-ink); }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Visually-hidden but still focusable/keyboard-operable inputs */
.vh-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   App shell — fills the viewport exactly, no page scroll
   ========================================================= */
.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   Header / nav
   ========================================================= */
.site-header {
  flex: 0 0 var(--header-h);
  background: rgba(11, 13, 16, 0.9);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.logo-mark { color: var(--accent); margin-right: 2px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.site-nav label { color: var(--muted); transition: color 0.15s ease; cursor: pointer; }
.site-nav label:hover { color: var(--ink); }
.site-nav label .dim { font-size: 0.8em; }

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #14110A; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.nav-resume { margin-left: 4px; }
.nav-resume--mobile { display: none; }

/* =========================================================
   CSS-only tabs: one <input type=radio> per panel, visually
   hidden but focusable. Panels live inside .panels, a sibling
   of the inputs, so we can target them with ~ combinators.
   ========================================================= */
.panels {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;               /* required so children can scroll instead of growing */
}
.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  padding-block: 40px 64px;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.panel::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.panel { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* bottom fade cue, shared across whichever panel is active */
.panels-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 5;
}

#tab-home:checked    ~ .app .panels #panel-home,
#tab-about:checked   ~ .app .panels #panel-about,
#tab-skills:checked  ~ .app .panels #panel-skills,
#tab-work:checked    ~ .app .panels #panel-work,
#tab-exp:checked     ~ .app .panels #panel-experience,
#tab-contact:checked ~ .app .panels #panel-contact {
  display: block;
}

/* active tab highlight in nav */
#tab-home:checked    ~ .app .site-nav label[for="tab-home"],
#tab-about:checked   ~ .app .site-nav label[for="tab-about"],
#tab-skills:checked  ~ .app .site-nav label[for="tab-skills"],
#tab-work:checked    ~ .app .site-nav label[for="tab-work"],
#tab-exp:checked     ~ .app .site-nav label[for="tab-exp"],
#tab-contact:checked ~ .app .site-nav label[for="tab-contact"],
#tab-home:checked    ~ .app .mobile-tabbar label[for="tab-home"],
#tab-about:checked   ~ .app .mobile-tabbar label[for="tab-about"],
#tab-skills:checked  ~ .app .mobile-tabbar label[for="tab-skills"],
#tab-work:checked    ~ .app .mobile-tabbar label[for="tab-work"],
#tab-exp:checked     ~ .app .mobile-tabbar label[for="tab-exp"],
#tab-contact:checked ~ .app .mobile-tabbar label[for="tab-contact"] {
  color: var(--accent);
  border-top-color: var(--accent);
}

/* =========================================================
   Home / hero panel
   ========================================================= */
#panel-home { padding-block: 0; } /* home is visible by default via #tab-home[checked] below */
.hero {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding-block: 48px;
}
.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 46ch;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(227, 179, 65, 0.18);
  justify-self: end;
  width: 100%;
  max-width: 360px;
}
.card-titlebar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-r { background: #E5675D; }
.dot-y { background: #E5B95D; }
.dot-g { background: #5DBF6C; }
.card-filename { margin-left: 8px; font-family: var(--font-mono); font-size: 0.75rem; color: rgba(255,255,255,0.45); }
.card-code { margin: 0; padding: 18px 16px 22px; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.7; color: #C9CDD3; overflow-x: auto; }
.tok-kw   { color: #C792EA; }
.tok-var  { color: #82AAFF; }
.tok-key  { color: #7FD1B9; }
.tok-str  { color: #E5B95D; }
.tok-bool { color: #C792EA; }
.cursor { display: inline-block; width: 7px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   Generic panel sections (about/skills/work/experience/contact)
   ========================================================= */
.panel-inner { min-height: 100%; }
.panel h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-label { font-family: var(--font-mono); font-weight: 500; font-size: 0.85rem; color: var(--accent); order: -1; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
.about-photo { width: 128px; height: 128px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 20px; }
.about-copy p { color: var(--muted); margin-bottom: 16px; max-width: 60ch; }
.about-copy p:last-child { margin-bottom: 0; }
.about-facts { display: grid; gap: 18px; align-content: start; border-left: 1px solid var(--line); padding-left: 26px; }
.about-facts dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.about-facts dd { margin: 0; font-weight: 500; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.skill-group h3 { font-family: var(--font-body); font-size: 0.92rem; font-weight: 600; margin-bottom: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li { font-family: var(--font-mono); font-size: 0.76rem; padding: 6px 11px; border-radius: 6px; background: var(--accent-bg); color: var(--accent-ink); border: 1px solid rgba(227, 179, 65, 0.2); }
.tag-list--muted li { background: transparent; color: var(--muted); border-color: var(--line); }

/* Projects — grows internally, panel scrolls, page never does */
.project-list { display: flex; flex-direction: column; }
.project { display: grid; grid-template-columns: 52px 1fr auto; gap: 26px; padding-block: 26px; border-top: 1px solid var(--line-soft); align-items: start; }
.project:first-child { border-top: none; padding-top: 0; }
.project-index { font-family: var(--font-mono); color: var(--muted); font-size: 0.85rem; padding-top: 4px; }
.project h3 { font-family: var(--font-body); font-size: 1.12rem; font-weight: 700; margin-bottom: 4px; }
.project-role { color: var(--accent-ink); font-size: 0.86rem; margin-bottom: 10px; }
.project-body > p:not(.project-role) { color: var(--muted); max-width: 62ch; margin-bottom: 14px; }
.project-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; padding-top: 4px; }
.link-arrow { font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; border-bottom: 1px solid transparent; transition: border-color 0.15s ease, color 0.15s ease; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* Experience timeline */
.timeline { display: flex; flex-direction: column; }
.timeline-row { display: grid; grid-template-columns: 150px 1fr; gap: 26px; padding-block: 22px; border-top: 1px solid var(--line-soft); }
.timeline-row:first-child { border-top: none; padding-top: 0; }
.timeline-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); padding-top: 3px; }
.timeline-body h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; margin-bottom: 6px; }
.timeline-body p { color: var(--muted); max-width: 62ch; }

/* Contact */
.contact-lead { color: var(--muted); max-width: 56ch; margin-bottom: 26px; font-size: 1.02rem; }
.contact-actions { margin-bottom: 26px; }
.social-links { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 0.85rem; }
.social-links a { color: var(--muted); border-bottom: 1px solid transparent; }
.social-links a:hover { color: var(--ink); border-color: var(--ink); }

/* =========================================================
   Footer status bar
   ========================================================= */
.status-bar { flex: 0 0 var(--footer-h); background: var(--surface); border-top: 1px solid var(--line); }
.status-inner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; height: var(--footer-h); font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.status-sep { color: var(--line); }

/* Mobile bottom tab bar — replaces .status-bar on small screens so a
   single control switches panels instantly with nothing left to "close". */
.mobile-tabbar {
  display: none;
  flex: 0 0 60px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.mobile-tabbar label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-top: 2px solid transparent;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-block: 32px; }
  .hero-card { justify-self: start; max-width: 420px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-facts { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project { grid-template-columns: 36px 1fr; }
  .project-links { grid-column: 2; flex-direction: row; align-items: center; padding-top: 0; }
  .timeline-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 720px) {
  /* Header collapses to just the logo + resume link; the full nav list
     moves to the fixed bottom tab bar below, which is always visible —
     so there's no open/close state that can get stuck. */
  .site-nav { display: none; }
  .nav-resume--mobile { display: inline-block; }

  .status-bar { display: none; }
  .mobile-tabbar { display: flex; }
}

@media (max-width: 560px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.7rem; }
  :root { --header-h: 60px; }
}