/* arjunoxnor.com
   Ink, paper, and the teal of the portrait backdrop.
   Typography carries the site: Cormorant for display, Inter for meta. */

@font-face {
  font-family: "Cormorant";
  src: url("assets/fonts/cormorant-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("assets/fonts/cormorant-italic-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0d1114;
  --ink-2: #141a1e;
  --paper: #e9e6e0;
  --paper-dim: rgba(233, 230, 224, 0.55);
  --teal: #4a7280;
  --teal-text: #8fb3c0;
  --line: rgba(233, 230, 224, 0.14);
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --serif: "Cormorant", "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Helvetica Neue", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--teal); color: var(--paper); }

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

:focus-visible {
  outline: 1px solid var(--teal-text);
  outline-offset: 4px;
}

/* Film grain: a still, near-invisible texture over everything but the player */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/noise.png") repeat;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 60;
}

/* ---------- meta type ---------- */

.meta-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
}
.meta-label.dim { color: var(--paper-dim); }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(16px, 2.5vw, 28px) var(--pad);
  z-index: 90;
}
.nav-brand {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
}
.nav-links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  transition: color 0.3s var(--ease);
}
.nav-links a:hover { color: var(--paper); }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  position: relative;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.8rem, 12.5vw, 11.5rem);
  line-height: 0.88;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.hero-name .mask {
  display: block;
  overflow: hidden;
  padding-block: 0.04em;
}
.hero-name .mask.indent { margin-left: clamp(2.5rem, 9vw, 10rem); }
html.js .hero-name .line {
  display: block;
  transform: translateY(115%);
  transition: transform 1.1s var(--ease);
}
body.loaded .hero-name .mask:nth-child(1) .line { transform: none; }
body.loaded .hero-name .mask:nth-child(2) .line {
  transform: none;
  transition-delay: 0.12s;
}

.hero-rule {
  height: 1px;
  background: var(--line);
  margin-top: clamp(1.6rem, 4vh, 3rem);
  transform-origin: left;
}
html.js .hero-rule {
  transform: scaleX(0);
  transition: transform 1.4s var(--ease) 0.5s;
}
body.loaded .hero-rule { transform: none; }

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: clamp(1rem, 2.5vh, 1.6rem);
}
html.js .hero-meta {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease) 0.75s, transform 0.9s var(--ease) 0.75s;
}
body.loaded .hero-meta { opacity: 1; transform: none; }

.hero-line {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--paper-dim);
}

.scroll-cue {
  position: absolute;
  bottom: clamp(20px, 4vh, 40px);
  left: var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
}
html.js .scroll-cue {
  opacity: 0;
  transition: opacity 1s var(--ease) 1.4s;
}
body.loaded .scroll-cue { opacity: 1; }
.scroll-cue span {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
.scroll-cue i {
  display: block;
  width: 36px;
  height: 1px;
  background: var(--paper-dim);
  transform-origin: left;
  animation: cue 3.2s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: scaleX(0); opacity: 0; }
  45% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1) translateX(18px); opacity: 0; }
}

/* ---------- films ---------- */

.films {
  padding: clamp(4rem, 12vh, 9rem) var(--pad) clamp(5rem, 14vh, 10rem);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: clamp(1.6rem, 4vh, 3rem);
}

.film-row {
  width: 100%;
  display: grid;
  grid-template-columns: 3.6rem 1fr auto;
  align-items: baseline;
  gap: 1.2rem;
  padding: clamp(1.3rem, 3.2vh, 2.1rem) 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.film-list .film-row:last-child { border-bottom: 1px solid var(--line); }

.film-num {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--paper-dim);
  transition: color 0.35s var(--ease);
}

.film-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  transition: color 0.35s var(--ease), transform 0.45s var(--ease);
}

.film-meta {
  display: flex;
  gap: 1.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  white-space: nowrap;
}

@media (hover: hover) {
  .film-row:hover .film-title,
  .film-row:focus-visible .film-title {
    color: var(--teal-text);
    transform: translateX(10px);
  }
  .film-row:hover .film-num { color: var(--teal-text); }
}

