/* ===== Design tokens ===== */
:root {
  --bg: #0B0C10;
  --bg-terminal: #07080B;
  --fg: #E9E8E3;
  --body: #B9BCC2;
  --muted: #90949B;
  --dim: #6B6F76;
  --border: #22252C;
  --accent: #4D79FF;
  --scan-opacity: 1;
  --max-w: 1360px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }
html, body { width: 100%; max-width: 100%; }

/* Clip sideways overflow on <body> only. Putting overflow-x on <html>
   makes it a scroll container, which degrades native scrolling and can
   break position:sticky (our masthead) — so it stays off <html>. */
body { overflow-x: hidden; }

/* only affects anchor/programmatic jumps, never wheel scrolling */
html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); }

::selection { background: var(--accent); color: var(--bg); }

.mono { font-family: 'JetBrains Mono', monospace; }
.display { font-family: 'Silkscreen', monospace; }

@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
@keyframes tickerScroll { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* ===== Masthead ===== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 12, 16, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--border);
}

.masthead-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  flex-shrink: 0;
}

.logo-text {
  font-size: 12px;
  color: var(--fg);
}

/* on sub-pages the logo doubles as a link home */
a.logo:hover .logo-text { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.nav-links a {
  color: var(--muted);
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--accent); }

.masthead-meta {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

/* ===== Layout ===== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px 120px 32px;
  display: flex;
  flex-direction: column;
}

.fig {
  padding-top: 140px;
}

#intro.fig { padding-top: 88px; }

.section-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.14em;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-label .tag { color: var(--accent); }
.section-label .sub { color: var(--dim); }

/* scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Reusable pieces ===== */
.code-block {
  position: relative;
  background: var(--bg-terminal);
  border: 2px solid var(--border);
  padding: 18px 20px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--body);
}
.code-block .dim { color: var(--dim); }
.code-block .accent-text { color: var(--accent); }

.spec-box { border: 2px solid var(--border); }
.spec-header {
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  font-size: 10px;
  color: var(--dim);
}
.spec-body {
  padding: 16px 16px 18px 16px;
  display: grid;
  grid-template-columns: 76px 1fr;
  row-gap: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.spec-body .k { color: var(--dim); }
.spec-body .accent-text { color: var(--accent); }

.img-frame {
  position: relative;
  border: 2px solid var(--border);
}
.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.03);
}
.img-frame .scanline-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--scan-opacity);
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent 3px);
}
.img-frame .corner {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  z-index: 2;
}
.corner-tl { top: -6px; left: -6px; }
.corner-tr { top: -6px; right: -6px; }
.corner-bl { bottom: -6px; left: -6px; }
.corner-br { bottom: -6px; right: -6px; }

.img-caption {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.img-caption .accent-text { color: var(--accent); }

/* ===== Hero ===== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: start;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-copy h1 {
  font-size: clamp(28px, 4.4vw, 54px);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  letter-spacing: 0;
}

.hero-copy p.lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  margin: 0;
  max-width: 560px;
}

.boot-terminal {
  position: relative;
  background: var(--bg-terminal);
  border: 2px solid var(--border);
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.9;
  min-height: 158px;
}
.boot-terminal .corner-tl { top: -6px; left: -6px; }
.boot-line .p { }
.boot-cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
.boot-cursor[hidden] { display: none; }

.hero-links {
  display: flex;
  gap: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  flex-wrap: wrap;
}

.hero-portrait {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-portrait .img-frame { aspect-ratio: 4 / 5; }

/* ===== Ticker (full-bleed: breaks out of the centered content column) ===== */
.ticker {
  margin-top: 64px;
  /* span the full viewport width regardless of the 1360px content column */
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 14px 0;
  overflow: hidden;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tickerScroll 36s linear infinite;
}
.ticker:hover .ticker-track {
  animation-play-state: paused;
}
.ticker-group {
  display: flex;
  gap: 32px;
  padding-right: 32px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}
.ticker-group .star { color: var(--accent); }

/* ===== Two-column project rows ===== */
.split {
  display: grid;
  gap: 48px;
  align-items: start;
}
.split-copy { display: flex; flex-direction: column; gap: 24px; }
.split-copy h2 {
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.split-copy p { font-size: 16px; line-height: 1.65; color: var(--body); margin: 0; }
.split-media { display: flex; flex-direction: column; gap: 20px; }

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.project-links a {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 2px solid var(--border);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.1em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.project-links a:hover,
.project-links a:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

#work.fig .split { grid-template-columns: 1.05fr 0.95fr; }
.forklab .split { grid-template-columns: 0.95fr 1.05fr; }
.auction .split { grid-template-columns: 1.05fr 0.95fr; }
.kpmg .split { grid-template-columns: 1.05fr 0.95fr; }
.aisoc .split { grid-template-columns: 1.05fr 0.95fr; }
.aisoc-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}
.aisoc-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.aisoc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--fg);
}
.aisoc-stats span {
  background: var(--bg-terminal);
  border: 2px solid var(--border);
  padding: 6px 10px;
}

