:root {
  --bg: #f1f2f4;
  --surface: #fbfbfc;
  --text: #121417;
  --muted: #5a606a;
  --line: #d8dbe0;
  --accent: #2e4cf5;
  --on-accent: #f5f6ff;
  --accent-tint: rgba(46, 76, 245, .08);
  --shadow: 0 1px 0 rgba(18,20,23,.04), 0 12px 32px -12px rgba(30,40,90,.18);
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113; --surface: #171a1d; --text: #eceef1; --muted: #9aa1ab; --line: #272b30;
    --accent: #7189ff; --on-accent: #0f1113; --accent-tint: rgba(113, 137, 255, .1);
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 16px 40px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113; --surface: #171a1d; --text: #eceef1; --muted: #9aa1ab; --line: #272b30;
  --accent: #7189ff; --on-accent: #0f1113; --accent-tint: rgba(113, 137, 255, .1);
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 16px 40px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color .4s var(--ease), color .4s var(--ease); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font: 500 14px var(--sans); padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .3s var(--ease), background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--text); color: var(--bg); }
.btn-solid:hover { background: var(--accent); color: var(--on-accent); }
.btn-line { border-color: var(--line); color: var(--text); background: transparent; }
.btn-line:hover { border-color: var(--text); }
.btn i { font-size: 16px; }

/* header */
.bar { position: sticky; top: 14px; z-index: 40; margin-top: 14px; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 10px 0 22px; border-radius: 999px; border: 1px solid transparent; transition: background-color .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease); }
.bar.stuck .bar-inner { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-color: var(--line); box-shadow: var(--shadow); }
.logo { font-weight: 600; font-size: 16px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.mark { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a.link { font-size: 14px; color: var(--muted); padding: 8px 14px; border-radius: 999px; transition: color .25s, background-color .25s; }
.nav a.link:hover { color: var(--text); background: var(--accent-tint); }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 17px; transition: border-color .25s, transform .3s var(--ease); }
.icon-btn:hover { border-color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.nav .btn { margin-left: 8px; padding: 10px 18px; }
.menu-toggle { display: none; }
.sheet { display: none; }

/* hero */
.hero-wrap { position: relative; isolation: isolate; margin-top: -88px; padding-top: 88px; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.hero-wrap > .wrap { position: relative; z-index: 1; }
.hero { min-height: calc(100dvh - 88px); display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; padding: 56px 0 72px; }
.hero-copy { max-width: 760px; }
.hero-copy h1 { max-width: 7.4em; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.avail { display: inline-flex; align-items: center; gap: 10px; font: 500 13px var(--mono); color: var(--muted); padding: 7px 14px 7px 10px; border: 1px solid var(--line); border-radius: 999px; }
.avail i { font-size: 15px; color: var(--accent); }
.live { width: 8px; height: 8px; border-radius: 50%; background: #22a35a; box-shadow: 0 0 0 4px rgba(34,163,90,.15); }
h1 { font-size: clamp(44px, 6vw, 84px); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; }
h1 .soft { color: var(--muted); }
h1 .w { display: inline-block; }
.lede { margin-top: 28px; font-size: 19px; color: var(--muted); max-width: 40ch; }
.lede b { color: var(--text); font-weight: 500; }
.actions { display: flex; gap: 10px; margin-top: 40px; flex-wrap: wrap; }

/* dot grid behind the hero, faded under the text */
.field { position: absolute; inset: 0; z-index: 0; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent), linear-gradient(90deg, rgba(0,0,0,.28) 15%, #000 62%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 72%, transparent), linear-gradient(90deg, rgba(0,0,0,.28) 15%, #000 62%);
  mask-composite: intersect; }
.field canvas { display: block; width: 100%; height: 100%; }
.hero-copy { transition: opacity .6s var(--ease); }

/* easter egg */
.egg-tip { position: absolute; z-index: 3; pointer-events: none; white-space: nowrap; font: 500 13px var(--mono); padding: 9px 15px; border-radius: 999px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, -120%) scale(.85); transition: opacity .25s var(--ease), transform .45s var(--ease); }
.egg-tip.show { opacity: 1; transform: translate(-50%, -160%) scale(1); }
.egg-tip.warn { background: var(--accent); color: var(--on-accent); }
.egg-tip.warn.show { animation: wobble .5s .1s; }
@keyframes wobble { 20%, 60% { rotate: -4deg; } 40%, 80% { rotate: 4deg; } }
html.is-broken { overflow: hidden; }
.broken { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; text-align: center; visibility: hidden; opacity: 0; transition: opacity .6s var(--ease), visibility 0s .6s; }
.broken.show { visibility: visible; opacity: 1; transition-delay: 0s; }
.broken-inner { max-width: 760px; transform: translateY(24px); transition: transform .8s var(--ease); }
.broken.show .broken-inner { transform: none; }
.broken h2 { font-size: clamp(40px, 7vw, 96px); letter-spacing: -.05em; line-height: .98; }
.broken p { color: var(--muted); font-size: clamp(17px, 2vw, 21px); margin: 20px auto 36px; }


/* logo strip */
.stack { border-block: 1px solid var(--line); padding: 26px 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; gap: 64px; width: max-content; animation: slide 38s linear infinite; }
.stack:hover .track { animation-play-state: paused; }
.track span { width: 30px; height: 30px; flex-shrink: 0; background: var(--muted); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; transition: background-color .25s; }
.track span:hover { background: var(--accent); }
@keyframes slide { to { transform: translateX(-50%); } }

/* sections */
section { padding: 128px 0; }
.eyebrow { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 18px; }
h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.05; letter-spacing: -.04em; font-weight: 600; }
.sub { color: var(--muted); font-size: 17px; max-width: 52ch; margin-top: 16px; }

/* projects */
.work-list { margin-top: 56px; border-top: 1px solid var(--text); }
.row { display: grid; grid-template-columns: 1.1fr 1.4fr auto; gap: 32px; align-items: center; padding: 34px 0; border-bottom: 1px solid var(--line); position: relative; }
.row h3 { font-size: clamp(26px, 3vw, 40px); letter-spacing: -.035em; font-weight: 600; line-height: 1.1; transition: transform .5s var(--ease), color .3s; }
.row p { color: var(--muted); font-size: 16px; max-width: 46ch; }
.row .meta { display: flex; align-items: center; gap: 16px; font: 13px var(--mono); color: var(--muted); }
.row .go { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; color: var(--text); transition: background-color .3s, color .3s, border-color .3s, transform .4s var(--ease); }
.row:hover h3 { transform: translateX(14px); color: var(--accent); }
.row:hover .go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: rotate(-45deg); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tags span { font: 12px var(--mono); padding: 3px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--text); }
.row .thumb { display: none; }

.preview { position: fixed; top: 0; left: 0; width: 340px; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; pointer-events: none; z-index: 30; opacity: 0; transform: translate3d(-50%, -50%, 0) scale(.85); transition: opacity .3s var(--ease); box-shadow: var(--shadow); will-change: transform; }
.preview.on { opacity: 1; }
.preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease); }
.preview img.show { opacity: 1; }