/* floating still preview (desktop pointer devices only) */
.film-preview {
  display: none;
  position: fixed;
  right: calc(var(--pad) * 0.75);
  top: 50%;
  transform: translateY(-50%) scale(1.03);
  width: min(32vw, 520px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease), transform 0.6s var(--ease);
  z-index: 1;
}
.film-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.film-preview img.show { opacity: 1; }
.film-preview.on {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
@media (hover: hover) and (min-width: 1100px) {
  .film-preview { display: block; }
}

/* ---------- about ---------- */

.about {
  background: var(--teal);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 0 0 0 var(--pad);
}

.about-text {
  padding: clamp(4rem, 12vh, 8rem) 0;
  max-width: 620px;
}
.about-text .meta-label { margin-bottom: clamp(1.4rem, 3vh, 2.4rem); }

.about-lede {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.42;
  color: #f2f1ed;
}

.about-more {
  margin-top: clamp(1.2rem, 3vh, 2rem);
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(242, 241, 237, 0.78);
  max-width: 46ch;
}
.about-more a {
  color: #f2f1ed;
  text-decoration: underline;
  text-decoration-color: rgba(242, 241, 237, 0.4);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.3s var(--ease);
}
.about-more a:hover { text-decoration-color: #f2f1ed; }

.about-photo {
  align-self: stretch;
  min-height: min(78vh, 760px);
  position: relative;
}
.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  /* feather the photo's left and top edges into the matched backdrop */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 90px),
    linear-gradient(to bottom, transparent 0, #000 70px);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 90px),
    linear-gradient(to bottom, transparent 0, #000 70px);
  mask-composite: intersect;
}

/* ---------- contact ---------- */

.contact {
  padding: clamp(5rem, 16vh, 11rem) var(--pad) clamp(2.5rem, 6vh, 4rem);
}
.contact .meta-label { margin-bottom: clamp(1.6rem, 4vh, 2.6rem); }

.contact-mail {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 4.6vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: 0.005em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
  text-underline-offset: 8px;
  transition: text-decoration-color 0.35s var(--ease), color 0.35s var(--ease);
  overflow-wrap: anywhere;
}
.contact-mail:hover {
  color: var(--teal-text);
  text-decoration-color: var(--teal-text);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.4rem, 3vw, 2.6rem);
  margin-top: clamp(2rem, 5vh, 3.4rem);
}
.contact-links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  transition: color 0.3s var(--ease);
}
.contact-links a:hover { color: var(--paper); }

.colophon {
  margin-top: clamp(4rem, 10vh, 7rem);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(233, 230, 224, 0.35);
}

/* ---------- theater overlay ---------- */

.theater {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
}
.theater[hidden] { display: none; }

.theater-scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 14, 0.95);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.theater.open .theater-scrim { opacity: 1; }

.theater-panel {
  position: relative;
  width: min(960px, 100%);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s var(--ease) 0.1s, transform 0.55s var(--ease) 0.1s;
}
.theater.open .theater-panel { opacity: 1; transform: none; }

.theater-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 1.1rem;
}
.theater-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.1;
}
.theater-head .meta-label { margin-top: 0.4rem; }

.theater-close,
.theater-nav button {
  background: none;
  border: 0;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: color 0.3s var(--ease);
}
.theater-close:hover,
.theater-nav button:hover { color: var(--paper); }

.theater-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}
.theater-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.theater-note {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--paper-dim);
  max-width: 60ch;
}

.theater-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.theater-nav button:empty { visibility: hidden; }

/* ---------- reveal on scroll ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
html.js .reveal.in { opacity: 1; transform: none; }

.film-row.reveal { transition-delay: calc(var(--i, 0) * 70ms); }

/* ---------- small screens ---------- */

@media (max-width: 800px) {
  .film-row { grid-template-columns: 2.2rem 1fr; row-gap: 0.5rem; }
  .film-meta { grid-column: 2; gap: 1.1rem; }
  .about { grid-template-columns: 1fr; padding: 0; }
  .about-text { padding: clamp(3.5rem, 10vh, 6rem) var(--pad) 0; }
  .about-photo { min-height: 0; aspect-ratio: 4 / 5; margin-top: 2.5rem; }
  .about-photo img {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 60px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 60px);
  }
  .theater { padding: 16px; align-items: flex-start; padding-top: 14vh; }
}

/* ---------- reduced motion (and ?flat debug mode) ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  html.js .hero-name .line, html.js .hero-rule, html.js .hero-meta,
  html.js .scroll-cue { transform: none; opacity: 1; }
  html.js .reveal { opacity: 1; transform: none; }
}

html.flat { scroll-behavior: auto; }
html.flat *, html.flat *::before, html.flat *::after {
  transition: none !important;
  animation: none !important;
}
html.flat .hero-name .line, html.flat .hero-rule, html.flat .hero-meta,
html.flat .scroll-cue { transform: none; opacity: 1; }
html.flat .reveal { opacity: 1; transform: none; }
