:root {
  --ink: oklch(20% 0.01 260);
  --bg: oklch(97% 0.004 260);
  --bg-alt: oklch(95% 0.006 260);
  --sub: oklch(55% 0.01 260);
  --line: oklch(88% 0.005 260);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--sub); }
::selection { background: var(--ink); color: var(--bg); }

.serif {
  font-family: 'PT Serif', Georgia, serif;
  font-weight: 400;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 16px;
}

/* ---------- language toggle ---------- */
[data-lang] { display: none; }
html[data-lang-active="no"] [data-lang="no"] { display: block; }
html[data-lang-active="en"] [data-lang="en"] { display: block; }
html[data-lang-active="no"] a[data-lang="no"],
html[data-lang-active="en"] a[data-lang="en"] { display: inline; }
html[data-lang-active="no"] span[data-lang="no"],
html[data-lang-active="en"] span[data-lang="en"] { display: inline; }

/* ---------- scroll-to-top ---------- */
.scroll-top-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 20px -8px color-mix(in oklch, var(--ink) 30%, transparent), inset 0 0 0 1px color-mix(in oklch, white 60%, transparent);
}
.scroll-top-btn.visible { display: flex; }
.scroll-top-btn svg { stroke: var(--ink); }

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transform: translateY(0);
  transition: transform 0.3s ease;
}
.site-nav.hidden { transform: translateY(-100%); }
.site-nav .wordmark { font-size: 20px; letter-spacing: 0.01em; cursor: default; }
.nav-links { display: flex; gap: 32px; font-size: 14px; letter-spacing: 0.02em; }
.nav-links a { white-space: nowrap; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.lang-toggle button {
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  letter-spacing: inherit;
  font-weight: 400;
  transition: all 0.2s ease;
}
.lang-toggle button.active {
  font-weight: 600;
  color: var(--bg);
  background: var(--ink);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-light { background: var(--bg); color: var(--ink); }
.btn-outline { border: 1px solid var(--line); color: var(--ink); background: transparent; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(48px, 10vw, 120px) clamp(20px, 5vw, 64px) clamp(40px, 8vw, 96px);
}
.hero-grid {
  max-width: 1280px;
  margin: 0 auto;
}
.hero-grid > div { max-width: 820px; }
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.15;
}
.hero p.sub {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
  color: color-mix(in oklch, var(--ink) 75%, transparent);
  max-width: 46ch;
  margin-top: 24px;
}
.hero h1.hero-statement { font-size: clamp(28px, 3.8vw, 46px); line-height: 1.2; }
.hero-kicker {
  margin: 24px 0 0 0;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.3;
}
.hero-body { max-width: 56ch; }
.hero-body p {
  margin: 18px 0 0 0;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.7;
  color: color-mix(in oklch, var(--ink) 75%, transparent);
}
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- section shells ---------- */
.section { padding: clamp(56px, 9vw, 100px) clamp(20px, 5vw, 64px); }
.section-inner { max-width: 1280px; margin: 0 auto; }
.section h2 { margin: 0; font-size: clamp(28px, 3.2vw, 40px); }
.section-lead {
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.7;
  color: var(--sub);
  max-width: 62ch;
  margin: 16px 0 40px 0;
}

/* ---------- work ---------- */
.work-header { margin-bottom: 40px; }
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.work-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 30px -18px color-mix(in oklch, var(--ink) 25%, transparent),
    inset 0 1px 0 color-mix(in oklch, white 70%, transparent),
    inset 0 0 0 1px color-mix(in oklch, white 45%, transparent);
}
.work-card-media img,
.work-card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 16:9 player scaled to cover the 4:3 card, sides cropped */
.work-card-media iframe {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: auto;
  aspect-ratio: var(--video-ratio, 16 / 9);
  transform: translateX(-50%);
  border: 0;
  display: block;
  pointer-events: none;
}
.work-card-media.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in oklch, var(--ink) 6%, var(--bg-alt)), color-mix(in oklch, var(--ink) 12%, var(--bg-alt)));
}
.work-card-media.placeholder span {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub);
}

