:root {
  --bg: #000000;
  --fg: #ededeb;
  --muted: #9a9a95;
  --faint: #5c5c58;
  --line: #1f1f1e;
  --hover: #121211;
  --raised: #0b0b0b;
  --accent: #ff7a45;
  --glow: rgba(255, 122, 69, .09);
  --shadow: 0 24px 60px -12px rgba(0,0,0,.7), 0 0 0 1px var(--line);
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
  interpolate-size: allow-keywords;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 24px; }


/* hero */
.hero { padding: 88px 0 88px; }
.who { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center;
  background: var(--fg); color: var(--bg);
  font: 500 14px/1 var(--mono); letter-spacing: -.02em;
}
.avatar::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2.5px solid var(--bg);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 1px var(--line); }
.icons { margin-left: auto; display: flex; gap: 8px; }
.icons a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .2s, border-color .2s, transform .3s var(--ease);
}
.icons a:hover { color: var(--fg); border-color: color-mix(in srgb, var(--fg) 30%, var(--line)); transform: translateY(-2px); }
.icons svg { width: 16px; height: 16px; }
.who b { display: block; font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.who small { display: block; white-space: nowrap; font: 400 12.5px/1.4 var(--mono); color: var(--faint); margin-top: 2px; }
h1 {
  font-size: clamp(30px, 8vw, 60px); line-height: 1.02; font-weight: 500;
  letter-spacing: -0.045em; text-wrap: nowrap;
}
h1 .w {
  display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(12px);
  animation: word .9s var(--ease) forwards; animation-delay: calc(.15s + var(--i) * .06s);
}
h1 .soft { color: var(--muted); }
h1 .line { display: block; }
.lede, .about p { text-align: justify; hyphens: auto; }
@keyframes word { to { opacity: 1; filter: blur(0); transform: none; } }
.lede { margin-top: 26px; color: var(--muted); font-size: 17px; }
.lede a {
  color: var(--fg);
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat,
              linear-gradient(var(--line), var(--line)) 0 100% / 100% 1px no-repeat;
  transition: background-size .4s var(--ease);
}
.lede a:hover { background-size: 100% 1px, 100% 1px; }
.cta { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500;
  border: 1px solid var(--line); background: var(--bg);
  transition: background .2s, border-color .2s, transform .25s var(--ease);
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { background: var(--fg); }
.btn svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateY(2px); }
.btn.primary:hover svg { transform: translateX(3px); }

/* sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }
.label {
  font: 400 12.5px/1 var(--mono); color: var(--faint);
  margin-bottom: 30px; display: flex; justify-content: space-between; gap: 12px;
}
.label b { font-weight: 400; color: var(--accent); }
.label i { font-style: normal; color: var(--accent); margin-right: 10px; }

/* work */
.work { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item {
  border: 1px solid var(--line); border-radius: 16px; background: var(--raised); overflow: hidden;
  transition: transform .4s var(--ease), border-color .25s, box-shadow .4s var(--ease);
}
.item:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--fg) 22%, var(--line)); box-shadow: 0 18px 40px -24px rgba(0,0,0,.35); }
.item.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { border-color: var(--accent); } }
.art {
  height: 148px; border-bottom: 1px solid var(--line); position: relative; color: var(--faint);
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.2px); background-size: 14px 14px;
  display: grid; place-items: center;
}
.art svg { width: 78%; height: 70%; overflow: visible; }
.art .hl { color: var(--accent); }
.art path, .art line, .art circle { vector-effect: non-scaling-stroke; }
.art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease) .2s; }
.reveal.in .art .draw { stroke-dashoffset: 0; }
.item .body { padding: 18px 20px 20px; }
.idx { font: 400 12px/1 var(--mono); color: var(--faint); display: flex; justify-content: space-between; margin-bottom: 12px; }
.idx svg { width: 14px; height: 14px; color: var(--faint); transition: transform .35s var(--ease), color .2s; }
.item:hover .idx svg { color: var(--accent); transform: translate(2px, -2px); }
.name { font-weight: 500; letter-spacing: -0.015em; font-size: 17px; }
.desc { color: var(--muted); font-size: 14.5px; margin-top: 3px; line-height: 1.5; }

/* now */
.now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card {
  padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised);
  transition: transform .35s var(--ease), border-color .25s;
}
a.card { display: block; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--fg) 25%, var(--line)); }
.card .k { font: 400 12px/1 var(--mono); color: var(--faint); display: flex; align-items: center; gap: 7px; }
.card .k svg { width: 13px; height: 13px; color: var(--accent); }
.card p { margin-top: 14px; font-size: 15px; line-height: 1.5; }
.card p span { color: var(--muted); display: block; font-size: 14px; margin-top: 2px; }

/* about */
.about p { color: var(--muted); }
.about p + p { margin-top: 14px; }
.about strong { color: var(--fg); font-weight: 500; }
.about a { color: var(--fg); border-bottom: 1px solid var(--line); transition: border-color .2s; }
.about a:hover { border-color: var(--accent); }

