/* Rime Films
   Layout: the showreel first, as large as the screen allows on black, then quiet,
   left-aligned editorial sections on a cool "frost" paper. One page. */

:root {
  --ink: #101315;          /* text and dark bands, blue-black */
  --ink-2: #181d20;        /* footer and raised dark surfaces */
  --paper: #f1f2f0;        /* page background, cool frost white */
  --frost: #e3e7e6;        /* quiet fill for alternating bands */
  --rule: #c8cfcf;         /* hairlines on light */
  --mute: #56616a;         /* secondary text on light */
  --glacier: #24485a;      /* accent on light: links, focus, hover */
  --on-dark: #eef1f1;      /* text on dark */
  --on-dark-mute: #9eaab0; /* secondary text on dark */
  --ice: #a9c3cc;          /* accent on dark */
  --rule-dark: #2c3438;    /* hairlines on dark */

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wide: 114%;            /* display width for headings */
  --max: 1320px;
  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(72px, 10vw, 136px);
  --header-h: 64px;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  --step-3: clamp(2rem, 1.45rem + 2.3vw, 3.4rem);
  --step-4: clamp(2.3rem, 1.4rem + 3.6vw, 4.6rem);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  font-stretch: var(--wide);
  letter-spacing: -0.018em;
  line-height: 1.04;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.01em; }

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--glacier); outline-offset: 3px; }
.band-dark :focus-visible, .reel :focus-visible, .site-header :focus-visible, .lightbox :focus-visible { outline-color: var(--ice); }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--paper); color: var(--ink); padding: 10px 14px; text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.section { padding-block: var(--section); }
.band-dark { background: var(--ink); color: var(--on-dark); }
.band-frost { background: var(--frost); }

.label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}
.band-dark .label, .reel .label { color: var(--on-dark-mute); }

.lead { font-size: var(--step-1); line-height: 1.55; color: var(--mute); max-width: 38em; }
.band-dark .lead { color: var(--on-dark-mute); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 64px);
}
.section-head > .label { grid-column: 1 / -1; }
@media (max-width: 860px) { .section-head { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  min-height: 48px;
  padding: 0.9em 1.35em;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn svg { width: 0.85em; height: 0.85em; flex: none; }
.btn .runtime { font-weight: 400; letter-spacing: 0.06em; opacity: 0.8; font-variant-numeric: tabular-nums; }

.btn--solid { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--glacier); border-color: var(--glacier); }
.btn--line:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.band-dark .btn--solid, .reel .btn--solid { background: var(--on-dark); border-color: var(--on-dark); color: var(--ink); }
.band-dark .btn--solid:hover, .reel .btn--solid:hover { background: var(--ice); border-color: var(--ice); }
.site-header .btn--line:hover, .band-dark .btn--line:hover { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.link:hover { text-decoration-color: currentColor; color: var(--glacier); }
.band-dark .link:hover, .reel .link:hover { color: var(--ice); }
.link-arrow { transition: transform 0.2s ease; }
.link:hover .link-arrow { transform: translateX(3px); }

/* ---------- Header (always dark, it sits on the showreel) ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--ink);
  color: var(--on-dark);
  border-bottom: 1px solid var(--rule-dark);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  font-stretch: 125%;
  font-size: 0.95rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.brand b { font-weight: 700; }
.brand span { font-weight: 400; opacity: 0.8; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 36px); }
.nav a:not(.btn) {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav a:not(.btn):hover { border-bottom-color: currentColor; }
.nav .btn { min-height: 38px; padding: 0.6em 1em; }
@media (max-width: 520px) { .nav-optional { display: none; } }

/* ---------- Showreel ---------- */

.reel {
  background: var(--ink);
  color: var(--on-dark);
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}
.reel-stage {
  display: flex;
  justify-content: center;
  background: #000;
}
.reel-frame {
  position: relative;
  width: 100%;
  max-width: 1920px;
  max-width: min(1920px, calc((100vh - var(--header-h) - 96px) * 16 / 9));
  max-width: min(1920px, calc((100svh - var(--header-h) - 96px) * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
}
.reel-frame video, .reel-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  background: #000;
}
.reel-sound {
  position: absolute;
  left: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 2;
  min-height: 44px;
  background: rgb(10 12 14 / 0.62);
  border-color: rgb(238 241 241 / 0.7);
  color: var(--on-dark);
}
.reel-sound:hover { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }
.reel.is-playing .reel-sound { display: none; }
@media (max-width: 520px) {
  .reel-sound { min-height: 38px; padding: 0.55em 0.9em; font-size: 0.75rem; }
}

.reel-intro {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 24px clamp(24px, 5vw, 80px);
  align-items: end;
  padding-block: clamp(36px, 5vw, 64px) clamp(56px, 8vw, 104px);
}
.reel-title { display: grid; gap: 18px; }
.reel-title h1 { max-width: 15ch; }
.reel-side { display: grid; gap: 24px; justify-items: start; }
.reel-side p { color: var(--on-dark-mute); max-width: 32em; }
.reel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
@media (max-width: 860px) { .reel-intro { grid-template-columns: minmax(0, 1fr); } }

/* ---------- What I make ---------- */

.make-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(16px, 2.4vw, 32px);
}
.make { display: grid; align-content: start; gap: 14px; min-width: 0; }
.make-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--frost); margin-bottom: 8px; }
.make-media img { width: 100%; height: 100%; object-fit: cover; }
.make p { color: var(--mute); max-width: 34em; }
@media (max-width: 860px) {
  .make-grid { grid-template-columns: minmax(0, 1fr); }
  .make-media { aspect-ratio: 3 / 2; }
}

