:root {
  color-scheme: dark;
  --paper: #0f2a4d;
  --panel: #14335c;
  --panel-2: #0b2142;
  --panel-2-rgb: 11 33 66;
  --line: #8fb4e6;
  --line-rgb: 143 180 230;
  --ink: #eaf2ff;
  --muted: #c4d6f0;
  --yellow: #ffc933;
  --yellow-hi: #ffd75e;
  --yellow-ink: #0b1e38;
  --shadow-rgb: 3 12 30;
  --shadow: 8px 12px 28px rgb(var(--shadow-rgb) / .45);
  --head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --nav-h: 56px;
  --ease: cubic-bezier(.2, .9, .3, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--yellow); color: var(--yellow-ink); }
/* the drafting grid sits behind everything and never moves */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(var(--line-rgb) / .22) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--line-rgb) / .22) 1px, transparent 1px),
    linear-gradient(rgb(var(--line-rgb) / .09) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--line-rgb) / .09) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  pointer-events: none;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.ico { display: inline-block; flex: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--yellow); color: var(--yellow-ink); padding: 10px 14px; border-radius: 8px; font-weight: 500; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------- jump nav ---------- */
.jump {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(var(--panel-2-rgb) / .94);
  border-bottom: 1.5px solid var(--line);
  backdrop-filter: blur(6px);
}
.jump ul { display: flex; justify-content: center; gap: 4px; list-style: none; margin: 0; padding: 0 12px; }
.jump a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--nav-h);
  padding: 0 14px;
  text-decoration: none;
  font: 500 .9375rem/1.2 var(--mono);
  color: var(--muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.jump a:hover { color: var(--ink); }
.jump a[aria-current] { color: var(--yellow); border-bottom-color: var(--yellow); }
.jump .contact a { color: var(--yellow-ink); background: var(--yellow); border-radius: 6px; margin: 8px 0 8px 8px; min-height: 44px; border-bottom: 0; transition: background-color .15s; }
.jump .contact a:hover { color: var(--yellow-ink); background: var(--yellow-hi); }
.progress { position: absolute; left: 0; bottom: -1.5px; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--yellow); }