.media-block { display: flex; flex-direction: column; gap: 10px; }
.media-block .img-frame { aspect-ratio: 16 / 10; }

.badge-winner {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg);
  padding: 6px 12px;
  font-size: 10px;
}

/* ===== Sharebite ===== */
.sharebite-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 40px;
}
.sharebite-heading h2 {
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.sharebite-heading p { font-size: 16px; line-height: 1.65; color: var(--body); margin: 0; }

.sharebite-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.sharebite-images .img-frame { aspect-ratio: 16 / 11; }
.sharebite-images .media-block { gap: 10px; }

.sharebite-meta {
  margin-top: 24px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.sharebite-meta .k { color: var(--dim); }
.sharebite-meta .accent-text { color: var(--accent); }

.sharebite-meta + .project-links { margin-top: 20px; }

/* ===== SAM2 FYP ===== */
.fyp-box {
  border: 2px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.fyp-copy {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.fyp-copy h2 {
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.fyp-copy p { font-size: 15px; line-height: 1.65; color: var(--body); margin: 0; }
.fyp-spec-col {
  border-left: 2px solid var(--border);
  align-self: stretch;
  display: flex;
  flex-direction: column;
}
.fyp-thumb { padding: 24px 40px 0; }
.fyp-thumb .img-frame { aspect-ratio: 2.5 / 1; }
.fyp-spec {
  padding: 24px 40px 36px;
  display: grid;
  grid-template-columns: 76px 1fr;
  row-gap: 10px;
  font-size: 12px;
  line-height: 1.5;
  align-content: center;
  flex: 1;
}
.fyp-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.fyp-spec .k { color: var(--dim); }
.fyp-spec .accent-text { color: var(--accent); }

/* ===== Origins ===== */
.timeline {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
  flex-wrap: wrap;
}
.timeline-line {
  flex: 0 0 60px;
  height: 2px;
  background: var(--accent);
}
.timeline-line.dashed {
  background: repeating-linear-gradient(90deg, var(--accent) 0px, var(--accent) 6px, transparent 6px, transparent 12px);
}
.timeline .accent-text { color: var(--accent); }


/* ===== Contact ===== */
.contact h2 {
  font-size: clamp(24px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 36px 0;
}
.contact-table {
  border: 2px solid var(--border);
  font-size: 13px;
}
.contact-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  align-items: center;
  border-bottom: 2px solid var(--border);
  color: var(--fg);
}
.contact-row:last-child { border-bottom: none; }
.contact-row:hover {
  background: #101218;
  color: var(--accent);
}
.contact-row .label {
  padding: 18px 20px;
  color: var(--dim);
  letter-spacing: 0.1em;
}
.contact-row .value {
  padding: 18px 0;
}
.contact-row .value .note { color: var(--dim); }
.contact-row .arrow {
  padding: 18px 20px 18px 0;
  color: var(--accent);
}

/* ===== Footer ===== */
footer {
  margin-top: 120px;
  border-top: 2px solid var(--border);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ===== Masthead right + menu button ===== */
.masthead-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--fg);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.menu-btn:hover { border-color: var(--accent); color: var(--accent); }

.menu-glyph {
  position: relative;
  width: 14px;
  height: 10px;
  flex-shrink: 0;
}
.menu-glyph,
.menu-glyph::before,
.menu-glyph::after {
  border-top: 2px solid currentColor;
}
.menu-glyph::before,
.menu-glyph::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
}
.menu-glyph::before { top: 3px; }
.menu-glyph::after { top: 7px; }

/* ===== Nav drawer ===== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 8, 11, 0.72);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.drawer-backdrop.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 340px;
  max-width: 86vw;
  height: 100%;
  background: var(--bg-terminal);
  border-right: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  transform: translateX(-104%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--scan-opacity);
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0px, rgba(0,0,0,0.16) 1px, transparent 1px, transparent 3px);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.drawer-blink { animation: blink 1s step-end infinite; color: var(--accent); }
.drawer-close {
  background: transparent;
  border: none;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
}
.drawer-close:hover { color: var(--accent); }

.drawer-tree {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}
.tree-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--body);
  border-left: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tree-row:hover,
.tree-row.is-active {
  background: rgba(77, 121, 255, 0.08);
  border-left-color: var(--accent);
  color: var(--fg);
}
.tree-row.is-focus {
  background: rgba(77, 121, 255, 0.16);
  border-left-color: var(--accent);
}
.tree-idx { color: var(--dim); font-size: 11px; }
.tree-name { font-size: 14px; letter-spacing: 0.02em; }
.tree-row:hover .tree-name,
.tree-row.is-active .tree-name { color: var(--accent); }
.tree-hint { color: var(--dim); font-size: 10px; letter-spacing: 0.08em; }

.drawer-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 2px solid var(--border);
  font-size: 13px;
}
.cmd-prompt { color: var(--accent); white-space: nowrap; }
.cmd-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 13px;
  caret-color: var(--accent);
}
.cmd-input::placeholder { color: var(--dim); }

.drawer-foot {
  padding: 0 20px 18px 20px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.drawer-foot b { color: var(--muted); font-weight: 500; }

/* lock scroll when drawer open */
body.drawer-open { overflow: hidden; }

/* ===== Highlighted FIG tag chip (RobertHQ-style) ===== */
.tag--chip {
  display: inline-block;
  background: var(--accent);
  color: var(--bg) !important;
  padding: 4px 9px;
  letter-spacing: 0.1em;
}

/* ===== Certifications ===== */
.certs-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 36px;
}
.certs-intro h2 {
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.certs-intro p { font-size: 16px; line-height: 1.65; color: var(--body); margin: 0; }

.certs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.certs-more {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.cert-card {
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.cert-head {
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  font-size: 10px;
  color: var(--dim);
}
.cert-body {
  padding: 14px 14px 16px 14px;
  display: grid;
  grid-template-columns: 60px 1fr;
  row-gap: 9px;
  font-size: 11px;
  line-height: 1.45;
  flex: 1;
}
.cert-body .k { color: var(--dim); }
.cert-body .dim { color: var(--dim); }
.cert-name { color: var(--fg); }
.cert-verify {
  display: block;
  padding: 11px 14px;
  border-top: 2px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.cert-verify:hover { background: var(--accent); color: var(--bg); }

/* ============================================================
   Certifications page (certifications.html)
   A vertical timeline of every credential, newest first. Shares the
   masthead, footer and tokens of the main page; these cards carry no
   media, so they read as one clean column rather than the split
   image/copy layout used by the hackathon timeline.
   ============================================================ */
.cert-list {
  margin-top: 44px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cert-entry {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 28px;
  position: relative;
  min-width: 0;
}
/* the connecting spine */
.cert-entry::before {
  content: '';
  position: absolute;
  left: 121px;
  top: 22px;
  bottom: -34px;
  width: 2px;
  background: var(--border);
}
.cert-entry:last-child::before { display: none; }

.cert-rail {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 14px;
}
.cert-rail .d {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
  white-space: nowrap;
}
.cert-rail .node {
  position: absolute;
  right: -16px;
  top: 16px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  z-index: 1;
}
.cert-entry-card {
  border: 2px solid var(--border);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color 0.18s ease;
}
.cert-entry-card:hover { border-color: var(--accent); }

.cert-entry-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cert-entry-top h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}
.cert-tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  border: 1px solid var(--border);
  color: var(--dim);
  white-space: nowrap;
}
.cert-tag--award {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.cert-issuer {
  font-size: 10px !important;
  letter-spacing: 0.1em;
  color: var(--dim) !important;
  margin: -4px 0 0 0 !important;
}
.cert-entry-card > p { font-size: 14px; line-height: 1.6; color: var(--body); margin: 0; }

.cert-entry-meta {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--body);
  padding-top: 12px;
  border-top: 2px solid var(--border);
  min-width: 0;
}
.cert-entry-meta .k { color: var(--dim); }
.cert-entry-meta span { min-width: 0; overflow-wrap: anywhere; }

.cert-entry-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.1em;
}
/* back link above the page title */
.page-back {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 20px;
}
.page-back:hover { color: var(--accent); }

/* ===== AFK / hobbies ===== */
.afk-intro {
  font-size: 13px;
  color: var(--body);
  margin-bottom: 28px;
}
.afk-intro .dim { color: var(--dim); }
.afk-intro .accent-text { color: var(--accent); }

.afk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.afk-card {
  border: 2px solid var(--border);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.18s ease;
}
.afk-card:hover { border-color: var(--accent); }
.afk-media { margin: -28px -26px 4px -26px; }
.afk-media .img-frame { aspect-ratio: 5 / 4; border-left: none; border-right: none; border-top: none; }
.afk-icon { color: var(--accent); line-height: 0; }
.afk-icon .pixicon {
  width: 46px;
  height: auto;
  display: block;
}
.afk-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}
.afk-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  margin: 0;
  flex: 1;
}
.afk-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 2px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.afk-stat .k { color: var(--dim); }
.afk-stat .accent-text { color: var(--accent); }

/* ============================================================
   INTERACTIVE TERMINAL
   ============================================================ */
.boot-terminal.is-live {
  max-height: 320px;
  overflow-y: auto;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.boot-terminal.is-live::-webkit-scrollbar { width: 8px; }
.boot-terminal.is-live::-webkit-scrollbar-track { background: transparent; }
.boot-terminal.is-live::-webkit-scrollbar-thumb { background: var(--border); }

.term-output { display: flex; flex-direction: column; }
.term-line { white-space: pre-wrap; word-break: break-word; }

.term-prompt-line {
  display: flex;
  align-items: baseline;
  gap: 0;
  flex-wrap: nowrap;
}
.term-user { color: var(--accent); }
.term-cwd  { color: #7FA0FF; }
.term-sep  { color: var(--dim); }
.term-input {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.9;
  caret-color: var(--accent);
  padding: 0;
}
.term-input::placeholder { color: var(--dim); }

.term-hint {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.term-hint b { color: var(--accent); font-weight: 500; }

/* terminal output palette */
.t-fg     { color: var(--fg); }
.t-body   { color: var(--body); }
.t-dim    { color: var(--dim); }
.t-accent { color: var(--accent); }
.t-ok     { color: #3DDC84; }
.t-warn   { color: #FF7A3D; }
.t-user   { color: var(--accent); }
.t-cwd    { color: #7FA0FF; }
.t-link   { color: var(--accent); text-decoration: none; }
.t-link:hover { color: var(--fg); text-decoration: underline; }

/* ============================================================
   CRT POWER-ON + GLITCH
   ============================================================ */
.crt-boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #05060A;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: crtOpen 0.78s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
.crt-boot.is-done { opacity: 0; transition: opacity 0.4s ease; }
.crt-line {
  width: 100%;
  height: 2px;
  background: #E9E8E3;
  box-shadow: 0 0 18px 4px rgba(233, 232, 227, 0.6);
  animation: crtLine 0.78s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
@keyframes crtOpen {
  0%   { background: #05060A; }
  70%  { background: rgba(5, 6, 10, 0.6); }
  100% { background: rgba(5, 6, 10, 0); }
}
@keyframes crtLine {
  0%   { transform: scaleX(0.15); opacity: 0; }
  18%  { transform: scaleX(1); opacity: 1; }
  55%  { transform: scaleX(1) scaleY(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(160); opacity: 0; }
}
body.crt-booting { overflow: hidden; }

body.crt-glitch main,
body.crt-glitch .masthead { animation: crtShake 0.5s steps(2, end); }
@keyframes crtShake {
  0%, 100% { transform: translate(0, 0); filter: none; }
  20% { transform: translate(-3px, 1px); filter: hue-rotate(12deg); }
  40% { transform: translate(3px, -1px); filter: contrast(1.25); }
  60% { transform: translate(-2px, 0); filter: hue-rotate(-12deg); }
  80% { transform: translate(2px, 1px); }
}

/* ============================================================
   KONAMI INVADERS + TOAST
   ============================================================ */
.invader-layer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  overflow: hidden;
}
.invader {
  position: absolute;
  top: -8vh;
  color: var(--accent);
  line-height: 0;
  animation-name: invaderFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
.invader svg { width: 100%; height: auto; display: block; }
@keyframes invaderFall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate(var(--drift, 0), 118vh) rotate(8deg); opacity: 0; }
}

.pixel-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 14px);
  z-index: 9500;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  border: 2px solid var(--accent);
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  max-width: 88vw;
  text-align: center;
}
.pixel-toast.is-in { opacity: 1; transform: translate(-50%, 0); }


/* ============================================================
   HACKATHON TIMELINE
   ============================================================ */
.hacks-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 44px;
}
.hacks-head h2 {
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.hacks-head p { font-size: 16px; line-height: 1.65; color: var(--body); margin: 0; }

.hack-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hack {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 28px;
  position: relative;
}
/* the connecting spine */
.hack::before {
  content: '';
  position: absolute;
  left: 121px;
  top: 22px;
  bottom: -50px;
  width: 2px;
  background: var(--border);
}
.hack:last-child::before { display: none; }

.hack-rail {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 14px;
}
.hack-date {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
  white-space: nowrap;
}
.hack-node {
  position: absolute;
  right: -16px;
  top: 16px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  z-index: 1;
}

.hack-card {
  border: 2px solid var(--border);
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  transition: border-color 0.18s ease;
  min-width: 0;
}
.hack-card:hover { border-color: var(--accent); }
/* entry with no photo yet: body takes the full card width */
.hack-card--noimg { grid-template-columns: 1fr; }
/* the photo fills its column and stretches to the card's height. no
   aspect-ratio here: combined with height: 100% it derives the width
   from the (text-driven) card height, so the frame grew wider than its
   column and painted over the description copy. */
.hack-media .img-frame {
  border: none;
  border-right: 2px solid var(--border);
  width: 100%;
  height: 100%;
  min-height: 190px;
}

/* two photos sharing one media slot (e.g. a team shot + an event/venue
   shot) — each takes half the column and the full card height. */
.hack-media--split {
  display: flex;
}
.hack-media--split .img-frame {
  flex: 1;
  min-width: 0;
}
.hack-media--split .img-frame:first-child { border-right: 1px solid var(--border); }
.hack-media--split .img-frame:last-child { border-right: 2px solid var(--border); }
.hack-body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-width: 0;
}
.hack-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hack-top h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}
.hack-badge {
  background: var(--accent);
  color: var(--bg);
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.hack-badge.is-muted {
  background: transparent;
  color: var(--dim);
  border: 1px dashed rgba(233, 232, 227, 0.2);
}
.hack-event {
  font-size: 10px !important;
  letter-spacing: 0.1em;
  color: var(--dim) !important;
  margin: -6px 0 0 0 !important;
}
.hack-body p { font-size: 14px; line-height: 1.6; color: var(--body); margin: 0; }

.hack-meta {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--body);
  padding-top: 12px;
  border-top: 2px solid var(--border);
  min-width: 0;
}
.hack-meta .k { color: var(--dim); }
.hack-meta span { min-width: 0; overflow-wrap: anywhere; }
.hack-media { min-width: 0; }

.hack-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* unfilled entries — obvious in the editor, quiet on the page */
.hack-todo { color: var(--dim); font-style: italic; }
.hack.is-template { opacity: 0.55; }

/* ===== Responsive ===== */
@media (max-width: 1040px) {
  .certs-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  /* certifications page: the timeline collapses to one column with the
     date sitting above each card */
  .cert-list { margin-top: 32px; }
  .cert-entry { grid-template-columns: 1fr; gap: 12px; }
  .cert-entry::before { display: none; }
  .cert-rail { justify-content: flex-start; padding-top: 0; align-items: center; }
  .cert-rail .node { position: static; }
  .cert-entry-card { padding: 20px 18px; }

  .hero-grid,
  #work.fig .split,
  .forklab .split,
  .auction .split,
  .kpmg .split,
  .aisoc .split,
  .sharebite-heading,
  .sharebite-images,
  .fyp-box,
  .certs-intro,
  .afk-grid,
  .hacks-head,
  .hack-card {
    grid-template-columns: 1fr;
  }
  .hacks-head { gap: 20px; }
  /* timeline collapses to a single column: date sits above the card */
  .hack { grid-template-columns: 1fr; gap: 12px; }
  .hack::before { display: none; }
  .hack-rail { justify-content: flex-start; padding-top: 0; }
  .hack-node { position: static; }
  .hack-media .img-frame { border-right: none; border-bottom: 2px solid var(--border); height: auto; aspect-ratio: 16 / 10; }
  /* stack the two split photos instead of squeezing them side by side */
  .hack-media--split { flex-direction: column; }
  .hack-media--split .img-frame { aspect-ratio: 16 / 10; border-right: none; }
  .hack-media--split .img-frame:first-child { border-bottom: 1px solid var(--border); }
  .hack-media--split .img-frame:last-child { border-bottom: 2px solid var(--border); }
  .boot-terminal.is-live { max-height: 260px; }
  .fyp-spec-col { border-left: none; border-top: 2px solid var(--border); }
  .hero-portrait { order: -1; max-width: 280px; }
  main { padding: 0 20px 100px 20px; }
  .masthead-inner { padding: 14px 20px; }
  .fig { padding-top: 96px; }
  .certs-intro { gap: 20px; }
}

/* below 720px the inline links give way to the menu drawer */
@media (max-width: 720px) {
  .nav-links { display: none; }
}

@media (max-width: 520px) {
  .masthead-meta { display: none; }
  .menu-btn-text { display: none; }
  .menu-btn { padding: 8px 10px; }
  .contact-row { grid-template-columns: 110px 1fr 32px; }
  .certs-grid { grid-template-columns: 1fr; }
}
