/* gate */
.gated { overflow: hidden; }
#gate {
  --l: 0;
  position: fixed; inset: 0; z-index: 950; overflow: hidden; isolation: isolate;
  background: var(--void);
  display: grid; place-items: center; text-align: center;
}
html:not(.js) #gate, html.lit-before #gate { display: none; }
#gate .inner { display: grid; justify-items: center; padding: 24px; }

.lamp {
  position: relative; width: clamp(230px, min(32vw, 54vh), 420px); aspect-ratio: 600 / 774; cursor: pointer;
  --tx: -999px; --ty: -999px; --tr: 0px; --f: 0;
}
.lamp img, .lamp-flame { position: absolute; display: block; pointer-events: none; }
.lamp img { inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
.lamp .lamp-torch {
  -webkit-mask: radial-gradient(circle var(--tr) at var(--tx) var(--ty), rgba(0,0,0,.95), rgba(0,0,0,.45) 45%, rgba(0,0,0,0));
  mask: radial-gradient(circle var(--tr) at var(--tx) var(--ty), rgba(0,0,0,.95), rgba(0,0,0,.45) 45%, rgba(0,0,0,0));
  transition: opacity .8s;
}
.lamp .lamp-lit { opacity: var(--l); }
.lamp-flame {
  left: 41%; top: 36.693%; width: 18%; height: 18.605%;
  background: url("../img/lamp/flame.webp") 0 0 / 400% 100% no-repeat;
  background-position: calc(var(--f) * 33.3333%) 0;
  opacity: var(--candle, 0);
}
#gate.lit .lamp { cursor: default; }
#gate.lit .lamp-torch { opacity: 0; }

#gate .choices { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: center; align-items: center; min-height: 40px; margin-top: clamp(14px, 3.5vh, 34px); }
#gate button {
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font-family: var(--typed); font-size: clamp(24px, 2.6vw, 38px); letter-spacing: .04em; word-spacing: .46em; text-transform: uppercase;
  color: var(--bone);
  display: inline-flex; align-items: center; gap: .55em;
}
#gate kbd { font-size: .5em; padding: .45em .55em .35em; border-radius: 4px; }
#gate button:hover, #gate button:focus-visible { color: var(--flame); }
#gate button:focus-visible { outline: none; }
@media (hover: none) and (pointer: coarse) { #gate kbd { display: none; } }
#gate.lit .choices { transition: opacity .5s; opacity: 0; }
#gate.gone { animation: gatefade 1s ease-in forwards; }
@keyframes gatefade { to { opacity: 0; visibility: hidden; } }

kbd {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0; line-height: 1;
  display: inline-block; min-width: 1.9em; padding: 4px 5px 3px; text-align: center;
  border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 3px; opacity: .85;
}

/* hand light + lights off */
.handlight {
  position: fixed; left: 0; top: 0; z-index: 960; width: 0; height: 0; pointer-events: none;
  opacity: 0; transition: opacity .4s;
}
.handlight::before {
  content: ""; position: absolute; left: -170px; top: -170px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,196,128,.13), rgba(255,170,90,.05) 45%, rgba(255,160,80,0));
  mix-blend-mode: screen; transform: scale(var(--hs, 1));
}
html.has-hand .handlight { opacity: 1; }
html.lights-off .handlight::before { background: radial-gradient(closest-side, rgba(255,196,128,.2), rgba(255,170,90,.07) 50%, rgba(255,160,80,0)); }
.night {
  --mx: 50vw; --my: 45vh; --nr: 190px;
  position: fixed; inset: 0; z-index: 850; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle var(--nr) at var(--mx) var(--my), rgba(3,2,2,0), rgba(3,2,2,.55) 52%, rgba(3,2,2,.975));
}
html.lights-off .night { opacity: 1; }

