/* ============================================================
   SAM VACQUIER — v9 SINGLE VIEW
   the wall is the site · paper/ink/brass · no scroll
   ============================================================ */

:root {
  --paper: #f2f2f1;
  --ink: #1a1a18;
  --gray: #6d6d6d;
  --hair: rgba(33, 33, 33, 0.16);
  --brass: #9e7e45;
  --font: "Saira", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
  --pad: clamp(18px, 3vw, 48px);
}

/* dark mode — the same drawing, inverted: ink paper, paper ink */
html.dark {
  --paper: #161614;
  --ink: #e8e7e3;
  --gray: #97928a;
  --hair: rgba(232, 231, 227, 0.16);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

.micro {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gray);
  text-transform: uppercase;
}
.link { transition: color 0.3s ease; }
.link:hover { color: var(--brass); }
.link--strong { color: var(--ink); font-weight: 700; }

/* ---------- Home state (held wall: hero disc + tendril field) ---------- */
/* the reel loops inside the disc; clicking blooms it out to the full frame */
.heroVideo {
  position: absolute; z-index: 7;
  display: none;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;             /* fingers drag the disc, not the page */
  /* transparent — a black bg bled into the crop's antialiased rim;
     now edge pixels blend with the matching disc behind instead */
  background: transparent;
  background-size: cover;
  background-position: center;    /* the backing thumb when autoplay is blocked */
  isolation: isolate;             /* keeps the round crop clean in safari */
}
.heroVideo iframe {
  /* fixed internal size: the player never re-lays-out when the circle
     blooms or morphs, so Vimeo never re-buffers (the blank-flash source).
     the rendered result is scaled to cover the wrapper instead. */
  position: absolute; top: 50%; left: 50%;
  width: 1280px; height: 720px;
  transform: translate(-50%, -50%) scale(var(--deckScale, 0.44));
  border: 0;
  pointer-events: none;           /* the wrapper takes the click */
}
.heroVideo canvas {
  /* the live edit — square canvas, stretched to the wrapper */
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
/* the loading-page dot stands in while a deck finds its frames */
.heroVideo .deckDot {
  position: absolute; left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  animation: loaderPulse 1.5s ease-in-out infinite;
}
.heroVideo .deckDot[hidden] { display: none; }


.enterStack {
  position: absolute; left: 50%; bottom: clamp(74px, 13vh, 130px); z-index: 12;
  transform: translateX(-50%);
  display: none;
  flex-direction: column; align-items: center; gap: 10px;
}
body.is-home .enterStack { display: flex; }
.enterStack--on { display: flex; }       /* always-on variant (archive page) */
/* the closed loop: home offers both enters; the selected wall offers
   the archive onward and the way back — never a button for where you are */
.enterStack .enter--back { display: none; }
.enterStack .enter--selected { display: none; }
body.sv-entered .enterStack { display: flex; }
body.sv-entered #enterBtn { display: none; }
body.sv-entered .enter--back { display: block; }
/* the in-place archive mode: offer selected + home, never itself */
body.sv-archive .enterStack { display: flex; }
body.sv-archive #enterBtn { display: none; }
body.sv-archive #enterArchivePill { display: none; }
body.sv-archive .enter--selected { display: block; }
body.sv-archive .enter--back { display: block; }
.enter {
  display: block;
  min-width: 236px;               /* equal widths keep the stack truly centred */
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--hair);
  border-radius: 100px;
  padding: 13px 24px;
  background: rgba(242, 242, 241, 0.65);
  background: color-mix(in srgb, var(--paper) 65%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  cursor: pointer;
  text-align: center;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.enter:hover { color: var(--brass); border-color: var(--brass); }
.picks { transition: opacity 0.7s ease; }
body.is-home .picks { opacity: 0; pointer-events: none; }

/* ---------- Showreel constellation ---------- */
/* the reel plays across a cluster of draggable, colliding circles —
   z6 sits under the hero circle (z7) so the main bubble rides on top */
.reelField {
  position: fixed; inset: 0; z-index: 6;
  background: rgba(242, 242, 241, 0.55);
  background: color-mix(in srgb, var(--paper) 55%, transparent);
}
.reelField[hidden] { display: none; }
.reelField__lines {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.reelClose {
  position: absolute; top: 20px; left: 50%;
  transform: translateX(-50%);
  color: var(--ink);
  padding: 8px 14px;
}
.reelClose:hover { color: var(--brass); }
.reelBubble {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  /* transparent — any tint under the image rims the antialiased edge */
  background: transparent;
}
.reelBubble iframe {
  position: absolute; top: 50%; left: 50%;
  width: 218.7%; height: 123%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.reelBubble {
  background-size: cover;
  background-position: center;
}
.reelBubble--mini {
  left: 0; top: 0;
  transform: none;                /* positioned wholly via per-frame transform */
}
.reelBubble.is-dragging, body.is-reel .heroVideo { cursor: grab; }
.reelBubble.is-dragging { cursor: grabbing; }
body.is-reel .enterStack { display: none; }

/* the title ring + volume cluster orbiting the playing circle */
.ring {
  position: absolute; inset: 0; z-index: 8;
  width: 100%; height: 100%;
  pointer-events: none;
}
/* the volume dot: bare, pinned to the circle's upper-left —
   click mutes, holding and dragging up/down sets the level */
.volOrb {
  position: absolute; z-index: 9;
  transform: translate(-50%, -50%);
}
.volOrb[hidden] { display: none; }
.volOrb button {
  position: relative;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  padding: 6px;
  cursor: ns-resize;
  touch-action: none;
  transition: color 0.3s ease;
}
.volOrb button:hover { color: var(--brass); }
/* every so often a little shockwave rings off the dot — "this makes sound" */
.volOrb button::before,
.volOrb button::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%) scale(0.35);
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: soundPing 4.2s ease-out infinite;
}
.volOrb button::after { animation-delay: 0.35s; }
.volOrb.is-muted button::before,
.volOrb.is-muted button::after { animation: none; }
@keyframes soundPing {
  0%   { transform: translate(-50%, -50%) scale(0.35); opacity: 0.5; }
  24%  { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .volOrb button::before, .volOrb button::after { animation: none; }
}
/* the nav sound button pings and drags just like the dot on the circle —
   rings centre on the glyph itself and pass BEHIND the neighbouring text */
#soundBtn { touch-action: none; cursor: ns-resize; }
#soundBtn .sdot { position: relative; display: inline-block; }
#soundBtn .sdot::before, #soundBtn .sdot::after {
  content: ""; position: absolute;
  left: 50%; top: 50%;
  width: 20px; height: 20px;
  transform: translate(-50%, -50%) scale(0.35);
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0; pointer-events: none;
  z-index: -1;                       /* the wave rolls under the other links */
  animation: soundPing 4.2s ease-out infinite;
}
#soundBtn .sdot::after { animation-delay: 0.35s; }
#soundBtn.is-muted .sdot::before, #soundBtn.is-muted .sdot::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #soundBtn .sdot::before, #soundBtn .sdot::after { animation: none; }
}
.volMeter {
  position: absolute; left: 50%; bottom: calc(100% + 4px);
  transform: translateX(-50%);
  width: 2px; height: 56px;
  background: var(--hair);
}
.volMeter[hidden] { display: none; }
.volMeter__fill {
  position: absolute; bottom: 0; left: 0;
  width: 100%;
  background: var(--brass);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--paper);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px;
  transition: opacity 0.55s ease;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink);
  animation: loaderPulse 1.5s ease-in-out infinite;
}
@keyframes loaderPulse {
  50% { transform: scale(1.9); opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) { .loader__dot { animation: none; } }

/* ---------- Frame ---------- */
.frame { position: fixed; inset: 0; }
.frame__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
.frame__canvas.is-dragging { cursor: grabbing; }
.links {
  position: absolute; inset: 0; z-index: 6;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* bars float over the canvas; only links/text catch the pointer */
.bar {
  position: absolute; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 18px;
  padding: 20px var(--pad);
  pointer-events: none;
}
.bar a, .bar button { pointer-events: auto; }
.bar--top { top: 0; align-items: flex-start; }
.bar--bottom { bottom: 0; }
/* the credit line sits at the page's true centre, not the flex midpoint */
.bar__mid { position: absolute; left: 50%; transform: translateX(-50%); }
.bar__col--right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
/* links live top-left now; the name block + film list sit top-right */
.bar__col--links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.name { font-weight: 500; font-size: 14px; letter-spacing: 0.02em; }
.name a { transition: color 0.3s ease; }
.name a:hover { color: var(--brass); }   /* the name is the home button */

/* film index — every file, right rail, scrollable */
.picks {
  margin-top: 26px;
  display: flex; flex-direction: column; align-items: flex-end;
  pointer-events: auto;
}
.picks__head { color: var(--brass); margin-bottom: 10px; }
.picks ul {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* no right inset, no reserved scrollbar gutter — the list's right edge
     meets the header's right edge (still scrolls by wheel / drag / touch) */
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}
.picks ul::-webkit-scrollbar { width: 0; height: 0; display: none; }
.picks button {
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 3px 0;
  text-align: right;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.picks button:hover { color: var(--ink); }
.picks button:hover::before { content: "▸ "; color: var(--brass); }
.picks button.is-live { color: var(--ink); }
.picks button.is-live::before { content: "▸ "; color: var(--brass); }
.picks__group {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--brass);
  padding: 14px 0 4px;
  text-align: right;
}
.picks li:first-child.picks__group { padding-top: 0; }
#archiveCaption { color: var(--brass); min-width: 200px; }

/* ---------- Title over the fog ---------- */
.title {
  position: absolute; left: var(--pad); bottom: clamp(64px, 10vh, 110px); z-index: 5;
  font-weight: 100;
  font-stretch: 125%;
  font-size: clamp(40px, 6.8vw, 110px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  display: flex; flex-direction: column;
  pointer-events: none;
}

/* ---------- Reduced-motion fallback list ---------- */
.fallback {
  position: absolute; inset: 80px var(--pad); z-index: 6;
  overflow: auto;
}
.fallback[hidden] { display: none; }
.fallback li { border-bottom: 1px solid var(--hair); }
.fallback button {
  width: 100%; text-align: left;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em;
  color: var(--gray);
  padding: 10px 0;
  transition: color 0.3s ease;
}
.fallback button:hover { color: var(--brass); }

/* ---------- Selected Work page ---------- */
.wpage {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}
.wtop {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px;
  padding: 22px var(--pad) 0;
}
.wtop__right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wmain { padding: 0 var(--pad) 26px; }
.wtitle {
  font-weight: 100;
  font-stretch: 125%;
  font-size: clamp(52px, 10vw, 150px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin-top: clamp(40px, 9vh, 100px);
}
.wcount { margin: 14px 0 26px; color: var(--brass); }
.wgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 2.6vw, 40px);
  border-top: 1px solid var(--hair);
  padding-top: clamp(18px, 2.6vw, 40px);
}
.wcard { cursor: pointer; }
.wcard--wide { grid-column: span 2; }
.wcard__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e7e6e2;
}
.wcard__media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: grayscale(35%) contrast(0.98);
  transform: scale(1.015);
  transition: filter 0.45s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.wcard:hover .wcard__media img { filter: none; transform: scale(1.0); }
.wcard__meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-top: 10px;
}
.wcard__title {
  font-weight: 300;
  font-size: clamp(17px, 1.8vw, 24px);
  transition: color 0.3s ease;
}
.wcard:hover .wcard__title { color: var(--brass); }
.wcard__spec { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.07em; color: var(--gray); text-transform: uppercase; text-align: right; }
.wfoot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(48px, 9vh, 100px);
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}
@media (max-width: 760px) {
  .wgrid { grid-template-columns: 1fr; }
  .wcard--wide { grid-column: span 1; }
  .wtop__right { display: none; }
}

