/* Design Studio by Sanchi — site styles
   Desktop (>=1024px): fixed left rail (title, text, nav) with images on the right.
   Mobile: single column, nav pinned to the bottom. */

@font-face { font-family: 'Switzer'; src: url('../fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('../fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ink: #0f0f0f;
  --text: #2b2b2b;
  --muted: #9c9c9c;
  --blank: #efede9;
  --bg: #ffffff;
  --pad: 20px;
  --split: 53.5vw;      /* where the image column starts on desktop */
  --col: 19.5vw;        /* secondary text column inside the rail */
  --ease: cubic-bezier(.22, .61, .21, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h2 { font: inherit; margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
address { font-style: normal; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: var(--pad); top: -60px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { top: var(--pad); }
.muted, .label { color: var(--muted); }
.label { display: block; font-size: 12px; line-height: 1.4; }

.blank { display: block; width: 100%; height: 100%; background: var(--blank); }
.blank-tall { aspect-ratio: 4 / 5; height: auto; }
.blank-line { display: inline-block; width: 168px; height: 11px; background: var(--blank); vertical-align: middle; }

img.fill { width: 100%; height: 100%; object-fit: cover; }

/* ---------- masthead + nav ---------- */
.masthead { position: fixed; top: var(--pad); left: var(--pad); z-index: 20; max-width: calc(var(--split) - 2 * var(--pad)); }
.title {
  margin: 0;
  font-weight: 500;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.roll { display: inline-grid; overflow: hidden; vertical-align: top; padding-bottom: .04em; }
.roll > span { grid-area: 1 / 1; transition: transform .6s var(--ease); }
.roll > span + span { transform: translateY(105%); }
.mark:hover .roll > span:first-child:not(:only-child),
.mark:focus-visible .roll > span:first-child:not(:only-child) { transform: translateY(-105%); }
.mark:hover .roll > span + span,
.mark:focus-visible .roll > span + span { transform: translateY(0); }

.nav { position: fixed; left: var(--pad); bottom: var(--pad); z-index: 20; display: flex; gap: 24px; font-size: 20px; line-height: 1.25; }
.nav a { transition: color .3s; }
.nav a:hover { color: var(--muted); }
.nav a[aria-current="page"] { color: #cfcfcf; }

/* ---------- motion helpers ---------- */
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(105%); } to { transform: translateY(0); } }
.js main { animation: enter .7s var(--ease) both; }
.js .roll > span:first-child { animation: rise .8s var(--ease) both; }
.js img.fade { opacity: 0; transition: opacity .9s var(--ease); }
.js img.fade.loaded { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- home ---------- */
.home-intro { max-width: 330px; }
.home-index { font-size: 14px; }
.home-index a { display: inline-flex; gap: 14px; color: var(--muted); transition: color .35s; padding: 2px 0; }
.home-index a.is-on, .home-index a:hover, .home-index a:focus-visible { color: var(--ink); }
.home-index .num { font-variant-numeric: tabular-nums; }
.home-index .see-all-static { color: var(--ink); margin-top: 14px; }
.tile { display: block; }
.frame { display: block; overflow: hidden; background: var(--blank); }
.frame img { transition: transform 1.4s var(--ease); }
.tile:hover .frame img { transform: scale(1.02); }
.tile-caption { display: none; }
.veil, .see-all, .scroll-hint { display: none; }

@media (min-width: 1024px) {
  .page-home .home { height: 100vh; }
  .home-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
  .home-intro { position: absolute; left: var(--pad); bottom: 112px; width: min(330px, 26vw); }
  .home-index { position: absolute; left: var(--pad); top: 42vh; }
  .collage { position: absolute; left: 39vw; right: var(--pad); top: var(--pad); bottom: var(--pad); }
  .tile { position: absolute; }
  .tile .frame { width: 100%; height: 100%; }
  .tile-1 { left: 0;   top: 0;   width: 40%; height: 56%; z-index: 1; }
  .tile-2 { left: 34%; top: 6%;  width: 66%; height: 52%; z-index: 2; }
  .tile-3 { left: 8%;  top: 52%; width: 54%; height: 46%; z-index: 3; }
  .tile-4 { left: 68%; top: 42%; width: 32%; height: 58%; z-index: 4; }

  /* Scroll-driven collage (enabled by JS when motion is allowed) */
  .motion .page-home .home { height: 420vh; }
  .motion .tile { transform: translate3d(0, calc((1 - var(--p, 0)) * 110vh), 0); will-change: transform; }
  .motion .veil { display: block; position: absolute; inset: -20px; background: #fff; opacity: calc(var(--veil, 0) * .86); z-index: 5; pointer-events: none; }
  .motion .see-all {
    display: inline-block; position: absolute; left: 50%; top: 50%; z-index: 6;
    transform: translate(-50%, calc(-50% + (1 - var(--veil, 0)) * 16px));
    opacity: var(--veil, 0); pointer-events: none;
    font-size: 28px; letter-spacing: -0.01em; white-space: nowrap;
  }
  .motion .see-all.live { pointer-events: auto; }
  .motion .see-all:hover { color: var(--text); }
  .motion .home-index .see-all-static { display: none; }
  .motion .scroll-hint { display: block; position: absolute; right: var(--pad); bottom: var(--pad); margin: 0; font-size: 12px; color: var(--muted); opacity: calc(1 - var(--veil, 0)); }
}

/* ---------- projects index ---------- */
.index-cards { display: none; }
@media (min-width: 1024px) {
  .index-list {
    position: fixed; top: 50%; right: calc(100vw - var(--split) + 2.5vw); transform: translateY(-50%);
    text-align: right; z-index: 5;
  }
  .group + .group { margin-top: 26px; }
  .group-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
  .index-list a { display: inline-flex; align-items: baseline; gap: 22px; padding: 2px 0; }
  .item-title { transition: color .3s; }
  .item-meta { font-size: 12px; color: var(--muted); opacity: 0; transform: translateX(6px); transition: opacity .35s, transform .35s var(--ease); white-space: nowrap; }
  .index-list a.is-on .item-meta { opacity: 1; transform: none; }
  .index-list:hover a:not(.is-on) .item-title { color: var(--muted); }

  .index-preview { position: fixed; left: var(--split); right: var(--pad); top: var(--pad); height: min(calc(100vh - 2 * var(--pad)), 46vw); }
  .preview { position: absolute; inset: 0; opacity: 0; transition: opacity .6s var(--ease); }
  .preview.is-active { opacity: 1; }
}

/* ---------- project page ---------- */
.next-mobile { display: none; }
@media (min-width: 1024px) {
  .project { display: grid; grid-template-columns: var(--split) 1fr; }
  .project-rail { position: sticky; top: 0; height: 100vh; padding: 132px var(--pad) 80px; }
  .facts { display: grid; grid-template-columns: var(--col) 1fr; gap: 18px 0; margin: 0; max-width: calc(var(--col) * 2 + 8vw); transition: opacity .5s; }
  .facts dt { font-size: 12px; color: var(--muted); }
  .facts dd { margin: 2px 0 0; padding-right: 16px; }
  .concept { display: grid; grid-template-columns: var(--col) 1fr; margin-top: 64px; transition: opacity .5s; }
  .concept-text { max-width: 30vw; color: var(--text); }
  .next {
    position: absolute; left: var(--pad); right: var(--pad); top: 46vh;
    display: grid; grid-template-columns: var(--col) 1fr; align-items: baseline;
    opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s var(--ease); pointer-events: none;
  }
  .next a { font-size: 20px; }
  .next a:hover { color: var(--muted); }
  .project-rail.at-end .facts, .project-rail.at-end .concept { opacity: 0; pointer-events: none; }
  .project-rail.at-end .next, .project-rail.show-next .next { opacity: 1; transform: none; pointer-events: auto; }
  .gallery { padding: var(--pad) var(--pad) var(--pad) 0; }
  .gallery-end { height: 1px; }
}
.shot { margin-bottom: 10px; }
.shot img { width: 100%; }
.shot figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.gallery-label { font-size: 12px; color: var(--muted); margin: 48px 0 10px; }

/* ---------- studio ---------- */
.studio-text strong { font-weight: 500; color: var(--ink); }
.studio-text { color: var(--text); }
.studio-list .label { margin-bottom: 6px; }
.studio-list li { padding: 1px 0; }
.studio-list a:hover { color: var(--muted); }
@media (min-width: 1024px) {
  .studio-text { position: fixed; left: var(--pad); top: 100px; width: min(560px, 33vw); }
  .studio-list { position: fixed; left: 34vw; bottom: 80px; display: grid; gap: 22px; }
  .side-image { position: fixed; left: var(--split); right: var(--pad); top: var(--pad); bottom: var(--pad); }
}

/* ---------- contact ---------- */
.contact-col p { margin-bottom: 14px; }
.contact-col .label { margin-bottom: 2px; }
.contact a:hover { color: var(--muted); }
@media (min-width: 1024px) {
  .contact-image { position: fixed; left: 35.6vw; right: var(--pad); top: var(--pad); height: 58vh; }
  .contact-row { position: fixed; left: var(--pad); right: var(--pad); top: 75vh; display: grid; grid-template-columns: calc(35.6vw - var(--pad)) 1fr auto; align-items: start; }
  .social { text-align: right; }
}

/* ---------- mobile ---------- */
@media (max-width: 1023.98px) {
  :root { --pad: 16px; }
  body { font-size: 15px; padding-bottom: 72px; }
  .masthead { position: static; padding: var(--pad) var(--pad) 0; max-width: none; }
  .title { font-size: clamp(28px, 8.4vw, 44px); }
  .nav {
    left: 0; right: 0; bottom: 0; padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 18px;
  }
  main { padding: 0 var(--pad); }

  .home-intro { margin: 28px 0 32px; max-width: 34em; }
  .home-index { display: none; }
  .collage { display: grid; gap: 36px; }
  .tile-1 .frame, .tile-4 .frame { aspect-ratio: 4 / 5; }
  .tile-2 .frame, .tile-3 .frame { aspect-ratio: 4 / 3; }
  .tile-caption { display: flex; flex-direction: column; margin-top: 10px; }
  .tile-caption .muted { font-size: 13px; }
  .see-all { display: inline-block; font-size: 20px; margin: 4px 0 24px; }

  .index-list, .index-preview { display: none; }
  .index-cards { display: block; margin-top: 28px; }
  .index-cards .group-label { font-size: 13px; color: var(--muted); margin: 8px 0 14px; }
  .cards { display: grid; gap: 30px; margin-bottom: 40px; }
  .cards a { display: block; }
  .card-frame { display: block; aspect-ratio: 4 / 3; overflow: hidden; margin-bottom: 10px; }
  .card-title { display: block; font-size: 18px; }
  .cards .muted { font-size: 13px; }

  .project-rail { padding: 22px 0 8px; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0; }
  .facts dt { font-size: 12px; color: var(--muted); }
  .facts dd { margin: 2px 0 0; }
  .concept { margin: 30px 0 10px; }
  .concept .label { margin-bottom: 8px; }
  .concept-text { color: var(--text); }
  .next { display: none; }
  .gallery { margin-top: 24px; }
  .next-mobile { display: block; margin: 36px 0 28px; }
  .next-mobile a { font-size: 22px; }

  .studio { padding-top: 24px; display: grid; gap: 32px; }
  .studio-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .side-image { aspect-ratio: 4 / 5; overflow: hidden; }

  .contact { padding-top: 24px; }
  .contact-image { aspect-ratio: 4 / 3; overflow: hidden; margin-bottom: 26px; }
  .contact-row { display: grid; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js img.fade { opacity: 1; }
}
