/* Layout concept: one vertical hairline splits the screen. Works pass across it
   as a folded strip; the work on the line opens to its true proportion.
   Everything else is 12px grey type pinned to the corners. Single light theme
   by choice: the images need white. */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --grey: #86878c;      /* cool grey, leans toward the blue-violet in the works */
  --line: #dcdce0;
  --soft: #f3f3f5;
  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, "Noto Sans SC", "PingFang SC", sans-serif;
  --cjk: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --fs: 12px;
  --fs-s: 11px;
  --pad: 20px;
  --side: 100px;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (min-width: 640px) { :root { --pad: 50px; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  background: var(--paper);
  color: var(--grey);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
img { display: block; user-select: none; -webkit-user-drag: none; max-width: none; }
@media (max-width: 639px) { img { max-width: 100%; } }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.ink { color: var(--ink); }
.b { color: var(--ink); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; background: var(--paper);
  transition: opacity .7s var(--ease) .15s;
}
.splash.is-done { opacity: 0; pointer-events: none; }
.splash_line {
  position: absolute; background: var(--line);
  left: 50%; top: 0; width: 1px; height: 100%;
  transform: scaleY(var(--p, 0)); transform-origin: 50% 50%;
  transition: transform .4s var(--ease-out);
}
.splash_name {
  position: absolute; left: var(--pad); top: calc(50% - 6px);
  color: var(--ink); font-weight: 700; white-space: nowrap;
}
.splash_count {
  position: absolute; left: calc(50% + var(--pad)); top: var(--pad);
  line-height: 1.5; font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) {
  .splash_line { left: 0; top: 50%; width: 100%; height: 1px; transform: scaleX(var(--p, 0)); }
  .splash_name { left: 50%; top: 38px; transform: translateX(-50%); }
  .splash_count { left: var(--pad); top: calc(50% + 20px); }
}

/* ---------- side index (desktop) ---------- */
.side {
  position: fixed; z-index: 30; left: var(--pad); top: var(--pad);
  width: var(--side); height: calc(100dvh - var(--pad) * 2);
  display: flex; flex-direction: column; justify-content: space-between;
}
.side_title {
  position: absolute; left: 0; top: calc(50% - 6px);
  font: inherit; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.side_list, .side_misc { display: flex; flex-direction: column; row-gap: 12px; }
.side_misc { row-gap: 32px; }
.row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; position: relative; transition: color .25s;
}
.row::before { content: ""; position: absolute; left: 0; top: -6px; width: 100%; height: calc(100% + 12px); }
.row:hover { color: var(--ink); }
.row.is-active { color: var(--ink); font-weight: 700; }
.order { display: flex; justify-content: space-between; }
.order button { position: relative; transition: color .25s; }
.order button:hover { color: var(--ink); }
.order button.is-active { color: var(--ink); font-style: italic; pointer-events: none; }
@media (max-width: 639px) { .side { display: none; } }

/* ---------- mobile header + menu ---------- */
.mob {
  display: none; position: fixed; z-index: 40; left: 0; top: 38px; width: 100%;
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
  justify-content: space-between; align-items: center;
}
.mob_title { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font: inherit; font-weight: 700; color: var(--ink); }
.mob button, .mob a { position: relative; }
.mob button::before, .mob a::before { content: ""; position: absolute; inset: -8px -10px; }
.mobmenu {
  position: fixed; inset: 0; z-index: 35; background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.mobmenu.is-open { opacity: 1; pointer-events: auto; }
.mobmenu_main { width: 110px; display: flex; flex-direction: column; row-gap: 9px; }
.mobmenu_main .row { height: 12px; }
.mobmenu_main .order { margin-top: 24px; }
@media (max-width: 639px) { .mob { display: flex; } }

/* ---------- views ---------- */
.view { position: fixed; inset: 0; overflow: hidden; }
.view.is-leaving { opacity: 0; transition: opacity .45s var(--ease); }
.view.is-entering { animation: fade-in .6s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- index strip ---------- */
.strip { position: absolute; inset: 0; z-index: 2; touch-action: none; cursor: grab; }
.strip.is-drag { cursor: grabbing; }
.strip.is-swap { opacity: 0; transition: opacity .3s var(--ease); }
.strip { transition: opacity .45s var(--ease); }
.item {
  position: absolute; left: 0; top: 0; overflow: hidden;
  will-change: transform, clip-path; background: var(--soft);
}
.item img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.item img.is-loaded { opacity: 1; }
.item.is-active { cursor: none; }
@media (hover: none) { .item.is-active { cursor: pointer; } }

.bar { position: absolute; z-index: 1; background: var(--line); pointer-events: none; left: 50%; top: 0; width: 1px; height: 100%; }
.titles {
  position: absolute; z-index: 3; left: calc(50% + var(--pad)); top: var(--pad);
  pointer-events: none; height: 40px; width: 40vw; overflow: hidden;
}
.titles p {
  position: absolute; left: 0; top: 0; white-space: nowrap; letter-spacing: -.01em; line-height: 1;
  transition: transform .7s var(--ease-out), opacity .5s var(--ease-out);
}
.titles p span { display: block; }
.titles p span + span { margin-top: 12px; }
.titles p.is-in { transform: translateY(110%); opacity: 0; }
.titles p.is-out { transform: translateY(-110%); opacity: 0; }
.titles.rev p.is-in { transform: translateY(-110%); }
.titles.rev p.is-out { transform: translateY(110%); }

.arrow { position: absolute; z-index: 3; width: 30px; left: calc(50% + var(--pad)); bottom: calc(var(--pad) + 3px); pointer-events: none; }
.arrow svg { display: block; width: 100%; height: auto; }
.count { position: absolute; z-index: 3; right: var(--pad); bottom: var(--pad); font-variant-numeric: tabular-nums; pointer-events: none; }

.end {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--ft, 0); transform: translate3d(calc((1 - var(--ft, 0)) * 30%), 0, 0);
}
.end.is-live { pointer-events: auto; }
.end_cr { position: absolute; left: calc(var(--pad) + var(--side) + 85px); top: calc(50% - 6px); color: var(--ink); font-weight: 700; white-space: nowrap; }
.end_back { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--ink); font-weight: 700; padding: 12px; }
.end_about { position: absolute; right: var(--pad); top: calc(50% - 6px); color: var(--ink); font-weight: 700; }

@media (max-width: 639px) {
  .strip { cursor: default; }
  .bar { left: 0; top: 50%; width: 100%; height: 1px; }
  .titles { left: var(--pad); top: calc(50% + 20px); width: 40px; height: 40vh; }
  .titles p { writing-mode: vertical-rl; }
  .titles p span + span { margin-top: 0; margin-right: 6px; }
  .titles p.is-in { transform: translateX(-110%); }
  .titles p.is-out { transform: translateX(110%); }
  .titles.rev p.is-in { transform: translateX(110%); }
  .titles.rev p.is-out { transform: translateX(-110%); }
  .arrow { left: auto; right: var(--pad); bottom: auto; top: calc(50% + 20px); }
  .arrow svg { transform: rotate(90deg); transform-origin: 50% 50%; }
  .arrow { top: calc(50% + 32px); }
  .count { display: none; }
  .end { transform: translate3d(0, calc((1 - var(--ft, 0)) * 30%), 0); }
  .end_cr { left: 50%; top: 96px; transform: translateX(-50%); }
  .end_about { right: auto; left: 50%; top: auto; bottom: 40px; transform: translateX(-50%); }
}

/* content fades out as it slides under the side index */
@media (min-width: 640px) {
  .strip, .work, .about {
    -webkit-mask-image: linear-gradient(90deg, transparent calc(var(--pad) + var(--side) + 12px), #000 calc(var(--pad) + var(--side) + 110px));
    mask-image: linear-gradient(90deg, transparent calc(var(--pad) + var(--side) + 12px), #000 calc(var(--pad) + var(--side) + 110px));
  }
}

/* cursor label */
.cursor {
  position: fixed; z-index: 90; left: 0; top: 0; pointer-events: none;
  color: var(--ink); font-weight: 700; white-space: nowrap;
  opacity: 0; transition: opacity .2s;
}
.cursor::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); margin-right: 8px; vertical-align: 1px; }
.cursor.is-on { opacity: 1; }
@media (hover: none) { .cursor { display: none; } }

/* flying image used between index and detail */
.fly { position: fixed; z-index: 50; object-fit: cover; pointer-events: none; }

/* ---------- horizontal track shared by work + about (desktop) ---------- */
.track { position: absolute; top: 0; left: 0; height: 100%; display: flex; will-change: transform; }
.track > * { flex-shrink: 0; height: 100%; }
@media (max-width: 639px) {
  .view.is-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .track { position: static; display: block; height: auto; transform: none !important; }
  .track > * { height: auto; }
}

/* ---------- work detail ---------- */
.work .track { padding-left: 50vw; }
.kv { position: relative; }
.kv img { height: 100%; width: auto; }
.kv_title { position: absolute; top: calc(50% - 6px); left: calc(var(--pad) * -1); transform: translateX(-100%); color: var(--ink); font-weight: 700; white-space: nowrap; }
.kv_scroll { position: absolute; bottom: var(--pad); left: calc(var(--pad) * -1); transform: translateX(-100%); white-space: nowrap; }
.kv_title, .kv_scroll { transition: opacity .6s var(--ease); }
.work.is-flying .kv_title, .work.is-flying .kv_scroll, .work.is-flying .kv img { opacity: 0; }

.info {
  width: 400px; margin-left: 150px; padding: 44px 0 50px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.meta { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 24px; line-height: 24px; letter-spacing: -.01em; }
.meta dt { line-height: 24px; }
.meta dd { color: var(--ink); line-height: 24px; }
.meta > div { display: flex; flex-direction: column; }
.swatches { display: flex; gap: 6px; margin-top: 6px; }
.swatch { display: flex; flex-direction: column; gap: 8px; width: 52px; }
.swatch i { display: block; width: 52px; height: 52px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.swatch span { font-size: 10px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.desc { font-family: var(--cjk); font-weight: 300; font-size: var(--fs-s); line-height: 2; text-align: justify; color: var(--ink); max-width: 400px; }

.gallery { display: flex; align-items: center; column-gap: 100px; margin-left: 150px; }
.gallery button { height: 50%; display: block; position: relative; }
.gallery img { height: 100%; width: auto; transition: opacity .3s; }
.gallery button:hover img { opacity: .82; }
.gallery figcaption { position: absolute; left: 0; bottom: -10px; transform: translateY(100%); white-space: nowrap; display: flex; justify-content: space-between; width: 100%; line-height: 1.5; }

.credit { margin-left: 150px; display: flex; flex-direction: column; }
.credit h2 { font: inherit; height: 25%; padding-top: 50px; }
.credit ol { height: 50%; display: flex; flex-direction: column; justify-content: center; }
.credit li { width: 400px; display: flex; justify-content: space-between; line-height: 21px; }
.credit li span:last-child { color: var(--ink); }

.wnav { width: 50vw; padding-right: var(--pad); display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.wnav div { display: flex; column-gap: 9px; color: var(--ink); font-weight: 700; }
.wnav a:hover, .wnav button:hover { font-style: italic; }

@media (max-width: 639px) {
  .work .track { padding: 88px 0 0; }
  .kv { padding: 0 var(--pad); }
  .kv img { width: 100%; height: auto; }
  .kv_title, .kv_scroll { position: static; transform: none; text-align: center; display: block; margin-top: 28px; }
  .kv_scroll { display: none; }
  .info { width: auto; margin: 56px 0 0; padding: 0 var(--pad); gap: 56px; }
  .meta { grid-template-columns: 1fr 1fr; }
  .gallery { flex-direction: column; row-gap: 72px; margin: 110px 0 0; padding: 0 var(--pad); }
  .gallery button { height: auto; width: 100%; }
  .gallery img { width: 100%; height: auto; }
  .credit { margin: 120px 0 0; padding: 0 var(--pad); }
  .credit h2 { height: auto; padding: 0; text-align: center; }
  .credit ol { height: auto; margin-top: 32px; align-items: center; row-gap: 14px; }
  .credit li { width: 100%; }
  .wnav { width: auto; padding: 120px 0 48px; align-items: center; }
}

/* ---------- about ---------- */
.about .track { padding: var(--pad) 0; }
.about .track > * { height: calc(100% - 0px); }
.ab_head { width: 50vw; position: relative; }
.ab_head h1 { position: absolute; right: 100px; top: calc(50% - 18px); font: inherit; line-height: 2; text-align: right; }
.ab_sec { border-left: 1px solid var(--line); padding: 0 100px; display: flex; flex-direction: column; justify-content: space-between; }
.ab_sec:last-of-type { border-right: 1px solid var(--line); }
.ab_sec h2 { font: inherit; }
.ab_profile p { font-family: var(--cjk); font-weight: 300; font-size: var(--fs-s); line-height: 2; color: var(--ink); width: 400px; text-align: justify; }
.ab_profile p + p { margin-top: 1em; }
.ab_profile .sig { display: flex; gap: 40px; line-height: 21px; }

.table { display: flex; column-gap: 50px; height: 50vh; }
.table ol { width: 520px; height: 100%; display: flex; flex-direction: column; }
.table ol + ol { border-left: 1px solid var(--line); padding-left: 50px; }
.table li { flex: 1; position: relative; }
.table li + li::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: var(--line); }
.table button {
  width: 100%; height: 100%; display: grid; grid-template-columns: 74px 1fr 120px 70px;
  align-items: center; text-align: left; font-size: var(--fs-s); transition: color .2s;
}
.table button:hover { color: var(--ink); }
.table button .t { color: var(--ink); }
.table button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.peek { position: fixed; z-index: 60; left: 0; top: 0; width: 180px; pointer-events: none; opacity: 0; transition: opacity .25s; }
.peek.is-on { opacity: 1; }
.peek img { width: 100%; height: auto; }

.contact { display: flex; flex-direction: column; row-gap: 14px; }
.contact li { display: flex; justify-content: space-between; width: 300px; line-height: 21px; }
.contact li > :last-child { color: var(--ink); user-select: all; }
.ab_foot { width: 100vw; position: relative; }
.ab_foot p { position: absolute; right: var(--pad); top: calc(50% - 6px); color: var(--ink); font-weight: 700; }

@media (max-width: 639px) {
  .about .track { padding: 0 var(--pad); }
  .ab_head { width: auto; height: 50dvh; }
  .ab_head h1 { right: auto; left: 0; top: auto; bottom: 14px; text-align: left; }
  .ab_sec { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 120px; display: block; }
  .ab_sec:last-of-type { border-right: 0; }
  .ab_sec h2 { margin-bottom: 40px; }
  .ab_profile p { width: auto; }
  .ab_profile .sig { margin-top: 40px; }
  .table { display: block; height: auto; }
  .table ol { width: auto; height: auto; }
  .table ol + ol { border-left: 0; padding-left: 0; }
  .table li { height: 48px; }
  .table ol + ol li:first-child::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: var(--line); }
  .table button { grid-template-columns: 70px 1fr 90px; }
  .table button span:nth-child(4) { display: none; }
  .contact li { width: auto; }
  .ab_foot { width: auto; height: 40dvh; }
  .ab_foot p { right: auto; left: 50%; transform: translateX(-50%); }
  .peek { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