/* the stack: one block lands per project you scroll past */
.tower { display: none; position: fixed; left: 16px; top: 50%; width: 76px; height: auto; transform: translateY(-50%); filter: drop-shadow(6px 8px 10px rgb(var(--shadow-rgb) / .4)); pointer-events: none; }
.tb { opacity: .12; transform: translateY(-26px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.tb.on { opacity: 1; transform: none; }
.tb.hot { --ct: #ffd24d; --cl: #e0a800; --cr: #b88600; --ce: #ffe08a; }
@media (min-width: 1360px) { .tower { display: block; } }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 32px; padding: 72px 0 40px; }
h1 { font: 800 clamp(3.2rem, 9vw, 6rem)/1 var(--head); letter-spacing: -.02em; margin: 0 0 20px; }
.lede { font: 600 clamp(1.3rem, 2.6vw, 1.7rem)/1.3 var(--head); margin: 0 0 14px; max-width: 30ch; text-wrap: balance; }
.hero p { margin: 0 0 14px; max-width: 56ch; color: var(--muted); }
.hero .lede { color: var(--ink); }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 26px; }
.hero p.studio { margin: 0; min-height: 48px; display: flex; align-items: center; padding: 0 14px; border: 1.5px solid var(--line); background: var(--panel-2); font: 500 .9375rem/1.3 var(--mono); color: var(--ink); }
.stack { width: min(100%, 360px); height: auto; margin-inline: auto; filter: drop-shadow(10px 14px 14px rgb(var(--shadow-rgb) / .4)); }
.blk { animation: drop .7s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
@keyframes drop { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- project sheets ---------- */
.sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 32px;
  padding: 32px;
  margin: 0 0 40px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.sheet.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.sheet.flip .info { order: 2; }
/* registration marks on the corners */
.sheet::before, .sheet::after { content: "+"; position: absolute; font: 500 1.4rem/1 var(--mono); color: var(--yellow); }
.sheet::before { left: 6px; top: 4px; }
.sheet::after { right: 7px; bottom: 5px; }
h2 { font: 800 clamp(1.7rem, 3.4vw, 2.3rem)/1.1 var(--head); letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
/* the drawing's title block: type, team and dates in ruled cells */
.meta { display: inline-flex; flex-wrap: wrap; gap: 1.5px; list-style: none; margin: 0 0 18px; padding: 0; border: 1.5px solid var(--line); background: var(--line); font: 500 .875rem/1.4 var(--mono); color: var(--yellow); }
.meta li { flex: 1 1 auto; padding: 6px 12px; background: var(--panel-2); }
.info p { margin: 0 0 12px; max-width: 46ch; }
.stamp-row { margin-top: 18px !important; }
.stamp { display: inline-block; padding: 6px 12px; border: 2px solid var(--yellow); border-radius: 4px; color: var(--yellow); font: 500 .8125rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; transform: rotate(-3deg); }

/* ---------- gallery ---------- */
.gallery { min-width: 0; }
.shot { margin: 0; }
.stage {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  cursor: zoom-in;
  overflow: hidden;
  aspect-ratio: 37 / 20;
}
.stage img { width: 100%; height: 100%; object-fit: contain; }
.zoom-ico { position: absolute; right: 10px; bottom: 10px; box-sizing: content-box; padding: 8px; border-radius: 6px; background: rgb(var(--panel-2-rgb) / .85); color: var(--ink); transition: transform .2s var(--ease), background-color .2s; }
.stage:hover .zoom-ico, .stage:focus-visible .zoom-ico { transform: scale(1.12); background: var(--yellow); color: var(--yellow-ink); }
.gallery:not(.is-ready) .shot + .shot { margin-top: 16px; }
.thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.thumb { width: 88px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: var(--panel-2); cursor: pointer; overflow: hidden; opacity: .75; transition: opacity .15s, transform .15s; }
.thumb:hover { opacity: 1; transform: translateY(-2px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-pressed="true"] { border-color: var(--yellow); opacity: 1; }
.thumbs-count { margin-left: auto; font: 500 .875rem/1.2 var(--mono); color: var(--muted); }

/* ---------- contact ---------- */
.contact-sheet { grid-template-columns: 1fr; align-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px;
  font: 500 1rem/1.2 var(--body);
  color: var(--ink); background: var(--panel-2);
  border: 1.5px solid var(--line); border-radius: 6px;
  text-decoration: none; cursor: pointer;
  box-shadow: 4px 6px 12px rgb(var(--shadow-rgb) / .4);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 5px 9px 16px rgb(var(--shadow-rgb) / .45); }
.btn:active { transform: translateY(1px); box-shadow: 2px 3px 6px rgb(var(--shadow-rgb) / .4); }
.btn-primary { background: var(--yellow); color: var(--yellow-ink); border-color: var(--yellow); }
.btn-primary:hover { background: var(--yellow-hi); border-color: var(--yellow-hi); }
.copy-label { font: 500 .8rem/1 var(--mono); padding: 5px 8px; border: 1.5px solid currentColor; border-radius: 4px; color: var(--yellow); }
.copy-status { min-height: 1.6em; margin: 10px 0 0; font-size: .95rem; color: var(--muted); }

/* ---------- footer ---------- */
.foot { padding: 24px 0 40px; border-top: 1.5px solid var(--line); color: var(--muted); font-size: .9375rem; }
.foot p { margin: 0 0 6px; }
.provided { color: var(--ink); }
.provided a { display: inline-block; padding-block: 12px; margin-block: -12px; font-weight: 800; color: var(--yellow); }

/* ---------- lightbox ---------- */
dialog { padding: 0; border: 1.5px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--ink); max-width: min(96vw, 1400px); max-height: 94vh; overflow: hidden; }
dialog::backdrop { background: rgb(var(--shadow-rgb) / .86); }
dialog img { width: auto; max-width: 100%; max-height: calc(94vh - 72px); margin: 0 auto; }
.lb-caption { margin: 0; padding: 10px 56px 12px 16px; font-size: .9375rem; color: var(--muted); }
.lb-close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 6px; background: rgb(var(--panel-2-rgb) / .9); color: var(--ink); cursor: pointer; }

/* ---------- phone: nav pinned to the bottom ---------- */
@media (max-width: 760px) {
  body { font-size: 1rem; padding-bottom: calc(var(--nav-h) + 8px); }
  html { scroll-padding-top: 16px; scroll-padding-bottom: calc(var(--nav-h) + 24px); }
  .jump { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-bottom: 0; border-top: 1.5px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  /* names scroll sideways; Contact stays pinned at the right edge */
  .jump ul { justify-content: flex-start; gap: 0; padding: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .jump ul::-webkit-scrollbar { display: none; }
  .jump li { flex: none; }
  .jump a { min-height: 52px; padding: 0 14px; border-bottom: 0; border-top: 3px solid transparent; }
  .jump a[aria-current] { border-top-color: var(--yellow); }
  .jump li.contact { position: sticky; right: 0; padding: 0 6px 0 12px; background: linear-gradient(90deg, transparent, rgb(var(--panel-2-rgb)) 12px); }
  .jump .contact a { margin: 4px 0; min-height: 44px; }
  .progress { bottom: auto; top: -1.5px; }
  .hero { grid-template-columns: 1fr; padding: 40px 0 24px; gap: 12px; }
  .stack { order: -1; width: 190px; margin: 0; }
  .sheet, .sheet.flip { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 36px 16px 20px; }
  .sheet.flip .info { order: 0; }
  .thumb { width: 72px; height: 44px; }
  .btn { width: 100%; justify-content: center; }
  .hero-row .studio { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blk { animation: none; }
  .tb, .btn, .zoom-ico, .thumb { transition: none; }
  .btn:hover, .btn:active, .thumb:hover, .stage:hover .zoom-ico { transform: none; }
}
