/* =========================================================
   Aris Kragsterman — portfolio
   Dark indie / psychological cinema + neofolk warmth.
   The artwork supplies the colour; the background transitions
   to vaguely match whatever work is on screen.
   ========================================================= */

:root {
  --ink:      #0a0908;
  --ink-2:    #100d0b;
  --bone:     #e9e0d2;
  --bone-dim: #a99f8f;
  --ash:      #6f665a;
  --rust:     #b5502a;
  --blood:    #6e2418;
  --amber:    #c9832f;
  --line:     rgba(233, 224, 210, 0.14);
  --serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fade: 0.45s;   /* shared hover darken/lighten fade — same for every hoverable work */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* colour-transition backdrop — JS sets --c1/--c2 from artwork colours; CSS eases them */
@property --c1 { syntax: "<color>"; inherits: false; initial-value: #0a0908; }
@property --c2 { syntax: "<color>"; inherits: false; initial-value: #0a0908; }
.bg-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --c1: #0a0908; --c2: #0a0908;
  background: linear-gradient(118deg, var(--c1) 0%, var(--c2) 100%);
  transition: --c1 0.7s linear, --c2 0.7s linear;
}

/* overlays */
.grain {
  position: fixed; inset: -50%; z-index: 9998; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.6s steps(3) infinite;
}
@keyframes grain-shift { 0%{transform:translate(0,0)} 33%{transform:translate(-2%,1%)} 66%{transform:translate(1%,-2%)} 100%{transform:translate(0,0)} }
.vignette { position: fixed; inset: 0; z-index: 9997; pointer-events: none; box-shadow: inset 0 0 22vw rgba(0,0,0,0.72); }

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  mix-blend-mode: difference;
}
.nav__mark { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.12em; color: #fff; text-decoration: none; }
.nav__links { display: flex; gap: clamp(0.8rem, 2.2vw, 1.8rem); }
.nav__links a { color: #fff; text-decoration: none; font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.85; transition: opacity 0.3s var(--ease); }
.nav__links a:hover { opacity: 1; }
.nav__links a[data-soon] { opacity: 0.4; }

/* hero */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 6vw, 6rem);
  overflow: hidden;
}
.hero__reel { position: absolute; inset: 0; z-index: 0; overflow: hidden; opacity: 0.16; }
.hero__reel-track {
  position: absolute; left: 0; right: 0; top: -50%; height: 200%;
  background-image:
    repeating-linear-gradient(0deg, rgba(233,224,210,0.10) 0 3px, transparent 3px 220px),
    radial-gradient(circle, rgba(233,224,210,0.18) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(233,224,210,0.18) 0 5px, transparent 6px);
  background-size: 100% 220px, 30px 46px, 30px 46px;
  background-position: 0 0, 24px 0, calc(100% - 24px) 0;
  background-repeat: repeat, repeat-y, repeat-y;
  animation: reel 26s linear infinite;
}
@keyframes reel { to { background-position: 0 220px, 24px 46px, calc(100% - 24px) 46px; } }
.hero__reel-tag {
  position: absolute; right: 1.2rem; bottom: 1rem;
  font-size: 0.55rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ash);
}
.hero__frame { position: relative; z-index: 1; max-width: 68rem; }
.hero__eyebrow { font-size: 0.8rem; letter-spacing: 0.42em; text-transform: uppercase; color: var(--rust); margin: 0 0 1.4rem; }
.hero__name { font-family: var(--serif); font-weight: 300; font-size: clamp(3.2rem, 13vw, 12rem); line-height: 0.92; letter-spacing: -0.02em; margin: 0; }
.hero__name span { display: block; }
.hero__name-last { font-style: italic; font-weight: 500; color: transparent; -webkit-text-stroke: 1px var(--bone-dim); }
.hero__statement { margin: 2.2rem 0 0; max-width: 34rem; font-size: clamp(1.05rem, 2vw, 1.4rem); color: var(--bone-dim); font-style: italic; font-family: var(--serif); }
.hero__cue { position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.7rem; font-size: 0.62rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--ash); z-index: 1; }
.hero__cue-line { width: 1px; height: 3.2rem; background: linear-gradient(var(--rust), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0%,100%{transform:scaleY(0.4);opacity:0.4} 50%{transform:scaleY(1);opacity:1} }

/* section framing */
.collage-section, .strip-section, .films-section { position: relative; z-index: 1; }
.collage-section { padding: clamp(4rem, 12vw, 12rem) 0 clamp(4rem, 10vw, 9rem); }
.collage-intro { padding: 0 clamp(1.2rem, 6vw, 6rem); max-width: 52rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.section-title { font-family: var(--serif); font-weight: 300; font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1; margin: 0 0 1rem; letter-spacing: -0.01em; }
.section-lede { color: var(--bone-dim); max-width: 34rem; font-size: clamp(0.98rem, 1.4vw, 1.1rem); margin: 0; }
.collage-foot { text-align: center; color: var(--ash); font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase; margin: clamp(3rem, 8vw, 6rem) 1rem 4rem; position: relative; z-index: 1; }

/* ---------- collage ---------- */
.collage { position: relative; width: 100%; }
.tile { position: absolute; top: 0; will-change: transform; }
.tile-inner {
  position: relative;
  transform: translate(var(--ex,0px), var(--ey,40px)) rotate(var(--rot,0deg)) scale(0.92);
  opacity: 0; filter: brightness(0.82) saturate(0.92);
  transition: transform 1.2s var(--ease), opacity 1.2s var(--ease), filter var(--fade) var(--ease);
  cursor: pointer;
}
.tile.in .tile-inner { transform: translate(0px,0px) rotate(var(--rot,0deg)) scale(1); opacity: 1; }
.tile img { display: block; width: 100%; height: auto; border-radius: 1px; box-shadow: 0 2px 6px rgba(0,0,0,0.5), 0 20px 50px rgba(0,0,0,0.55); }

.collage.has-hover .tile-inner { filter: brightness(0.38) saturate(0.55); }
.tile.is-hot { z-index: 9999 !important; }
.tile.is-hot .tile-inner { transform: rotate(0deg) scale(1.07); filter: brightness(1.06) saturate(1.06); }
.tile.is-hot img { box-shadow: 0 8px 20px rgba(0,0,0,0.65), 0 44px 110px rgba(0,0,0,0.82), 0 0 0 1px rgba(201,131,47,0.28); }
/* Twin Smoke: only the image twists a half-turn — the caption stays upright */
.tile.tile--twist .tile-inner img { transition: transform 0.95s var(--ease), box-shadow 0.45s var(--ease); }
.tile.tile--twist.is-hot .tile-inner img { transform: rotate(180deg); }

/* ---------- shared hover focus (used by every hoverable artwork) ---------- */
/* a full-screen scrim dims + desaturates everything except the focused work */
.focus-scrim {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: rgba(7,5,4,0.66); backdrop-filter: saturate(0.28) brightness(0.72);
  -webkit-backdrop-filter: saturate(0.28) brightness(0.72);
  transition: opacity var(--fade) var(--ease);
}
body.is-focusing .focus-scrim { opacity: 1; }
/* the section that owns the focused work rises above the scrim */
.focus-host { z-index: 3 !important; }
/* siblings of the focused work (outside the collage) dim to match the collage */
.sec-focusing .comic:not(.is-hot),
.sec-focusing .strip-item:not(.is-hot),
.sec-focusing .film:not(.is-hot) { filter: brightness(0.38) saturate(0.55); }

.tile figcaption {
  position: absolute; left: 2px; bottom: -2.5rem;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  white-space: nowrap; pointer-events: none;
}
.tile.is-hot figcaption { opacity: 1; transform: translateY(0); }
.tile figcaption b {
  display: block; font-family: var(--serif); font-style: italic; font-size: 0.98rem;
  color: var(--cap, var(--bone));
  text-shadow: 0 1px 2px rgba(0,0,0,0.95), 0 2px 12px rgba(0,0,0,0.85), 0 0 26px rgba(0,0,0,0.7);
}
.tile figcaption span {
  font-size: 0.56rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--bone-dim);
  text-shadow: 0 1px 2px rgba(0,0,0,0.95), 0 1px 9px rgba(0,0,0,0.85);
}

/* ---------- comics (stacked covers) ---------- */
.comics-grid { display: flex; flex-wrap: wrap; gap: clamp(2rem, 6vw, 5rem); padding: 0 clamp(1.2rem, 6vw, 6rem); align-items: flex-start; }
.comic { margin: 0; transition: filter var(--fade) var(--ease); }
.comic.is-hot { z-index: 5; }
.comic.is-hot .comic__page { box-shadow: 0 8px 20px rgba(0,0,0,0.62), 0 46px 110px rgba(0,0,0,0.82); }
.comic__stack { position: relative; display: inline-block; cursor: pointer; }
.comic__page { display: block; height: min(66vh, 600px); width: auto; border-radius: 1px; box-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 24px 55px rgba(0,0,0,0.6); }
.comic__page--front { position: relative; z-index: 3; transition: transform 0.5s var(--ease); }
.comic__page--back1, .comic__page--back2 { position: absolute; top: 0; left: 0; transition: transform 0.5s var(--ease); }
.comic__page--back1 { z-index: 2; transform: translate(14px, 12px) rotate(2.2deg); }
.comic__page--back2 { z-index: 1; transform: translate(28px, 24px) rotate(4.2deg); }
.comic__stack:hover .comic__page--front { transform: translate(-6px, -6px) rotate(-1deg); }
.comic__stack:hover .comic__page--back1 { transform: translate(20px, 12px) rotate(3.4deg); }
.comic__stack:hover .comic__page--back2 { transform: translate(40px, 26px) rotate(6deg); }
.comic__count {
  position: absolute; z-index: 4; right: -10px; top: -10px;
  background: var(--blood); color: var(--bone); font-size: 0.6rem; letter-spacing: 0.15em;
  padding: 0.25rem 0.5rem; border-radius: 999px; text-transform: uppercase;
}
.comic figcaption { margin-top: 1.1rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--bone); }
.comic figcaption span { display: block; font-family: var(--sans); font-style: normal; font-size: 0.58rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--rust); margin-top: 0.3rem; }

