* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #555; --muted: #999; --line: #f5f5f5; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; font-family: Arial, Helvetica, sans-serif; font-weight: 300; }
a { color: inherit; }
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: stretch; width: min(1200px, 100%); height: 83px; margin: 0 auto; background: rgba(255,255,255,.98); }
body[data-page="portfolio"] > .site-header { position: static; }
.portfolio-end-header { position: static; }
.header-brand { position: relative; display: flex; flex: 0 0 210px; align-items: center; padding: 10px 15px; color: #fff; background: #252525; text-decoration: none; }
.header-brand span { font-size: 22px; line-height: 1.18; letter-spacing: .28em; font-weight: 400; }
.header-brand i { position: absolute; top: 17px; right: 15px; width: 20px; height: 20px; border-top: 1px solid #fff; border-right: 1px solid #fff; }
.site-nav { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 26px; padding: 0 16px 0 28px; white-space: nowrap; }
.site-nav a { color: #b0b0b0; font-size: 13px; text-decoration: none; transition: color .18s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #333; }
.portfolio-main { width: 100%; }
.portfolio-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
.portfolio-item { position: relative; display: block; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; border-right: 1px solid #eee; border-bottom: 1px solid #eee; background: #292929; cursor: pointer; }
.portfolio-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .22s ease, transform .35s ease; }
.portfolio-item:hover img, .portfolio-item:focus-visible img { opacity: .78; transform: scale(1.025); }
.portfolio-item:focus-visible { outline: 2px solid #fff; outline-offset: -4px; z-index: 1; }
.welcome-page { background: #aaa; }
.welcome-screen { display: grid; min-height: 100svh; place-items: center; }
.welcome-brand { position: relative; display: inline-block; color: #fff; text-decoration: none; text-align: left; }
.brand-name { display: block; font-size: 34px; line-height: 1.14; letter-spacing: .31em; font-weight: 300; }
.brand-corner { position: absolute; top: 7px; right: 0; width: 22px; height: 22px; border-top: 1px solid #fff; border-right: 1px solid #fff; }
.enter-label { display: block; margin-top: 6px; text-align: center; font-size: 11px; letter-spacing: .16em; }
.welcome-brand:hover .enter-label { letter-spacing: .22em; }
.cinematics-main { width: min(770px, calc(100% - 40px)); margin: 17px auto 72px; font-size: 16px; line-height: 1.43; }
.year-block { margin: 0 0 22px; }
.year-block h1 { margin: 0; color: #454545; font-size: 16px; line-height: 1.45; font-weight: 700; }
.project-line { margin: 0; }
.project-line a { text-decoration: none; }
.project-line a:hover { text-decoration: underline; }
.project-role { color: #9b9b9b; font-style: italic; }
.about-hero { display: flex; align-items: flex-start; min-height: 835px; padding: 84px max(5vw, calc((100vw - 1200px) / 2)) 34px; background: #333 url("assets/about-scene.jpg") center center / cover no-repeat; }
.about-card { width: 390px; margin-left: auto; padding: 36px 28px 10px; background: rgba(255,255,255,.97); }
.about-card h1, .contact-panel h1 { margin: 0 0 22px; color: #777; font-size: 27px; font-weight: 300; letter-spacing: .12em; }
.about-card p { margin: 0 0 16px; color: #777; font-size: 14px; line-height: 1.28; }
.about-card .older-work { margin-bottom: 0; }
.about-card a { color: #888; text-decoration: none; }
.about-card a:hover { text-decoration: underline; }
body[data-page="about"] { --about-header-height: 83px; --about-bottom-height: 54px; height: 100vh; overflow: hidden; }
body[data-page="about"] .site-header { height: var(--about-header-height); }
body[data-page="about"] .about-hero { height: calc(100vh - var(--about-header-height) - var(--about-bottom-height)); min-height: 0; padding-top: min(84px, 7vh); padding-bottom: 24px; overflow: hidden; }
body[data-page="about"] .about-card { max-height: 100%; overflow: hidden; }
.about-bottom-band { height: var(--about-bottom-height, 54px); background: #fff; }
.contact-hero { position: relative; display: flex; justify-content: flex-end; width: min(1190px, 100%); min-height: 740px; margin: 0 auto; padding: 36px 8.8% 40px 0; background: #aaa url("assets/contact-scene.jpg") center / cover no-repeat; }
.contact-panel { width: 345px; min-height: 430px; padding: 0 0 20px; }
.contact-panel h1 { margin-bottom: 28px; font-size: 28px; }
.contact-label { margin: 0; font-size: 13px; font-weight: 600; }
.contact-value { margin: 2px 0 18px; font-size: 13px; }
.contact-value a { text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }
#contact-form { margin-top: 30px; }
#contact-form input, #contact-form textarea { display: block; width: 100%; margin: 4px 0; border: 1px solid #bcbcbc; border-radius: 0; padding: 7px 8px; background: rgba(255,255,255,.88); color: #555; font: inherit; font-size: 13px; }
#contact-form input { height: 29px; }
#contact-form textarea { min-height: 128px; resize: vertical; }
#contact-form input:focus, #contact-form textarea:focus { outline: 1px solid #555; }
#contact-form button { float: right; margin-top: 9px; border: 0; padding: 8px 11px; color: #fff; background: #189cac; font: inherit; font-size: 13px; cursor: pointer; }
#contact-form button:hover { background: #127e8b; }
.form-note { clear: both; padding-top: 16px; color: #696969; font-size: 11px; line-height: 1.4; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 50; display: block; background: rgba(255,255,255,.98); }
.lightbox-tools { position: absolute; inset: 14px 16px auto; z-index: 2; display: flex; align-items: center; gap: 18px; }
.icon-button { display: inline-grid; place-items: center; min-width: 25px; min-height: 28px; padding: 0; border: 0; color: #666; background: transparent; font: inherit; font-size: 25px; line-height: 1; text-decoration: none; cursor: pointer; }
.icon-button:hover, .icon-button.is-active { color: #111; }
.close-lightbox { margin-left: auto; font-size: 38px; font-weight: 200; }
.lightbox-figure { position: absolute; top: 50%; left: 50%; display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: 48px; width: min(78vw, 1600px); margin: 0; transform: translate(-50%, -50%); }
.lightbox-image-stage { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; min-height: min(38vh, 300px); background: #f7f7f7; }
.lightbox-image-stage img { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
.lightbox-image-stage img.fit-width { max-height: none; }
.loading-spinner { position: absolute; display: none; width: 44px; height: 44px; border: 4px solid #dedede; border-top-color: #666; border-radius: 50%; animation: image-spin .8s linear infinite; }
.lightbox-image-stage.is-loading .loading-spinner { display: block; }
.image-load-error { position: absolute; display: none; margin: 0; padding: 12px 16px; color: #666; background: rgba(255,255,255,.92); font-size: 14px; }
.lightbox-image-stage.has-error .image-load-error { display: block; }
@keyframes image-spin { to { transform: rotate(360deg); } }
.lightbox-figure figcaption h1 { margin: 0 0 18px; color: #555; font-size: 22px; line-height: 1.35; font-weight: 300; }
.lightbox-figure figcaption p { margin: 0; color: #777; font-size: 13px; }
.lightbox-arrow { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); border: 0; padding: 0 12px; color: #666; background: transparent; font-size: 42px; font-weight: 200; cursor: pointer; }
.lightbox-arrow:hover { color: #111; }
.lightbox-arrow.previous { left: 12px; }
.lightbox-arrow.next { right: 12px; }
.lightbox.expanded-view { background: #f7f7f7; }
.lightbox.expanded-view .lightbox-figure { top: 0; left: 3.8vw; width: 92.4vw; height: 100vh; padding: 0 1.2vw; grid-template-columns: 1fr; place-items: center; background: #f7f7f7; transform: none; }
.lightbox.expanded-view .lightbox-image-stage { width: 100%; height: 100%; min-height: 0; }
.lightbox.expanded-view .lightbox-image-stage img { width: auto; height: auto; max-width: 100%; max-height: 100vh; object-fit: contain; }
.lightbox.expanded-view .lightbox-figure figcaption,
.lightbox.expanded-view #download-image,
.lightbox.expanded-view #share-image,
.lightbox.expanded-view #love-image { display: none; }
.lightbox.expanded-view .lightbox-tools { inset: 0; z-index: 4; pointer-events: none; }
.lightbox.expanded-view #expand-image,
.lightbox.expanded-view .close-lightbox { position: absolute; top: 0; display: grid; width: 3.8vw; height: 100vh; min-width: 40px; margin: 0; color: #444; background: #fff; font-size: 25px; pointer-events: auto; }
.lightbox.expanded-view #expand-image { top: 0; left: 0; z-index: 3; width: 3.8vw; height: 64px; min-width: 40px; }
.lightbox.expanded-view .close-lightbox { top: 0; right: 0; z-index: 5; width: 3.8vw; height: 64px; min-width: 40px; color: #222; background: #fff; font-size: 38px; }
.lightbox.expanded-view .lightbox-arrow.previous { top: 0; left: 0; width: 3.8vw; height: 100vh; padding: 0; color: #555; background: #fff; transform: none; }
.lightbox.expanded-view .lightbox-arrow.next { top: 0; right: 0; width: 3.8vw; height: 100vh; padding: 0; color: #555; background: #fff; transform: none; }
body.modal-open { overflow: hidden; }
@media (max-width: 900px) {
  .site-header { height: auto; min-height: 78px; flex-wrap: wrap; }
  body[data-page="about"] { --about-header-height: 83px; }
  body[data-page="about"] .site-header { height: var(--about-header-height); min-height: 0; }
  .header-brand { flex-basis: 190px; height: 78px; }
  .header-brand span { font-size: 20px; }
  .site-nav { min-height: 52px; justify-content: center; gap: clamp(12px, 3vw, 25px); padding: 0 10px; overflow-x: auto; }
  .site-nav a { font-size: 12px; }
  .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-page="about"] .about-hero { padding: min(52px, 6vh) 6vw 18px; }
  body[data-page="about"] .about-card { width: min(390px, 52vw); padding: 25px 24px 8px; }
  body[data-page="about"] .about-card p { font-size: clamp(11px, 1.3vh, 14px); margin-bottom: 11px; }
  body[data-page="about"] .about-card h1 { font-size: clamp(20px, 2.5vh, 27px); margin-bottom: 15px; }
  .contact-hero { min-height: 690px; padding-right: 5%; }
  .contact-panel { width: min(345px, 48%); }
  .lightbox-figure { grid-template-columns: minmax(0, 1fr); gap: 16px; width: calc(100% - 80px); }
  .lightbox-image-stage img { max-height: 68vh; }
  .lightbox-figure figcaption { padding: 0 2px; }
  .lightbox-figure figcaption h1 { margin-bottom: 8px; font-size: 18px; }
  .lightbox.expanded-view .lightbox-figure { left: 44px; width: calc(100vw - 88px); padding: 0 8px; }
  .lightbox.expanded-view #expand-image, .lightbox.expanded-view .close-lightbox, .lightbox.expanded-view .lightbox-arrow.previous, .lightbox.expanded-view .lightbox-arrow.next { width: 44px; }
}
@media (max-width: 600px) {
  .site-header { position: relative; }
  body[data-page="about"] { --about-header-height: 124px; }
  .header-brand { flex-basis: 100%; justify-content: center; }
  .header-brand span { width: 166px; }
  .header-brand i { right: calc(50% - 83px); }
  .site-nav { justify-content: flex-start; width: 100%; min-height: 46px; gap: 19px; }
  .site-nav a { flex: 0 0 auto; }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-name { font-size: 29px; }
  .cinematics-main { width: calc(100% - 32px); margin-top: 24px; font-size: 15px; }
  body[data-page="about"] .about-hero { padding: 18px; background-position: 34% center; }
  body[data-page="about"] .about-card { width: 100%; margin: 0; padding: 18px; }
  body[data-page="about"] .about-card p { font-size: clamp(10px, 1.15vh, 13px); line-height: 1.25; margin-bottom: 7px; }
  body[data-page="about"] .about-card h1 { font-size: clamp(18px, 2vh, 23px); margin-bottom: 10px; }
  .contact-hero { min-height: 700px; padding: 32px 18px; background-position: 39% center; }
  .contact-panel { width: 100%; padding: 22px; background: rgba(255,255,255,.89); }
  .contact-panel h1 { font-size: 25px; }
  .lightbox-tools { inset: 8px 10px auto; gap: 12px; }
  .lightbox-figure { width: calc(100% - 60px); }
  .lightbox-image-stage { min-height: 220px; }
  .lightbox-image-stage img { max-height: 58vh; }
  .lightbox-arrow.previous { left: 0; }
  .lightbox-arrow.next { right: 0; }
}