/* a clicked disc's ghost — rides the circle→rectangle morph to the player */
.tileGhost {
  position: fixed; z-index: 499;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 70px rgba(26, 26, 24, 0.22);
  pointer-events: none;
}

/* ---------- Player ---------- */
.player {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(242, 242, 241, 0.42);   /* paper scrim — the dot mesh shows through */
  background: color-mix(in srgb, var(--paper) 42%, transparent);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--pad);
  opacity: 0;
}
.player[hidden] { display: none; }
/* techy rectangular stage: HUD readout, hard frame, corner brackets */
.player__stage { position: relative; width: min(1200px, 100%); }
.player__hud {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 9px; min-height: 14px;
  color: var(--gray);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.player__rec { display: inline-flex; align-items: center; gap: 6px; color: var(--brass); }
.player__rec::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brass);
  animation: recBlink 1.3s steps(1) infinite;
}
@keyframes recBlink { 50% { opacity: 0.2; } }
.player__hud .player__spec { margin-left: auto; color: var(--gray); }
.player__framewrap { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.player__frame {
  position: absolute; inset: 0;
  background: #000;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.player__frame iframe, .player__frame video { width: 100%; height: 100%; border: 0; display: block; }
.player__frame video { object-fit: contain; background: #000; }
/* faint scanlines for the monitor feel */
.player__framewrap::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.05) 0 1px, transparent 1px 3px);
  opacity: 0.35;
}
/* L-shaped corner ticks just outside the frame */
.player__corner { position: absolute; width: 20px; height: 20px; z-index: 3; pointer-events: none; }
.player__corner::before, .player__corner::after { content: ""; position: absolute; background: var(--brass); }
.player__corner::before { height: 1.5px; width: 100%; top: 0; left: 0; }
.player__corner::after { width: 1.5px; height: 100%; top: 0; left: 0; }
.player__corner.tl { left: -6px; top: -6px; }
.player__corner.tr { right: -6px; top: -6px; }
.player__corner.tr::before { left: auto; right: 0; }
.player__corner.tr::after { left: auto; right: 0; }
.player__corner.bl { left: -6px; bottom: -6px; }
.player__corner.bl::before { top: auto; bottom: 0; }
.player__corner.bl::after { top: auto; bottom: 0; }
.player__corner.br { right: -6px; bottom: -6px; }
.player__corner.br::before { top: auto; bottom: 0; left: auto; right: 0; }
.player__corner.br::after { top: auto; bottom: 0; left: auto; right: 0; }
.player__close {
  position: absolute; top: 22px; right: var(--pad);
  color: var(--ink);
  padding: 8px 0;
}
.player__close:hover { color: var(--brass); }
/* the cluster centre's techy frame — brackets + HUD ride heroVideo each frame */
.reelFrame { position: fixed; z-index: 8; pointer-events: none; }
.reelFrame[hidden] { display: none; }
.reelFrame__hud { position: absolute; bottom: calc(100% + 7px); left: 0; white-space: nowrap; }
.heroVideo.is-rect { border-radius: 4px; }

