:root {
  --bg: #000;
  --bg-dim: #0a0a0b;
  --card: #0b0b0c;
  --frame: #111113;
  --fg: #f5f5f7;
  --fg-2: #a1a1a6;
  --fg-3: #8e8e93;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --accent: #ffffff;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.is-loading main { opacity: 0; }
main { transition: opacity .8s var(--ease); }
::selection { background: #fff; color: #000; }
a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid #fff; outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.mono { font-family: var(--mono); }
.label { font-size: 11px; letter-spacing: .24em; color: var(--fg-3); text-transform: uppercase; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--fg-3); }
.h2 { margin: 0; font-size: clamp(32px, 4.4vw, 44px); font-weight: 200; letter-spacing: -.02em; line-height: 1.1; }
.h2--gap { margin: 20px 0 48px; }
.section { padding-bottom: 160px; }
.section--inner { padding-top: 140px; padding-bottom: 140px; }
.band { border-top: 1px solid var(--line); }
.band--dim { background: var(--bg-dim); border-bottom: 1px solid var(--line); }

/* scroll progress hairline */
.progress { position: fixed; inset: 0 0 auto 0; height: 1px; z-index: 30; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: rgba(255,255,255,.55); transform-origin: left; transform: scaleX(0); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__name { font-size: 14px; font-weight: 400; letter-spacing: .02em; white-space: nowrap; }
.nav__links { display: flex; gap: 28px; font-size: 12px; }
.nav__links a { color: var(--fg-2); transition: color .3s; position: relative; }
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: #fff; transform: scaleX(0); transition: transform .5s var(--ease); }
.nav__links a.is-active::after { transform: scaleX(1); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 980px; font-size: 12px; padding: 7px 16px; font-weight: 400; transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease); white-space: nowrap; }
.pill:active { transform: scale(.97); }
.pill--light { background: var(--fg); color: #000; }
.pill--light:hover { background: #fff; }
.pill--ghost { border: 1px solid rgba(255,255,255,.3); }
.pill--ghost:hover { border-color: #fff; }
.pill--lg { font-size: 14px; padding: 13px 26px; }

/* hero */
.hero { padding-top: 120px; padding-bottom: 64px; text-align: center; }
.hero__title { margin: 24px 0 0; font-size: clamp(48px, 8vw, 104px); font-weight: 200; letter-spacing: -.035em; line-height: 1.02; }
.hero__intro { margin: 28px auto 0; max-width: 560px; font-size: 19px; line-height: 1.5; color: var(--fg-2); }

/* showreel */
.reel-wrap { padding-bottom: 140px; }
.reel { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: var(--card); border: 1px solid var(--line); isolation: isolate; }
.reel__media { position: absolute; inset: 0; z-index: 0; }
.reel__media img, .reel__media video { width: 100%; height: 100%; object-fit: cover; opacity: .6; transition: opacity 1s var(--ease), transform 6s var(--ease); }
.reel:hover .reel__media img, .reel:hover .reel__media video { transform: scale(1.02); opacity: .75; }
.reel__media iframe, .reel__media video.is-playing { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 1; transform: none; }
.reel__lines { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 3px); pointer-events: none; }
.reel__scan { position: absolute; top: 0; bottom: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.025), transparent); animation: scan 6s linear infinite; pointer-events: none; }
.reel__tl, .reel__tr { position: absolute; top: 22px; font-size: 11px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.reel__tl { left: 24px; letter-spacing: .18em; color: #c7c7cc; }
.reel__tr { right: 24px; color: var(--fg-3); }
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; animation: rec 1.6s ease-in-out infinite; }
.reel__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 88px; height: 88px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .6s var(--ease), background .4s, border-color .4s;
}
.reel__play svg { margin-left: 3px; }
.reel__play:hover { transform: translate(-50%, -50%) scale(1.08); background: rgba(255,255,255,.12); border-color: #fff; }
.reel__play::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); animation: ring 2.8s var(--ease) infinite; }
.reel__bar { position: absolute; left: 24px; right: 24px; bottom: 22px; display: flex; align-items: center; gap: 16px; font-size: 11px; color: #c7c7cc; z-index: 2; }
.reel__track { flex: 1; height: 1px; background: rgba(255,255,255,.18); position: relative; }
.reel__thumb { position: absolute; left: 0; top: -1px; width: 18%; height: 3px; border-radius: 2px; background: #fff; transition: width 1.2s var(--ease); }
.reel:hover .reel__thumb { width: 26%; }
.reel.is-playing .reel__lines, .reel.is-playing .reel__scan, .reel.is-playing .reel__tl, .reel.is-playing .reel__tr, .reel.is-playing .reel__play, .reel.is-playing .reel__bar { opacity: 0; pointer-events: none; transition: opacity .4s; }
.reel__under { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12px; color: var(--fg-3); flex-wrap: wrap; gap: 8px; }
.reel__under a { color: var(--fg-2); transition: color .3s; }
.reel__under a:hover { color: #fff; }

/* cuts (16:9 grid) */
.cuts__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 40px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { padding: 6px 14px; border-radius: 980px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #c7c7cc; font-size: 12px; cursor: pointer; transition: all .3s var(--ease); }
.filter:hover { border-color: rgba(255,255,255,.5); color: #fff; }
.filter.is-on { background: var(--fg); border-color: var(--fg); color: #000; }
.cuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px 20px; }
.clip { display: flex; flex-direction: column; justify-content: flex-start; align-self: start; width: 100%; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; color: inherit; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.clip.is-out { opacity: 0; transform: translateY(8px); }
.clip__frame { display: block; position: relative; aspect-ratio: 16 / 9; background: var(--frame); border-radius: 10px; border: 1px solid rgba(255,255,255,.06); overflow: hidden; transition: border-color .4s, transform .6s var(--ease); }
.clip:hover .clip__frame { border-color: rgba(255,255,255,.3); transform: scale(1.015); }
.clip__frame img, .clip__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--ease), transform 1.2s var(--ease); }
.clip:hover .clip__frame img { transform: scale(1.04); }
.clip__frame video { opacity: 0; }
.clip.is-previewing .clip__frame video { opacity: 1; }
.clip__dur { position: absolute; right: 8px; bottom: 7px; font-family: var(--mono); font-size: 10px; color: #e5e5ea; padding: 2px 6px; border-radius: 5px; background: rgba(0,0,0,.6); z-index: 1; }
.clip__icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); opacity: 0; transition: opacity .4s, transform .5s var(--ease); z-index: 1; }
.clip:hover .clip__icon, .clip__frame.is-empty .clip__icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.clip__meta { margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.clip__n { font-family: var(--mono); font-size: 11px; color: var(--fg-3); padding-top: 2px; }
.clip__sub { display: block; margin-top: 2px; font-size: 12px; color: var(--fg-3); }
.clip__roles { display: block; margin-top: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); }
.cuts__titles { max-width: 640px; }
.cuts__note { margin: 12px 0 0; font-size: 13px; line-height: 1.55; color: var(--fg-3); }
.cuts__note:empty { display: none; }
.cuts__head { align-items: end; }

/* about */
.about { padding-top: 140px; padding-bottom: 140px; display: flex; flex-wrap: wrap; gap: 64px; }
.about__left, .about__right { flex: 1 1 420px; min-width: 0; }
.about__title { margin: 20px 0 0; font-size: clamp(36px, 5vw, 52px); font-weight: 200; letter-spacing: -.025em; line-height: 1.08; }
.about__text { font-size: 17px; line-height: 1.65; color: var(--fg-2); }
.about__text p { margin: 0 0 1em; }
.stats { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 24px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 28px; }
.stat__v { font-size: 36px; font-weight: 200; color: var(--fg); line-height: 1.1; }
.stat__l { font-size: 12px; margin-top: 4px; color: var(--fg-2); }
.chips { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: 980px; border: 1px solid var(--line-2); color: #c7c7cc; }

/* projects */
.projects { border-top: 1px solid rgba(255,255,255,.1); }
.project { display: grid; grid-template-columns: 80px minmax(0, 2fr) minmax(0, 1.4fr) 40px; gap: 16px; align-items: center; padding: 26px 0; border-bottom: 1px solid rgba(255,255,255,.1); transition: background .3s, padding .4s var(--ease); }
a.project:hover { background: rgba(255,255,255,.03); padding-left: 12px; padding-right: 12px; }
.project__y { font-family: var(--mono); font-size: 12px; color: var(--fg-3); }
.project__t { font-size: 22px; font-weight: 300; }
.project__r { font-size: 13px; color: var(--fg-2); }
.project__a { justify-self: end; transition: transform .4s var(--ease); }
a.project:hover .project__a { transform: translate(3px, -3px); }

/* research + toolkit */
.research__head { display: flex; flex-wrap: wrap; gap: 24px 64px; justify-content: space-between; align-items: end; margin-bottom: 8px; }
.research__head > div:first-child { flex: 1 1 380px; }
.research__intro { flex: 1 1 380px; max-width: 520px; padding-bottom: 48px; }
.research__intro p { margin: 0 0 24px; font-size: 16px; line-height: 1.65; color: var(--fg-2); }
.research__intro .pill { font-size: 13px; padding: 10px 20px; }
.toolkit { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: #000; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; overflow: hidden; }
.tool { background: #000; outline: 1px solid rgba(255,255,255,.1); padding: 32px 28px; min-height: 170px; display: flex; flex-direction: column; gap: 10px; transition: background .4s; }
a.tool:hover { background: #0e0e10; }
.tool__tag { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--fg-3); }
.tool__t { font-size: 18px; font-weight: 400; margin-top: 6px; }
.tool__d { font-size: 13px; color: var(--fg-3); line-height: 1.55; flex: 1; }
.tool__go { font-family: var(--mono); font-size: 11px; color: #c7c7cc; transition: transform .4s var(--ease); }
a.tool:hover .tool__go { transform: translateX(4px); }

/* contact */
.contact { padding-top: 160px; padding-bottom: 120px; text-align: center; }
.contact__title { margin: 0; font-size: clamp(44px, 7vw, 88px); font-weight: 200; letter-spacing: -.035em; line-height: 1.04; }
.contact__mail { display: inline-block; margin-top: 36px; font-size: clamp(18px, 2.4vw, 22px); font-weight: 300; padding-bottom: 4px; position: relative; }
.contact__mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255,255,255,.3); transition: background .4s; }
.contact__mail:hover::after { background: #fff; }
.contact__cv { margin-top: 44px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.socials { margin-top: 64px; display: flex; gap: 32px; justify-content: center; font-size: 13px; flex-wrap: wrap; }
.socials a { color: var(--fg-3); transition: color .3s; }
.socials a:hover { color: #fff; }
.footer { padding-top: 24px; padding-bottom: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 11px; color: var(--fg-3); flex-wrap: wrap; gap: 8px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .4s var(--ease); }
.lightbox.is-open { opacity: 1; }
.lightbox__frame { width: min(1200px, 100%, calc((100vh - 140px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); transform: scale(.97); transition: transform .5s var(--ease); }
.lightbox.is-open .lightbox__frame { transform: none; }
.lightbox__frame iframe, .lightbox__frame video { width: 100%; height: 100%; border: 0; }
.lightbox__caption { margin-top: 16px; font-size: 11px; color: var(--fg-3); letter-spacing: .08em; text-align: center; }
.lightbox__close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.04); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color .3s, transform .4s var(--ease); }
.lightbox__close:hover { border-color: #fff; transform: rotate(90deg); }
.empty-video { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--fg-3); }

/* contact phone */
.contact__phone { display: block; width: fit-content; margin: 14px auto 0; font-size: 15px; color: var(--fg-2); font-family: var(--mono); letter-spacing: .04em; transition: color .3s; }
.contact__phone:hover { color: #fff; }
.contact__cv .pill { cursor: pointer; border: 0; }
.contact__cv .pill--ghost { border: 1px solid rgba(255,255,255,.3); }

/* full-screen CV viewer */
.cvview { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.94); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); display: flex; flex-direction: column; opacity: 0; transition: opacity .45s var(--ease); }
.cvview.is-open { opacity: 1; }
.cvview__bar { flex: none; height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.cvview__title { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cvview__actions { display: flex; align-items: center; gap: 12px; }
.cvview__actions .pill { font-size: 13px; padding: 9px 18px; }
.cvview__close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.04); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color .3s, transform .4s var(--ease); }
.cvview__close:hover { border-color: #fff; transform: rotate(90deg); }
.cvview__body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 40px 24px 80px; display: flex; flex-direction: column; align-items: center; gap: 24px; transform: translateY(16px); transition: transform .6s var(--ease); }
.cvview.is-open .cvview__body { transform: none; }
.cvview__page { width: min(900px, 100%); height: auto; background: #fff; border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.cvview__frame { width: min(900px, 100%); flex: 1; min-height: 70vh; border: 0; border-radius: 6px; background: #fff; }
.cvview__msg { margin: auto; font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: .1em; text-align: center; }
.cvview__msg a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.3); }
.cvview__spin { width: 22px; height: 22px; margin: 0 auto 14px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .cvview__bar { padding: 0 14px; }
  .cvview__body { padding: 20px 10px 60px; gap: 12px; }
  .cvview__actions .pill { padding: 9px 14px; }
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@keyframes rec { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
@keyframes ring { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.45); opacity: 0; } }

/* mobile */
@media (max-width: 760px) {
  .nav__inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; row-gap: 8px; }
  .nav__links { order: 3; width: 100%; overflow-x: auto; gap: 22px; padding-bottom: 4px; scrollbar-width: none; }
  .nav__links::-webkit-scrollbar { display: none; }
  .hero { padding-top: 72px; }
  .hero__intro { font-size: 17px; }
  .reel { border-radius: 14px; }
  .reel__play { width: 64px; height: 64px; }
  .reel__tl, .reel__tr { top: 14px; font-size: 9px; }
  .reel__tl { left: 14px; } .reel__tr { right: 14px; }
  .reel__bar { left: 14px; right: 14px; bottom: 12px; font-size: 9px; }
  .reel-wrap, .section { padding-bottom: 100px; }
  .about, .section--inner { padding-top: 100px; padding-bottom: 100px; }
  .project { grid-template-columns: 52px minmax(0, 1fr) 24px; }
  .project__r { grid-column: 2; grid-row: 2; margin-top: -10px; }
  .project__a { grid-column: 3; grid-row: 1; }
  .project__t { font-size: 18px; }
  .contact { padding-top: 110px; }
  .research__head .h2--gap { margin-bottom: 0; }
  .research__intro { padding-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
