/* ==================================================================
   DAEMS FILMS — foundations
   Tokens, reset, typography, chrome (header / footer), motion.
   ================================================================== */

:root {
  /* Ink & ground — warm near-black, warm off-white. */
  --bg:        #0a0a0b;
  --bg-raised: #121214;
  --bg-card:   #171719;
  --ink:       #f2efe9;
  --ink-dim:   #a7a29a;
  --ink-faint: #6d6862;

  /* One accent: tungsten, the colour of a practical light on set. */
  --accent:      #d9a441;
  --accent-soft: rgba(217, 164, 65, 0.14);

  --line:        rgba(242, 239, 233, 0.13);
  --line-strong: rgba(242, 239, 233, 0.28);

  --font-display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid display sizes. */
  --step-hero: clamp(3rem, 12vw, 11rem);
  --step-xl:   clamp(2.25rem, 6.2vw, 5.5rem);
  --step-lg:   clamp(1.75rem, 3.6vw, 3rem);
  --step-md:   clamp(1.25rem, 2vw, 1.6rem);

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1560px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --header-h: 72px;
}

/* ------------------------------------------------------------------ reset */

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.028em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

img { max-width: 100%; display: block; }

/* Any class setting `display` outbids the UA's [hidden] rule, which would
   leave elements we hide from script (the sound toggle, the form's success
   panel) on screen. Make the attribute win. */
[hidden] { display: none !important; }

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: #14100a; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------------------------------- layout helpers */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(5rem, 11vw, 10rem); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #14100a;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Small uppercase label with a rule — used to head every section. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 2.25rem;
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* Over centred content the trailing rule pulls the label off-axis. */
.eyebrow--center { justify-content: center; }
.eyebrow--center::after { display: none; }

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 46ch;
}

/* ------------------------------------------------------------- buttons */

.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.7rem;
  border: 1px solid var(--btn-line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.45s var(--ease), color 0.45s var(--ease),
              border-color 0.45s var(--ease), transform 0.45s var(--ease);
}
.btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: translateY(-2px);
}
.btn--accent {
  --btn-bg: var(--accent);
  --btn-ink: #14100a;
  --btn-line: var(--accent);
  font-weight: 600;
}
.btn--accent:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.btn .arw { transition: transform 0.45s var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

/* Text link that underlines itself on hover. */
.link-u {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-u::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.link-u:hover::after { transform: scaleX(1); transform-origin: left; }

/* -------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: transform 0.5s var(--ease), background 0.4s linear,
              border-color 0.4s linear, opacity 0.4s linear;
  border-bottom: 1px solid transparent;
}
.site-header[data-solid='true'] {
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header[data-hidden='true'] { transform: translateY(-100%); }

/* The intro curtain owns the screen until the visitor scrolls. */
.site-header[data-veiled='true'] {
  opacity: 0;
  pointer-events: none;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  gap: 0.42em;
  align-items: baseline;
}
.brand span:last-child { color: var(--ink-faint); transition: color 0.4s var(--ease); }
.brand:hover span:last-child { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.4rem);
}
.nav a {
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.35s var(--ease);
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page'] { color: var(--accent); }

.nav .btn { padding: 0.6rem 1.2rem; font-size: 0.72rem; }

@media (max-width: 720px) {
  .nav { gap: 1rem; }
  .nav a:not(.btn) { display: none; }
  .nav a.nav-keep { display: inline; }
}

/* -------------------------------------------------------------- footer */

/* Positioned and layered deliberately: on the home page the showreel
   curtain is a fixed element inside a z-index:1 ancestor, which would
   otherwise paint straight over a static footer. */
.site-footer {
  position: relative;
  z-index: 3;
  border-top: 1px solid var(--line);
  padding-block: clamp(3.5rem, 7vw, 6rem) 2.5rem;
  background: var(--bg);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.footer-cta { font-size: var(--step-lg); max-width: 16ch; }
.footer-cta em {
  font-style: normal;
  color: var(--accent);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
.footer-mail {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  letter-spacing: -0.02em;
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.footer-social { display: flex; gap: 1.5rem; }
.footer-social a:hover { color: var(--accent); }

.footer-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.footer-credits b { color: var(--ink-dim); font-weight: 400; }

@media (max-width: 820px) {
  .footer-top { grid-template-columns: 1fr; align-items: start; }
}

/* ------------------------------------------------------- film texture */

/* A fixed grain + vignette layer. Purely decorative, never interactive. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 120;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  animation: grain-shift 0.7s 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: 119;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.5) 100%);
}

/* -------------------------------------------------------------- motion */

/* Elements tagged data-reveal fade in once, when first seen.

   A fade and nothing else — no travel, no stagger of words sliding into
   place. Type should arrive like a dissolve between shots.

   Scoped to .js — the class is set by an inline script in <head>. If
   scripting is off or something throws before it runs, the content is
   simply visible rather than stuck at opacity 0 forever. */
.js [data-reveal] {
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .grain { animation: none; }
}
