/* joel mörk — base styles (first draft, look & feel to be decided) */

/* Montserrat (variable, weights 100–900), self-hosted. SIL Open Font License: fonts/Montserrat-OFL.txt */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-var-latin.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

/* Page background lives on the root element only (body stays transparent).
   It is a gradient between two practically identical near-blacks on purpose: Chrome on Mac draws
   completely flat, empty areas through a shortcut that comes out a shade darker than areas with
   text, which showed as a lighter band behind the landing intro. A gradient is never "flat", so the
   whole page goes through the same path and stays one even colour. */
html {
  min-height: 100%;
  background-color: #0d0d0c;
  background-image: linear-gradient(#0d0d0c, #0e0e0d);
  color-scheme: dark;
}

body {
  color: #eeede9;
  font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px var(--edge);
}
.site-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.site-nav a { margin-left: 24px; color: #8c8c8c; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #eeede9; }

/* One shared margin on both sides of every page: the distance from the window edge to the G of
   GAMES on the landing page (about 9.8% of the window width). A script fine-tunes it to the pixel. */
:root { --edge: max(12px, 9.82vw); }
main { padding: 0 var(--edge) 80px; }

/* Category sections on the front page */
.category { margin: 24px 0 0; }
.category h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8c8c8c;
  margin: 0 0 16px;
}

/* Project grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 3px;
}
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #1c1c1a;
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.3s;
}
.tile:hover img { transform: scale(1.03); filter: brightness(1.08); }

/* title + role inside the picture, lower right */
.tile .caption {
  position: absolute;
  right: 16px;
  bottom: 12px;
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.3;
  pointer-events: none;
}
.tile .title { font-size: 17px; font-weight: 500; }
.tile .sub { font-size: 13px; font-weight: 300; opacity: 0.85; }
.tile.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
}
.tile.has-img .caption { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); z-index: 1; }
.tile.no-img .caption { color: #aaa; }

.tile .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6f6f6f;
  font-size: 14px;
}