/* ---------- Films ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(16px, 2.4vw, 32px);
}
.film { min-width: 0; }
.film-link { display: grid; gap: 18px; color: inherit; text-decoration: none; }
.film-frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink-2); }
.film-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.film-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(10 12 14 / 0.55), rgb(10 12 14 / 0) 40%);
  pointer-events: none;
}
.film-play {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.film-play svg { width: 11px; height: 11px; }
.film-play .runtime { font-weight: 400; letter-spacing: 0.06em; color: rgb(238 241 241 / 0.75); font-variant-numeric: tabular-nums; }
.film-link:hover .film-frame img, .film-link:focus-visible .film-frame img { transform: scale(1.03); }
.film-meta { display: grid; gap: 8px; }
.film-tags {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
}
.film h3 { font-size: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem); }
.film-desc { color: var(--on-dark-mute); max-width: 36em; }
@media (max-width: 860px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 40px clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-copy { display: grid; gap: 20px; max-width: 38em; }
.about-copy p:not(.label) { color: var(--mute); }
.about-copy p.big { color: var(--ink); font-size: var(--step-1); line-height: 1.55; }
.facts-list { margin: 0; border-top: 1px solid var(--ink); }
.facts-list > div {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 8px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.facts-list dt { font-weight: 600; }
.facts-list dd { margin: 0; color: var(--mute); }
@media (max-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .facts-list > div { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 48px clamp(32px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

.form { display: grid; gap: 22px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 600px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-size: 0.9375rem; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--mute); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: #fbfbfa;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}
.field textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--mute); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--glacier); outline: 1px solid var(--glacier); outline-offset: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 4px; }
.form-note { font-size: 0.875rem; color: var(--mute); max-width: 30em; }
.honeypot { position: absolute; left: -9999px; }

.form-status { border-left: 2px solid var(--glacier); padding: 4px 0 4px 16px; display: grid; gap: 8px; margin-top: 32px; }
.form[hidden] + .form-status { margin-top: 0; }
.form-status strong { font-weight: 600; }
.form-status p { color: var(--mute); }
.form-status .email { color: var(--ink); font-weight: 600; user-select: all; overflow-wrap: anywhere; }

.contact-side { display: grid; gap: 32px; }
.contact-block { display: grid; gap: 6px; border-top: 1px solid var(--ink); padding-top: 16px; }
.contact-block .label { margin-bottom: 4px; }
.contact-block .value { font-size: var(--step-1); font-weight: 500; overflow-wrap: anywhere; }
.contact-block p:not(.label):not(.value) { color: var(--mute); }

.copy-btn {
  justify-self: start;
  border: 0;
  padding: 4px 0;
  background: none;
  color: var(--glacier);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  cursor: pointer;
}

/* ---------- Footer ---------- */

.site-footer { background: var(--ink-2); color: var(--on-dark-mute); padding-block: 36px; font-size: 0.875rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; }
.footer-row .brand { color: var(--on-dark); }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--on-dark);
  overflow: hidden;
}
.lightbox::backdrop { background: rgb(8 10 11 / 0.94); }
.lightbox-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.lightbox-title {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-close {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--on-dark);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.lightbox-close:hover { color: var(--ice); }
.lightbox-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.lightbox-stage video, .lightbox-stage iframe {
  width: 100%;
  height: 100%;
  max-width: 1600px;
  object-fit: contain;
  border: 0;
  background: transparent;
}
.lightbox-stage iframe { aspect-ratio: 16 / 9; height: auto; max-height: 100%; width: min(100%, 1600px); }
.lightbox-stage iframe.is-vertical { aspect-ratio: 9 / 16; width: auto; height: 100%; }

/* ---------- 404 ---------- */

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 24px;
  padding-top: calc(var(--header-h) + 96px);
  padding-bottom: 96px;
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .film-link:hover .film-frame img { transform: none; }
}