/* ---------- work card dropdown info ---------- */
.work-details { margin-top: 14px; border-top: 1px solid var(--line); }
.work-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.work-details summary::-webkit-details-marker { display: none; }
.work-details h3 { font-size: 16px; font-weight: 600; margin: 0; }
.work-details .chevron { stroke: var(--sub); flex: none; transition: transform 0.2s ease; }
.work-details[open] .chevron { transform: rotate(180deg); }
.work-details-body { padding: 0 0 16px 0; }
.work-card .client { font-size: 13px; color: var(--sub); margin-bottom: 10px; }
.work-card .desc { font-size: 14px; line-height: 1.6; color: color-mix(in oklch, var(--ink) 78%, transparent); margin: 0 0 10px 0; }
.work-card .role { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sub); }
.work-card .role strong { color: var(--ink); font-weight: 600; text-transform: none; letter-spacing: 0; }
.work-card .watch-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}


/* ---------- contact ---------- */
.contact-section {
  padding: clamp(64px, 11vw, 130px) clamp(20px, 5vw, 64px);
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-deco { position: absolute; right: -60px; bottom: -60px; opacity: 0.15; }
.contact-inner { max-width: 640px; margin: 0 auto; position: relative; }
.contact-section .eyebrow { color: color-mix(in oklch, var(--bg) 65%, transparent); }
.contact-section h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; }
.contact-section p.body { font-size: 17px; line-height: 1.6; margin-top: 20px; color: color-mix(in oklch, var(--bg) 80%, transparent); }
.contact-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.btn-outline-light { border: 1px solid color-mix(in oklch, var(--bg) 40%, transparent); color: var(--bg); }
.btn-outline-light:hover { color: var(--bg); border-color: var(--bg); }
.contact-email { margin-top: 16px; font-size: 13px; letter-spacing: 0.02em; color: color-mix(in oklch, var(--bg) 60%, transparent); }
.contact-email a { color: inherit; }
.contact-email a:hover { color: var(--bg); }
.footer-contact { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer {
  padding: 24px clamp(20px, 5vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: color-mix(in oklch, var(--ink) 55%, transparent);
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- front-page card link ---------- */
.work-card-link { display: block; }
.work-card-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 18px; }
a.wordmark { color: var(--ink); cursor: pointer; }

/* ---------- project page ---------- */
.project-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) clamp(20px, 5vw, 64px) clamp(56px, 9vw, 100px);
}

/* --film-rw = width/height, so tall films are capped by viewport height */
.film-player {
  position: relative;
  display: block;
  aspect-ratio: var(--film-ratio, 16 / 9);
  width: min(100%, calc(80vh * var(--film-rw, 1.7778)));
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 16px 30px -18px color-mix(in oklch, var(--ink) 25%, transparent);
}
button.film-player { cursor: pointer; }
.film-player img,
.film-player iframe,
.film-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}
.film-player.is-playing video { object-fit: contain; background: #000; }
.film-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.9;
  filter: drop-shadow(0 4px 18px rgb(0 0 0 / 0.45));
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.film-play svg { width: 64px; height: 64px; }
.film-player:is(button, a):hover .film-play,
.film-player:is(button, a):focus-visible .film-play { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
.film-missing {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  background: rgb(0 0 0 / 0.55);
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.project-title {
  margin: clamp(40px, 6vw, 72px) 0 32px 0;
  font-family: 'PT Serif', Georgia, serif;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 400;
  line-height: 1.15;
}
.project-meta { font-weight: 400; color: var(--sub); }
.project-info {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.project-info h3 { font-size: 17px; font-weight: 600; margin: 0 0 12px 0; }
.project-info p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--sub); }
.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .nav-links { display: none !important; }
  .work-grid { grid-template-columns: 1fr !important; }
  .project-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
  .info-about { grid-column: 1 / -1; }
}
