:root {
  --bg: #000;
  --ink: #f4efe6;
  --muted: rgba(244, 239, 230, 0.56);
  --faint: rgba(244, 239, 230, 0.18);
  --red: #e3261b;
  --font: shzc, "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

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

/* A soft pool of light behind the viewer that falls away to black at the edges, where it meets the
   view through the eyepiece. The 3D canvas is transparent, so the shadows land on this. */
body {
  background:
    radial-gradient(ellipse 62% 58% at 50% 44%, #262524 0%, #161515 36%, #080808 70%, #000 100%) fixed,
    #000;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

a { color: inherit; }

.hk-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The header lives in site-header.css (shared with the project pages). */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Browse overlay ---------------------------------------------------------- */

.hk-browse { transition: opacity 0.5s, visibility 0.5s; }

.hk-caption {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(90vw, 640px);
  text-align: center;
  pointer-events: none;
}
.hk-caption .num {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.hk-caption .title {
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hk-caption .hint {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hk-index {
  position: fixed;
  z-index: 5;
  left: var(--gutter);
  bottom: 26px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hk-index-head {
  margin: 0 0 10px;
  color: var(--muted);
  letter-spacing: 0.24em;
  font-size: 11px;
}
.hk-index ol { list-style: none; margin: 0; padding: 0; }
.hk-index a {
  display: flex;
  gap: 12px;
  padding: 3px 0;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}
.hk-index a .n { width: 2ch; color: rgba(244, 239, 230, 0.34); }
.hk-index a:hover,
.hk-index a.is-active { color: var(--ink); transform: translateX(4px); }
.hk-index a.is-active .n { color: var(--red); }

@media (max-width: 1000px), (max-height: 640px) {
  .hk-index { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* Viewing overlay --------------------------------------------------------- */

.hk-view {
  position: fixed;
  z-index: 12;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s, visibility 0.45s;
}
.hk-view > * { pointer-events: auto; }

body.is-viewing .hk-view { opacity: 1; visibility: visible; }
body.is-viewing .hk-header,
body.is-viewing .hk-browse,
body.is-busy .hk-browse { opacity: 0; visibility: hidden; }
body.is-viewing #stage { cursor: pointer; }
body.is-busy #stage { cursor: progress; }

.hk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: rgba(10, 9, 9, 0.55);
  border: 1px solid var(--faint);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}
.hk-btn:hover { border-color: rgba(244, 239, 230, 0.6); background: rgba(24, 21, 20, 0.7); }
.hk-btn.hk-sound { font-size: 13px; letter-spacing: 0.14em; color: var(--ink); }

.hk-eject {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: var(--gutter);
}
.hk-view-tools {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: var(--gutter);
  display: flex;
  gap: 10px;
}

.hk-counter {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
}
.hk-counter-text {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  min-width: 180px;
  text-align: center;
  text-transform: uppercase;
}
.hk-counter-text .title { font-size: 20px; letter-spacing: 0.06em; }
.hk-counter-text .count { font-size: 12px; letter-spacing: 0.24em; color: var(--muted); }
.hk-step {
  width: 40px;
  height: 40px;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: rgba(10, 9, 9, 0.5);
  border: 1px solid var(--faint);
  border-radius: 50%;
  cursor: pointer;
}
.hk-step:hover { border-color: rgba(244, 239, 230, 0.6); }

.hk-view-hint {
  position: absolute;
  left: 50%;
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 62px);
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.6s;
}
.hk-view-hint.is-used { opacity: 0; }

/* Phones held sideways: every control goes in one row along the top, so the picture gets the
   rest of the screen. */
@media (max-height: 599px) and (orientation: landscape) {
  .hk-eject,
  .hk-view-tools { top: max(10px, env(safe-area-inset-top)); }
  .hk-eject { left: max(12px, env(safe-area-inset-left)); }
  .hk-view-tools { right: max(12px, env(safe-area-inset-right)); }
  .hk-counter {
    top: max(10px, env(safe-area-inset-top));
    bottom: auto;
    gap: 12px;
  }
  .hk-counter-text { min-width: 0; gap: 2px; }
  .hk-counter-text .title { font-size: 15px; }
  .hk-counter-text .count { font-size: 10px; }
  .hk-step { width: 34px; height: 34px; font-size: 20px; }
  .hk-btn { padding: 8px 12px; font-size: 12px; }
  .hk-view-hint,
  .hk-view-tools .hk-sound { display: none; }
}

@media (max-width: 700px) {
  .hk-view-hint { display: none; }
  .hk-full .label-long { display: none; }
  .hk-btn { padding: 9px 13px; font-size: 12px; }
  .hk-view-tools .hk-sound { display: none; }
}

/* Grid view: same header and backdrop, project covers in place of the reels ------- */

.hk-grid { display: none; }
html.is-grid,
html.is-grid body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
html.is-grid #stage,
html.is-grid .hk-browse,
html.is-grid .hk-view,
html.is-grid .hk-loader,
html.is-grid .hk-iris { display: none; }
html.is-grid .hk-header {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.6) 65%, transparent);
  padding-bottom: 28px;
}
html.is-grid .hk-grid {
  display: block;
  max-width: 1400px;
  margin: 0 auto;
  padding: 120px var(--gutter) 72px;
}
.hk-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(20px, 3vw, 40px) clamp(16px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hk-grid-list a {
  display: grid;
  gap: 12px;
  text-decoration: none;
  color: var(--muted);
}
.hk-grid-img {
  display: block;
  overflow: hidden;
  aspect-ratio: 202 / 158;
  border-radius: 6px;
  background: #111;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.hk-grid-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hk-grid-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.hk-grid-meta .n { color: rgba(244, 239, 230, 0.34); }
.hk-grid-list a:hover,
.hk-grid-list a:focus-visible { color: var(--ink); }
.hk-grid-list a:hover .n,
.hk-grid-list a:focus-visible .n { color: var(--red); }
.hk-grid-list a:hover img,
.hk-grid-list a:focus-visible img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .hk-grid-img img { transition: none; } }

/* Phones: covers run the full width of the screen. */
@media (max-width: 600px) {
  html.is-grid .hk-grid { padding: 96px 0 48px; }
  .hk-grid-list { gap: 28px; }
  .hk-grid-img { border-radius: 0; box-shadow: none; }
  .hk-grid-meta { padding: 0 16px; }
}

/* Video player -------------------------------------------------------------- */

.hk-player {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 72px 16px 24px;
  background: rgba(5, 4, 4, 0.92);
  animation: hk-player-in 0.3s ease-out;
}
.hk-player[hidden] { display: none; }
.hk-player-close {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: var(--gutter);
}
.hk-player-frame {
  width: min(100%, 1280px, calc((100vh - 120px) * var(--aspect, 1.7778)));
  aspect-ratio: var(--aspect, 16 / 9);
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.hk-player-frame iframe,
.hk-player-frame video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
@keyframes hk-player-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hk-player { animation: none; } }

/* Transitions, loader ---------------------------------------------- */

.hk-iris {
  position: fixed;
  z-index: 11;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.hk-loader {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.9s 0.1s, visibility 0.9s 0.1s;
}
.hk-loader p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
body:not(.is-loading) .hk-loader { opacity: 0; visibility: hidden; }

.hk-loader-reel {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg) 0 8%, #f2ecdf 9% 18%, var(--red) 19% 36%, #f2ecdf 37% 100%);
  position: relative;
  animation: hk-advance 2.1s steps(7) infinite;
}
.hk-loader-reel::before {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background: repeating-conic-gradient(from -10deg, #2a2521 0 20deg, transparent 20deg 51.43deg);
  -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 63% 97%, transparent 98%);
  mask: radial-gradient(circle, transparent 0 62%, #000 63% 97%, transparent 98%);
}
@keyframes hk-advance { to { transform: rotate(360deg); } }

.hk-fallback {
  position: fixed;
  inset: auto 0 40% 0;
  text-align: center;
  font-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .hk-loader-reel { animation: none; }
}

