/* Felix Specter — the gallery (standalone) */
@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-display: swap; src: url("/fonts/cormorant-garamond-300-latin.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-display: swap; src: url("/fonts/cormorant-garamond-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-garamond-500-latin.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-display: swap; src: url("/fonts/eb-garamond-400-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); }

:root {
  --ink: #050505;
  --bone: #ebe4d6;
  --bone-dim: #a39b8c;
  --mute: #867d70;
  --ember: #c9925e;
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --text: "EB Garamond", Garamond, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--ink); color: var(--bone); }
body { font-family: var(--text); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p { margin: 0; }
.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; }

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

.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(0, 0, 0, .28) 100%); }
/* Film grain, as on the site */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
#fade { position: fixed; inset: 0; background: var(--ink); opacity: 0; pointer-events: none; transition: opacity .45s ease; z-index: 20; }
#fade.on { opacity: 1; }
#fade.light { background: #f1e3c8; transition-duration: 1.3s; }   /* walking out through the door, into daylight */

/* ── HUD ── */
.hud { position: fixed; left: 0; right: 0; z-index: 10; pointer-events: none; transition: opacity 1.2s ease; }
.hud > * { pointer-events: auto; }
body.pre .hud { opacity: 0; }
.hud-top { top: 0; display: flex; justify-content: space-between; align-items: baseline; padding: max(22px, env(safe-area-inset-top)) clamp(18px, 3vw, 40px) 0; }
.wordmark { font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: .04em; }
.wordmark span { color: var(--ember); }
.top-right { display: grid; justify-items: end; gap: 8px; }
.where { color: var(--bone-dim); text-align: right; }
#sound { color: var(--mute); font-size: 9.5px; padding: 4px 0; transition: color .25s; }
#sound:hover { color: var(--bone); }
#sound:focus-visible { outline: 1px solid var(--ember); outline-offset: 3px; }

.hud-bottom { bottom: 0; display: grid; justify-items: center; gap: 14px; padding: 0 clamp(18px, 3vw, 40px) max(20px, env(safe-area-inset-bottom)); }
.hint { color: var(--bone-dim); text-align: center; transition: opacity 1.5s ease; pointer-events: none; }
.hint.gone { opacity: 0; }
.tour { display: flex; align-items: center; gap: 6px; }
.tour button { padding: 9px 14px; color: var(--bone-dim); transition: color .25s; }
.tour button:hover, .tour button[aria-pressed="true"] { color: var(--bone); }
.tour button[aria-pressed="true"]::before { content: "● "; color: var(--ember); }
.tour button:focus-visible, .bar button:focus-visible, .buy:focus-visible, #enter:focus-visible { outline: 1px solid var(--ember); outline-offset: 3px; }

.bar { position: relative; width: min(680px, 100%); height: 30px; }
.bar-line { position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: rgba(235, 228, 214, .16); }
.bar-dot { position: absolute; left: 0; top: 3px; width: 7px; height: 7px; margin-left: -3.5px; will-change: transform; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px var(--ember); pointer-events: none; }
.bar button { position: absolute; top: 0; padding: 0 0 4px; transform: translateX(-50%); min-width: 28px; height: 30px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; color: var(--mute); transition: color .25s; }
.bar button::before { content: ""; position: absolute; left: 50%; top: 2px; width: 1px; height: 9px; background: rgba(235, 228, 214, .3); }
.bar button span { position: absolute; left: 50%; top: 15px; transform: translateX(-50%); }
.bar button:hover { color: var(--bone); }
.bar button.on { color: var(--ember); }

/* ── The label by the picture: quiet on purpose ── */
#label { position: fixed; left: 0; top: 0; z-index: 9; width: 230px; opacity: 0; transition: opacity .7s ease; pointer-events: none; will-change: transform; }
#label.on { opacity: 1; pointer-events: auto; }
#label .no { color: var(--mute); font-size: 9.5px; }
#label h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.1; margin: 5px 0 6px; }
#label .line { font-size: 14.5px; line-height: 1.4; color: var(--bone-dim); }
.buy { display: inline-flex; gap: .9em; align-items: baseline; margin-top: 13px; padding: 6px 0; font-size: 9.5px; color: var(--mute); }
.buy .go { color: var(--bone-dim); border-bottom: 1px solid rgba(201, 146, 94, .55); padding-bottom: 2px; transition: color .25s, border-color .25s; }
.buy .go::after { content: " →"; opacity: 0; transition: opacity .25s; }
.buy:hover .go, .buy:focus-visible .go { color: var(--bone); border-color: var(--ember); }
.buy:hover .go::after, .buy:focus-visible .go::after { opacity: 1; }

/* ── Chapter card ── */
#chapter { position: fixed; left: 0; right: 0; top: 17vh; z-index: 8; text-align: center; padding: 0 24px; opacity: 0; transform: translateY(8px); transition: opacity 1.6s ease, transform 1.6s var(--ease); pointer-events: none; text-shadow: 0 2px 30px rgba(0, 0, 0, .9); }
#chapter.on { opacity: 1; transform: none; }
#chapter .mono { color: var(--ember); }
#chapter h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(38px, 6vw, 84px); line-height: 1.05; margin: 10px 0 12px; letter-spacing: .01em; }
#chapter .line { font-style: italic; color: var(--bone-dim); font-size: clamp(16px, 1.5vw, 20px); max-width: 34em; margin: 0 auto; }

