/* Halden Coachworks: the work gallery with the Next cursor */
:root {
  --black: #000000;          /* the Next tag */
  --dark: #191919;           /* behind the photos */
  --grey: #f0f0f0;           /* small words */
  --white: #ffffff;          /* titles */
  --line: rgba(255, 255, 255, 0.1); /* thin rules */
  --sans: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  --mono: "Geist Mono Variable", "Geist Mono", ui-monospace, monospace;
  --pad: clamp(14px, min(3vw, 4.2vh), 36px);
  --title: clamp(20px, min(5.4vw, 7vh), 62px); /* the caption title: on width AND height */
}

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

html, body { height: 100%; }

body {
  background: var(--dark);
  color: var(--white);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

.mono {
  font-family: var(--mono);
  font-size: clamp(9.5px, min(1vw, 1.5vh), 12px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
}

/* ------------------------------------------------------------------ the stage */
.stage {
  position: fixed;
  inset: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--dark);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* a soft dark band under the words, top and bottom */
.stage__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 22%),
    linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0) 46%);
}

/* fine film grain over everything, shifted a little every few frames */
.stage__grain {
  position: absolute; inset: -40px; pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ header */
.bar {
  position: absolute; left: var(--pad); right: var(--pad); top: var(--pad);
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
}
.brand { display: flex; flex-direction: column; gap: 0.42em; }
.brand__name {
  font-size: clamp(15px, min(2vw, 3vh), 22px);
  font-weight: 560;
  font-stretch: 112%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
}
.brand__sub { opacity: 0.6; }
.bar__right { opacity: 0.6; padding-top: 0.2em; }

/* ------------------------------------------------------------------ caption */
.cap {
  position: absolute; left: var(--pad); bottom: var(--pad);
  max-width: min(64vw, 720px);
  pointer-events: none;
}
.cap__kind { opacity: 0.6; margin-bottom: clamp(8px, 1.6vh, 14px); }
.cap__title {
  font-size: var(--title);
  font-weight: 500;
  font-stretch: 96%;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.cap__data {
  display: flex; gap: clamp(14px, 2.4vw, 32px);
  margin-top: clamp(10px, 2.2vh, 20px);
  padding-top: clamp(8px, 1.6vh, 12px);
  border-top: 1px solid var(--line);
}
.cap__data div { display: flex; gap: 0.8em; }
.cap__data dt { opacity: 0.45; }
.cap__data dd { color: var(--grey); }

.ch { display: inline; }

/* ------------------------------------------------------------------ the hit area of the thumbnail (keyboard and taps) */
.hit {
  position: absolute; left: 0; top: 0;
  width: 10px; height: 10px;
  cursor: pointer;
  border-radius: 1px;
}
.hit:focus-visible { outline: 1px solid var(--white); outline-offset: 3px; }

/* ------------------------------------------------------------------ the black Next tag */
.tag {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  will-change: transform;
}
.tag__in {
  display: flex; align-items: center; gap: 0.9em;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: clamp(9px, min(0.9vw, 1.4vh), 11px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
  padding: 4px 8px 3px;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.tag__job { opacity: 0.5; }

/* ------------------------------------------------------------------ the drawn pointer of the self-running tour */
.ghost {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
.ghost__in {
  display: block;
  width: 18px; height: 22px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

/* narrow boxes: the tag keeps only the word Next */
@media (max-width: 520px) {
  .tag__job { display: none; }
  .bar__right { display: none; }
  .cap { max-width: calc(100% - 120px); }
  .cap__data { flex-direction: column; gap: 6px; }
}
