/* Shared base for every page: light only, one centered column, Geist Mono.
   Loaded before each page's own <style>. */

:root {
  --bg: rgb(250,250,248);
  --card: rgb(255,255,255);
  --elevated: rgb(244,244,242);
  --card-hover: rgb(245,245,243);
  --hover-bg: rgb(237,237,233);   /* shared hover fill for buttons and links */
  --muted-bg: rgba(0,0,0,0.03);
  --divider: rgb(228,228,224);
  --line: rgb(200,200,195);
  --text: rgb(23,23,23);
  --body2: rgb(64,64,62);
  --muted: rgb(102,102,102);
  --nav-text: rgb(102,102,102);
  --faint: rgb(150,150,146);
  --green: rgb(0,168,72);
  --accent: rgb(23,23,23);
  --gold: rgb(23,23,23);
  --gutter: 36px;          /* space between the timeline rail and its text */
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist Mono', monospace;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--green); outline-offset: 3px; border-radius: 3px;
}

/* ---- Centered column ---- */
.col {
  position: relative; z-index: 1;
  max-width: 668px; margin: 0 auto;
  padding: 48px 24px 56px;
  /* soft halo in the page color: keeps text legible over the ASCII figure and pixel trail */
  text-shadow: 0 0 3px var(--bg), 0 0 7px var(--bg), 0 0 12px var(--bg);
}

/* ---- Top bar on inner pages: monogram + pill tabs ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 56px;
}
.home {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--elevated); border: 1px solid var(--divider);
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  transition: border-color 180ms, background 180ms;
}
.home:hover { border-color: var(--text); background: var(--hover-bg); }
.pills, .tabs { display: flex; gap: 8px; }
.tab {
  font-size: 13px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--divider); color: var(--muted);
  transition: color 180ms, border-color 180ms, background 180ms;
}
.tab:hover { color: var(--text); border-color: var(--text); background: var(--hover-bg); }
.tab.active { background: var(--elevated); border-color: var(--elevated); color: var(--text); }
.tab.active:hover { background: var(--hover-bg); border-color: var(--text); }

/* ---- Reveal: only with JS, so no-JS still shows everything ---- */
.js [data-reveal] .r,
.js .rv {
  opacity: 0; transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].in .r,
.js .rv.in { opacity: 1; transform: none; }

/* ---- Small shared bits ---- */
.label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 18px;
}
.more {
  display: inline-block; margin-top: 22px; font-size: 13px;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
  transition: border-color 180ms;
}
.more:hover { border-color: var(--text); }
/* text links that sit in running rows get a pill on hover */
.pill-link { margin: 0 -9px; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; transition: color 180ms, background 180ms, border-color 180ms; }
.pill-link:hover { color: var(--text); background: var(--hover-bg); border-color: var(--line); }

/* =====================================================
   TIMELINE (front page + experience)
   Rail: dashed where you haven't been, solid where you have.
   Stops: a double ring per role, a small dot per project.
   ===================================================== */
.tl { position: relative; padding-left: var(--gutter); margin-top: 56px; }
.tl-rail, .tl-fill { position: absolute; left: 5px; top: 0; width: 1px; height: 0; }
.tl-rail { background: repeating-linear-gradient(to bottom, var(--line) 0 3px, transparent 3px 7px); }
.tl-fill { background: var(--text); transform-origin: top; transform: scaleY(0); }
.tl-marker {
  position: absolute; left: 5.5px; top: 0; width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 6px rgba(23,23,23,0.07);
  opacity: 0; transition: opacity 300ms; will-change: transform;
}
.tl.moving .tl-marker { opacity: 1; }

.tl-item { position: relative; padding-bottom: 84px; }
.tl-item:last-of-type { padding-bottom: 56px; }

.stop { position: relative; }
.stop::before, .stop::after {
  content: ''; position: absolute; top: 50%; border-radius: 50%;
  transform: translateY(-50%);
  transition: background 350ms, border-color 350ms;
}
.stop::before {
  left: calc(-1 * var(--gutter) - 1px); width: 13px; height: 13px;
  border: 1.5px solid var(--line); background: var(--bg);
}
.stop::after { left: calc(-1 * var(--gutter) + 3px); width: 5px; height: 5px; background: transparent; }
.stop.on::before { border-color: var(--text); }
.stop.on::after  { background: var(--text); }
.now-status.on::before { border-color: var(--green); animation: pulse 2.4s ease-out infinite; }
.now-status.on::after  { background: var(--green); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,168,72,0.32); }
  70%  { box-shadow: 0 0 0 9px rgba(0,168,72,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,168,72,0); }
}

/* year and place hanging left of the rail */
.when {
  position: absolute; top: 44px; right: calc(100% + var(--gutter) + 16px);
  width: 96px; text-align: right; line-height: 1.15;
}
.when .code { display: block; font-size: 10px; letter-spacing: 0.14em; color: var(--faint); }
.when .yr { display: block; font-size: 14px; letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }
.tl-item.now .when { top: 0; }