/* ── Intro ── */
#intro { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center; padding: 24px; background: radial-gradient(ellipse at 50% 50%, rgba(4, 4, 5, .84), rgba(4, 4, 5, .93) 70%); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: opacity 2.2s ease, visibility 0s 2.2s; }
#intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-in > * { opacity: 0; animation: rise 1.6s var(--ease) forwards; }
.intro-in > :nth-child(2) { animation-delay: .25s; } .intro-in > :nth-child(3) { animation-delay: .6s; }
.intro-in > :nth-child(4) { animation-delay: 1s; } .intro-in > :nth-child(5) { animation-delay: 1.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#intro .mono span { color: var(--ember); }
#intro h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(72px, 15vw, 210px); line-height: .95; letter-spacing: -.01em; margin: 14px 0 18px; }
#intro .lede { font-size: clamp(17px, 1.6vw, 21px); color: var(--bone-dim); font-style: italic; max-width: 30em; margin: 0 auto; }
#enter { margin-top: 44px; padding: 17px 34px; border: 1px solid rgba(235, 228, 214, .35); color: var(--bone); transition: border-color .4s, background .4s, letter-spacing .6s var(--ease); }
#enter:hover { border-color: var(--ember); background: rgba(201, 146, 94, .1); letter-spacing: .26em; }
#intro .small { margin-top: 26px; color: var(--mute); font-size: 9.5px; }
#intro .tiny { margin-top: 18px; font-size: 7.5px; letter-spacing: .16em; opacity: .55; }
#intro .tiny a { color: var(--mute); }
#intro .tiny a:hover { color: var(--bone-dim); }

@media (max-width: 720px) {
  .hint { display: none; }
  .where { max-width: 50vw; }
  /* On a phone the label sits above the controls instead of beside the frame */
  #label { left: 18px; right: 18px; top: auto; bottom: calc(118px + env(safe-area-inset-bottom)); width: auto; transform: none !important; text-shadow: 0 1px 14px rgba(0, 0, 0, .95); }
  #label h2 { font-size: 22px; }
  #chapter { top: 13vh; }
}
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

/* Link between the two versions, for comparing */
#intro .swap { color: var(--bone-dim); border-bottom: 1px solid rgba(201, 146, 94, .55); padding-bottom: 2px; }
#intro .swap:hover { color: var(--bone); border-color: var(--ember); }

/* Controls fade when you are still; the label by the picture stays */
body.idle .hud { opacity: 0; }
body.idle #scene { cursor: none; }

#enter:disabled { opacity: .55; cursor: default; border-color: rgba(235, 228, 214, .18); letter-spacing: .2em; background: none; }

#intro .boot-detail { display: block; margin-top: 10px; opacity: .6; text-transform: none; letter-spacing: .04em; }

/* ── The walking ring ── */
#stick { position: fixed; left: clamp(18px, 3vw, 40px); bottom: max(26px, env(safe-area-inset-bottom)); z-index: 11; width: 78px; height: 78px; border-radius: 50%;
  border: 1px solid rgba(235, 228, 214, .26); background: radial-gradient(circle, rgba(5, 5, 5, .0) 40%, rgba(5, 5, 5, .35) 100%);
  display: grid; place-items: center; touch-action: none; cursor: grab; opacity: .75; transition: opacity 1.2s ease, border-color .3s, box-shadow .4s; }
/* four faint ticks: forward, back, left, right */
#stick::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background:
  linear-gradient(rgba(235, 228, 214, .5), rgba(235, 228, 214, .5)) 50% 0 / 1px 5px no-repeat, linear-gradient(rgba(235, 228, 214, .28), rgba(235, 228, 214, .28)) 50% 100% / 1px 5px no-repeat,
  linear-gradient(rgba(235, 228, 214, .28), rgba(235, 228, 214, .28)) 0 50% / 5px 1px no-repeat, linear-gradient(rgba(235, 228, 214, .28), rgba(235, 228, 214, .28)) 100% 50% / 5px 1px no-repeat; pointer-events: none; }
#stick i { width: 16px; height: 16px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px rgba(201, 146, 94, .7); transition: transform .35s var(--ease), box-shadow .3s; pointer-events: none; }
#stick:hover, #stick.on { opacity: 1; border-color: rgba(201, 146, 94, .7); }
#stick.on { cursor: grabbing; box-shadow: 0 0 26px rgba(201, 146, 94, .22); }
#stick.on i { transition: box-shadow .3s; box-shadow: 0 0 18px rgba(240, 200, 150, .95); }
body.pre #stick { opacity: 0; pointer-events: none; }
body.idle #stick { opacity: .3; }
@media (max-width: 720px) {
  /* on a phone the ring sits under the left thumb, and the picture label makes room for it */
  #stick { left: 18px; bottom: calc(104px + env(safe-area-inset-bottom)); width: 84px; height: 84px; opacity: .85; }
  body.idle #stick { opacity: .6; }
  #label { left: 118px; }
}

/* The ring is for touch screens only; with a mouse and keyboard it stays out of the way */
@media (hover: hover) and (pointer: fine) { #stick { display: none; } }
