/* ==========================================================================
   Josephine & Company — V3 (round 2 design, 2026-11-17)
   One stylesheet for the whole site.

   Sizes are measured from Ida's designs (design-reference/v3-round2/),
   drawn on a 1728px-wide canvas, and written in vw so pages keep the same
   proportions on any screen: 1vw = 17.28px of the design.
     DeVinne (menu, film titles): 16px -> 0.926vw, 24px -> 1.389vw
     Inter (text):                 16px -> 0.926vw
   Each size has a minimum so text stays readable on small laptops.
   Phones (<= 760px) get their own sizes at the end of each section.
   ========================================================================== */

@font-face {
  font-family: "DeVinne";
  src: url("../fonts/devinne.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #d9d9d9;                       /* Ida's grey */
  --ink: #000000;
  --on-image: #ffffff;
  --serif: "DeVinne", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --menu: max(12px, 0.926vw);          /* 16px */
  --title: max(15px, 1.389vw);         /* 24px */
  --text: max(14px, 0.926vw);          /* 16px */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text);
  line-height: 1.26;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
.label { text-transform: uppercase; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
/* links in text: underline on hover (Ida's design shows the hover state) */
.work-list a:hover, .contact-text a:hover { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

/* ---- Menu (drawn by site.js), on top of the page, no bar ------------------- */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  height: 8.12vw;                      /* centres the words 4.06vw from the top */
  padding: 0 3.25vw 0 2.45vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--menu);
  text-transform: uppercase;
  line-height: 1;
}
[data-nav="light"] .nav { color: var(--on-image); }
.nav-links { display: flex; gap: 2.15vw; }
.nav-links--right { justify-content: flex-end; margin-left: -0.8vw; }
.nav-links a { display: block; padding: 0.5em 0; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 0.6; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.nav-logo {
  display: block;
  width: 4.9vw; min-width: 44px;
  aspect-ratio: 360 / 260;
  margin-top: 0.54vw;                  /* logo sits a touch lower than the words */
  background-color: currentColor;
  -webkit-mask: url("../img/art/logo.png") center / contain no-repeat;
          mask: url("../img/art/logo.png") center / contain no-repeat;
}

@media (max-width: 760px) {
  .nav { height: 64px; padding: 0 16px; grid-template-columns: auto 1fr auto; font-size: 12px; }
  .nav-logo { order: -1; width: 46px; margin-top: 4px; }
  .nav-links { gap: 14px; }
  .nav-links--left { justify-content: flex-end; }
  .nav-links--right { margin-left: 14px; }
}

/* ---- Shared: film image filling its box, video loop on top ---------------- */
.media {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #1a1a1a;
}
.media picture { position: absolute; inset: 0; display: block; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the loop sits on the still (its own first frame) and shows once moving */
.media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s linear;
}
.media video.is-playing { opacity: 1; }
/* gentle shading so the white menu and titles read over bright footage */
.media-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0) 18%),
    linear-gradient(to top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 28%);
  pointer-events: none;
}
/* film title over the image: DeVinne, white, bottom-left */
.caption {
  position: absolute;
  left: 3.33vw;
  bottom: 3.5vw;
  right: 30vw;
  color: var(--on-image);
  font-family: var(--serif);
  font-size: var(--title);
  text-transform: uppercase;
  line-height: 1.1;
}

/* ---- Home: full-screen reel ---------------------------------------------------- */
.page-home { overflow: hidden; }
.reel {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
}
.slide {
  position: absolute; inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s var(--ease), visibility 0s linear 0.9s;
}
.slide.is-active {
  opacity: 1; visibility: visible; z-index: 1;
  transition: opacity 0.9s var(--ease), visibility 0s;
}
.slide > a { position: absolute; inset: 0; display: block; }

/* film numbers along the bottom: Roman numerals in DeVinne (I II III ...),
   the current one bright and underlined, like an old film reel */
.dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: max(14px, 1.6vw);            /* centred, just below the film title */
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 0;                              /* numerals' own padding makes the spacing, */
  padding: 0 6px;                      /* so there are no dead gaps between them   */
}
.dot {
  padding: 14px 0.75vw;                /* big click target around each numeral */
  margin-bottom: -8px;                 /* keep the numerals where they were */
  cursor: pointer;
  border: 0;
  background: none;
  color: var(--on-image);
  font-family: var(--serif);
  font-size: var(--menu);
  line-height: 1;
  letter-spacing: 0.06em;
  opacity: 0.62;
  transition: opacity 0.4s var(--ease);
}
.dot:hover { opacity: 0.85; }
.dot.is-active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}