/* ---------- posters strip ---------- */
.strip-section { padding: clamp(3rem, 9vw, 8rem) 0 clamp(2rem, 5vw, 4rem); }
/* top padding leaves room for the lift+scale on hover so the poster's top edge isn't clipped */
.strip { display: flex; gap: clamp(1rem, 3vw, 2.5rem); overflow-x: auto; padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1.2rem, 6vw, 6rem) 1.5rem; scrollbar-width: thin; scrollbar-color: var(--blood) transparent; }
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: var(--blood); border-radius: 3px; }
.strip-item { margin: 0; flex: 0 0 auto; transition: transform 0.5s var(--ease), filter var(--fade) var(--ease); }
.strip-item.is-hot { z-index: 5; transform: translateY(-6px) scale(1.03); }
.strip--posters .strip-item img { height: min(72vh, 700px); width: auto; }
.strip-item img { display: block; border-radius: 1px; box-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 26px 60px rgba(0,0,0,0.6); transition: box-shadow 0.45s var(--ease); }
.strip-item.is-hot img { box-shadow: 0 8px 20px rgba(0,0,0,0.65), 0 46px 110px rgba(0,0,0,0.82); }
.strip-item figcaption { margin-top: 0.9rem; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--bone); }
.strip-item figcaption span { display: block; font-family: var(--sans); font-style: normal; font-size: 0.58rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--rust); margin-top: 0.2rem; }

