/* Aligned Productions — shared styles for every page */

:root {
  --navy: #061845;
  --navy-deep: #040F2E;
  --paper: #F4F6FA;
  --surface: #FFFFFF;
  --ink: #061845;
  --muted: #4F5A70;
  --line: #D8DFEC;
  --signal: #2E6BFF;
  --signal-hover: #1F57E6;
  --danger: #B42318;
  --on-navy: #FFFFFF;
  --on-navy-muted: #B9C4DD;
  --photo-bg: #FFFCF9;
  --ease-out: cubic-bezier(.16,.84,.24,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy-deep: #030B22;
    --paper: #0A1330;
    --surface: #0F1A3D;
    --ink: #EEF2FA;
    --muted: #A9B4CC;
    --line: #23305A;
    --signal: #5C8BFF;
    --signal-hover: #7AA0FF;
    --danger: #FF9A8F;
  }
}
:root[data-theme="dark"] {
  --navy-deep: #030B22;
  --paper: #0A1330;
  --surface: #0F1A3D;
  --ink: #EEF2FA;
  --muted: #A9B4CC;
  --line: #23305A;
  --signal: #5C8BFF;
  --signal-hover: #7AA0FF;
  --danger: #FF9A8F;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 40px; } }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  padding: 15px 26px;
  border: 0;
  border-radius: 6px;
  background: var(--signal);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s ease;
}
.btn:hover { background: var(--signal-hover); }
.btn[disabled] { opacity: .6; cursor: progress; }
.textlink {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ---------- Header ---------- */
.hero {
  background: var(--navy);
  color: var(--on-navy);
  padding-bottom: 96px;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.logo { width: 132px; height: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.navlink {
  color: var(--on-navy-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: 6px 0;
}
.navlink:hover { color: #fff; }
.btn-outline {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  padding: 11px 16px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 6px;
  transition: border-color .2s ease, background-color .2s ease;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.06); }
@media (max-width: 720px) { .navlink { display: none; } }

.hero-body { position: relative; padding-top: 72px; padding-left: 20px; }
@media (min-width: 768px) { .hero-body { padding-top: 112px; padding-left: 32px; } }
.guide {
  position: absolute;
  left: 0;
  top: 72px;
  bottom: 0;
  width: 2px;
  background: var(--signal);
  transform-origin: top;
}
@media (min-width: 768px) { .guide { top: 112px; } }

h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.1rem, 8.6vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
h1 .line { display: block; white-space: nowrap; }
@media (max-width: 359px) { h1 .line { white-space: normal; } }

.lede {
  margin: 32px 0 0;
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--on-navy-muted);
}
.lede strong { color: var(--on-navy); font-weight: 600; }
.lede a { color: #fff; }
.actions { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero .textlink { color: var(--on-navy-muted); }
.hero .textlink:hover { color: #fff; }

/* Page-load moment: the guide draws, then each line settles onto it */
@media (prefers-reduced-motion: no-preference) {
  .guide { animation: draw .7s cubic-bezier(.2,.7,.2,1) both; }
  h1 .line { animation: settle .9s var(--ease-out) both; }
  h1 .line:nth-child(1) { --from: 64px;  animation-delay: .45s; }
  h1 .line:nth-child(2) { --from: -48px; animation-delay: .55s; }
  h1 .line:nth-child(3) { --from: 96px;  animation-delay: .65s; }
  .hero .lede, .hero .actions { animation: rise .7s ease both; animation-delay: 1.1s; }
}
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes settle {
  from { transform: translateX(var(--from)); opacity: 0; }
  60% { opacity: 1; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Kinetic type reel (plays until the showreel is ready) ---------- */
.reel { margin-top: -48px; position: relative; }
.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy-deep);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  overflow: hidden;
  container-type: inline-size;
}
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kt { position: absolute; inset: 0; }
.kt > * { position: absolute; margin: 0; }
.kt:not(.is-live) > :not(.kt-e) { opacity: 0; }

.kt-guide { left: 8cqw; top: 30%; bottom: 30%; width: max(2px, .3cqw); background: #2E6BFF; transform-origin: top; }

.kt-e { inset: 0; display: grid; place-items: center; align-content: center; gap: 2.4cqw; }
.kt-e img { width: 34cqw; height: auto; }
.kt-e p { margin: 0; font-size: max(12px, 2cqw); font-weight: 600; color: #B9C4DD; }

.reel-note { margin-top: 14px; font-size: .95rem; color: var(--muted); max-width: 40rem; }
.reel-note a { color: var(--ink); }

/* ---------- Sections ---------- */
section.block, main.block { padding: 96px 0; }
@media (max-width: 767px) { section.block, main.block { padding: 64px 0; } }
.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 {
  margin: 0 0 40px;
  font-weight: 800;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 18ch;
}
h3 { margin: 0 0 10px; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.muted { color: var(--muted); }
.section-lede { margin: -20px 0 44px; max-width: 38rem; font-size: 1.1rem; color: var(--muted); }

.makes { display: grid; gap: 40px; }
@media (min-width: 900px) { .makes { grid-template-columns: repeat(3, 1fr); gap: 48px; } }
.makes article { padding-top: 20px; border-top: 2px solid var(--ink); }
.makes p { color: var(--muted); }

/* About, with the waving portrait */
.about { display: grid; row-gap: 32px; grid-template-areas: "head" "photo" "copy"; }
.about h2 { grid-area: head; margin: 0; }
.about .copy { grid-area: copy; }
.about .copy p + p { margin-top: 18px; }
.about .copy p { max-width: 36rem; }
.sign { margin-top: 24px !important; font-weight: 700; }
@media (min-width: 900px) {
  .about {
    grid-template-columns: 1.2fr .8fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "head photo" "copy photo";
    column-gap: 72px;
    row-gap: 28px;
  }
  .about h2 { align-self: end; }
  .about .copy { align-self: start; }
}
.portrait {
  grid-area: photo;
  position: relative;
  width: min(100% - 16px, 300px);
  margin: 0 16px 16px 0;
}
@media (min-width: 900px) { .portrait { width: 100%; max-width: 330px; justify-self: end; } }
.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--signal);
  transform: translate(var(--tx, 16px), var(--ty, 16px)) rotate(var(--r, 0deg));
}
.portrait video, .portrait img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 1148;
  object-fit: cover;
  background: var(--photo-bg);
}

/* Process, drawn as a timeline that fills as you scroll */
.timeline { position: relative; }
.tl-track { position: absolute; left: 15px; top: 6px; bottom: 24px; width: 2px; background: var(--line); }
.tl-fill { position: absolute; inset: 0; background: var(--signal); transform-origin: top center; transform: scaleY(var(--p, 1)); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 40px 56px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -6px;
  width: 32px;
  padding: 4px 0 8px;
  text-align: center;
  background: var(--paper);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--signal);
  transition: color .4s ease;
}
.steps p { color: var(--muted); }
@media (min-width: 900px) {
  .tl-track { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 2px; }
  .tl-fill { transform-origin: left center; transform: scaleX(var(--p, 1)); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { padding: 40px 32px 0 0; }
  .steps li::before { position: static; display: block; width: auto; padding: 0; text-align: left; background: none; font-size: 2.4rem; margin-bottom: 16px; }
  .steps li::after {
    content: "";
    position: absolute;
    left: 0;
    top: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 4px var(--paper);
    transition: background-color .4s ease;
  }
}
.motion-ready .steps li h3, .motion-ready .steps li p { transition: opacity .5s ease; }
.motion-ready .steps li:not(.is-on)::before { color: var(--line); }
.motion-ready .steps li:not(.is-on)::after { background: var(--line); }
.motion-ready .steps li:not(.is-on) h3, .motion-ready .steps li:not(.is-on) p { opacity: .4; }

/* Quote block */
.quote-block { display: grid; gap: 8px; }
@media (min-width: 900px) { .quote-block { grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; } }
.quote-block h2 { margin-bottom: 24px; }
.quote-lead { font-size: 1.25rem; line-height: 1.55; max-width: 36rem; margin-bottom: 28px; }
.quote-block .muted { margin-bottom: 28px; }

/* FAQ */
.faq-grid { display: grid; gap: 8px; }
@media (min-width: 900px) { .faq-grid { grid-template-columns: 5fr 7fr; gap: 64px; } }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 20px 44px 20px 0;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background:
    linear-gradient(var(--signal), var(--signal)) center / 16px 2px no-repeat,
    linear-gradient(var(--signal), var(--signal)) center / 2px 16px no-repeat;
  transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 44px 24px 0; color: var(--muted); max-width: 40rem; }

/* Contact band */
.contact { background: var(--navy); color: var(--on-navy); padding: 96px 0; }
@media (max-width: 767px) { .contact { padding: 72px 0; } }
.contact-head { display: flex; align-items: center; gap: 22px; margin-bottom: 20px; }
.contact h2 { margin: 0; max-width: 16ch; }
.contact p { color: var(--on-navy-muted); max-width: 32rem; }
.avatar {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px #2E6BFF;
}
@media (max-width: 600px) { .contact-head { align-items: flex-start; flex-direction: column; } .avatar { width: 64px; height: 64px; } }
.contact-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.contact-actions .or { color: var(--on-navy-muted); }
.mail-link {
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  text-decoration: none;
  border-bottom: 2px solid #2E6BFF;
  padding-bottom: 3px;
  word-break: break-word;
}
.mail-link:hover { border-bottom-color: #fff; }

footer { background: var(--navy-deep); color: var(--on-navy-muted); padding: 32px 0; font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
footer .logo { width: 104px; }
footer .meta { display: flex; flex-wrap: wrap; gap: 4px 24px; }
footer a { color: var(--on-navy-muted); text-decoration: none; }
footer a:hover { color: #fff; }

/* ---------- Start a project page ---------- */
.hero-compact { padding-bottom: 72px; }
.hero-compact h1 { font-size: clamp(2.2rem, 6.6vw, 4.6rem); }
.start-grid { display: grid; gap: 56px; }
@media (min-width: 960px) { .start-grid { grid-template-columns: 7fr 4fr; gap: 72px; align-items: start; } }

.form-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .field.full { grid-column: 1 / -1; } }
.field { display: grid; gap: 8px; align-content: start; }
.field label, .field legend { font-weight: 600; font-size: .95rem; padding: 0; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color .2s ease;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--signal); }
.field select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237D879C' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field textarea { min-height: 160px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem; margin-top: 2px; }
.check input { width: 18px; height: 18px; accent-color: var(--signal); margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form-actions p { color: var(--muted); font-size: .95rem; }
.form-error { margin-top: 20px; color: var(--danger); font-weight: 600; }
.form-error a { color: inherit; }
.sent { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--signal); padding: 36px; }
.sent h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 16px; }
.sent p { color: var(--muted); max-width: 32rem; }
.sent p + p { margin-top: 16px; }
.sent h2:focus { outline: none; }

.start-aside { border-top: 2px solid var(--ink); padding-top: 24px; }
.start-aside h2 { font-size: 1.5rem; margin-bottom: 20px; }
.next { list-style: none; margin: 0 0 32px; padding: 0; counter-reset: next; }
.next li { counter-increment: next; position: relative; padding: 0 0 18px 40px; color: var(--muted); }
.next li::before { content: counter(next); position: absolute; left: 0; top: -2px; font-weight: 800; font-size: 1.4rem; line-height: 1.2; color: var(--signal); }
.aside-person { display: flex; gap: 16px; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); }
.aside-person .avatar { width: 60px; height: 60px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--signal); }
.aside-person p { color: var(--muted); font-size: .95rem; }
.aside-person a { color: var(--ink); font-weight: 600; }

/* ---------- Scroll motion ---------- */
main, .contact { overflow-x: clip; }

/* Playhead: page progress drawn as a video timeline, with a running timecode */
.playhead { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.playhead span { display: block; height: 100%; background: #2E6BFF; transform-origin: left center; transform: scaleX(var(--p, 0)); }
.timecode {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(4, 15, 46, .88);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  padding: 7px 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.timecode::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2E6BFF; }
.timecode.show { opacity: 1; transform: none; }
.rm .playhead, .rm .timecode { display: none; }
@media (max-width: 899px) { .timecode { display: none; } }

/* Showreel frame grows to full size as it scrolls into view */
.motion-ready .frame { transform: scale(var(--s, 1)); transform-origin: 50% 0; }

/* Headings: each word settles into alignment */
.kw { display: inline-block; }
.motion-ready .kwi {
  display: inline-block;
  opacity: 0;
  transform: translateX(var(--x));
  transition: transform 1s var(--ease-out), opacity .6s ease;
  transition-delay: calc(var(--i) * 60ms);
}
.motion-ready .is-in .kwi { opacity: 1; transform: none; }

/* What I make: rules draw across, then the copy lands */
.motion-ready .makes article { border-top: 0; position: relative; }
.motion-ready .makes article:nth-child(2) { --i: 1; }
.motion-ready .makes article:nth-child(3) { --i: 2; }
.motion-ready .makes article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s var(--ease-out) calc(var(--i, 0) * 140ms);
}
.motion-ready .makes article > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease calc(var(--i, 0) * 140ms + 300ms), transform .8s var(--ease-out) calc(var(--i, 0) * 140ms + 300ms);
}
.motion-ready .makes.is-in article::before { transform: scaleX(1); }
.motion-ready .makes.is-in article > * { opacity: 1; transform: none; }

/* FAQ answers open smoothly where the browser supports it */
@media (prefers-reduced-motion: no-preference) {
  @supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    .faq details::details-content { height: 0; overflow: clip; transition: height .35s var(--ease-out), content-visibility .35s allow-discrete; }
    .faq details[open]::details-content { height: auto; }
  }
}

/* Legal pages */
.legal { max-width: 46rem; }
.legal h2 { font-size: 1.4rem; margin: 40px 0 12px; max-width: none; }
.legal p { color: var(--muted); }
.legal p + p { margin-top: 14px; }
.legal a { color: var(--ink); }
.form-actions p a { color: var(--ink); }
