/* ============================================================
   The Align Studio — spherical portfolio
   ============================================================ */

:root {
  --bg: #060606;
  --panel: #0b0b0b;
  --fg: #ffffff;
  --dim: #9b9b9b;
  --mute: #6d6d6d;
  --line: #242424;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: 36px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

.skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  background: var(--fg);
  color: #0a0a0a;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
body.dragging #scene { cursor: grabbing; }
body.tile-hover #scene { cursor: pointer; }

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse 105% 85% at 50% 50%, transparent 36%, rgba(0, 0, 0, 0.55) 68%, rgba(0, 0, 0, 0.96) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.5) 8%, transparent 19%, transparent 84%, rgba(0, 0, 0, 0.72) 100%);
}

.mono {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.55;
  text-transform: uppercase;
}
.dim { color: var(--dim); }

/* chrome fades in once the page is ready */
.ui-fade { opacity: 0; translate: 0 10px; }
.ui-ready .ui-fade { opacity: 1; translate: 0 0; transition: opacity 0.9s ease, translate 0.9s var(--ease-out); }
.ui-ready .tagline { transition-delay: 0.08s; }
.ui-ready .clocks { transition-delay: 0.16s; }
.ui-ready .lets-talk { transition-delay: 0.24s; }
.ui-ready .view-toggle { transition-delay: 0.32s; }
.ui-ready .bottom-nav { transition-delay: 0.4s; }
.ui-ready .readout { transition-delay: 0.48s; }

/* ============ alignment marks around the centred tile ============ */

