/* ── reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; }
ul, ol { list-style: none; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── tokens ────────────────────────────────────────── */
:root {
  --bg:        #050607;
  --bg-2:      #0a0d0e;
  --panel:     #0a0e0f;
  --line:      #1c2426;
  --line-soft: #141a1b;
  --fg:        #e8efec;
  --fg-dim:    #aebab6;
  --fg-faint:  #6d7c78;
  --acc:       #00e58a;
  --acc-dim:   #0a8f5b;
  --amber:     #ffb454;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --wrap: 1080px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
}

/* ── base ──────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: .01em;
  overflow-x: hidden;
  /* Kept very low so the page reads as near-black; the glyph field
     supplies the texture that a brighter wash used to. */
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(0, 229, 138, .035), transparent 70%);
  background-attachment: fixed;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.dim   { color: var(--fg-faint); }
.ok    { color: var(--acc); }
.prompt{ color: var(--acc); }
code   { font: inherit; color: var(--amber); }

.tag {
  color: var(--acc-dim);
  font-size: .72em;
  letter-spacing: .12em;
  white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--acc); color: #000; padding: .5rem 1rem;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* ── atmosphere ────────────────────────────────────── */
/* Glyph field sits above the body gradient but under all content,
   which is why main/footer below claim their own stacking level. */
#bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
main, .site-foot { position: relative; z-index: 1; }

.scanlines, .grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
}
.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, .22) 2px 4px
  );
  opacity: .35;
  mix-blend-mode: multiply;
}
.grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .028;
}

/* ── header ────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(5, 6, 7, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color .3s ease;
}
.site-head.scrolled { border-bottom-color: var(--line); }

.head-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 58px;
}

.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.brand-mark { color: var(--acc); font-weight: 700; }
.brand-txt { letter-spacing: .16em; font-size: .82rem; color: var(--fg); }

.nav { display: flex; gap: .4rem; }
.nav a {
  text-decoration: none;
  color: var(--fg-dim);
  font-size: .8rem;
  padding: .35rem .5rem;
  transition: color .18s ease, background-color .18s ease;
}
.nav a:hover, .nav a.active { color: var(--acc); background: rgba(0, 229, 138, .07); }

.menu-btn { display: none; color: var(--fg-dim); font-size: .8rem; }
.menu-btn:hover { color: var(--acc); }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
  padding: .35rem var(--pad) .75rem;
}
.mobile-nav a { text-decoration: none; color: var(--fg-dim); font-size: .85rem; padding: .5rem 0; }
.mobile-nav a:hover { color: var(--acc); }
.mobile-nav.open { display: flex; }

/* ── hero ──────────────────────────────────────────── */
.hero { padding-block: clamp(2.4rem, 7vw, 4.5rem) clamp(2.2rem, 5.5vw, 3.6rem); }

.boot { font-size: .8rem; color: var(--fg-faint); margin-bottom: 1.5rem; }
.boot-line { opacity: 0; animation: bootIn .32s ease forwards; }
.boot-line:nth-child(1) { animation-delay: .05s; }
.boot-line:nth-child(2) { animation-delay: .35s; }
.boot-line:nth-child(3) { animation-delay: .65s; }
.boot-line:nth-child(4) { animation-delay: .95s; }
@keyframes bootIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.hero-name {
  font-size: clamp(1.55rem, 6.2vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -.005em;
  font-weight: 700;
  word-break: break-word;
  text-shadow: 0 0 26px rgba(0, 229, 138, .16);
}

.hero-role { margin-top: .7rem; color: var(--fg-dim); font-size: clamp(.85rem, 2.4vw, 1rem); }

.hero-line {
  margin-top: 1.15rem;
  font-size: clamp(.92rem, 2.6vw, 1.22rem);
  color: var(--fg);
  min-height: 2.1em;
}
#typed { color: var(--fg); }
.caret {
  display: inline-block;
  width: .58em; height: 1.05em;
  background: var(--acc);
  vertical-align: -.16em;
  margin-left: .12em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.hero-sub {
  margin-top: 1rem;
  max-width: 62ch;
  color: var(--fg-dim);
  font-size: clamp(.85rem, 2.2vw, .96rem);
}

.hero-meta {
  margin-top: 1.4rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.6rem;
  font-size: .78rem; color: var(--fg-dim);
}

.hero-cta { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .7rem; }

.btn {
  display: inline-block;
  text-decoration: none;
  font-size: .82rem;
  padding: .6rem 1.15rem;
  border: 1px solid var(--acc-dim);
  color: var(--acc);
  background: rgba(0, 229, 138, .05);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { background: rgba(0, 229, 138, .13); border-color: var(--acc); transform: translateY(-1px); }
.btn.ghost { border-color: var(--line); color: var(--fg-dim); background: none; }
.btn.ghost:hover { color: var(--fg); border-color: var(--fg-faint); background: rgba(255, 255, 255, .03); }
.btn.big { margin-top: 1.5rem; padding: .8rem 1.5rem; font-size: .9rem; }

/* ── sections ──────────────────────────────────────── */
.section { padding-block: clamp(2.1rem, 5.5vw, 3.4rem); scroll-margin-top: 66px; }

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.7rem;
}
.sec-head h2 {
  font-size: clamp(.95rem, 3vw, 1.15rem);
  letter-spacing: .1em;
  font-weight: 700;
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
}
.sec-note { font-size: .74rem; color: var(--fg-faint); }

/* ── reveal ────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── jobs ──────────────────────────────────────────── */
.jobs { display: flex; flex-direction: column; }

.job {
  border-left: 1px solid var(--line);
  padding: 0 0 1.7rem 1.35rem;
  position: relative;
}
.job::before {
  content: "";
  position: absolute; left: -4.5px; top: .62rem;
  width: 8px; height: 8px;
  background: var(--bg);
  border: 1px solid var(--fg-faint);
  border-radius: 50%;
}
.job:first-child::before { border-color: var(--acc); background: var(--acc); box-shadow: 0 0 12px rgba(0, 229, 138, .55); }
.job:last-child { border-left-color: transparent; }
.job:last-child::before { border-color: var(--line); }
/* when the log is collapsed, the last visible entry ends the timeline */
.jobs:not(.expanded) .job:nth-child(3) { border-left-color: transparent; padding-bottom: 1.1rem; }

.job-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .6rem 1.25rem; flex-wrap: wrap;
}
.job-title { font-size: clamp(.98rem, 2.6vw, 1.1rem); font-weight: 700; letter-spacing: .01em; }
.job-org { color: var(--fg-dim); font-size: .86rem; margin-top: .15rem; }
.job-when { font-size: .74rem; color: var(--fg-faint); white-space: nowrap; }
.job-when.live { color: var(--acc); }

.bullets { margin-top: .8rem; display: flex; flex-direction: column; gap: .35rem; }
.bullets li {
  position: relative;
  padding-left: 1.35rem;
  font-size: .87rem;
  color: var(--fg-dim);
  max-width: 78ch;
}
.bullets li::before {
  content: "▸";
  position: absolute; left: 0; top: 0;
  color: var(--acc-dim);
}
.bullets li strong { color: var(--fg); font-weight: 700; }

.stack-line {
  margin-top: .75rem;
  font-size: .76rem;
  color: var(--fg-faint);
  display: flex; gap: .5rem; flex-wrap: wrap;
}

.hidden-entry { display: none; }
.jobs.expanded .hidden-entry { display: block; }

.expand {
  margin-top: .5rem;
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--acc);
  border: 1px dashed var(--acc-dim);
  padding: .6rem 1.15rem;
  transition: background-color .18s ease;
}
.expand:hover { background: rgba(0, 229, 138, .08); }
.expand-count { color: var(--fg-faint); }

