/* Layout state animation and 3D gallery adapted from Codrops, MIT.
   Licenses and original templates are retained in vendor/codrops/. */
* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #22221e; --paper: #f2f1eb; --muted: #77766e; --line: #22221e28; --accent: #b64e32; }
/* Measurements must be synchronous. In-page links opt into smooth scrolling in site.js. */
html { scroll-behavior: auto; scroll-padding-top: 92px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; -webkit-font-smoothing: antialiased; }
body.concept-c { color-scheme: dark; --paper: #101211; --ink: #e9ede7; --muted: #a0aaa1; --line: #e9ede72c; --accent: #bdd4bb; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
img, video { display: block; width: 100%; height: 100%; object-fit: contain; }
figure, h1, h2, h3, p { margin: 0; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
h1 { font-size: calc(clamp(30px, 3.5vw, 50px) * var(--heading-scale, 1)); font-weight: 500; line-height: 1.5; letter-spacing: -.045em; }
h2 { font-size: calc(clamp(28px, 3.1vw, 44px) * var(--heading-scale, 1)); line-height: 1.5; font-weight: 500; letter-spacing: -.035em; }
.micro { font: 10px/1.5 monospace; letter-spacing: .13em; }
.masthead { height: 96px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; position: absolute; z-index: 30; inset: 0 0 auto; }
.brand { width: 128px; }
.brand img { height: auto; }
.masthead nav { display: flex; gap: 36px; font-size: 12px; }
.masthead nav a { padding: 12px 0; border-bottom: 1px solid transparent; }
.masthead nav a:hover { border-color: currentColor; }
.header-contact { display: flex; gap: 32px; align-items: center; font-size: 11px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.header-contact span { font-size: 18px; }
.hero-meta { position: absolute; inset: 116px 4vw auto; display: flex; justify-content: space-between; font: 9px/1.5 monospace; letter-spacing: .11em; color: var(--muted); }
.hero-meta i { display: inline-block; width: 7px; height: 7px; background: var(--accent); margin-right: 8px; }
.arrow-link { display: inline-flex; align-items: center; gap: 36px; border-bottom: 1px solid var(--ink); padding: 14px 0; font-size: 12px; }
.arrow-link span { font-size: 21px; transition: transform .3s; }
.arrow-link:hover span { transform: translate(3px, -3px); }
.intro-lead { font-size: 13px; line-height: 2; color: var(--muted); margin: 24px 0 20px; }
.hero-bottom { position: absolute; inset: auto 4vw 42px; display: flex; justify-content: space-between; font: 9px/1.5 monospace; letter-spacing: .1em; color: var(--muted); }
.hero-bottom b { font: 18px Arial; margin-left: 18px; }

/* B: a quiet editorial canvas; the portfolio itself supplies the movement. */
.layout-scroll { height: 100svh; min-height: 700px; }
.motion-enabled .layout-scroll { height: 270svh; }
.kinetic-hero { position: sticky; top: 0; width: 100%; height: 100svh; min-height: 700px; overflow: hidden; }
.intro-copy { position: absolute; z-index: 5; left: 6vw; top: 32%; width: 43%; }
.intro-copy .micro { margin-bottom: 26px; color: var(--accent); }
.kinetic-gallery { position: absolute; inset: 0; }
.gallery__item { position: absolute; display: flex; flex-direction: column; margin: 0; box-shadow: 0 20px 42px #3432261a; }
.tile-image { height: 100%; min-height: 0; background: #fff; overflow: hidden; }
.tile-image img { object-fit: contain; }
.tile-meta { position: absolute; top: calc(100% + 14px); inset-inline: 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 11px; }
.tile-meta small { font: 9px monospace; color: var(--muted); }
.tile-meta span:last-child { margin-left: auto; }
.gallery__item:nth-child(1) { width: 34%; height: 31%; left: 54%; top: 34%; z-index: 3; transform: rotate(-6deg); }
.gallery__item:nth-child(2) { width: 16%; height: 25%; left: 79%; top: 16%; z-index: 2; transform: rotate(9deg); }
.gallery__item:nth-child(3) { width: 17%; height: 23%; left: 49%; top: 65%; z-index: 4; transform: rotate(5deg); }
.gallery__item:nth-child(4) { width: 22%; height: 23%; left: 74%; top: 66%; transform: rotate(-4deg); }
.gallery--switch .gallery__item { top: 24%; width: 21.5%; height: 41%; transform: rotate(0deg); box-shadow: 0 12px 24px #34322612; }
.gallery--switch .gallery__item:nth-child(1) { left: 4%; }
.gallery--switch .gallery__item:nth-child(2) { left: 27.5%; }
.gallery--switch .gallery__item:nth-child(3) { left: 51%; }
.gallery--switch .gallery__item:nth-child(4) { left: 74.5%; }
.project-yoando .tile-image, .project-yoando .project-photo { background: #292b2b; }
.project-eatoco .tile-image, .project-eatoco .project-photo { background: #bfc1c0; }
.project-gubo .tile-image img { padding: 9%; }
.gallery-caption { position: absolute; left: 4vw; right: 4vw; bottom: 11%; display: none; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 28px; pointer-events: none; }
.gallery-caption h2 { font-size: calc(25px * var(--heading-scale, 1)); }
.gallery-caption a { pointer-events: auto; }
.motion-enabled .gallery-caption { display: grid; visibility: hidden; }
.studio-statement { padding: 110px 7vw; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.studio-statement > .micro { color: var(--accent); }
.studio-statement > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; margin: 48px 0; align-items: center; }
.studio-statement > div > p { font-size: 14px; line-height: 2.2; }
.statement-sign { font-family: Georgia, serif; font-size: 15px; color: var(--muted); font-style: italic; }
.work-section, .expertise { padding: 110px 5vw; }
.section-heading { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 30px; align-items: start; margin-bottom: 70px; }
.section-heading > span { font: 9px/1.6 monospace; letter-spacing: .12em; text-align: right; color: var(--muted); }
.editorial-projects { display: grid; grid-template-columns: 1fr 1fr; column-gap: 5vw; row-gap: 90px; align-items: start; }
.editorial-project:nth-child(even) { margin-top: 130px; }
.project-photo { aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.project-photo img { object-fit: contain; }
.project-gubo .project-photo img { padding: 6%; }
.project-info { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }
.project-info .micro { color: var(--muted); font-size: 9px; }
.project-info h3 { font-size: calc(22px * var(--heading-scale, 1)); font-weight: 500; margin: 15px 0; }
.project-info p:not(.micro) { font-size: 12px; line-height: 1.9; max-width: 34em; }
.project-scope { display: block; font: 10px monospace; color: var(--muted); margin-top: 22px; }
.expertise { border-top: 1px solid var(--line); }
.expertise .section-heading { grid-template-columns: 1fr 2.5fr; }
.expertise-list { margin-left: 28.6%; border-top: 1px solid var(--line); }
.service-row { border-bottom: 1px solid var(--line); }
.service-row summary { list-style: none; display: grid; grid-template-columns: 40px 1fr 140px 25px; align-items: center; gap: 20px; padding: 28px 0; cursor: pointer; }
.service-row summary::-webkit-details-marker { display: none; }
.service-row summary > span:first-child { font: 10px monospace; color: var(--muted); }
.service-row summary h3 { font-size: calc(clamp(22px, 2.5vw, 34px) * var(--heading-scale, 1)); font-weight: 400; letter-spacing: -.04em; }
.service-ja { font-size: 11px; color: var(--muted); }
.service-row b { font-size: 20px; font-weight: 400; transition: transform .3s; }
.service-row[open] b { transform: rotate(45deg); }
.service-row p { font-size: 13px; padding: 0 40px 32px 60px; line-height: 2; }
.motion-feature { margin: 0 4vw 120px; padding: 64px 4vw; background: #e4e3db; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 5vw; }
.motion-text h2 { margin: 25px 0; font-size: calc(32px * var(--heading-scale, 1)); }
.motion-text > p:not(.micro) { font-size: 12px; line-height: 2; margin-bottom: 16px; }
.motion-stills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.motion-stills img { height: 300px; object-fit: cover; }
.motion-stills img:nth-child(2) { margin-top: 45px; }
.motion-stills span { grid-column: 1 / -1; font: 8px monospace; letter-spacing: .12em; margin-top: 12px; }
.contact-section { padding: 100px 7vw 110px; border-top: 1px solid var(--line); }
.contact-section h2 { margin: 30px 0; }
.contact-section > p:not(.micro) { font-size: 13px; color: var(--muted); }
.contact-trigger { width: min(520px, 100%); background: none; border: 0; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding: 20px 0; font-size: 13px; }
.contact-trigger span { font-size: 28px; }
.site-footer { border-top: 1px solid var(--line); padding: 48px 4vw 90px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.site-footer img { width: 116px; height: auto; }
.site-footer p, .site-footer > span { color: var(--muted); font-size: 10px; }

/* C: cinematic opening and a scroll-driven 3D portfolio. */
.spatial-hero { position: relative; min-height: 760px; height: 100svh; overflow: hidden; }
.spatial-copy { position: absolute; z-index: 5; left: 5vw; top: 37%; width: 42%; }
.spatial-copy .micro { margin-bottom: 28px; color: var(--accent); }
.spatial-copy h1 { font-size: calc(clamp(30px, 3.6vw, 52px) * var(--heading-scale, 1)); }
.spatial-film { position: absolute; width: 57%; height: 66%; right: 4%; top: 19%; perspective: 1400px; }
.film-window { height: 100%; clip-path: inset(0 0 0 0 round 2px); }
.motion-enabled .film-window { clip-path: inset(6% 0% 6% 13% round 2px); }
.film-window video { object-fit: cover; opacity: .77; }
.spatial-film::after { content: ""; pointer-events: none; position: absolute; inset: 0; background: linear-gradient(90deg, #101211 0%, #10121133 28%, transparent 55%); }
.film-index, .video-toggle { position: absolute; z-index: 3; bottom: 15px; font: 9px monospace; letter-spacing: .1em; }
.film-index { left: 26%; }
.video-toggle { right: 14px; border: 1px solid #e9ede74d; padding: 9px 12px; background: #10121166; }
.spatial-side { position: absolute; right: 16px; top: 42%; font: 9px monospace; letter-spacing: .18em; writing-mode: vertical-rl; color: var(--muted); }
.concept-c .studio-statement { background: #d9e0d6; color: #20291f; border: 0; }
.concept-c .studio-statement > .micro, .concept-c .statement-sign { color: #50654a; }
.rotation-section { position: relative; padding: 110px 5vw 60px; overflow: clip; }
.rotation-heading { position: sticky; top: 110px; width: 28%; margin-bottom: -200px; z-index: 5; pointer-events: none; }
.rotation-heading h2 { font-size: calc(33px * var(--heading-scale, 1)); margin: 26px 0 35px; }
.current-work { display: inline-block; border-top: 1px solid var(--line); width: 150px; padding-top: 18px; font: 11px monospace; color: var(--accent); }
.rotation-gallery { width: 60%; margin-left: 32%; padding-top: 20px; }
.rotation-wrap { position: relative; perspective: 1600px; margin: 0 0 120px; padding: 65px 0; }
.rotation-item { transform-style: preserve-3d; will-change: transform; }
.rotation-item .project-photo { aspect-ratio: 4 / 3; box-shadow: 0 35px 70px #0005; }
.rotation-meta { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; }
.rotation-meta > span { font: 9px/1.5 monospace; color: var(--muted); letter-spacing: .06em; }
.rotation-meta h3 { font-size: calc(17px * var(--heading-scale, 1)); font-weight: 500; }
.rotation-meta p { font: 10px/1.5 monospace; color: var(--muted); grid-column: 1 / -1; }
.scroll-mark { position: absolute; inset: auto 0 10px; overflow: hidden; opacity: .06; pointer-events: none; }
.scroll-mark span { display: block; white-space: nowrap; font: 500 12vw/1.3 Arial; letter-spacing: -.055em; }
.concept-c .motion-feature { background: #1c231d; }
.concept-c .contact-section { background: #182219; }
.concept-c .contact-section h2 { font-size: calc(clamp(32px, 3.7vw, 52px) * var(--heading-scale, 1)); }

.concept-switcher { position: fixed; z-index: 60; bottom: 16px; left: 50%; transform: translateX(-50%); background: #171917; color: #fff; padding: 6px; display: flex; align-items: center; gap: 4px; border: 1px solid #ffffff26; border-radius: 40px; box-shadow: 0 8px 24px #0002; }
.concept-switcher a { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 50%; font: 10px monospace; }
.concept-switcher [aria-current] { background: #eeefe9; color: #171917; }
.concept-switcher > span { font: 9px monospace; padding: 0 12px; white-space: nowrap; }
.contact-dialog { max-width: 530px; padding: 44px; border: 1px solid #777; background: var(--paper); color: var(--ink); }
.contact-dialog::backdrop { background: #0009; backdrop-filter: blur(5px); }
.contact-dialog h2 { margin: 20px 0; font-size: calc(28px * var(--heading-scale, 1)); }
.contact-dialog p { font-size: 12px; line-height: 2; }
.dialog-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 24px; }
.dialog-close-button { margin-top: 22px; padding: 12px 16px; border: 1px solid var(--ink); background: none; }
@media (min-width: 1600px) { .intro-copy { left: 7vw; } .gallery--switch .gallery__item { height: 44%; top: 22%; } }
@media (max-width: 900px) {
  .masthead { height: 80px; } .masthead nav { gap: 18px; }
  .header-contact { font-size: 10px; gap: 12px; }
  .brand { width: 112px; }
  .hero-meta { top: 96px; }
  .hero-meta > span:last-child { display: none; }
  h1 { font-size: calc(32px * var(--heading-scale, 1)); }
  .intro-copy { left: 5vw; width: 46%; }
  .intro-copy .micro, .spatial-copy .micro { font-size: 8px; }
  .gallery-caption { grid-template-columns: 1fr 1fr; gap: 18px; }
  .gallery-caption > .micro { display: none; }
  .gallery-caption h2 { font-size: calc(22px * var(--heading-scale, 1)); }
  .studio-statement { padding: 80px 5vw; }
  .studio-statement > div { gap: 40px; }
  .studio-statement > div > p { font-size: 12px; }
  .section-heading { grid-template-columns: 1fr 1.5fr; }
  .section-heading > span { display: none; }
  .expertise-list { margin-left: 0; }
  .motion-feature { padding: 40px 4vw; gap: 24px; }
  .motion-text h2 { font-size: calc(26px * var(--heading-scale, 1)); }
  .motion-stills img { height: 220px; }
  .spatial-copy { top: 35%; width: 48%; }
  .rotation-heading h2 { font-size: calc(26px * var(--heading-scale, 1)); }
  .rotation-gallery { width: 63%; }
  .rotation-meta { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 24px; }
  .masthead { padding: 0 22px; }
  .masthead nav { display: none; }
  .hero-meta { inset-inline: 22px; font-size: 7px; }
  .header-contact { font-size: 9px; }
  .hero-bottom { inset-inline: 22px; bottom: 76px; font-size: 7px; }
  .hero-bottom > span:first-child { max-width: 150px; }
  .hero-bottom b { margin-left: 6px; }
  .layout-scroll { min-height: 810px; height: 110svh; }
  .motion-enabled .layout-scroll { height: 250svh; min-height: 0; }
  .kinetic-hero { height: 100svh; min-height: 690px; }
  .intro-copy { left: 22px; top: 150px; width: calc(100% - 44px); }
  .intro-copy .micro { margin-bottom: 15px; }
  h1, .spatial-copy h1 { font-size: calc(clamp(26px, 7.2vw, 34px) * var(--heading-scale, 1)); line-height: 1.5; }
  .intro-lead { font-size: 11px; margin: 16px 0 8px; }
  .arrow-link { font-size: 11px; padding: 10px 0; }
  .gallery__item:nth-child(1) { width: 53%; height: 19%; left: 8%; top: 59%; }
  .gallery__item:nth-child(2) { width: 28%; height: 18%; left: 65%; top: 51%; }
  .gallery__item:nth-child(3) { width: 24%; height: 13%; left: 43%; top: 75%; }
  .gallery__item:nth-child(4) { width: 29%; height: 12%; left: 68%; top: 73%; }
  .gallery--switch .gallery__item { width: 42%; height: 23%; transform: none; }
  .gallery--switch .gallery__item:nth-child(1) { left: 6%; top: 18%; }
  .gallery--switch .gallery__item:nth-child(2) { left: 52%; top: 18%; }
  .gallery--switch .gallery__item:nth-child(3) { left: 6%; top: 48%; }
  .gallery--switch .gallery__item:nth-child(4) { left: 52%; top: 48%; }
  .tile-meta { font-size: 9px; gap: 5px; top: calc(100% + 10px); }
  .tile-meta small { display: none; }
  .gallery-caption { bottom: 14%; left: 6%; right: 6%; }
  .gallery-caption { grid-template-columns: 1fr auto; gap: 12px; }
  .gallery-caption h2 { font-size: calc(15px * var(--heading-scale, 1)); }
  .gallery-caption .arrow-link { font-size: 9px; gap: 8px; justify-self: end; }
  .studio-statement { padding: 65px 24px; }
  .studio-statement > .micro { font-size: 8px; }
  .studio-statement > div { grid-template-columns: 1fr; margin: 32px 0; gap: 26px; }
  .studio-statement > div > p { line-height: 2.2; font-size: 12px; }
  h2 { font-size: calc(28px * var(--heading-scale, 1)); }
  .work-section, .expertise { padding: 70px 24px; }
  .section-heading, .expertise .section-heading { grid-template-columns: 1fr; gap: 24px; margin-bottom: 38px; }
  .editorial-projects { grid-template-columns: 1fr; row-gap: 60px; }
  .editorial-project:nth-child(even) { margin-top: 0; }
  .project-info h3 { font-size: calc(21px * var(--heading-scale, 1)); }
  .service-row summary { grid-template-columns: 26px 1fr 20px; gap: 12px; padding: 24px 0; }
  .service-ja { display: none; }
  .service-row summary h3 { font-size: calc(24px * var(--heading-scale, 1)); }
  .service-row p { padding: 0 10px 26px 38px; }
  .motion-feature { grid-template-columns: 1fr; margin: 0 0 70px; padding: 50px 24px; gap: 35px; }
  .motion-stills img { height: 215px; }
  .contact-section { padding: 70px 24px; }
  .site-footer { padding: 38px 24px 90px; flex-wrap: wrap; gap: 26px; }
  .site-footer p { display: none; }
  .site-footer > span { font-size: 8px; }
  .concept-switcher > span { display: none; }
  .spatial-hero { height: 100svh; min-height: 760px; }
  .spatial-copy { top: 147px; left: 24px; width: calc(100% - 48px); }
  .spatial-copy .micro { margin-bottom: 20px; }
  .spatial-film { width: calc(100% - 36px); right: 18px; top: 52%; height: 34%; }
  .spatial-film::after { background: linear-gradient(#10121111, transparent); }
  .film-index { left: 16%; font-size: 8px; }
  .video-toggle { font-size: 8px; }
  .spatial-side { display: none; }
  .rotation-section { padding: 70px 24px 20px; }
  .rotation-heading { position: relative; top: 0; width: auto; margin-bottom: 40px; display: grid; grid-template-columns: 1fr auto; }
  .rotation-heading h2 { grid-column: 1; margin: 18px 0 0; }
  .current-work { grid-column: 2; grid-row: 1 / 3; align-self: end; width: 70px; }
  .rotation-gallery { width: 100%; margin-left: 0; padding-top: 0; }
  .rotation-wrap { margin: 0 0 60px; padding: 20px 0; }
  .rotation-meta h3 { font-size: calc(17px * var(--heading-scale, 1)); }
  .rotation-meta > span { font-size: 8px; }
  .scroll-mark { display: none; }
}

/* Scale semantic headings while retaining their existing responsive sizes. */
.adopted-site { --heading-scale: 1.3; }
.adopted-site :is(h1, h2, h3) { text-wrap: balance; }
.kinetic-hero .intro-copy h1 { word-break: keep-all; }
h3 { font-size: calc(1.17em * var(--heading-scale, 1)); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kinetic-hero { position: relative; }
  .tile-meta { display: none; }
  .rotation-item { will-change: auto; }
}