/* top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 870;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px var(--gutter) 22px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4,5,4,.85), rgba(4,5,4,.45) 60%, rgba(4,5,4,0));
}
.home .bar { background: linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,0)); }
.bar > * { pointer-events: auto; }
.bar .mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bone); opacity: .8; }
.bar .mark:hover { opacity: 1; }
.bar .mark img { width: 22px; height: auto; }
.bar .mark span { font-family: var(--typed); font-size: 17px; letter-spacing: 0; word-spacing: .46em; }
.home .bar .mark span { display: none; }
.bar .tools { display: flex; align-items: center; gap: 4px 20px; }
.bar .tools a, .bar .tools .to-steam {
  color: var(--bone-dim); text-decoration: none; background: none; border: 0; cursor: pointer;
  font-family: var(--typed); font-size: 17px; letter-spacing: 0; word-spacing: .46em; white-space: nowrap;
  padding: 10px 0; min-height: 36px; display: inline-flex; align-items: center; gap: 8px;
}
.bar .tools a:hover, .bar .tools a[aria-current="page"] { color: var(--bone); }
.bar .tools .to-steam { border: 1px solid rgba(255,178,90,.5); color: var(--flame); padding: 6px 12px 5px; background: rgba(4,5,4,.6); }
@media (max-width: 600px) {
  .bar .mark span { display: none; }
  .bar .tools { gap: 4px 14px; }
}
@media (max-width: 480px) { .home .bar .tools a[href="devlog.html"], .home .bar .tools a[href="credits.html"] { display: none; } }

/* steam button */
.steam {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--bone); color: var(--void);
  padding: 15px 22px 14px; text-decoration: none;
  font-family: var(--typed); font-size: 19px; letter-spacing: .04em; word-spacing: .46em; text-transform: uppercase; -webkit-text-stroke: .5px currentColor;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.9);
  clip-path: polygon(0 3%, 3% 0, 97% 2%, 100% 8%, 99% 94%, 96% 100%, 4% 98%, 0 91%);
  transition: background .2s;
}
.steam:hover, .steam:focus-visible { background: var(--flame); }
.steam.soon, .steam.soon:hover { background: var(--bone); cursor: default; }

/* pictures */
body.home { background: #000; }
.show { position: relative; padding: 0; }
.show:focus { outline: none; }
.frame { position: relative; aspect-ratio: 1400 / 654; background: #000; overflow: hidden; }
.frame::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; z-index: 2; pointer-events: none;
  background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,.25) 55%, rgba(0,0,0,0));
}
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.4s ease-in-out; }
.slide.on { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: contain; filter: brightness(var(--arrive, 1)); transition: filter .12s; }
.slide::before { content: ""; position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; transition: opacity .05s; pointer-events: none; }
.slide .bulb {
  position: absolute; left: 71.4%; top: 5%; width: 30%; aspect-ratio: 1;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, rgba(225,240,210,.14), rgba(0,0,0,0) 60%);
  mix-blend-mode: screen;
}
.slide .bulb.dip { opacity: 0; }
.slide:has(.bulb.dip)::before { opacity: .38; }

.caption {
  position: absolute; z-index: 3; left: 50%; bottom: clamp(14px, 4.6%, 42px); transform: translateX(-50%);
  width: min(92%, 900px); text-align: center; pointer-events: none;
  text-shadow: 0 1px 10px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8);
  transition: opacity 1.1s ease-in-out;
}
.caption.out { opacity: 0; }

/* which picture: one dot each, at the top in line with the bar */
.dots { position: absolute; z-index: 875; top: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 0; }
.dots button { width: 19px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots button::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(217,210,189,.65); transition: background .3s, border-color .3s; }
.dots button:hover::before { border-color: var(--bone); }
.dots button[aria-current="true"]::before { background: var(--bone); border-color: var(--bone); }
.dots button:focus-visible { outline: none; }
.dots button:focus-visible::before { border-color: var(--flame); box-shadow: 0 0 0 2px var(--flame); }
.caption { font-family: var(--typed); word-spacing: .46em; }
.caption .big { margin: 0; font-size: clamp(18px, 1.8vw, 31px); line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; color: var(--bone); }
.caption .small { margin: .3em 0 0; font-size: clamp(15px, 1.4vw, 24px); line-height: 1.4; letter-spacing: 0; color: var(--bone-dim); }

/* logo + wishlist */
.call {
  display: grid; justify-items: center; text-align: center;
  padding: clamp(110px, calc(100vh - 46.72vw + 30px), 42vh) var(--gutter) 0;
  padding-top: clamp(110px, calc(100svh - 46.72vw + 30px), 42svh);
}
.call h1 { margin: 0 0 clamp(26px, 4vw, 44px); width: min(720px, 84vw); }
.call h1 picture, .call h1 img { display: block; width: 100%; height: auto; }
.call .when { margin: 18px 0 0; font-family: var(--typed); font-size: 17px; line-height: 1.5; letter-spacing: 0; word-spacing: .46em; color: var(--bone-dim); }
.call .when b { display: block; margin-top: .3em; font-weight: 400; -webkit-text-stroke: .4px currentColor; color: var(--bone); }
html.js .call h1 { opacity: 0; }
html.js .call .steam, html.js .call .when { opacity: 0; transition: opacity 1s ease; }
html.js .call.lit h1, html.js .call.lit .steam, html.js .call.lit .when { opacity: 1; }
html.js .call.lit .when { transition-delay: .3s; }