@media (max-width: 760px) {
  .caption { left: 16px; right: 16px; bottom: 52px; font-size: 15px; }
  .dots { bottom: 20px; gap: 0; }
  .dot { font-size: 13px; padding: 12px 9px; margin-bottom: -6px; }
}

/* ---- Film page --------------------------------------------------------------- */
.film-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
}
.film-hero .caption { bottom: 4.4vw; }
.hero-links {
  position: absolute;
  right: 4.7vw;
  bottom: 4.4vw;
  display: flex;
  gap: 3vw;
  color: var(--on-image);
  font-family: var(--serif);
  font-size: var(--title);
  text-transform: uppercase;
  line-height: 1.1;
}
.hero-link { transition: opacity 0.2s; }
.hero-link:hover { opacity: 0.65; }

/* details: columns from the design at 14.1vw | 32vw | 54.6vw */
.film-body {
  padding: 13.4vw 0 0 14.1vw;
  display: grid;
  grid-template-columns: 17.9vw 22.6vw 1fr;
}
.film-block > .label { margin-bottom: 2.3vw; }
.film-body:last-child { padding-bottom: 12vw; }      /* pages without a stills row */
.film-text { max-width: 32.5vw; }
.synopsis { grid-column: 1 / 3; }
.project  { grid-column: 3; }
.credits {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  margin-top: 5.2vw;
}
.credit .label { margin-bottom: 1.1em; }
.credit--1 { grid-column: 1; }
.credit--2 { grid-column: 2; }
.credit--3 { grid-column: 3; }

/* stills: an endless sideways-scrolling row, full width */
.stills { padding: 10.6vw 0 10.8vw; }
.stills-label {
  text-align: center;
  font-family: var(--serif);
  font-size: var(--menu);
  text-transform: uppercase;
  margin-bottom: 1.7vw;
}
.stills-row {
  display: flex;
  gap: 1.3vw;
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
  outline-offset: -2px;
}
.stills-row::-webkit-scrollbar { display: none; }
.stills-row.is-dragging { cursor: grabbing; }
.still { flex: 0 0 33.4vw; }
.still img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #c8c8c8; user-select: none; }

@media (max-width: 760px) {
  .film-hero .caption { bottom: 56px; }
  .hero-links { left: 16px; right: auto; bottom: 22px; gap: 22px; font-size: 13px; }
  .film-body { padding: 56px 16px 0; grid-template-columns: 1fr 1fr; line-height: 1.4; }
  .film-block > .label { margin-bottom: 14px; }
  .film-body:last-child { padding-bottom: 72px; }
  .film-text { max-width: none; }
  .synopsis, .project { grid-column: 1 / -1; }
  .project { margin-top: 40px; }
  .credits { grid-template-columns: 1fr 1fr; row-gap: 26px; margin-top: 40px; }
  .credits .credit { grid-column: auto; }
  .stills { padding: 64px 0 56px; }
  .stills-label { font-size: 12px; margin-bottom: 14px; }
  .stills-row { gap: 8px; }
  .still { flex-basis: 78vw; }
}

/* ---- Grey pages: About, Work, Contact, Reel --------------------------------- */
.about-main, .work-main, .contact-main, .blank-main {
  min-height: 100vh;
  min-height: 100svh;
}

/* About and Work fit on one screen, never scroll. Their sizes use --u,
   which is 1vw on a screen shaped like Ida's (1728 x 1022) but shrinks with
   the window's height on shorter screens, so everything always fits. */
.about-main, .work-main {
  --u: min(1vw, 1.69svh);
  height: 100vh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8.12vw 0 1.5vw;            /* clear the menu, then centre */
  text-align: center;
  font-size: max(13px, calc(1.12 * var(--u)));   /* ~20% bigger than Ida's 16px, as asked */
}