.rows { margin-top: 40px; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.row .when { font: 400 12.5px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.row.cur .when { color: var(--accent); }
.row .what { color: var(--fg); font-weight: 500; }
.row .what span { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; font-size: .92em; }
.row .what a { color: inherit; border: 0; transition: color .2s; }
.row .what a:hover { color: var(--fg); }

/* contact */
.contact h2 { font-size: clamp(26px, 4.8vw, 36px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.15; }
.contact h2 .soft { color: var(--muted); }
.mail {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 12px;
  font: 500 15px/1 var(--mono); padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--raised); cursor: pointer; transition: border-color .2s, transform .25s var(--ease);
}
.mail:hover { border-color: var(--fg); }
.mail:active { transform: scale(.98); }
.mail .hint {
  color: var(--faint); font-weight: 400; display: inline-flex; align-items: center; gap: 5px; transition: color .2s;
}
.mail .hint svg { width: 13px; height: 13px; }
.mail.copied .hint { color: #2fb36b; }
.socials { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 24px; font-size: 15px; }
.socials a { color: var(--muted); display: inline-flex; gap: 4px; align-items: center; transition: color .2s; }
.socials a:hover { color: var(--fg); }
.socials svg { width: 12px; height: 12px; transition: transform .3s var(--ease); }
.socials a:hover svg { transform: translate(2px, -2px); }

/* photos */
.bento {
  display: grid; gap: 10px;
  --bw: min(840px, 100vw - 48px);
  margin-inline: calc((100% - var(--bw)) / 2);
  grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: clamp(130px, 18vw, 210px);
  grid-template-areas:
    "a b c"
    "a e g";
}
.shot { margin: 0; position: relative; overflow: hidden; border-radius: 16px; background: var(--hover); }
.shot img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.9); transition: filter .5s, transform .8s var(--ease);
}
.shot:hover img { filter: saturate(1.1); transform: scale(1.04); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px;
  font: 400 11.5px/1 var(--mono); color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .4s var(--ease);
}
.shot:hover figcaption { opacity: 1; transform: none; }
@media (hover: none) { .shot figcaption { opacity: 1; transform: none; } }

/* github graph */
.label a { color: var(--faint); transition: color .2s; }
.label a:hover { color: var(--fg); }
.gh-total { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.gh-total b { color: var(--fg); font-weight: 500; font-size: 28px; letter-spacing: -.03em; margin-right: 6px; font-variant-numeric: tabular-nums; }
.gh-months { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; font: 400 11px/1 var(--mono); color: var(--faint); margin-bottom: 8px; height: 11px; }
.gh-months span { white-space: nowrap; overflow: visible; }
.gh { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.gh i, .gh-legend i { display: block; aspect-ratio: 1; border-radius: 2.5px; background: var(--hover); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 4%, transparent); }
.gh i { opacity: 0; transform: scale(.4); transition: opacity .5s, transform .5s var(--ease), outline-color .2s; transition-delay: calc(var(--c) * 12ms); outline: 1px solid transparent; outline-offset: 1px; }
.reveal.in .gh i { opacity: 1; transform: none; }
.gh i:hover { outline-color: var(--fg); }
.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--hover)) !important; }
.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--hover)) !important; }
.l3 { background: color-mix(in srgb, var(--accent) 76%, var(--hover)) !important; }
.l4 { background: var(--accent) !important; }
.gh-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font: 400 12px/1 var(--mono); color: var(--faint); }
.gh-legend { display: inline-flex; align-items: center; gap: 4px; }
.gh-legend i { width: 10px; }

