:root {
  --dark: #0b0b0d;
  --ink: #f4f3f1;
  --chapter-title-size: min(146px, calc(100vw * 146 / 1440), calc(100svh * 146 / 900));
  --chapter-ease: cubic-bezier(.22,.74,.24,1);
  color: var(--ink);
  background: var(--dark);
  scroll-behavior: smooth;
}
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #79a5d7;
  outline-offset: 4px;
}
#site-content { isolation: isolate; }
.opening { z-index: 40; color: #181819; }
.portfolio-section { position: relative; background: var(--dark); color: var(--ink); }
.floating-pill, .opening-return, .enter-site, .effects-toggle {
  padding: 8px 15px;
  border: 1px solid #d8d8d4;
  border-radius: 999px;
  background: #f5f5f3ea;
  color: #252524;
  font-size: 14px;
  font-weight: 550;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.opening-return:hover, .enter-site:hover {
  background: #282828;
  border-color: #282828;
  color: #fff;
  transform: translateY(-2px);
}
.enter-site {
  position: absolute;
  z-index: 4;
  inset: auto max(4.63%, env(safe-area-inset-right)) max(5.5%, env(safe-area-inset-bottom)) auto;
}
.effects-toggle {
  position: fixed;
  z-index: 9;
  top: max(22px,env(safe-area-inset-top));
  right: max(21px,env(safe-area-inset-right));
  background: #212125ed;
  border-color: #ffffff36;
  color: #e9e8e7;
  font-size: 12px;
}
.effects-toggle:hover { background: #35353a; transform: translateY(-2px); }
body:has(#opening:not([hidden])) .effects-toggle { display: none; }
body:has(#quick-about:popover-open) #about-button { background: #252524; border-color: #252524; color: #fff; }
#quick-about:popover-open {
  animation: quick-in .24s var(--chapter-ease) both;
}
@keyframes quick-in {
  from { opacity: .45; transform: translateY(11px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.chapter-nav {
  --nav-pad: 4px;
  position: fixed;
  z-index: 10;
  top: max(clamp(15px,3.56svh,32px),env(safe-area-inset-top));
  left: 50%;
  translate: -50%;
  width: min(296px,calc(100vw - 28px));
  height: 53px;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  padding: var(--nav-pad);
  border: 1px solid #ffffff38;
  border-radius: 999px;
  background: #18181bee;
  box-shadow: 0 6px 18px #0004;
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s;
}
.chapter-nav[data-visible] { opacity: 1; visibility: visible; }
.chapter-thumb {
  position: absolute;
  inset: var(--nav-pad) auto var(--nav-pad) var(--nav-pad);
  width: calc((100% - 2 * var(--nav-pad)) / 4);
  border-radius: 999px;
  background: #eeedee;
  box-shadow: inset 0 -1px 0 #c9c8ca;
  transform: translate3d(calc(var(--chapter-progress, 0) * 100%),0,0);
  pointer-events: none;
}
.chapter-nav a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 999px;
}
.chapter-nav a img {
  display: block;
  width: 32px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
  transition: transform .19s var(--chapter-ease),filter .19s;
}
.chapter-nav a:hover img, .chapter-nav a:focus-visible img {
  transform: scale(1.11);
  filter: brightness(1.1);
}
.chapter-nav a .chapter-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.chapter-title {
  margin: 0;
  font-size: var(--chapter-title-size);
  font-weight: 750;
  line-height: 1.03;
  letter-spacing: -.047em;
}
.projects-surface {
  min-height: max(640px, 100svh);
  padding: clamp(200px,31.33svh,314px) 0 clamp(36px,9.8svh,88px);
  background: radial-gradient(ellipse 48% 46% at 50% 35%,#212125,transparent 100%), #09090a;
  isolation: isolate;
}
.projects-surface > .chapter-title {
  position: absolute;
  inset: clamp(97px,17.8svh,160px) 0 auto;
  text-align: center;
  white-space: nowrap;
}
.project-cards {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: clamp(12px,1.1vw,16px);
  width: min(1206px, calc(100% - 12vw));
  margin-inline: auto;
}
.project-card {
  --lift: 0px;
  display: flex;
  flex-direction: column;
  align-items: start;
  text-align: left;
  width: 100%;
  height: clamp(370px,58.8svh,529px);
  padding: clamp(22px,2vw,26px);
  padding-top: clamp(37px,6.5svh,62px);
  border: 1px solid #ffffff31;
  border-radius: 21px;
  color: #f6f5f4;
  background: linear-gradient(152deg,#202023a6,#131315ef 35%,#101011 88%);
  backdrop-filter: blur(5px);
  box-shadow: inset 0 1px 0 #ffffff14,0 12px 32px #0005;
  transform: translateY(var(--lift));
  transition: transform .24s var(--chapter-ease), border-color .24s, background .24s;
}
.project-card:hover, .project-card:focus-visible {
  --lift: -6px;
  border-color: #ffffff88;
  background: linear-gradient(152deg,#34343aaf,#1a1a1df7 48%,#161617);
}
.project-brand, .project-description { color: #b8b8bd; font-size: clamp(12px,1.08vw,15px); line-height: 1.45; }
.project-card strong { margin-top: 7px; color: #f6f5f3; font-size: clamp(23px,2.53vw,37px); line-height: 1.2; letter-spacing: -.04em; }
.project-description { margin-top: 8px; }
.project-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  margin: clamp(19px,4.65svh,42px) 0 18px;
  transition: filter .25s;
}
.project-card:hover img { filter: brightness(1.07); }
.project-open {
  width: 100%;
  margin-top: auto;
  padding: 11px 8px;
  text-align: center;
  border: 1px solid #41454e;
  border-radius: 999px;
  background: #0b0c10;
  font-size: 14px;
  font-weight: 600;
  transition: color .22s, background .22s;
}
.project-card:hover .project-open, .project-card:focus-visible .project-open { color: #171719; background: #f0eeed; }
.project-dialog {
  position: fixed;
  inset: 0;
  width: min(1228px,calc(100vw - 40px));
  height: min(860px,calc(100dvh - 56px));
  max-height: none;
  max-width: none;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 24px;
  background: #f5f5f3;
  color: #19191b;
  overflow: hidden;
}
.project-dialog[open] { display: flex; flex-direction: column; }
.project-dialog::backdrop { background: #111016aa; backdrop-filter: blur(4px); }
.project-dialog-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px clamp(14px,3.4vw,40px);
  border-bottom: 1px solid #d9d9d6;
}
.project-dialog-nav button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 9px 0 2px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #242426;
  font-size: 15px;
}
.project-dialog-nav button span { font: 25px/1 system-ui; }
.project-dialog-nav button:hover { background: #eaeae6; }
.project-dialog-nav h2 { margin: 0; font-size: 15px; font-weight: 650; }
.project-case-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; }
.project-case-content { position: relative; margin-inline: auto; }
.project-case-content > img { display: block; width: 100%; height: auto; }
.project-overlay {
  position: absolute;
  left: var(--left);
  top: var(--top);
  width: var(--width);
  height: var(--height);
}
.project-video, .project-overlay-link {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  transition: box-shadow .18s;
}
.project-overlay:hover { box-shadow: 0 0 0 2px #d6d4d2bd; }
.project-overlay video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #151517;
  opacity: 0;
}
.project-overlay[data-played] video { opacity: 1; }
.project-video { position: relative; z-index: 1; background: transparent; border: 0; padding: 0; }
.project-video span {
  position: absolute;
  bottom: 7px;
  left: 7px;
  display: grid;
  place-items: center;
  width: clamp(19px,2.4vw,29px);
  aspect-ratio: 1;
  border: 1px solid #ffffff64;
  border-radius: 50%;
  background: #141419ad;
  color: #fff;
  font-size: clamp(9px,1.04vw,12px);
  opacity: 0;
  transition: opacity .18s;
}
.project-video:hover span, .project-video:focus-visible span { opacity: 1; }
@media (hover:none) { .project-video span { opacity: 1; } }
.project-dialog .project-error {
  position: sticky;
  bottom: 9px;
  padding: 7px 13px;
  margin: 9px;
  font-size: 14px;
  color: #5b4246;
  background: #f6eeef;
}

.about-surface {
  min-height: max(690px,100svh);
  background: radial-gradient(ellipse 37% 50% at 78% 46%,#211e1e,transparent 97%),var(--dark);
}
.about-layout {
  position: relative;
  width: min(100%,1440px);
  min-height: max(690px,100svh);
  margin: auto;
  padding: clamp(122px,16svh,145px) 7.35% clamp(60px,9svh,86px);
  overflow: hidden;
}
.about-story { position: relative; z-index: 2; width: min(46%,562px); }
.about-story .chapter-title { margin-left: -.025em; white-space: nowrap; }
.about-summary { margin-top: clamp(8px,1.3svh,14px); }
.about-summary p { margin: 0; font-size: clamp(16px,1.42vw,20px); line-height: 1.66; color: #bdbab9; }
.about-summary p:first-child {
  margin-bottom: 8px;
  color: #f4f3f1;
  font-size: clamp(21px,1.94vw,28px);
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -.024em;
}
.about-jobs { margin-top: clamp(19px,3.05svh,29px); padding-top: 17px; border-top: 1px solid #ffffff27; }
.about-jobs h2, .about-details h2 { margin: 0 0 10px; color: #aaa8aa; font-size: 15px; font-weight: 650; }
.about-jobs dl { margin: 0; }
.about-jobs dl div {
  display: grid;
  grid-template-columns: minmax(73px,21.5%) minmax(0,1fr);
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #ffffff22;
}
.about-jobs dt { font-size: clamp(15px,1.38vw,20px); font-weight: 650; }
.about-jobs dd { margin: 0; color: #bdbab9; font-size: clamp(14px,1.12vw,16px); }
.about-details {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: start;
  margin-top: clamp(24px,3.75svh,34px);
}
.about-address { min-width: 0; }
.about-mail { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; }
.about-mail a { color: #f4f3f1; text-decoration: none; overflow-wrap: anywhere; font-size: clamp(14px,1.53vw,22px); }
.about-mail a:hover { text-decoration: underline; }
.copy-contact {
  padding: 7px 13px;
  border: 1px solid #37373b;
  border-radius: 999px;
  background: #19191d;
  color: #c7c5c5;
  font-size: 12px;
  white-space: nowrap;
  transition: background .18s;
}
.copy-contact:hover { background: #313137; }
.download-contact {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  margin-top: 20px;
  padding: 0 17px;
  border-radius: 999px;
  color: #18181a;
  background: #eeedeb;
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  transition: background .18s, transform .18s;
}
.download-contact:hover { background: #fff; transform: translateY(-2px); }
.download-contact span { font: 18px/1 system-ui; }
.about-code { flex: 0 0 min(20%,110px); margin: 0; text-align: center; }
.about-code a { display: block; padding: 6px; border-radius: 9px; background: #faf9f8; transition: transform .18s; }
.about-code a:hover { transform: translateY(-2px); }
.about-code img { display: block; width: 100%; height: auto; }
.about-code figcaption { margin-top: 6px; color: #a19fa1; font-size: 12px; }
.about-portrait {
  position: absolute;
  top: clamp(89px,12.3svh,111px);
  left: calc(50% - 16px);
  width: min(52.1%,83.4svh);
  pointer-events: none;
}
.about-portrait img { display: block; width: 100%; height: auto; user-select: none; }

.site-motion .portfolio-section:not([data-revealed]) [data-arrive] { opacity: 0; }
.site-motion .portfolio-section[data-revealed] [data-arrive] {
  animation: chapter-in .57s var(--chapter-ease) var(--arrival,0ms) backwards;
}
.project-card:nth-child(1) { --arrival: 95ms; }
.project-card:nth-child(2) { --arrival: 159ms; }
.project-card:nth-child(3) { --arrival: 223ms; }
.folder:nth-child(1), .selected-work, .about-summary { --arrival: 110ms; }
.folder:nth-child(2) { --arrival: 175ms; }
.about-jobs { --arrival: 165ms; }
.about-details { --arrival: 215ms; }
.about-portrait { --arrival: 82ms; }
@keyframes chapter-in {
  from { opacity: 0; translate: 0 25px; }
  to { opacity: 1; translate: none; }
}
@media (min-width:681px) and (max-height:820px) {
  .project-card img { margin-block: 2.2svh 14px; }
  .project-card { padding-top: 4.7svh; }
}
@media (max-width:960px) {
  .about-story { width: 52%; }
  .about-jobs dd { line-height: 1.49; }
  .about-portrait { top: max(110px,13svh); left: 52%; width: 53%; }
}
@media (max-width:680px) {
  :root { --chapter-title-size: min(9.8vw,65px); }
  .chapter-nav { width: min(250px,calc(100vw - 120px)); height: 49px; }
  .chapter-nav a img { width: 28px; height: 28px; }
  .opening-return,.enter-site { font-size: 12px; padding: 7px 12px; }
  .portfolio-footer { inset-block-end: max(2.5%,env(safe-area-inset-bottom)); }
  .effects-toggle {
    top: max(calc(clamp(15px,3.56svh,32px) + 6px),calc(env(safe-area-inset-top) + 6px));
    right: max(8px,env(safe-area-inset-right));
    width: 43px;
    height: 37px;
    padding: 0;
    font-size: 10px;
  }
  .projects-surface { padding-top: 171px; padding-bottom: 61px; }
  .projects-surface > .chapter-title { top: 106px; }
  .project-cards { width: min(431px,calc(100% - 42px)); grid-template-columns: minmax(0,1fr); gap: 15px; }
  .project-card { height: auto; padding: 18px; border-radius: 16px; }
  .project-card strong { font-size: 25px; }
  .project-description { margin-top: 5px; }
  .project-card img { margin: 16px 0 13px; }
  .project-open { padding: 9px; font-size: 13px; }
  .project-dialog { width: calc(100vw - 20px); height: calc(100dvh - 24px); border-radius: 17px; }
  .project-case-content { min-width: 620px; }
  .about-layout { padding: 111px 23px 62px; }
  .about-story { width: 100%; }
  .about-story .chapter-title { margin-bottom: min(57vw,330px); }
  .about-portrait {
    width: min(72vw,490px);
    inset: 103px 0 auto auto;
    height: min(62vw,360px);
    overflow: hidden;
    mask-image: linear-gradient(#000 calc(100% - 20px),transparent);
  }
  .about-summary p { font-size: 16px; }
  .about-details { gap: 12px; }
  .about-code { flex-basis: min(28%,94px); }
}
@media (prefers-reduced-motion:reduce) {
  :root { scroll-behavior: auto; }
  #quick-about:popover-open,
  .site-motion .portfolio-section[data-revealed] [data-arrive] { animation: none; }
  .site-motion .portfolio-section:not([data-revealed]) [data-arrive] { opacity: 1; }
  .project-card, .project-open, .download-contact, .effects-toggle, .chapter-nav, .chapter-nav a img { transition: none; }
}