/* Project page */
.project-head { max-width: 720px; margin: 24px 0 40px; }
.project-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.project-head p { color: #aaa; margin: 0; }

.project-head .project-text { color: #eeede9; margin-top: 16px; }

.group-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8c8c8c;
  margin: 56px 0 16px;
  padding-top: 16px;
  border-top: 1px solid #262523;
}
.project-head + .group-title { margin-top: 0; }

.tile .ph.locked {
  background: #1c1c1c;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.tile:hover .ph.locked { color: #fff; }

/* Password page */
.unlock { max-width: 360px; margin: 10vh auto 0; }
.unlock h1 { font-size: 24px; font-weight: 400; margin: 0 0 8px; }
.unlock p { color: #aaa; margin: 0 0 24px; }
.unlock input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #3a3a38;
  background: #161615;
  color: inherit;
  border-radius: 0;
}
.unlock button {
  margin-top: 12px;
  font: inherit;
  padding: 10px 18px;
  background: #eeede9;
  color: #0d0d0c;
  border: 0;
  cursor: pointer;
}
.unlock .error { color: #f07a70; margin: 12px 0 0; }

.gallery { display: flex; flex-direction: column; gap: 16px; }
.gallery img { display: block; width: 100%; height: auto; background: #1c1c1a; }

/* Contact */
.contact { max-width: 560px; margin-top: 24px; }
.contact a { border-bottom: 1px solid #555; }

@media (max-width: 600px) {
  .category { margin: 16px 0 0; }
  .site-header { padding: 20px var(--edge); flex-direction: column; gap: 8px; }
  .site-nav a { margin: 0 20px 0 0; }
  main { padding: 0 var(--edge) 60px; }
  .grid { grid-template-columns: 1fr; }
}

/* Landing page: just the two categories */
body.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-main { padding: 0 24px; text-align: center; }
.landing-intro { color: #8c8c8c; font-size: clamp(1rem, 1.6vw, 1.25rem); margin: 0 0 0.6em; }
.landing-nav {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.28em;
  font-size: clamp(2.2rem, 9.5vw, 16rem);   /* scales with the window, fills most of its width */
  font-weight: 700;
  letter-spacing: 0.01em;   /* capitals read better with a touch more space */
}
.landing-or { font-size: max(14px, 0.3em); font-weight: 300; color: #6f6f6f; letter-spacing: 0; }
.landing-slash { color: #eeede9; }   /* same size and weight as the words */
.landing-q { font-size: 0.45em; color: #6f6f6f; margin-left: 0.08em; }
.landing-nav a { color: #eeede9; transition: color 0.2s; }
.landing-nav:hover a { color: #444; }
.landing-nav a:hover { color: #eeede9; }

.group-title a:hover { color: #eeede9; }
.empty-note { color: #6f6f6f; }
.tile:hover .ph:not(.locked) { background: #262624; }

/* Landing hover flicker */
.flash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 1;               /* collage lands on top of the info text… */
}
body.has-collage .flash { opacity: 1; }
.landing-main { position: relative; z-index: 2; }   /* …but under GAMES / MUSIC */
/* while images flicker, the words invert against whatever is behind them */
body.has-collage .landing-main { mix-blend-mode: difference; }
body.has-collage .landing-nav a,
body.has-collage .landing-nav:hover a,
body.has-collage .landing-or,
body.has-collage .landing-slash,
body.has-collage .landing-q { color: #fff; }

/* Locked project tile with a public (blurred) cover */
.tile-locked .cover-wrap { position: relative; }
.tile-locked .lock-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eee;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: background 0.2s;
}
.tile-locked:hover .lock-label { background: rgba(0, 0, 0, 0.1); }
.tile-locked:hover .lock-label { color: #fff; }

/* Projects without a page yet: small note by the cursor on click */
.tile.soon { cursor: pointer; }
.soon-tip {
  position: fixed;
  z-index: 10;
  transform: translate(12px, -50%);
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.soon-tip.show { opacity: 1; transition: opacity 0.1s ease; }

/* Name + short intro in the top left of the landing page (sits under the collage) */
.landing-info {
  position: absolute;
  top: clamp(48px, 9vh, 110px);
  left: 32px;
  max-width: 560px;
  z-index: 0;
  color: #ccc;
}
.landing-info .site-name { display: inline-block; margin-bottom: 6px; }
.landing-info p { margin: 0 0 12px; }
.landing-info .intro { line-height: 1.5; }
.landing-info .intro span { display: block; white-space: nowrap; }
.landing-info .intro span:last-child { margin-top: 0.9em; }   /* the email row sits a little apart */
.landing-info p a { border-bottom: 1px solid #555; }
@media (max-width: 600px) {
  .landing-info { top: 44px; left: 20px; right: 20px; font-size: 14px; }
  .landing-info .site-name { margin-bottom: 4px; }
}

/* Mixed image / video project pages */
.gallery figure { margin: 0; }
.gallery video { display: block; width: 100%; height: auto; background: #111; }
.gallery video.small { max-width: 720px; }
.gallery figcaption { margin-top: 6px; font-size: 13px; color: #8c8c8c; }
.gallery figcaption.credit { font-size: 12px; color: #6f6f6f; }
.gallery-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.group-note { margin: -6px 0 16px; color: #8c8c8c; font-size: 14px; max-width: 720px; }
.project-text + .project-text { margin-top: 10px; }
@media (max-width: 600px) {
  .gallery-row { grid-template-columns: 1fr; }
}
.gallery + .gallery { margin-top: 16px; }

/* YouTube embed: our poster + play button, player loads on click */
.yt { position: relative; aspect-ratio: 16 / 9; background: #111; }
.yt-play { all: unset; display: block; position: absolute; inset: 0; cursor: pointer; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; }
.yt-icon { --s: clamp(54px, 6vw, 84px); position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s);
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0,0,0,.45); transition: background .2s, transform .2s; }
.yt-icon::after { content: ""; position: absolute; left: 39%; top: 31%; width: 30%; height: 38%;
  background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.yt-play:hover .yt-icon, .yt-play:focus-visible .yt-icon { background: rgba(0,0,0,.7); transform: translate(-50%, -50%) scale(1.06); }
.yt-play:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Short all-caps project paragraph under the title (The Weeknd page) */
.project-blurb {
  max-width: 470px;
  margin: -12px 0 72px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8c8c8c;
}
/* Three across, 16:9, tight columns and a little more air between rows */
.gallery-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 2px; row-gap: 10px; }
.gallery-grid3 img { aspect-ratio: 16 / 9; object-fit: cover; }
.gallery-grid3 + .gallery { margin-top: 48px; }
@media (max-width: 600px) {
  .gallery-grid3 { grid-template-columns: 1fr; row-gap: 2px; }
  .project-blurb { margin-bottom: 40px; }
}
/* Side-by-side photos share one shape (4:5), so the row lines up top and bottom */
.gallery-row img { aspect-ratio: 4 / 5; object-fit: cover; }

/* Full-size image viewer (assets/lightbox.js) */
.lb-zoomable { cursor: zoom-in; }
.lb-zoomable:focus-visible { outline: 2px solid #eeede9; outline-offset: 2px; }
html.lb-lock { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 13, 12, 0.55);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  opacity: 0; visibility: hidden; transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.lightbox.open { opacity: 1; visibility: visible; transition: opacity 0.18s ease; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 48px 88px; box-sizing: border-box; cursor: zoom-out; }
.lb-img { display: block; max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.5); cursor: default; transition: opacity 0.15s; }
.lb-img.loading { opacity: 0.4; }
.lb-cap { margin-top: 10px; font-size: 12px; color: #9a9a9a; min-height: 1em; }
.lb-btn { position: absolute; background: none; border: 0; padding: 16px; color: #eeede9; cursor: pointer;
  opacity: 0.7; transition: opacity 0.15s; }
.lb-btn:hover, .lb-btn:focus-visible { opacity: 1; }
.lb-btn:focus-visible { outline: 1px solid #eeede9; outline-offset: -6px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 10px; right: 14px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
@media (max-width: 600px) {
  .lb-figure { padding: 56px 8px 40px; }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; padding: 10px 18px; }
}
@media (prefers-reduced-motion: reduce) { .lightbox, .lb-img { transition: none; } }

/* Name with the short intro under it (Games and Other pages). Mirrors .landing-info exactly:
   same distance from the top, same size and colour, and a script lines its left edge up with
   where the G of GAMES sits on the landing page. */
.site-header.with-intro { align-items: flex-start; padding-top: 0; }
.site-header.with-intro .site-nav { margin-top: 28px; }
.site-id { margin-top: clamp(48px, 9vh, 110px); color: #ccc; }
.site-id .site-name { display: inline-block; margin-bottom: 6px; }
.site-id .intro { margin: 0 0 12px; line-height: 1.5; }
.site-id .intro span { display: block; white-space: nowrap; }
.site-id .intro span:last-child { margin-top: 0.9em; }
.site-id .intro a { border-bottom: 1px solid #555; }
.g-probe { position: fixed; top: 0; left: 0; width: 100vw; height: 0; overflow: hidden;
  display: flex; justify-content: center; visibility: hidden; pointer-events: none; }
@media (max-width: 600px) {
  .site-header.with-intro { padding-top: 0; }
  .site-header.with-intro .site-nav { margin-top: 0; }
  .site-id { margin-top: 44px; font-size: 14px; }
  .site-id .site-name { margin-bottom: 4px; }
}

/* Tiles everywhere: three across on desktop, the same size on the Games/Other pages and inside
   projects. Project images are cropped to 16:9 tiles; clicking one shows the whole image. */
.grid, .gallery, .gallery-grid3, .gallery-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-items: start;
}
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; height: auto; }
.gallery-row img { aspect-ratio: 4 / 5; }                 /* concert photos keep their portrait shape */
.gallery figure:has(.yt), .gallery > .yt { grid-column: 1 / -1; }   /* a video player stays full width */
.gallery-grid3 + .gallery { margin-top: 3px; }
@media (max-width: 900px) {
  .grid, .gallery, .gallery-grid3, .gallery-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid, .gallery, .gallery-grid3, .gallery-row { grid-template-columns: 1fr; }
}
/* A set of images kept apart from what follows (The Weeknd: Joel's renders vs. the team's frames) */
.gallery.gallery-set-apart + .set-label { margin-top: 56px; }
@media (max-width: 600px) { .gallery.gallery-set-apart + .set-label { margin-top: 36px; } }
/* Small, quiet caption above a set of images (same look as the photo credits) */
.set-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 300;
  color: #6f6f6f;
}

/* Landing without the hover collage: GAMES / OTHER stay put, no dimming on hover */
.landing-nav.plain a, .landing-nav.plain:hover a, .landing-nav.plain a:hover { color: #eeede9; transition: none; }

/* Images can't be dragged out or long-press saved (right-click is blocked in assets/lightbox.js) */
img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
