@font-face {
  font-family: Bricolage;
  src: url("assets/fonts/bricolage.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("assets/fonts/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080d15;
  --surface: #0e1622;
  --surface-up: #121d2a;
  --line: #253446;
  --text: #f1f6fc;
  --muted: #afbed1;
  --cyan: #83e9ff;
  --font-display: Bricolage, "Segoe UI", sans-serif;
  --font-body: Inter, "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --shell: min(1240px, calc(100% - 96px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; color: var(--text); background: var(--bg); font: 400 1rem/1.6 var(--font-body); }
body:has(dialog[open]) { overflow: hidden; }
::selection { color: #06101d; background: var(--cyan); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure, dl { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.06; letter-spacing: -.035em; }
h2 { font-weight: 700; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link:focus { position: absolute; z-index: 4; top: 14px; left: 14px; background: var(--cyan); color: var(--bg); padding: .6rem 1rem; }

.site-header { background: #0a111b; border-bottom: 1px solid #213042; }
.header-layout { min-height: 75px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; font-size: .94rem; font-weight: 650; white-space: nowrap; }
.monogram, .role-mark {
  display: grid; place-items: center; width: 37px; height: 37px;
  border: 1px solid #478297; color: var(--cyan); background: #122530;
  border-radius: 8px; font: 700 .82rem/1 var(--font-mono); letter-spacing: -.07em;
}
.site-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 45px); color: var(--muted); font-size: .92rem; font-weight: 500; }
.site-nav a, .footer-bottom a { transition: color .18s ease; }
.site-nav a:hover, .footer-bottom a:hover { color: var(--cyan); }
.header-github { justify-self: end; }
.button {
  min-height: 48px; padding: .69rem 1.15rem; border: 1px solid transparent; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-size: .92rem; font-weight: 650; white-space: nowrap; color: var(--text);
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.button-small { min-height: 40px; padding: .42rem .9rem; font-size: .87rem; }
.button-primary { color: #0b1a21; background: var(--cyan); border-color: var(--cyan); }
.button-primary:hover { background: #c5f5ff; border-color: #c5f5ff; }
.button-outline { background: #111b29; border-color: #374b62; }
.button-outline:hover { color: var(--cyan); background: #172634; border-color: #578393; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.section-label { color: var(--cyan); font: 600 .82rem/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }

.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--line); background: #090f18; }
.hero-art {
  position: absolute; z-index: -1; inset: 0; 
  background:
    linear-gradient(90deg, #090f18 0%, #090f18db 26%, #090f1810 65%),
    linear-gradient(0deg, #090f18 0%, transparent 31%),
    url("assets/hero.webp") 74% 49% / cover no-repeat;
}
.hero-layout { display: flex; flex-direction: column; min-height: 653px; }
.hero-content { padding: 108px 0 70px; }
.hero-content .section-label { margin-bottom: 17px; }
.hero h1 { font-size: clamp(5rem, 8.6vw, 8.6rem); line-height: .93; letter-spacing: -.079em; font-weight: 760; }
.hero h1 span { color: var(--cyan); }
.hero-description { margin: 26px 0 30px; max-width: 545px; color: #c7d4e4; font-size: clamp(1.06rem, 1.5vw, 1.25rem); line-height: 1.6; }
.hero .button-primary { padding-inline: 1.45rem; }
.hero-stats { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr 1fr; max-width: 880px; border-top: 1px solid #3a4c60; }
.hero-stats div { padding: 25px 20px 29px 0; }
.hero-stats div + div { border-left: 1px solid #3a4c60; padding-left: clamp(22px, 3vw, 43px); }
.hero-stats dt { font: 700 clamp(1.75rem, 3vw, 2.55rem)/1 var(--font-display); letter-spacing: -.07em; }
.hero-stats dd { color: #bacbe0; margin: 8px 0 0; font-size: .88rem; line-height: 1.45; }

.section { padding-block: 92px; }
.section-intro { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 21px 36px; margin-bottom: 34px; }
.section-intro h2, .footer h2 { margin-top: 7px; font-size: clamp(2.65rem, 5.2vw, 4.55rem); letter-spacing: -.064em; }
.section-intro > p { flex: 0 1 382px; color: var(--muted); line-height: 1.6; }
.featured { display: grid; gap: 16px; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; }
.feature-card {
  display: grid; gap: 0; border: 1px solid #293a4d; border-radius: 14px; overflow: hidden;
  background: #0e1723; transition: background .18s ease, border-color .18s ease, translate .18s ease;
}
.feature-card:hover, .library-card:hover { border-color: #558498; background: #111f2d; }
.feature-card:hover { translate: 0 -2px; }
.feature-main { grid-row: span 2; grid-template-rows: minmax(200px, 1fr) auto; }
.feature-visual { min-width: 0; overflow: hidden; position: relative; background: #0a1222; }
.feature-main .feature-visual { display: grid; place-items: center; padding: 25px 23px 0; background: radial-gradient(ellipse at 53% 90%, #163954, transparent 74%), #0c1726; }
.feature-visual img { width: 100%; height: 100%; object-fit: cover; }
.feature-main .feature-visual img {
  width: 100%; max-height: 325px; object-fit: cover; object-position: center 20%;
  border-radius: 11px 11px 0 0; border: 1px solid #4c6380; border-bottom: 0;
}
.feature-side { grid-template-columns: 1.4fr 1fr; }
.feature-side .feature-visual { order: 2; border-left: 1px solid var(--line); }
.feature-side .feature-visual img { object-position: 60% center; }
.feature-copy { padding: clamp(19px, 2.1vw, 27px); display: grid; gap: 9px; align-content: start; }
.feature-copy h3 { font-size: clamp(1.4rem, 2.6vw, 2.32rem); }
.feature-copy p, .library-card p { color: var(--muted); line-height: 1.49; font-size: 1rem; }
.feature-copy .kicker, .feature-action { color: var(--cyan); font: 600 .77rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .085em; }
.feature-action { display: inline-flex; align-items: center; align-self: start; gap: 7px; margin-top: 8px; }
.play-marker { font-size: .66rem; }
.mini-report {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px 14px; color: #d8eef7;
  background: radial-gradient(ellipse at 40% 70%, #16435475, transparent 85%), #0a1521;
}
.mini-report p { font: 650 .73rem/1.4 var(--font-mono); color: #99bbcf; letter-spacing: .035em; }
.mini-report strong { font: 720 clamp(1.5rem, 2.8vw, 2.65rem)/1 var(--font-display); color: var(--cyan); letter-spacing: -.05em; }
.feature-main .calibration-report { display: flex; align-items: stretch; gap: 10px; min-height: 270px; padding: clamp(18px, 3vw, 32px); }
.calibration-rows { display: grid; gap: 11px; margin-top: 6px; }
.calibration-detail { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #c6d9ec; font-size: .88rem; }
.calibration-detail span:last-child { flex: 0 0 auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.calibration-track { height: 5px; margin-top: 4px; border-radius: 3px; background: #2b4357; overflow: hidden; }
.calibration-fill { height: 100%; border-radius: inherit; background: #77deef; }

.library { margin-top: 62px; }
.library-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 15px; }
.library-header h3 { font-size: clamp(1.75rem, 3vw, 2.55rem); }
.library-header p { min-height: 1.55em; margin-top: 7px; font-size: .89rem; color: var(--muted); }
.search { width: min(100%, 325px); display: flex; align-items: center; gap: 10px; border: 1px solid #33485f; border-radius: 7px; padding-inline: 13px; background: #101a27; }
.search:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.search-icon { flex: 0 0 14px; width: 14px; height: 14px; border: 1.5px solid #a0bbd1; border-radius: 50%; position: relative; margin-right: 2px; }
.search-icon::after { content: ""; width: 6px; height: 1.5px; position: absolute; background: #a0bbd1; transform: rotate(45deg); top: 11px; left: 9px; }
.search input { width: 100%; min-height: 46px; color: var(--text); background: transparent; border: 0; outline: none; }
.search input::placeholder { color: #92a7bd; font-size: .9rem; opacity: 1; }
.search input:focus-visible { outline: none; }
.filters, .media-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { margin-bottom: 19px; }
.filter { background: #111c29; color: var(--muted); border: 1px solid #304359; border-radius: 7px; padding: .4rem .82rem; min-height: 42px; font-weight: 600; font-size: .88rem; }
.filter:hover { color: var(--text); border-color: #688098; }
.filter.is-active { color: var(--cyan); background: #132a36; border-color: #527f91; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.library-card {
  min-width: 0; min-height: 183px; display: flex; flex-direction: column; gap: 9px;
  padding: 19px 20px; border: 1px solid #25364a; border-radius: 9px; background: #0e1722;
  transition: background .18s ease, border-color .18s ease;
}
.library-card h4 { font-size: clamp(1.16rem, 1.65vw, 1.47rem); }
.library-card p { font-size: .94rem; }
.library-card .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: auto; }
.card-category { color: #a9bcd1; font: 600 .76rem/1.4 var(--font-mono); }
.card-media { color: var(--cyan); font: 600 .76rem/1.4 var(--font-mono); white-space: nowrap; }
.empty-state { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.empty-state .button { margin-top: 12px; }

.experience { background: #0c1420; border-block: 1px solid var(--line); }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.role { display: flex; flex-direction: column; gap: 16px; background: #111b29; border: 1px solid #31435a; border-radius: 12px; padding: clamp(20px, 3vw, 33px); }
.role-top { display: flex; gap: 14px; align-items: center; margin-bottom: 3px; }
.role-mark { width: 46px; height: 46px; font-size: .91rem; }
.role h3 { font-size: clamp(1.6rem, 2.8vw, 2.65rem); }
.role > p { line-height: 1.55; color: var(--muted); }
.role-top p { margin-top: 5px; font-weight: 600; color: var(--cyan); }
.stack-list { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-list span { padding: .23rem .55rem; color: #c8d9ec; font: 560 .78rem/1.5 var(--font-mono); border-radius: 5px; border: 1px solid #36516c; background: #17283b; }
.role .stack-list { margin-top: auto; padding-top: 2px; }
.education { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px 17px; margin-top: 24px; color: var(--muted); }
.education > span { color: var(--cyan); font: 600 .83rem/1.5 var(--font-mono); }
.education strong { color: var(--text); }

.tool-list { border-top: 1px solid #2e4057; }
.tool-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2.7fr); gap: 19px; align-items: baseline; padding-block: 16px; border-bottom: 1px solid #293a4e; }
.tool-row h3 { color: #e3efff; font-size: 1.16rem; letter-spacing: -.011em; line-height: 1.35; }
.tool-row p { color: var(--muted); }
.footer { position: relative; background: radial-gradient(ellipse at 75% 30%, #17334890, transparent 55%), #0b1520; border-top: 1px solid #31465b; }
.footer-layout { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; padding-block: 58px; gap: 22px; }
.footer-bottom { display: flex; justify-content: space-between; padding-block: 17px; gap: 12px; border-top: 1px solid #31465b; color: var(--muted); font-size: .9rem; }

.project-dialog {
  inset: 0; width: min(900px, calc(100% - 36px)); max-height: min(88dvh, 1080px); padding: 0; margin: auto;
  border-radius: 16px; border: 1px solid #42708a; background: #0f1a28; color: var(--text);
  box-shadow: 0 22px 110px #000c; overscroll-behavior: contain;
}
.project-dialog::backdrop { background: #040810cb; backdrop-filter: blur(5px); }
.dialog-top {
  display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px clamp(19px, 4vw, 34px);
  position: sticky; top: 0; z-index: 2; background: #111d2c; border-bottom: 1px solid #2b4055;
}
.close-button { min-width: 43px; min-height: 43px; border-radius: 8px; border: 1px solid #41607c; background: #17293b; color: var(--text); font-size: 1.75rem; line-height: 1; }
.close-button:hover { color: var(--cyan); }
.dialog-content { padding: clamp(19px, 4vw, 34px); }
.dialog-content h2 { font-size: clamp(2.15rem, 5vw, 3.9rem); }
.dialog-description { color: #c0d3e8; font-size: 1.13rem; margin-block: 9px 14px; }
.dialog-quick { margin-top: 15px; }
.detail-columns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 24px; }
.detail-columns h3, .proof h3, .media h3 { font-size: 1.24rem; letter-spacing: -.015em; }
.detail-columns p, .proof p { margin-top: 7px; color: var(--muted); }
.proof { margin-block: 20px; padding: 17px 20px; border: 1px solid #386477; border-radius: 8px; background: #112834; }
.detail-image { background: #08111b; margin-block: 18px; max-height: 290px; overflow: hidden; border: 1px solid #334d66; border-radius: 9px; }
.detail-image img { margin: auto; width: 100%; max-height: 288px; object-fit: contain; }
.media { margin-top: 24px; scroll-margin-top: 80px; }
.media-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.media video { width: 100%; height: auto; max-height: 65dvh; aspect-ratio: 16/9; object-fit: contain; background: #060b12; border: 1px solid #386078; border-radius: 9px; }
.media-note { margin-top: 9px; color: var(--muted); font-size: .88rem; }
.dialog-links { margin-top: 23px; }
.print-profile { display: none; }

@media (max-width: 1000px) {
  :root { --shell: calc(100% - 64px); }
  .hero-layout { min-height: 604px; }
  .hero-content { padding-top: 88px; }
  .section { padding-block: 72px; }
  .feature-side { grid-template-columns: 1.55fr .8fr; }
  .feature-copy { padding-inline: 19px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 721px) and (max-width: 860px) {
  .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-main { grid-row: auto; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .feature-main .feature-visual { padding: 16px 16px 0; }
  .feature-side { grid-template-columns: 1fr; grid-template-rows: auto 135px; }
  .feature-side .feature-visual { border-left: 0; border-top: 1px solid var(--line); }
  .feature-side .feature-visual img { object-position: center 10%; }
}
@media (max-width: 720px) {
  :root { --shell: calc(100% - 38px); }
  .header-layout { grid-template-columns: 1fr auto; min-height: 67px; gap: 12px; }
  .header-github { display: none; }
  .site-nav { gap: clamp(11px, 2.5vw, 20px); font-size: .82rem; }
  .monogram { width: 32px; height: 32px; }
  .brand { gap: 7px; font-size: .86rem; }
  .hero-layout { min-height: 0; }
  .hero-art {
    opacity: .68;
    background: linear-gradient(0deg, #090f18, transparent 48%),
      linear-gradient(90deg, #090f18f5, #090f1830),
      url("assets/hero.webp") 61% 45% / auto 100% no-repeat;
  }
  .hero-content { padding-block: 83px 57px; }
  .hero h1 { font-size: clamp(3.65rem, 12vw, 5rem); }
  .hero-description { font-size: 1.03rem; margin: 20px 0 24px; }
  .hero-stats div { padding-block: 20px; padding-right: 9px; }
  .hero-stats div + div { padding-left: 10px; }
  .hero-stats dd { font-size: .78rem; }
  .section { padding-block: 56px; }
  .section-intro { margin-bottom: 24px; }
  .section-intro > p { flex-basis: 100%; }
  .featured { grid-template-columns: 1fr; }
  .feature-main { grid-row: auto; }
  .feature-main .feature-visual { padding: 19px 18px 0; }
  .feature-main .feature-visual img { max-height: 245px; }
  .library { margin-top: 48px; }
  .library-header { align-items: start; }
  .role-grid, .detail-columns { grid-template-columns: 1fr; }
  .search { max-width: 100%; }
  .tool-row { grid-template-columns: 1fr; gap: 5px; }
  .footer-layout { padding-block: 44px; }
}
@media (max-width: 440px) {
  .brand > span:last-child { display: none; }
  .hero-content { padding-block: 66px 45px; }
  .hero-content .section-label { font-size: .76rem; letter-spacing: .07em; }
  .hero h1 { letter-spacing: -.067em; }
  .hero-stats dt { font-size: 1.63rem; }
  .hero-stats dd { font-size: .75rem; }
  .library-grid { grid-template-columns: 1fr; }
  .library-card { min-height: 143px; }
  .feature-side { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .feature-copy { padding: 15px; }
  .feature-copy p { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
@media print {
  :root { color-scheme: light; --text: #16191b; --muted: #2b333b; --cyan: #173e53; --line: #acb9c5; --shell: 100%; }
  body { background: #fff; color: #16191b; font: 10.5pt/1.4 var(--font-body); }
  .site-header, .hero-art, .hero .actions, .hero-stats, #projects, #download-resume, .footer,
  .project-dialog, .role-mark, .skip-link { display: none !important; }
  .hero, .experience { border: 0; background: #fff; }
  .hero-layout { display: block; min-height: 0; }
  .hero-content { padding: 0 0 13pt; }
  .hero h1 { font-size: 29pt; }
  .hero-description { color: #26313b; font-size: 10.5pt; margin: 8pt 0; }
  .print-profile { display: block; font-size: 9pt; color: #26313b; }
  .hero-content .section-label { margin-bottom: 4pt; }
  .section-label { font-size: 8.5pt; }
  .section { padding: 12pt 0; }
  .section-intro { margin-bottom: 8pt; }
  .section-intro h2 { font-size: 21pt; }
  .section-intro > p { display: none; }
  .role-grid { display: block; }
  .role { display: block; break-inside: avoid; padding: 8pt 0; border: 0; background: none; }
  .role h3 { font-size: 15pt; }
  .role-top p { margin: 2pt 0 5pt; }
  .role > p { margin-bottom: 4pt; }
  .stack-list span { color: #26313b; background: none; border-color: #b0bcc8; padding: 1pt 4pt; font-size: 8pt; }
  .education { margin-top: 6pt; }
  .tool-row { break-inside: avoid; padding: 5pt 0; grid-template-columns: 150pt 1fr; }
  .tool-row h3 { color: #1c2935; font-size: 11pt; }
}