.logo {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--elevated); border: 1px solid var(--divider);
  font-size: 11px; font-weight: 500; letter-spacing: 0.05em; color: var(--body2);
  margin-bottom: 10px;
}
.tl-item h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.tl-item .position { color: var(--body2); margin-top: 2px; }
.desc { color: var(--muted); margin-top: 6px; max-width: 520px; }
.results { margin-top: 14px; font-size: 12px; color: var(--muted); max-width: 520px; }
.results b { font-weight: 500; color: var(--text); }

.now-status { display: flex; align-items: center; gap: 10px; }
.now-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.now-lines { margin-top: 8px; color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.chip {
  font-size: 12px; color: var(--muted); border: 1px solid var(--divider);
  border-radius: 999px; padding: 2px 11px; background: var(--card);
}

/* projects under a role: tilted thumbnail, title, one line */
.projects { list-style: none; margin-top: 28px; }
.proj { position: relative; }
.proj + .proj { margin-top: 10px; }
.proj > a, .proj > div {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 10px 8px 4px; margin-left: 6px; border-radius: 12px;
  transition: background 200ms;
}
.proj > a { border: 1px solid transparent; }
.proj > a:hover { background: var(--card); border-color: var(--line); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.proj::before {
  content: ''; position: absolute; top: 50%; left: calc(-1 * var(--gutter) + 3px);
  width: 5px; height: 5px; border-radius: 50%; transform: translateY(-50%);
  background: var(--line); transition: background 350ms;
}
.proj.on::before { background: var(--text); }
.proj.plain > div { padding-left: 0; margin-left: 0; display: block; }

.thumb { position: relative; width: 92px; height: 64px; flex: none; margin-left: 14px; }
.thumb::before, .thumb::after {
  content: ''; position: absolute; inset: 5px 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--divider);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 400ms cubic-bezier(.2,.7,.2,1);
}
.thumb::before { transform: rotate(-8deg) translateX(-9px); }
.thumb::after  { transform: rotate(8deg)  translateX(9px); }
.proj > a:hover .thumb::before { transform: rotate(-12deg) translateX(-13px); }
.proj > a:hover .thumb::after  { transform: rotate(12deg)  translateX(13px); }
.thumb img, .thumb video {
  position: relative; z-index: 1; display: block;
  width: 76px; height: 54px; margin: 5px 8px; object-fit: cover; object-position: center top;
  border-radius: 9px; border: 1px solid var(--divider); background: var(--elevated);
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}
.proj .t { font-size: 14px; color: var(--text); line-height: 1.3; }
.proj .t .yr { font-size: 12px; color: var(--faint); margin-left: 8px; }
.proj .d { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* end of the line: chevron + sign-off */
.tl-end { position: relative; padding-top: 4px; }
.tl-end::before {
  content: ''; position: absolute; top: 12px; left: calc(-1 * var(--gutter) + 0.5px);
  width: 8px; height: 8px; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line);
  transform: rotate(45deg); transition: border-color 350ms;
}
.tl-end.on::before { border-color: var(--text); }
.tl-end h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.tl-end p { color: var(--muted); }

/* ---- Footer ---- */
.foot {
  margin-top: 72px; padding-top: 18px; border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.foot a { padding: 2px 8px; margin: 0 -8px; border: 1px solid transparent; border-radius: 999px; transition: color 180ms, background 180ms, border-color 180ms; }
.foot a:hover { color: var(--text); background: var(--hover-bg); border-color: var(--line); }
.foot .fl { display: flex; gap: 16px; }

/* ---- ASCII animation: same element, script and frames as always ---- */
.ascii-anim {
  position: fixed; left: 16px; bottom: 12px; margin: 0; z-index: 0;
  font-family: 'Geist Mono', monospace; font-size: 8px; line-height: 1.02;
  letter-spacing: 0; white-space: pre; color: var(--text); opacity: 0.5;
  pointer-events: none; user-select: none; overflow: hidden;
  max-width: min(80vw, 880px); max-height: 96vh;
  -webkit-mask-image:
    linear-gradient(to top,   #000 32%, transparent 100%),
    linear-gradient(to right, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to top,   #000 32%, transparent 100%),
    linear-gradient(to right, #000 55%, transparent 100%);
  mask-composite: intersect;
  will-change: contents;
}

/* ---- Responsive ---- */
@media (max-width: 880px) {      /* no left margin to hang the year in: fold it inline */
  .when { position: static; width: auto; text-align: left; display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; }
  .when .yr { margin-top: 0; }
  .tl-item.now .when { display: none; }
}
@media (max-width: 820px) { .ascii-anim { font-size: 6px; opacity: 0.34; max-width: 64vw; } }
@media (max-width: 560px) {
  :root { --gutter: 30px; }
  .col { padding: 32px 20px 44px; }
  .top { margin-bottom: 40px; }
  .tab { padding: 6px 12px; }
  .ascii-anim { font-size: 5px; opacity: 0.26; max-width: 82vw; }
  .proj > a { gap: 14px; }
  .thumb { margin-left: 8px; width: 84px; }
  .thumb img, .thumb video { width: 68px; margin: 5px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ascii-anim { opacity: 0.4; }
  .js [data-reveal] .r, .js .rv { opacity: 1; transform: none; transition: none; }
  .now-status.on::before { animation: none; }
}