/* ---------- films ---------- */
.films-section { padding: clamp(3rem, 9vw, 8rem) 0 clamp(3rem, 7vw, 6rem); }
.films-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 2rem); padding: 0 clamp(1.2rem, 6vw, 6rem); }
.film { margin: 0; transition: filter var(--fade) var(--ease); }
.film.is-hot { z-index: 5; }
.film.is-hot .film__frame { box-shadow: 0 10px 24px rgba(0,0,0,0.6), 0 50px 120px rgba(0,0,0,0.82); }
.film--feature { grid-column: 1 / -1; }
.film__frame {
  position: relative; aspect-ratio: 16 / 9; background: #050403;
  border: 1px solid var(--line); border-radius: 2px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.film--feature .film__frame { aspect-ratio: 16 / 9; }
.film__frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.film--soon .film__frame { background: repeating-linear-gradient(135deg, #0d0b09 0 12px, #100d0b 12px 24px); }
.film--soon .film__frame span { font-family: var(--serif); font-size: 2rem; color: var(--ash); opacity: 0.5; }
.film--soon .film__frame::after { content: ""; position: absolute; inset: 8px; border: 1px dashed var(--line); border-radius: 2px; }
.film figcaption { margin-top: 0.9rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--bone); }
.film--soon figcaption { color: var(--ash); }
.film figcaption span { display: block; font-family: var(--sans); font-style: normal; font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--rust); margin-top: 0.25rem; }
.film--soon figcaption span { color: var(--ash); }
@media (max-width: 900px) { .films-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(6,4,4,0.86); display: flex; flex-direction: column; cursor: zoom-out; }
.lightbox__pages img { cursor: default; }
.lightbox[hidden] { display: none; }
.lightbox__close { position: fixed; top: 1.2rem; right: 1.4rem; z-index: 2; background: none; border: 1px solid var(--line); color: var(--bone); font-size: 1.1rem; width: 2.6rem; height: 2.6rem; border-radius: 999px; cursor: pointer; transition: background 0.3s var(--ease); }
.lightbox__close:hover { background: var(--blood); }
.lightbox__pages { overflow-y: auto; padding: clamp(3rem, 8vw, 6rem) 1rem; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.lightbox__pages img { max-width: min(92vw, 820px); width: 100%; height: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.7); }

@media (prefers-reduced-motion: reduce) {
  .grain, .hero__cue-line, .hero__reel-track { animation: none; }
  .tile-inner { transition: opacity 0.4s ease; transform: rotate(var(--rot,0deg)) scale(1); }
}