/* ---------- Small + narrow screens (phones and portrait windows) ---------- */
@media (max-width: 820px) {
  .bar__mid { display: none; }
  .title { font-size: clamp(30px, 9.5vw, 54px); bottom: 196px; }
  .bar--bottom { flex-wrap: wrap; }
  .enterStack { bottom: 78px; gap: 8px; }
  .enter { white-space: nowrap; padding: 11px 18px; font-size: 10px; }
  /* the header restacks: identity block on top, nav as one wrapping row
     beneath — the two desktop columns can't share a phone's width */
  .bar--top { flex-direction: column; align-items: stretch; gap: 10px; }
  .bar__col--links { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
  .bar__col--links .name,
  .bar__col--links > p.micro { width: 100%; text-align: left; }
  .bar__col--links > p:nth-of-type(3) { display: none; }    /* coords rest on desktop */
  .bar__col--right { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
  .bar__col--right .link { white-space: nowrap; }
  /* the film index stays on phones — compact, left-run, scrollable */
  body.is-home .picks { display: none; }
  .picks { margin-top: 8px; width: 100%; align-items: flex-start; }
  .picks ul { max-height: 26vh; align-items: flex-start; padding-right: 0; padding-left: 8px; }
  .picks button, .picks__group { text-align: left; }
  /* the bottom bar centres and stacks */
  .bar--bottom { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
  #archiveCaption { min-width: 0; text-align: center; }
}