/* About: centred text with the TV underneath */
.about-text { width: min(46vw, calc(66 * var(--u))); min-width: 300px; }   /* wider on short screens so it needs fewer lines */
.about-text p + p { margin-top: 1.26em; }
.about-media { width: calc(8.94 * var(--u)); min-width: 64px; margin-top: calc(5.9 * var(--u)); flex-shrink: 0; }
.about-media img { width: 100%; height: auto; }

/* Work: centred list of films with the jester underneath */
.work-list li { line-height: 1.26; }
.work-soon { cursor: default; }
.work-jester { width: calc(4.56 * var(--u)); min-width: 36px; height: auto; margin-top: calc(8 * var(--u)); flex-shrink: 0; }

/* Contact: email and links inside the ornate frame, centred on the page */
.contact-main { display: flex; align-items: center; justify-content: center; padding: 8.12vw 0 2vw; }
.contact-frame { position: relative; width: 29.8vw; min-width: 280px; }
.contact-frame img { width: 100%; height: auto; }
.contact-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}

@media (max-width: 760px) {
  .about-main, .work-main { padding: 64px 20px 16px; line-height: 1.35; }
  .about-main { font-size: clamp(13px, 1.8svh, 15px); }
  .about-text { width: auto; min-width: 0; max-width: 30em; }
  .about-media { width: clamp(64px, 11svh, 110px); margin-top: clamp(16px, 3.5svh, 40px); }
  .work-main { font-size: clamp(14px, 2.2svh, 17px); line-height: 1.5; }
  .work-jester { width: clamp(44px, 8svh, 64px); margin-top: clamp(24px, 6svh, 56px); }
  .contact-main { padding: 80px 16px 24px; }
  .contact-frame { width: 86vw; }
  .contact-text { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---- Spiral cursor (site.js) ------------------------------------------------ */
html.has-spiral, html.has-spiral * { cursor: none !important; }
.spiral-cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: difference;      /* dark on grey, light over film */
  transition: opacity 0.2s;
  will-change: transform;
}
.spiral-cursor.is-on { opacity: 1; }
.spiral-cursor-art {
  width: 26px;
  aspect-ratio: 96 / 87;
  margin: -12px 0 0 -13px;           /* the spiral's centre is the pointer */
  background: #fff;
  -webkit-mask: url("../img/art/spiral.png") center / contain no-repeat;
          mask: url("../img/art/spiral.png") center / contain no-repeat;
}
.spiral-cursor-art.is-spinning { animation: spiral-spin 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes spiral-spin { to { transform: rotate(-360deg); } }

/* ---- Page not found ---------------------------------------------------------- */
.notfound-main {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4em;
  padding: 0 24px;
  text-align: center;
}
.notfound-title {
  font-family: var(--serif);
  font-size: var(--title);
  text-transform: uppercase;
  line-height: 1.1;
}
.notfound-text a { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.notfound-text a:hover { opacity: 0.6; }

/* ---- Reel page ---------------------------------------------------------------- */
.sound-toggle {
  background: none; border: 0; padding: 0; margin: 0;
  color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit;
  cursor: pointer;
}
/* phones: show the whole 16:9 reel (black above and below) instead of cropping it */
@media (max-width: 760px) {
  .reel-hero .media { background: #000; }
  .reel-hero .media img, .reel-hero .media video { object-fit: contain; }
}
/* restart + pause, centred at the bottom: solid white shapes at the height of
   the capital letters, so they sit on the same line as the caption */
.reel-controls {
  position: absolute;
  left: 50%;
  bottom: 4.4vw;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5em;
  color: var(--on-image);
  font-size: var(--title);
  line-height: 1.1;
}
.reel-btn {
  display: flex; align-items: center; justify-content: center;
  height: 1.1em;
  background: none; border: 0; padding: 0 0.3em; margin: 0 -0.3em;
  color: inherit; font: inherit; cursor: pointer;
  transition: opacity 0.2s;
}
.reel-btn:hover { opacity: 0.65; }
.reel-btn svg { display: block; height: 0.68em; width: auto; fill: currentColor; }
.reel-pause .icon-play, .reel-pause.is-paused .icon-pause { display: none; }
.reel-pause.is-paused .icon-play { display: block; }
@media (max-width: 760px) {
  .reel-controls { bottom: 25.5px; font-size: 13px; gap: 26px; }
  .reel-btn { padding: 12px; margin: -12px; height: auto; }
}
