/* dundysm.github.io — single-page portfolio. All values are the final design. */
:root {
  --bg: #1b1a19;
  --surface: #232221;      /* empty thumbnail */
  --hover-plate: #242322;  /* card hover background */
  --line: #2e2c2b;         /* tag borders */
  --rule: #3a3836;         /* contact rules */
  --ink: #f4f1eb;          /* name */
  --text: #e8e5df;         /* tagline, card titles */
  --muted: #9b9891;        /* skills, labels, icons */
  --faint: #55524d;        /* separators */
  --gold: #d4af37;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'URW Palladio L', P052, Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body {
  font-family: var(--mono);
  color: var(--text);
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Backdrop: Alexander Mosaic, gold-leaf treatment. Tight oval at 7% + 5% strip along the bottom */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: .07;
  -webkit-mask-image: radial-gradient(40% 46% at 50% 48%, #000 0%, rgba(0,0,0,.8) 40%, rgba(0,0,0,.25) 75%, transparent 100%);
          mask-image: radial-gradient(40% 46% at 50% 48%, #000 0%, rgba(0,0,0,.8) 40%, rgba(0,0,0,.25) 75%, transparent 100%); }
.backdrop-foot { opacity: .05;
  -webkit-mask-image: linear-gradient(to top, #000 0, #000 40px, rgba(0,0,0,.5) 100px, transparent 160px);
          mask-image: linear-gradient(to top, #000 0, #000 40px, rgba(0,0,0,.5) 100px, transparent 160px); }
.backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 30%; display: block;
  filter: grayscale(1) brightness(.9) contrast(3) sepia(1) saturate(2.2) hue-rotate(-8deg); }

#fireflies { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }

.page { min-height: 100vh; display: flex; align-items: center; }
.layout {
  position: relative; z-index: 1; width: 100%; padding: 0 20px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  column-gap: clamp(64px, 9vw, 240px); row-gap: 48px;
}
main {
  flex: 0 1 1440px; min-width: 0;
  height: min(calc(100vh - 128px), 1200px);
  display: flex; flex-direction: column;
}

/* Header */
.name {
  margin: 0; font-family: var(--serif); font-size: clamp(34px, 9vw, 42.4px); line-height: 1.13;
  font-weight: 400; color: var(--ink); letter-spacing: -0.01em;
}
.name .at {
  font-family: var(--mono); font-size: 0.4em; color: var(--gold);
  position: relative; top: -1.1em; margin-right: 4px;
}
.tagline { margin: 6px 0 0; font-size: 14px; line-height: 24px; color: var(--text); text-wrap: pretty; }
.skills { margin: 14px 0 0; max-width: 720px; font-size: 12.5px; line-height: 22px; color: var(--muted); text-wrap: pretty; text-transform: none; } /* keep real casing: CUDA, vLLM */
.skills .sep { color: var(--faint); }
.nw { white-space: nowrap; }

.section-label {
  margin: 57px 0 0; padding-bottom: 14px;
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.02em; color: var(--muted);
}

/* Two halves: projects on the left, upstream on the right; each column scrolls on its own */
.columns { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 56px; }
.col { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* Scrollable column area */
.scroll-wrap { flex: 1; min-height: 0; display: flex; gap: 12px; margin: 0 -14px; }
.scroller {
  flex: 1; min-width: 0; overflow-y: auto; scrollbar-width: none;
  padding: 24px 14px 28px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 28px), transparent 100%);
}
.scroller::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); column-gap: 28px; row-gap: 36px; }

/* Scroll indicator: 20px gold dash + fading trail, visible only while scrolling */
.rail { position: relative; flex: none; width: 1px; margin: 24px 0 28px; opacity: 0; transition: opacity .35s; }
.rail-trail { position: absolute; left: 0; top: 0; width: 1px; height: 0; will-change: transform, height; }
.rail-dash {
  position: absolute; left: 0; top: 0; width: 1px; height: 20px;
  background: var(--gold); opacity: .6; box-shadow: 0 0 3px rgba(212,175,55,.35); will-change: transform;
}

/* Project card (YouTube-style hover) */
.card { position: relative; display: block; color: inherit; text-decoration: none; outline: none; }
.card::before {
  content: ""; position: absolute; inset: -10px; border-radius: 16px; background: var(--hover-plate);
  opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .25s ease; pointer-events: none;
}
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface); transition: border-radius .2s ease; }
.zoom { position: absolute; inset: 0; transition: transform .3s ease; }
.zoom img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover::before, .card:focus-visible::before { opacity: 1; transform: scale(1); }
.card:hover .thumb, .card:focus-visible .thumb { border-radius: 4px; }
.card:hover .zoom, .card:focus-visible .zoom { transform: scale(1.06); transition: transform 6s linear; }
.meta { position: relative; margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.title { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text); }
.desc { font-size: 12.5px; line-height: 19px; color: var(--muted); }
.tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { white-space: nowrap; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 18px; }

/* Upstream PRs: the right-hand column */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); column-gap: 28px; row-gap: 36px; }
.group-label { margin: 0 0 4px; font-size: 12.5px; line-height: 19px; font-weight: 500; letter-spacing: 0.02em; color: var(--text); }
.pr { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0 0; }
.pr-body { flex: 1; min-width: 0; }
.pr-logo { flex: none; display: block; width: 32px; height: 32px; margin-top: 2px; border-radius: 8px; overflow: hidden;
  background: var(--ink); opacity: .9; transition: opacity .15s, transform .2s ease, border-radius .2s ease; }
.pr-logo img { display: block; width: 100%; height: 100%; }
.pr:hover .pr-logo { opacity: 1; transform: scale(1.06); border-radius: 6px; }
.pr-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.pr-repo, .pr-num { text-decoration: none; transition: color .15s; outline: none; }
.pr-repo { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.pr-org { color: var(--muted); font-weight: 400; }
.pr-num { font-size: 12px; line-height: 20px; color: var(--muted); }
.pr-repo:hover, .pr-repo:focus-visible, .pr-repo:hover .pr-org, .pr-repo:focus-visible .pr-org,
.pr-num:hover, .pr-num:focus-visible { color: #fff; }
.pr-desc { margin: 2px 0 0; font-size: 12.5px; line-height: 19px; color: var(--muted); text-wrap: pretty; }
.review { margin: 36px 0 0; font-size: 12.5px; line-height: 22px; color: var(--muted); }
.review .sep { color: var(--faint); }

/* Contact */
.contact { flex: none; margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 20px; }
.contact .rule { width: 40px; height: 1px; background: var(--rule); }
.contact .rule:first-child { margin-right: 4px; }
.contact .rule:last-child { margin-left: 4px; }
.contact a { display: flex; color: var(--muted); text-decoration: none; transition: color .15s, filter .15s; }
.contact a:hover, .contact a:focus-visible { color: #fff; filter: drop-shadow(0 0 1.5px rgba(255,255,255,.3)); outline: none; }

/* Phones and short windows: the whole page scrolls; the scroll rail is hidden */
@media (max-width: 719px), (max-height: 559px) {
  .page { padding: 48px 0 32px; }
  main { height: auto; }
  .section-label { margin-top: 40px; }
  .columns { display: block; }
  .col + .col .section-label { margin-top: 56px; }
  .scroller { overflow: visible; padding: 20px 14px 8px; -webkit-mask-image: none; mask-image: none; }
  .rail { display: none; }
  .grid { row-gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .card:hover .zoom, .card:focus-visible .zoom { transform: none; }
}