/* experience */
.exp { display: grid; grid-template-columns: 1fr 1.6fr; gap: 80px; align-items: start; }
.exp-head { position: sticky; top: 120px; }
.exp-head .btn { margin-top: 32px; }
details { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; transition: border-color .3s, box-shadow .3s; }
details[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 26px 28px; }
summary::-webkit-details-marker { display: none; }
summary .role { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
summary .org { color: var(--muted); font-size: 15px; margin-top: 2px; }
summary .when { font: 13px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 14px; }
summary .when i { font-size: 18px; color: var(--text); transition: transform .4s var(--ease); }
details[open] summary .when i { transform: rotate(45deg); }
.detail { padding: 0 28px 28px; color: var(--muted); }
.detail ul { list-style: none; display: grid; gap: 10px; }
.detail li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; }
.detail li i { color: var(--accent); margin-top: 4px; }
.detail a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* about */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(200px, auto); gap: 14px; margin-top: 56px; }
.cell { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 32px; position: relative; overflow: hidden; }
.c-about { grid-column: span 4; grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.c-about p { font-size: clamp(20px, 2vw, 26px); line-height: 1.4; letter-spacing: -.02em; max-width: 34ch; }
.c-about p .soft { color: var(--muted); }
.c-now { grid-column: span 2; background: var(--accent); color: var(--on-accent); border-color: transparent; display: flex; flex-direction: column; justify-content: space-between; }
.c-now small { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
.c-now strong { font-size: 22px; letter-spacing: -.02em; font-weight: 600; line-height: 1.25; display: block; }
.now-note { display: block; margin-top: 10px; font-size: 14px; opacity: .85; }
.c-gh { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; background: var(--accent-tint); transition: border-color .3s, transform .4s var(--ease); }
.c-gh:hover { border-color: var(--accent); transform: translateY(-3px); }
.c-gh > i { font-size: 40px; }
.c-gh strong { display: block; font-size: 20px; letter-spacing: -.02em; font-weight: 600; }
.c-gh span { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font: 13px var(--mono); color: var(--muted); }
.c-skills { grid-column: span 6; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; align-items: start; background: transparent; }
.c-skills h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.c-skills h3 i { color: var(--accent); font-size: 18px; }
.c-skills p { color: var(--muted); font-size: 15px; }
.socials { display: flex; gap: 8px; }

/* contact */
.contact { padding: 120px 0 64px; }
.contact h2 { font-size: clamp(40px, 7vw, 104px); letter-spacing: -.05em; line-height: .98; max-width: 12ch; }
.mail { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 44px; }
.mail a.addr { font-size: clamp(20px, 2.6vw, 32px); letter-spacing: -.02em; font-weight: 500; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--ease); padding-bottom: 4px; }
.mail a.addr:hover { background-size: 100% 2px; }
.copy.done { border-color: var(--accent); color: var(--accent); }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.foot a:hover { color: var(--text); }
.foot nav { display: flex; gap: 22px; }

/* scroll reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.rv.in { opacity: 1; transform: none; }
h1 .w { opacity: 0; transform: translateY(.5em); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d) * 55ms + 100ms); }
.loaded h1 .w { opacity: 1; transform: none; }

/* case study page */
.case { padding: 72px 40px 96px; }
.case-nav .link { display: inline-flex; align-items: center; gap: 6px; }
.case-nav .link, .case-nav .icon-btn { display: inline-flex !important; }
.case-head h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1; letter-spacing: -.045em; font-weight: 600; max-width: 14ch; }
.case-lede { font-size: 20px; color: var(--muted); max-width: 56ch; margin-top: 22px; }
.case-meta { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 24px 56px; margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.case-meta dt { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.case-meta dd { font-size: 15px; }
.case-links { display: flex; gap: 18px; }
.case-links a { display: inline-flex; align-items: center; gap: 4px; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.case-shot { margin: 64px 0; }
.case-shot img { width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.case-shot figcaption { font: 13px var(--mono); color: var(--muted); margin-top: 14px; }
.case-body { max-width: 720px; }
.case-body section { padding: 0; }
.case-body h2 { font-size: clamp(28px, 3vw, 38px); letter-spacing: -.035em; font-weight: 600; margin: 72px 0 16px; }
.case-body section:first-child h2 { margin-top: 0; }
.case-body h3 { font-size: 20px; letter-spacing: -.02em; font-weight: 600; margin: 40px 0 10px; }
.case-body p { font-size: 17px; line-height: 1.7; margin-bottom: 14px; }
.case-body p code { font: 14px var(--mono); background: var(--accent-tint); padding: 2px 6px; border-radius: 6px; }
.case-body pre { margin: 22px 0; padding: 20px 22px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; font: 13.5px/1.65 var(--mono); }
.case-list { list-style: none; display: grid; gap: 14px; margin-top: 18px; }
.case-list li { position: relative; padding-left: 22px; font-size: 17px; line-height: 1.65; color: var(--muted); }
.case-list li strong { color: var(--text); font-weight: 600; }
.case-list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.case-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.case-stats div { padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.case-stats b { display: block; font-size: 40px; letter-spacing: -.04em; font-weight: 600; color: var(--accent); }
.case-stats span { font-size: 14px; color: var(--muted); }
.case-end { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 64px; }

/* mobile */
@media (max-width: 1023px) {
  .nav a.link, .nav .btn { display: none; }
  .menu-toggle { display: grid; }
  .sheet { display: block; max-height: 0; overflow: hidden; transition: max-height .5s var(--ease); }
  .sheet.open { max-height: 380px; }
  .sheet-inner { margin-top: 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 10px; box-shadow: var(--shadow); }
  .sheet a { display: block; padding: 14px 16px; border-radius: 12px; font-size: 16px; }
  .sheet a:hover { background: var(--accent-tint); }
  .hero { min-height: 0; padding: 48px 0 140px; }
  .field { -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), #000 55%, transparent); mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), #000 55%, transparent); }
  .exp { grid-template-columns: 1fr; gap: 40px; }
  .exp-head { position: static; }
  .bento { grid-template-columns: 1fr 1fr; }
  .c-about, .c-skills { grid-column: span 2; }
  .c-now, .c-gh { grid-column: span 1; }
  .c-skills { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .case { padding: 48px 16px 72px; }
  .case-meta { grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .case-stats { grid-template-columns: 1fr 1fr; }
  .wrap { padding: 0 16px; }
  .bar-inner { padding-left: 16px; }
  section { padding: 88px 0; }
  .row { grid-template-columns: 1fr auto; gap: 14px 16px; padding: 26px 0; }
  .row .thumb { display: block; grid-column: 1 / -1; order: -1; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; }
  .row .thumb img { width: 100%; height: 100%; object-fit: cover; }
  .row p { grid-column: 1 / -1; grid-row: 3; }
  .row .meta { grid-column: 2; grid-row: 2; }
  .row:hover h3 { transform: none; }
  .preview { display: none; }
  summary { padding: 20px; grid-template-columns: 1fr; }
  .detail { padding: 0 20px 22px; }
  .bento { grid-template-columns: 1fr; }
  .c-about, .c-now, .c-gh, .c-skills { grid-column: span 1; }
  .c-skills { grid-template-columns: 1fr; padding: 24px; }
  .cell { padding: 24px; }
}
@media (hover: none) { .preview { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .rv, h1 .w { opacity: 1; transform: none; }
}
