:root {
  color-scheme: dark;
  --black: #080808;
  --white: #f8f7f4;
  --muted: #a7a5a1;
  --line: #31312f;
  --gutter: clamp(22px, 5vw, 96px);
  --body-font: "Geist", Arial, sans-serif;
  --display-font: "Zalando Sans Expanded", "Geist", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--black); color: var(--white); font: 400 16px/1.5 var(--body-font); }
a { color: inherit; text-decoration: none; }
button, summary { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #8ebffc; outline-offset: 5px; }
::selection { background: #e9c890; color: #171410; }

.shell { padding-inline: var(--gutter); }
.display { font-family: var(--display-font); font-weight: 400; letter-spacing: -.06em; line-height: .86; }
.label { color: var(--muted); font-size: .875rem; }
.skip-link { position: fixed; top: 12px; left: var(--gutter); z-index: 40; padding: 12px 18px; background: var(--white); color: var(--black); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  background: var(--black);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-color: var(--line); }
.header-inner {
  min-height: 76px;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 500 1.22rem/1 var(--display-font);
  letter-spacing: -.065em;
}
.brand-mark { font: 700 .61rem/.84 var(--body-font); letter-spacing: -.065em; }
.desktop-nav, .footer-links { display: flex; flex-wrap: wrap; gap: clamp(22px, 3vw, 52px); }
.desktop-nav a, .header-contact, .footer-links a { font-size: .93rem; }
.desktop-nav a:hover, .header-contact:hover, .footer-links a:hover { text-decoration: underline; text-underline-offset: 5px; }
.header-contact { justify-self: end; }
.header-contact span, .footer-links span { margin-left: .28em; }
.mobile-nav { display: none; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: max(680px, 100svh);
  display: grid;
  grid-template-rows: minmax(420px, 1fr) auto;
  padding: 76px var(--gutter) clamp(27px, 5vh, 68px);
}
.hero-visual { position: relative; display: grid; place-items: center; min-width: 0; }
.hero-wordmark {
  font: 400 clamp(94px, 20.9vw, 395px)/.82 var(--display-font);
  letter-spacing: -.035em;
  padding-right: .035em;
  transform: scaleX(1.09);
  white-space: nowrap;
  user-select: none;
}
.sculpture {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 57%;
  width: min(45vw, 57vh, 690px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.sculpture-still, .sculpture-canvas, .sculpture-control { position: absolute; inset: 0; width: 100%; height: 100%; }
.sculpture-still { object-fit: contain; }
.sculpture-canvas canvas { display: block; width: 100%; height: 100%; }
.sculpture.is-live .sculpture-still { visibility: hidden; }
.sculpture-control {
  inset: 12% 18%;
  width: auto;
  height: auto;
  border-radius: 16px;
  cursor: grab;
  touch-action: pan-y;
}
.sculpture-control.dragging { cursor: grabbing; }
.glass-controls { position: absolute; z-index: 2; bottom: 3px; left: 57%; transform: translateX(-50%); }
.glass-toggle {
  color: var(--muted);
  border: 0;
  background: var(--black);
  padding: 8px 10px;
  white-space: nowrap;
  font-size: .78rem;
}
.glass-toggle:hover, .glass-toggle[aria-expanded="true"] { color: var(--white); }
.glass-toggle[aria-expanded="true"] span { display: inline-block; transform: rotate(45deg); }
.glass-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(254px, 75vw);
  padding: 17px;
  background: #151515;
  border: 1px solid #50504e;
  border-radius: 12px;
  box-shadow: 0 15px 50px #000a;
}
.glass-panel label { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; }
.glass-panel output { color: var(--muted); }
.glass-panel input { display: block; width: 100%; margin: 3px 0 12px; accent-color: #e9c890; }
.glass-panel button { padding: 0; color: var(--white); background: none; border: 0; text-decoration: underline; font-size: .8rem; }

.hero-bottom {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr minmax(187px, 290px) 48px;
  gap: clamp(14px, 2vw, 28px);
  align-items: end;
}
.hero-intro { max-width: 450px; }
.hero-intro h1 { max-width: 19ch; font-size: clamp(1.75rem, 2.48vw, 2.7rem); font-weight: 500; line-height: 1.02; letter-spacing: -.058em; }
.hero-intro p { max-width: 40ch; margin-top: 14px; color: var(--muted); line-height: 1.45; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 33px;
  min-height: 48px;
  margin-top: 22px;
  padding: 0 18px 0 20px;
  border: 1px solid var(--white);
  border-radius: 30px;
  background: var(--white);
  color: var(--black);
  font-size: .88rem;
  font-weight: 500;
  transition: color .2s, background .2s;
}
.pill:hover { background: var(--black); color: var(--white); }
.pill span { font-size: 1.12rem; }
.hero-project {
  min-height: 72px;
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 5px 13px 5px 5px;
  transition: border-color .2s, background .2s;
}
.hero-project:hover { border-color: var(--muted); background: #191919; }
.hero-project img { width: 100%; height: 60px; object-fit: cover; object-position: left; }
.hero-project small { display: block; color: var(--muted); font-size: .73rem; }
.hero-project-arrow { font-size: 1.2rem; }
.hero-down { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; font-size: 1.28rem; transition: background .2s, color .2s; }
.hero-down:hover { background: var(--white); color: var(--black); }

.work { padding-block: clamp(100px, 13vw, 215px) clamp(94px, 12vw, 190px); border-top: 1px solid var(--line); }
.work-heading, .case { max-width: 1540px; margin-inline: auto; }
.work-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: clamp(30px, 5vw, 76px); }
.work-heading h2 { font-size: clamp(79px, 16vw, 235px); }
.work-heading p { margin-bottom: .15em; color: var(--muted); font-size: .875rem; text-align: right; }
.case-cover {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  overflow: hidden;
  aspect-ratio: 1.92;
  padding: 5.5%;
  background: #30271e url("assets/karu-home-room.webp") center / cover no-repeat;
}
.case-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, #100d07aa 0%, #130e0880 35%, #130e0800 68%); }
.case-cover-title { color: #fff6e6; font: 400 clamp(1.5rem, 5.9vw, 7rem)/.93 var(--display-font); letter-spacing: -.08em; max-width: 4ch; }
.case-screen {
  position: absolute;
  width: 61%;
  height: auto;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  border: clamp(3px, .52vw, 8px) solid #171715;
  border-radius: clamp(5px, 1vw, 16px);
  box-shadow: 0 24px 65px #0009;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
}
.case-cover:hover .case-screen { transform: translateY(-50%) scale(1.035); }
.image-action {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  font-size: 1.2rem;
  transition: transform .2s;
}
a:hover > .image-action { transform: rotate(10deg); }
.case-summary {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: end;
  gap: 23px;
  padding-block: clamp(21px, 3vw, 40px) clamp(45px, 8vw, 116px);
}
.case-summary h3 { margin-top: 6px; font-size: clamp(1.65rem, 3.1vw, 3.4rem); font-weight: 500; line-height: 1.03; letter-spacing: -.06em; }
.case-summary > p { max-width: 41ch; justify-self: end; color: var(--muted); }
.case-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 36px); }
.detail-image { position: relative; display: block; overflow: hidden; background: #292724; }
.detail-image img { width: 100%; height: auto; transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.detail-image:hover img { transform: scale(1.035); }
figcaption { padding-top: 14px; color: var(--muted); font-size: .92rem; }
figcaption span { display: block; color: var(--white); font-size: 1.13rem; font-weight: 500; }
.case-end { margin-top: clamp(32px, 5vw, 70px); padding-top: 21px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.project-status { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .875rem; }
.project-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e9c890; }
.text-link { display: inline-flex; align-items: center; gap: 12px; width: fit-content; border-bottom: 1px solid currentColor; padding-bottom: 4px; font-size: .92rem; }
.text-link:hover span { transform: translate(2px, -2px); }
.text-link span { transition: transform .2s; }

.about { background: #f2f0eb; color: #111110; padding-block: clamp(80px, 10vw, 157px); }
.about .label { color: #5d5b54; }
.about h2 { margin: clamp(32px, 5vw, 70px) 0 clamp(35px, 6vw, 84px); font-size: clamp(64px, 14.5vw, 248px); }
.about-copy { max-width: 600px; margin-left: auto; padding-left: 22px; border-left: 1px solid #b5b0a6; }
.about-copy > p { font-size: clamp(1.25rem, 2.34vw, 2.15rem); line-height: 1.23; letter-spacing: -.045em; }
.about-copy .text-link { margin-top: 24px; }

.closing { padding-top: clamp(88px, 11vw, 173px); }
.closing h2 { font-size: clamp(52px, 12vw, 205px); margin-top: 24px; }
.contact-link { display: flex; align-items: center; gap: 0; padding-bottom: clamp(40px, 7vw, 105px); }
.contact-link > span:first-child { color: #a7a5a1; transition: color .2s; }
.contact-link:hover > span:first-child { color: #e9c890; }
.contact-arrow { margin-left: auto; padding-left: .22em; font-size: .68em; font-family: var(--body-font); transition: transform .2s; }
.contact-link:hover .contact-arrow { transform: translate(5px, -5px); }
.footer-end { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding-block: 27px; border-top: 1px solid var(--line); }
.local-time { display: flex; gap: 10px; color: var(--muted); font-size: .875rem; }
.local-time time { color: var(--white); font-variant-numeric: tabular-nums; }
.footer-links { justify-self: end; }

.image-dialog { padding: 0; max-width: min(1200px, 94vw); max-height: 95dvh; border: 0; background: transparent; color: var(--white); overflow: visible; }
.image-dialog::backdrop { background: #000e; }
.image-dialog-layout { position: relative; }
.image-dialog img { width: auto; max-height: 86dvh; object-fit: contain; }
.image-dialog button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--muted);
  border-radius: 50%;
  font-size: 1.55rem;
  line-height: 1;
}
body:has(.image-dialog[open]) { overflow: hidden; }

@media (max-width: 740px) {
  html { scroll-padding-top: 70px; }
  .header-inner { min-height: 64px; grid-template-columns: 1fr auto; gap: 10px; }
  .desktop-nav, .header-contact { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav summary { min-height: 44px; display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav summary span { width: 15px; height: 6px; border-block: 1px solid currentColor; }
  .mobile-nav[open] summary span { transform: rotate(-45deg); }
  .mobile-nav nav { position: absolute; inset: 100% 0 auto; display: grid; background: var(--black); border-block: 1px solid var(--line); padding: 6px var(--gutter) 20px; }
  .mobile-nav nav a { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1.32rem; }
  .hero { min-height: max(600px, 100svh); grid-template-rows: minmax(244px, 1fr) auto; padding-top: 64px; }
  .hero-visual { align-self: stretch; }
  .hero-wordmark { font-size: clamp(66px, 21.7vw, 154px); transform: translateY(clamp(20px, 8vw, 38px)) scaleX(1.09); }
  .sculpture { top: calc(50% - clamp(30px, 8vh, 66px)); left: 57%; width: min(66vw, 39vh, 365px); }
  .glass-controls { left: 57%; bottom: 12px; }
  .hero-bottom { grid-template-columns: 1fr 46px; gap: 16px; padding-top: 12px; }
  .hero-intro h1 { font-size: clamp(1.75rem, 5.7vw, 2.4rem); }
  .hero-intro p { font-size: .94rem; }
  .hero-project { display: none; }
  .hero-down { width: 46px; height: 46px; }
  .work-heading h2 { font-size: clamp(65px, 16.5vw, 122px); }
  .work-heading p { font-size: .76rem; }
  .case-cover { aspect-ratio: 1.38; padding: 0; align-items: start; }
  .case-cover-title { max-width: none; margin: 5% 0 0 6%; font-size: clamp(1.25rem, 6vw, 3rem); }
  .case-screen { width: 78%; top: auto; bottom: 8%; right: 10%; transform: none; }
  .case-cover:hover .case-screen { transform: scale(1.03); }
  .image-action { right: 9px; bottom: 9px; width: 34px; height: 34px; font-size: 1rem; }
  .case-summary { grid-template-columns: 1fr; gap: 12px; }
  .case-summary > p { justify-self: start; }
  .case-details { grid-template-columns: 1fr; gap: 30px; }
  .about h2 { font-size: clamp(54px, 15vw, 110px); }
  .about-copy { max-width: 410px; padding-left: 14px; }
  .footer-end { grid-template-columns: 1fr auto; }
  .local-time { justify-self: end; }
  .footer-links { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 360px) {
  .work-heading { align-items: start; flex-direction: column; }
  .work-heading p { text-align: left; }
}

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