/* Kontext Window Studio */

:root {
  --bg: #000;
  --ink: #ebe8e3;
  --ink-2: #8e8a84;
  --ink-3: #4a4844;
  --line: rgba(235, 232, 227, 0.14);
  --accent: #3a8dff;
  --font-display: "Panchang", "Arial Black", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter);
}
.wordmark {
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
}
.site-nav { display: flex; gap: 36px; margin-left: auto; }
.site-nav a {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2); transition: color .2s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Home ---------- */
.home {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.home main {
  position: relative; z-index: 1;
  overflow-x: clip;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: clamp(40px, 8vh, 100px);
  padding: clamp(24px, 5vh, 72px) var(--gutter) clamp(32px, 6vh, 64px);
}
.headline {
  font-family: "Tanker", var(--font-display); font-weight: 400;
  font-size: min(15vw, 18.5svh);   /* scales with the monitor, but never more than about half its height */
  line-height: 0.9; letter-spacing: 0.01em;
  text-transform: uppercase;
}
.headline .line { display: block; }

/* Headline: the text is drawn once into a stencil image. Solid letters and
   the video both show through that stencil. No blend modes, so it stays
   light even when the browser renders without the graphics card. */
.hero-title {
  --ease: cubic-bezier(.65, 0, .25, 1);
  position: relative; display: block; align-self: stretch;
}
.hero-title .headline { text-align: center; color: var(--ink); }
.hero-title.ready .headline { color: transparent; }   /* the stencil takes over once drawn */
.hero-title .line > span { display: inline-block; }
.stencil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  -webkit-mask-image: var(--stencil); mask-image: var(--stencil);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
/* Solid letters: stretch with a cheap transform. On leaving, they fade back in first, then shrink. */
.stencil-solid {
  background: var(--ink);
  transform-origin: 50% 50%; will-change: transform;
  transition: opacity .35s ease, transform .6s var(--ease) .3s;
}
.hero-title.reveal .stencil-solid {
  transform: scaleX(var(--k, 1)); opacity: 0;
  transition: transform .6s var(--ease), opacity .45s ease .5s;
}
/* Video letters: always at the stretched width, they only fade in once the stretch is done */
.stencil-video {
  opacity: 0; background: #4a4540;   /* warm grey base keeps letters visible in dark shots */
  -webkit-mask-size: calc(var(--k, 1) * 100%) 100%; mask-size: calc(var(--k, 1) * 100%) 100%;
  transition: opacity .35s ease;
}
.stencil-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.hero-title.reveal .stencil-video { opacity: 1; transition: opacity .45s ease .5s; }


/* Film index */
.index-label {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 18px;
}
.index-list { border-top: 1px solid var(--line); }
.index-list a {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto;
  gap: 8px 40px; align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.index-list .t {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 2.8vw, 42px); line-height: 1.1;
  transition: color .35s;
}
.index-list .d { color: var(--ink-2); transition: color .35s; }
.index-list .y { color: var(--ink-2); font-size: 14px; letter-spacing: 0.1em; }
.index-list:hover a:not(:hover) .t,
.index-list:hover a:not(:hover) .d { color: var(--ink-3); }

/* Still that fades in behind the page on hover */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.backdrop img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04);
  transition: opacity .7s ease, transform 1.6s ease;
}
.backdrop img.on { opacity: 0.38; transform: scale(1); }

.home .site-footer { position: relative; z-index: 1; margin-top: 0; }

/* ---------- Films ---------- */
.films { display: grid; gap: clamp(64px, 10vw, 140px); }
.film { display: grid; gap: 24px; scroll-margin-top: 32px; }
.film-still { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0d0d0d; }
.film-still img { width: 100%; height: 100%; object-fit: cover; }
.film-info { display: grid; grid-template-columns: 1fr 2fr; gap: 8px 40px; align-items: baseline; }
.film-info h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2.4vw, 34px); letter-spacing: 0.01em; line-height: 1.1;
}
.film-info .year { color: var(--ink-2); font-size: 14px; letter-spacing: 0.1em; grid-column: 1; }
.film-info .desc { color: var(--ink-2); grid-column: 2; grid-row: 1 / span 2; max-width: 520px; }

/* Click-to-play YouTube */
.player { cursor: pointer; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 14px;
  padding: 18px 34px 18px 30px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(235,232,227,0.55); border-radius: 999px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font: 500 18px var(--font-body);
  letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.play::before {
  content: ""; border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent currentColor;
}
.player img { transition: filter .4s; }
.player:hover img { filter: brightness(0.75); }
.player:hover .play {
  background: var(--ink); color: #000; border-color: var(--ink);
  transform: translate(-50%, -50%) scale(1.04);
}

/* ---------- Inner pages ---------- */
.page { padding: clamp(64px, 12vh, 140px) var(--gutter) clamp(80px, 12vh, 140px); }
.page-title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(28px, 4vw, 56px); line-height: 1; margin-bottom: clamp(40px, 6vw, 80px);
}
.lead { font-size: clamp(22px, 2.6vw, 38px); line-height: 1.35; max-width: 1000px; }
.email {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 4vw, 60px); word-break: break-all;
  border-bottom: 2px solid var(--line); transition: border-color .2s;
}
.email:hover { border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 14px; color: var(--ink-2);
}
.site-footer a:hover { color: var(--ink); }

/* Gentle fade-in on load */
main { animation: fade 0.8s ease-out both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .headline { font-size: 29vw; }
  .site-header { padding: 20px var(--gutter); }
  .site-nav { gap: 20px; }
  .site-nav a { font-size: 12px; letter-spacing: 0.12em; }
  .wordmark { font-size: 11px; letter-spacing: 0.12em; white-space: nowrap; }
  .site-header:has(.wordmark) { flex-wrap: wrap; row-gap: 14px; }
  .site-header:has(.wordmark) .site-nav { margin-left: 0; width: 100%; }
  .index-list a { grid-template-columns: 1fr auto; padding: 22px 0; }
  .index-list .d { grid-column: 1 / -1; grid-row: 2; }
  .film-info { grid-template-columns: 1fr; }
  .film-info .desc { grid-column: 1; grid-row: auto; }
  .play { padding: 13px 24px 13px 21px; font-size: 15px; gap: 11px; }
}

@media (hover: none) { .backdrop { display: none; } }

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  * { transition: none !important; }
}
