/* Aegis Partnerships landing mock.
   The films do the work; the page stays out of their way. */
:root {
  --ink: #0e0a07;
  --stone: #f4ecdc;
  --bronze: #e2a04c;
  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --pad: clamp(1.25rem, 5vw, 5.5rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; color: var(--stone); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, p { margin: 0; }
a { color: inherit; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--stone); color: var(--ink); padding: .6rem 1rem; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 4px; }

/* ---------- Films ---------- */
.stage { position: fixed; inset: 0; z-index: 0; background: var(--ink); overflow: hidden; }
.layer { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.layer:first-child { opacity: 1; }
.layer video, .layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The looping ending sits over the finished film. */
.layer video.idle { opacity: 0; }
.layer video.idle.show { opacity: 1; transition: opacity 1.1s ease; }
/* Darken only the side the words sit on. */
.layer::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.layer[data-side="right"]::after {
  background:
    linear-gradient(90deg, rgba(14,10,7,0) 40%, rgba(14,10,7,.5) 68%, rgba(14,10,7,.74) 100%),
    linear-gradient(180deg, rgba(14,10,7,.45) 0%, rgba(14,10,7,0) 20%);
}
.layer[data-side="left"]::after {
  background:
    linear-gradient(270deg, rgba(14,10,7,0) 40%, rgba(14,10,7,.5) 68%, rgba(14,10,7,.74) 100%),
    linear-gradient(180deg, rgba(14,10,7,.45) 0%, rgba(14,10,7,0) 20%);
}

/* ---------- Top bar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--pad);
}
.brand { font: 400 1.35rem/1 var(--display); letter-spacing: .03em; text-decoration: none; }

.btn {
  display: inline-block; font: 500 .95rem/1 var(--body); text-decoration: none; white-space: nowrap;
  padding: .95rem 1.5rem; border: 1px solid rgba(244,236,220,.5);
  transition: background .25s, color .25s, border-color .25s;
}
.btn:hover { background: var(--stone); color: var(--ink); border-color: var(--stone); }
.btn-solid { background: var(--bronze); border-color: var(--bronze); color: #1d1104; }
.btn-solid:hover { background: #f3b866; border-color: #f3b866; color: #1d1104; }

/* ---------- Scenes ---------- */
main { position: relative; z-index: 10; }
.chapter { position: relative; height: 190vh; }
.chapter.last { height: 130vh; }
.pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; padding: 6rem var(--pad) 4rem;
}
.chapter[data-side="right"] .pin { justify-content: flex-end; }
.chapter[data-side="left"]  .pin { justify-content: flex-start; }
.copy { width: min(38rem, 44vw); }

h1, h2 { font-family: var(--display); font-weight: 400; text-wrap: balance; text-shadow: 0 2px 28px rgba(14,10,7,.6); }
h1 { font-size: clamp(2.7rem, 5.6vw, 6rem); line-height: 1.03; }
h2 { font-size: clamp(2.5rem, 5vw, 5.2rem); line-height: 1.05; }

/* Headline lines rise out of a mask when their scene arrives. */
.ln { display: block; overflow: hidden; padding-bottom: .08em; }
.ln > span { display: block; transform: translateY(108%); transition: transform 1.2s var(--ease); }
.ln:nth-child(2) > span { transition-delay: .09s; }
.chapter.on .ln > span { transform: none; }

.lede, .copy .btn { opacity: 0; transition: opacity .9s ease .35s; }
.chapter.on .lede, .chapter.on .copy .btn { opacity: 1; }
.chapter:not(.on) .ln > span { transition-duration: .5s; transition-delay: 0s; }
.chapter:not(.on) .lede, .chapter:not(.on) .copy .btn { transition-duration: .35s; transition-delay: 0s; }

.lede { margin-top: 1.5rem; max-width: 31rem; font-size: clamp(1.08rem, 1.3vw, 1.3rem); line-height: 1.55; text-shadow: 0 1px 18px rgba(14,10,7,.7); }
.copy .btn { margin-top: 2.2rem; }

footer { position: absolute; left: var(--pad); bottom: 1.6rem; font-size: .85rem; opacity: .6; }

/* ---------- Phones: words sit at the bottom ---------- */
@media (max-width: 860px) {
  .nav .btn { display: none; }
  .pin { align-items: flex-end; padding: 5rem var(--pad) 4.5rem; }
  .copy { width: 100%; }
  .layer[data-side]::after { background: linear-gradient(180deg, rgba(14,10,7,.4) 0%, rgba(14,10,7,0) 18%, rgba(14,10,7,.1) 40%, rgba(14,10,7,.82) 68%, rgba(14,10,7,.95) 100%); }
  .layer video, .layer canvas { object-position: var(--x, 50%) 50%; }
  .layer[data-scene="shield"] { --x: 22%; }
  .layer[data-scene="foundation"] { --x: 74%; }
  .layer[data-scene="keystone"] { --x: 24%; }
  .layer[data-scene="phalanx"] { --x: 78%; }
  .layer[data-scene="seawall"] { --x: 40%; }
  .layer[data-scene="sundial"] { --x: 20%; }
  .layer[data-scene="hall"] { --x: 76%; }
  .layer[data-scene="aegis"] { --x: 16%; }
}

@media (prefers-reduced-motion: reduce) {
  .ln > span, .lede, .copy .btn { transition-duration: .01s !important; transition-delay: 0s !important; }
}