.reticle {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.reticle.on { opacity: 1; }
.reticle i {
  position: absolute;
  left: 0; top: 0;
  width: 13px; height: 13px;
  border: solid rgba(255, 255, 255, 0.9);
  border-width: 0;
  will-change: transform;
}
.reticle i:nth-child(1) { border-top-width: 1px; border-left-width: 1px; }
.reticle i:nth-child(2) { border-top-width: 1px; border-right-width: 1px; margin-left: -13px; }
.reticle i:nth-child(3) { border-bottom-width: 1px; border-left-width: 1px; margin-top: -13px; }
.reticle i:nth-child(4) { border-bottom-width: 1px; border-right-width: 1px; margin: -13px 0 0 -13px; }

/* ============ top chrome ============ */

.chrome {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  pointer-events: none;
}
.chrome > * { pointer-events: auto; position: absolute; }

.brand {
  top: 24px;
  left: var(--pad);
  display: flex;
  align-items: center;
  gap: 14px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}
.brand-mark { width: 31px; height: 32px; flex: none; }
.brand-word {
  font-family: "Montserrat", var(--sans);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tagline {
  top: 26px;
  left: 50%;
  color: var(--fg);
  transition: opacity 0.35s ease;
}

.clocks {
  top: 26px;
  left: 72%;
  color: var(--fg);
  white-space: nowrap;
  transition: opacity 0.35s ease;
}
.clock { display: flex; align-items: center; gap: 7px; }
.clock.off { color: var(--dim); }
.clock-time { margin-left: 6px; font-variant-numeric: tabular-nums; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--fg);
  display: inline-block;
  flex: none;
}
.clock.off .dot { background: transparent; border: 1px solid var(--dim); }

.lets-talk {
  top: 22px;
  right: var(--pad);
  background: var(--fg);
  color: #0a0a0a;
  font-weight: 500;
  font-size: 15px;
  border-radius: 999px;
  padding: 15px 26px;
  transition: transform 0.25s ease;
}
.lets-talk:hover { transform: scale(1.05); }

body.is-panel .tagline,
body.is-panel .clocks { opacity: 0; pointer-events: none; }

/* ============ bottom chrome ============ */

.bottom-nav {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  background: rgba(26, 26, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 4px;
}
.nav-pill {
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
  border-radius: 999px;
  padding: 12px 24px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-pill:not(.active):hover { color: #bdbdbd; }
.nav-pill.active { background: var(--fg); color: #0a0a0a; }

.view-toggle {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  left: var(--pad);
  z-index: 20;
  display: flex;
  gap: 4px;
  background: rgba(26, 26, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 4px;
  transition: opacity 0.3s ease;
}
.vt-btn {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  color: #8a8a8a;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}
.vt-btn:hover { color: var(--fg); }
.vt-btn.active { background: #3a3a3a; color: var(--fg); }
body.is-about .view-toggle,
body.is-contact .view-toggle { opacity: 0; pointer-events: none; }

.readout {
  position: fixed;
  right: var(--pad);
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  text-align: right;
  pointer-events: none;
  display: grid;
  justify-items: end;
  transition: opacity 0.35s ease;
}
.readout > span { grid-area: 1 / 1; transition: opacity 0.35s ease; white-space: nowrap; }
.readout-hint::before { content: "::::::"; color: var(--mute); letter-spacing: 1px; margin-right: 10px; }
.readout-proj { opacity: 0; color: var(--dim); }
.readout-proj b { font-weight: 400; color: var(--fg); margin-right: 12px; }
.readout.show-proj .readout-hint { opacity: 0; }
.readout.show-proj .readout-proj { opacity: 1; }
body.is-panel .readout { opacity: 0; }

/* ============ panels (index / about / contact) ============ */

.panel {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: var(--panel);
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
}
.panel.open { visibility: visible; }

.panel-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 132px max(5vw, var(--pad)) 150px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 62px, #000 118px, #000 calc(100% - 120px), transparent calc(100% - 64px));
  mask-image: linear-gradient(to bottom, transparent 0, transparent 62px, #000 118px, #000 calc(100% - 120px), transparent calc(100% - 64px));
}

.eyebrow { color: var(--dim); margin-bottom: 22px; }

.panel-title,
.statement {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.panel-title { font-size: clamp(44px, 6.4vw, 104px); text-transform: uppercase; font-weight: 600; }
.statement { font-size: clamp(34px, 4.7vw, 76px); max-width: 21ch; text-wrap: balance; }

.plain li {
  font-size: 17px;
  line-height: 1.35;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: #dcdcdc;
}
.plain li:last-child { border-bottom: 1px solid var(--line); }
.panel h2.mono { color: var(--dim); font-weight: 400; margin-bottom: 12px; }

/* ---- index ---- */

.list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
.list-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid #2f2f2f;
  color: #bdbdbd;
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chip span { color: var(--mute); margin-left: 4px; }
.chip:hover { border-color: #5a5a5a; color: var(--fg); }
.chip.active { background: var(--fg); border-color: var(--fg); color: #0a0a0a; }
.chip.active span { color: #555; }

.list-rows { border-bottom: 1px solid var(--line); }
.list-rows li[hidden] { display: none; }
.row {
  display: grid;
  grid-template-columns: 44px minmax(150px, 1.1fr) minmax(200px, 1.6fr) minmax(190px, 1.4fr) 86px 62px;
  gap: 20px;
  align-items: baseline;
  padding: 17px 0 16px;
  border-top: 1px solid var(--line);
  transition: opacity 0.25s ease, padding 0.35s var(--ease-out);
}
.row .n, .row .svc, .row .yr, .row .kd {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}
.row .cl { font-size: clamp(19px, 1.7vw, 26px); font-weight: 500; letter-spacing: -0.01em; }
.row .ti { font-size: 15px; color: #c9c9c9; }
.row .yr { text-align: right; font-variant-numeric: tabular-nums; }
.row .kd i {
  font-style: normal;
  display: inline-block;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  padding: 3px 9px;
}
.row .kd.client i { border-color: transparent; padding-left: 0; color: #dcdcdc; }
@media (hover: hover) {
  .list-rows:hover .row { opacity: 0.38; }
  .list-rows .row:hover { opacity: 1; padding-left: 14px; }
}
.row:focus-visible { outline-offset: -1px; opacity: 1; }

.list-preview {
  position: fixed;
  left: 0; top: 0;
  z-index: 9;
  width: clamp(220px, 21vw, 340px);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.list-preview img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
@media (hover: none) { .list-preview { display: none; } }

/* ---- about ---- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 72px);
  margin-top: clamp(48px, 7vw, 104px);
  align-items: start;
}
.about-copy p {
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.42;
  color: #d8d8d8;
  max-width: 34ch;
}
.about-copy p + p { margin-top: 1.05em; }
.about-copy .about-fine {
  font-size: 10px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 44ch;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.about-col h2 + ul + h2 { margin-top: 38px; }
.people li { display: grid; gap: 3px; }
.people strong { font-weight: 500; font-size: 17px; }
.people span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }

.big-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: clamp(56px, 8vw, 120px);
  padding: 26px 0;
  border-top: 1px solid #3a3a3a;
  border-bottom: 1px solid #3a3a3a;
  font-size: clamp(30px, 4.4vw, 68px);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: padding 0.45s var(--ease-out);
}
.big-link:hover { padding-left: 18px; padding-right: 18px; }

/* ---- contact ---- */

.email {
  display: inline-block;
  margin-top: clamp(30px, 4vw, 56px);
  font-size: clamp(24px, 4.3vw, 70px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  border-bottom: 1px solid #4a4a4a;
  padding-bottom: 6px;
  overflow-wrap: anywhere;
  transition: border-color 0.25s ease;
}
.email:hover { border-color: var(--fg); }
.contact-actions { display: flex; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.pill-btn {
  background: var(--fg);
  color: #0a0a0a;
  border: 1px solid var(--fg);
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.pill-btn:hover { transform: scale(1.04); }
.pill-btn.ghost { background: transparent; color: var(--fg); border-color: #3a3a3a; }
.copy-status { color: var(--dim); margin-left: 6px; min-height: 1em; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  gap: clamp(28px, 4vw, 72px);
  margin-top: clamp(56px, 8vw, 110px);
}
.contact-grid .mono.dim { float: right; margin-top: 4px; }

/* ============ project detail ============ */

.detail {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0c0c0c;
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
  overflow: hidden;
}
.detail.open { visibility: visible; }

.detail-bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--pad) 0;
  pointer-events: none;
}
.detail-bar > * { pointer-events: auto; }
.bar-btn {
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #2c2c2c;
  border-radius: 999px;
  padding: 13px 20px;
  transition: background 0.2s ease;
}
.bar-btn:hover { background: #2e2e2e; }
.detail-count {
  color: #c4c4c4;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 13px 18px;
  font-variant-numeric: tabular-nums;
}

.detail-inner {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 118px max(5vw, 40px) 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  outline: none;
}

.detail-client { color: var(--dim); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.kind {
  border: 1px solid #3d3d3d;
  border-radius: 999px;
  padding: 3px 10px;
  color: #cfcfcf;
}
.kind:empty { display: none; }

.detail-title {
  font-size: clamp(40px, 7.4vw, 118px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 15ch;
  text-wrap: balance;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 34px 0 26px;
  color: var(--dim);
}
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-tags span {
  border: 1px solid #2f2f2f;
  background: #161616;
  color: #cfcfcf;
  border-radius: 999px;
  padding: 7px 14px;
}

.detail-hero,
.detail-gallery figure {
  overflow: hidden;
  border-radius: 6px;
  background: #141414;
}
.detail-hero img,
.detail-gallery img { width: 100%; height: auto; }

.detail-body { margin-top: clamp(44px, 5vw, 72px); }
.detail-lede {
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.01em;
  max-width: 27ch;
  margin-bottom: clamp(36px, 4.4vw, 60px);
  text-wrap: balance;
}
.detail-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: start;
}
.detail-text { color: #b9b9b9; font-size: 17px; line-height: 1.65; max-width: 58ch; }
.detail-text p + p { margin-top: 1.1em; }

.detail-facts { display: grid; grid-template-columns: 96px 1fr; border-bottom: 1px solid var(--line); }
.detail-facts dt,
.detail-facts dd { padding: 12px 0; border-top: 1px solid var(--line); }
.detail-facts dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  padding-top: 15px;
}
.detail-facts dd { font-size: 15px; line-height: 1.5; color: #dcdcdc; }
.detail-facts a { border-bottom: 1px solid #5a5a5a; transition: border-color 0.2s ease; }
.detail-facts a:hover { border-color: var(--fg); }

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 22px);
  margin-top: clamp(56px, 7vw, 104px);
}
.detail-gallery figure { grid-column: span 12; }
.detail-gallery figure.half { grid-column: span 6; }
.detail-gallery figure.solo { grid-column: 4 / span 6; }
.detail-gallery .pair {
  grid-column: span 12;
  display: flex;
  gap: clamp(10px, 1.4vw, 22px);
  align-items: flex-start;
}
.detail-gallery .pair figure { min-width: 0; }

.detail-note {
  color: var(--dim);
  margin-top: 34px;
  max-width: 76ch;
}
.detail-note:empty { display: none; }

.next-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 32px;
  margin-top: clamp(72px, 9vw, 140px);
  padding: 30px 0 calc(64px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #3a3a3a;
}
.next-card .mono { grid-column: 1; color: var(--dim); }
.next-card strong {
  grid-column: 1;
  font-size: clamp(38px, 6.6vw, 104px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  transition: transform 0.5s var(--ease-out);
}
.next-thumb {
  grid-column: 2; grid-row: 1 / span 2;
  width: clamp(120px, 16vw, 240px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #141414;
}
.next-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease-out); }
.next-card:hover strong { transform: translateX(14px); }
.next-card:hover .next-thumb img { transform: scale(1.06); }

/* ============ no WebGL: the index becomes the home page ============ */

.no-webgl #scene,
.no-webgl .vignette,
.no-webgl .reticle,
.no-webgl .readout,
.no-webgl .view-toggle { display: none; }

/* ============ noscript ============ */

.noscript {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: grid; place-content: center; gap: 16px;
  padding: 40px; max-width: 60ch; margin: auto;
}
.noscript a { border-bottom: 1px solid #666; }

/* ============ responsive ============ */

@media (max-width: 1180px) {
  .tagline { left: 42%; }
  .clocks { left: 66%; }
}

@media (max-width: 980px) {
  .tagline { display: none; }
  .clocks { left: auto; right: 190px; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-copy { grid-column: 1 / -1; }
  .row { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.2fr) 80px 48px; }
  .row .svc { display: none; }
}

@media (max-width: 700px) {
  :root { --pad: 18px; }
  .clocks, .readout, .brand-word { display: none; }
  .brand { top: 20px; }
  .lets-talk { top: 16px; padding: 12px 20px; font-size: 14px; }
  .view-toggle {
    bottom: auto;
    top: 16px;
    left: auto;
    right: calc(var(--pad) + 118px);
    padding: 3px;
  }
  .vt-btn { width: 37px; height: 37px; }
  .bottom-nav { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .nav-pill { padding: 12px 20px; }

  .panel-scroll {
    padding: 104px var(--pad) 130px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 56px, #000 96px, #000 calc(100% - 110px), transparent calc(100% - 62px));
    mask-image: linear-gradient(to bottom, transparent 0, transparent 56px, #000 96px, #000 calc(100% - 110px), transparent calc(100% - 62px));
  }
  .list-head { margin-bottom: 26px; }
  .row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0 13px; }
  .row .ti { grid-column: 2; grid-row: 2; font-size: 13.5px; color: var(--dim); }
  .row .kd { grid-column: 3; grid-row: 1; text-align: right; }
  .row .yr { grid-column: 3; grid-row: 2; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .plain li { font-size: 16px; }

  .detail-bar { padding: 16px var(--pad) 0; }
  .bar-btn { padding: 11px 16px; }
  .detail-inner { padding: 92px var(--pad) 0; }
  .detail-meta { align-items: flex-start; margin: 24px 0 20px; }
  .detail-cols { grid-template-columns: 1fr; }
  .detail-gallery figure.solo { grid-column: span 12; }
  .detail-gallery .pair { flex-direction: column; }
  .detail-gallery .pair figure { flex: none !important; width: 100%; }
  .next-card { grid-template-columns: 1fr; }
  .next-thumb { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  /* zero, not "nearly zero": a 0.01ms transition on `all` still holds visibility at hidden for a tick,
     which makes a panel unfocusable at the moment the router moves focus into it */
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}