/* ── cards ─────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: .7rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.05rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .2s ease, transform .2s ease, background-color .2s ease,
              opacity .5s ease;
}
.card:hover { border-color: var(--acc-dim); transform: translateY(-2px); background: var(--bg-2); }
.card header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card h3 { font-size: .95rem; color: var(--acc); font-weight: 700; }
.badge {
  font-size: .68rem;
  color: var(--amber);
  border: 1px solid rgba(255, 180, 84, .3);
  padding: .1rem .5rem;
  white-space: nowrap;
}
.card p { font-size: .84rem; color: var(--fg-dim); }
.card-stack { font-size: .74rem !important; color: var(--fg-faint) !important; margin-top: auto; padding-top: .3rem; }

/* ── bio ───────────────────────────────────────────── */
.bio { display: flex; flex-direction: column; gap: .75rem; max-width: 76ch; }
.bio p { font-size: .89rem; color: var(--fg-dim); }
.bio p:first-child { font-size: clamp(.95rem, 2.6vw, 1.08rem); color: var(--fg); }
.bio strong { color: var(--fg); }
.edu {
  margin-top: .5rem; padding-top: .85rem;
  border-top: 1px solid var(--line-soft);
  font-size: .8rem !important;
}

/* ── stack ─────────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.stack-block {
  background: var(--bg);
  padding: .95rem 1.05rem;
  transition: background-color .2s ease, opacity .5s ease, transform .5s ease;
}
.stack-block:hover { background: var(--panel); }
.stack-block h3 {
  font-size: .82rem; letter-spacing: .08em; color: var(--fg);
  display: flex; align-items: baseline; gap: .6rem;
}
.num { color: var(--acc-dim); font-size: .74rem; }
.stack-block p { margin-top: .55rem; font-size: .8rem; color: var(--fg-dim); }

/* ── connect ───────────────────────────────────────── */
.connect { max-width: 62ch; }
.connect-intro { font-size: clamp(.9rem, 2.5vw, 1.02rem); margin-bottom: 1.3rem; }
.links { display: flex; flex-direction: column; gap: .5rem; }
.links li { display: flex; align-items: baseline; gap: .85rem; }
.links a {
  text-decoration: none;
  color: var(--fg);
  font-size: .88rem;
  border-bottom: 1px solid var(--line);
  transition: color .18s ease, border-color .18s ease;
  word-break: break-all;
}
.links a:hover { color: var(--acc); border-color: var(--acc); }

/* ── footer ────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); padding-block: 1.35rem; margin-top: 1.25rem; }
.foot-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1.5rem;
  font-size: .76rem; color: var(--fg-faint);
}
.foot-links { display: flex; gap: 1.1rem; }
.foot-links a { text-decoration: none; transition: color .18s ease; }
.foot-links a:hover { color: var(--acc); }

/* ── responsive ────────────────────────────────────── */
@media (max-width: 720px) {
  .nav { display: none; }
  .menu-btn { display: inline-block; }
  .job-when { font-size: .72rem; }
  .scanlines { opacity: .22; }
  /* reserve room so the typing line doesn't reflow the page as it wraps */
  .hero-line { min-height: 4.4em; }
}