/* prints on the line */
.darkroom { position: relative; z-index: 860; margin-top: clamp(80px, 13vh, 150px); display: grid; justify-items: center; gap: clamp(18px, 3vh, 30px); }
.switch {
  position: relative; z-index: 3; max-width: calc(100% - 2 * var(--gutter));
  background: none; border: 0; cursor: pointer; padding: 6px 2px;
  color: var(--bone); font-family: var(--typed); font-size: clamp(19px, 2vw, 27px); letter-spacing: 0; word-spacing: .46em; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
}
.switch kbd { font-size: .5em; word-spacing: 0; padding: .45em .55em .35em; border-radius: 4px; }
.switch:hover, .switch:focus-visible { color: var(--flame); }
.switch:focus-visible { outline: none; }
@media (hover: none) and (pointer: coarse) { .switch kbd { display: none; } }
.line { justify-self: stretch; position: relative; height: 330px; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.line.dragging { cursor: grabbing; }
.reel { position: absolute; left: 0; top: 0; height: 100%; will-change: transform; }
.string { position: absolute; left: 0; top: 0; height: 90px; pointer-events: none; overflow: visible; }
.string path { fill: none; stroke: #6f6452; stroke-width: 1.4; stroke-linecap: round; }
.prints { list-style: none; margin: 0; padding: 0; display: flex; width: max-content; }
.prints li { flex: none; width: 200px; margin-right: 170px; padding-top: 40px; transform: translateY(var(--drop, 0px)); }
.print {
  position: relative; display: block;
  box-shadow: 0 18px 24px -12px rgba(0,0,0,.95), 0 2px 4px rgba(0,0,0,.55);
  transform-origin: 50% -14px; transform: rotate(var(--rot, 0deg));
  transition: filter .3s;
}
.print .photo { display: block; position: relative; aspect-ratio: 1116 / 1374; }
.print .photo img { display: block; width: 100%; height: 100%; pointer-events: none; }
/* black until the lights go off */
.print .photo::after { content: ""; position: absolute; left: 5.2%; top: 5.39%; width: 89.6%; height: 72.78%; background: #070707; transition: opacity .5s; }
html.lights-off .print .photo::after { opacity: 0; transition: opacity 3.5s ease-in .3s; }
.print .peg {
  position: absolute; left: 50%; top: -21px; z-index: 2; width: 9px; height: 30px; margin-left: -4.5px;
  background: linear-gradient(90deg, #4e3a22, #86684a 45%, #5e4629 70%, #3f2f1b); border-radius: 2px;
  box-shadow: 0 3px 4px rgba(0,0,0,.55);
}
.print .peg::after { content: ""; position: absolute; left: -1px; right: -1px; top: 11px; height: 2px; background: #2d2a25; }
html.lights-off .print { filter: sepia(1) saturate(2.6) hue-rotate(-40deg) brightness(.7); }
html.lights-off .string path { stroke: #6a2018; }
html.lights-off .switch { color: #b0473a; }

@media (max-width: 860px) {
  .line { height: 262px; }
  .prints li { width: 156px; margin-right: 96px; }
  .slide .bulb { display: none; }
}
/* phones: captions under the picture */
@media (max-width: 700px) {
  .show { padding-top: 60px; }
  .dots { top: 62px; }
  .call { padding-top: 120px; }
  .frame::before { display: none; }
  .caption { position: static; transform: none; width: auto; min-height: 4.6em; padding: 14px var(--gutter) 0; text-shadow: none; }
  .caption .big { font-size: 16px; }
  .caption .small { font-size: 15px; }
  .call .when { font-size: 15px; text-wrap: balance; }
}

/* footer */
.foot { background: var(--void); padding: 60px var(--gutter) 40px; color: var(--ash); font-size: 13px; border-top: 1px solid #16170f; position: relative; }
.home .foot { margin-top: 40px; }
.foot .inner { max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.foot nav a { color: var(--bone-dim); text-decoration: none; font-size: 15px; border-bottom: 1px solid rgba(156,150,138,.4); }
.foot nav a:hover { color: var(--bone); }
.foot .small { line-height: 1.6; max-width: 70em; margin: 0; }