/* footer */
footer .in {
  padding: 40px 0 56px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font: 400 12.5px/1 var(--mono); color: var(--faint);
}
footer a:hover { color: var(--fg); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  font: 500 13px/1 var(--mono); padding: 12px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg); display: inline-flex; gap: 8px; align-items: center;
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast i { width: 6px; height: 6px; border-radius: 50%; background: #2fb36b; }

/* entrance */
.rise { opacity: 0; transform: translateY(10px); animation: rise .8s var(--ease) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal > * { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s var(--ease); }
.reveal.in > * { opacity: 1; transform: none; }
.reveal.in > *:nth-child(2) { transition-delay: .08s; }
.reveal.in > *:nth-child(3) { transition-delay: .16s; }
.reveal.in > *:nth-child(4) { transition-delay: .24s; }
.reveal.in > *:nth-child(5) { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .art .draw { stroke-dashoffset: 0; transition: none; }
  .rise, h1 .w, .reveal > * { animation: none; opacity: 1; transform: none; filter: none; transition: none; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 72px 0 60px; }
  .work { grid-template-columns: 1fr; }
    .who { gap: 10px; }
  .avatar { width: 42px; height: 42px; }
  .who b { font-size: 14px; }
  .who small { font-size: 11.5px; }
  .icons { gap: 4px; }
  .icons a { width: 32px; height: 32px; }
  .icons svg { width: 14px; height: 14px; }
  .bento {
    --bw: calc(100vw - 16px);
    grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; gap: 8px;
    grid-template-areas: "a a" "a a" "b c" "e g";
  }
  .now { grid-template-columns: 1fr; }
  .mail { font-size: 14px; }
}

/* projects page */
.page-head { padding: 72px 0 48px; }
.back { font: 400 13px/1 var(--mono); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; transition: color .2s; }
.back:hover { color: var(--fg); }
.page-head h1 { margin-top: 28px; }
.page-head p { margin-top: 18px; color: var(--muted); font-size: 17px; max-width: 52ch; }
.shot[data-area="g"] img { object-position: center 70%; }

/* ===================== motion ===================== */
:root { --expo: cubic-bezier(.16,1,.3,1); --spring: cubic-bezier(.34,1.56,.64,1); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* hero sequence */
.motion .who { animation: none; opacity: 1; transform: none; }
.motion .avatar { animation: springIn .9s var(--spring) .15s both; }
.motion .avatar::after { animation: springIn .6s var(--spring) .75s both; }
.motion .who > div:nth-child(2) { animation: slideIn .8s var(--expo) .3s both; }
.motion .icons a { animation: springIn .7s var(--spring) both; }
.motion .icons a:nth-child(1) { animation-delay: .45s; }
.motion .icons a:nth-child(2) { animation-delay: .53s; }
.motion .icons a:nth-child(3) { animation-delay: .61s; }
@keyframes springIn { from { opacity: 0; transform: scale(.4); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }

/* headline letters rise out of their line */
h1.split .w { opacity: 1; filter: none; transform: none; animation: none; }
h1.split .line { overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
h1.split .ch { display: inline-block; transform: translateY(105%) rotate(6deg); transform-origin: left bottom; animation: chUp 1s var(--expo) both; animation-delay: calc(.35s + var(--d) * 22ms); }
@keyframes chUp { to { transform: none; } }

/* section rules draw in */
section { border-top: 0; position: relative; }
section::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--expo);
}
section.in::before, .no-motion section::before { transform: none; }
.page-head + section::before { display: none; }

/* labels */
.label i { display: inline-block; }
.motion .reveal .label i { transform: translateY(8px); opacity: 0; transition: transform .7s var(--spring) .1s, opacity .4s .1s; }
.motion .reveal.in .label i { transform: none; opacity: 1; }

/* cards + project tiles stagger in (uses `translate`, so hover transforms stay free) */
.motion .reveal .now .card, .motion .reveal .work .item {
  opacity: 0; translate: 0 28px; scale: .97;
  transition: opacity .8s ease, translate 1s var(--expo), scale 1s var(--expo), transform .35s var(--ease), border-color .25s, box-shadow .4s;
  transition-delay: calc(.12s + var(--k) * 110ms), calc(.12s + var(--k) * 110ms), calc(.12s + var(--k) * 110ms), 0s, 0s, 0s;
}
.motion .reveal.in .now .card, .motion .reveal.in .work .item { opacity: 1; translate: 0 0; scale: 1; }
.card .k svg { transition: transform .6s var(--spring); }
.card:hover .k svg { transform: rotate(-12deg) scale(1.2); }

/* experience: rows rise in */
.motion .reveal .row { opacity: 0; translate: 0 10px; transition: opacity .6s, translate .9s var(--expo); transition-delay: calc(.25s + var(--k) * 120ms); }
.motion .reveal.in .row { opacity: 1; translate: 0 0; }

/* photos: curtain reveal + slow zoom + parallax */
.motion .reveal .shot { clip-path: inset(100% 0 0 0 round 16px); transition: clip-path 1.2s var(--expo); transition-delay: calc(var(--k) * 110ms); }
.motion .reveal.in .shot { clip-path: inset(0 0 0 0 round 16px); }
.shot img { transform: none !important; scale: 1.12; translate: 0 var(--py, 0px); transition: scale 1.1s var(--expo), filter .5s; }
.motion .reveal .shot img { scale: 1.45; transition: scale 1.8s var(--expo), filter .5s; transition-delay: calc(var(--k) * 110ms), 0s; }
.motion .reveal.in .shot img { scale: 1.12; }
.motion .reveal.in .shot:hover img, .shot:hover img { scale: 1.2; transition-delay: 0s; transition-duration: 1.1s; }

/* contact heading words rise */
.mw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.mi { display: inline-block; transform: translateY(105%); transition: transform 1s var(--expo); transition-delay: calc(.1s + var(--k) * 55ms); }
.reveal.in .mi, .no-motion .mi { transform: none; }

/* buttons press */
.btn:active, .icons a:active, .mail:active { scale: .96; }
.icons a, .btn, .mail { transition-property: background, border-color, color, transform, translate, scale; }

/* github cells: diagonal wave with overshoot */
.gh i { transform: scale(0); transition: opacity .3s, transform .6s var(--spring), outline-color .2s; transition-delay: calc(var(--c) * 14ms); }
.gh i:hover { transform: scale(1.35) !important; transition-delay: 0s; z-index: 1; }

/* copy burst particles */
.spark { position: fixed; z-index: 90; width: 7px; height: 7px; background: var(--accent); border-radius: 2px; pointer-events: none; }
.spark:nth-of-type(2n) { background: var(--fg); width: 5px; height: 5px; }

/* projects page art: gentle float */
.motion .item:hover .art svg { animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  .gh i { transform: none; }
}

