:root {
  --ecru: #F6F1EB;
  --sand: #E9E1D6;
  --line: #D6CDC0;
  --ink: #2B2E30;
  --slate: #454A4D;
  --mist: #62808A;
  --mist-deep: #4B6670;
  --mist-pale: #B4C6CC;

  --display: 'Bodoni Moda', 'Bodoni 72', Didot, 'Times New Roman', serif;
  --text: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --section: clamp(5rem, 11vw, 10rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--slate) var(--ecru);
  -webkit-text-size-adjust: 100%;
}

/* Lenis drives the scroll itself when it is running */
html.lenis { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--ecru);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  caret-color: var(--mist-deep);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--slate); color: var(--ecru); }

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

h1, h2, h3, p, dl, dd, figure { margin: 0; }

h1, h2, h3, .statement-lead, .wordmark text {
  font-optical-sizing: none;
  font-variation-settings: 'opsz' 28;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
}

a { color: inherit; text-underline-offset: 0.3em; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--mist-deep);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--ecru);
  z-index: 30;
}
.skip:focus { top: 0.75rem; }

/* Header: floats over the film, turns solid after it, steps aside on the way down */

.site-head {
  --wm-heim: var(--ecru);
  --wm-travel: var(--mist-pale);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  color: var(--ecru);
  font-size: 0.9375rem;
  transition: transform 0.7s var(--ease), background-color 0.5s var(--ease), color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.site-head.is-solid {
  --wm-heim: var(--slate);
  --wm-travel: var(--mist);
  background: var(--ecru);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

.site-head.is-away { transform: translateY(-101%); }
.site-head:focus-within { transform: none; }
.site-head:not(.is-solid) :focus-visible { outline-color: var(--ecru); }

.nav { display: flex; gap: clamp(1.25rem, 2.6vw, 2.5rem); }

.nav a {
  text-decoration: none;
  padding: 0.2rem 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.nav a:hover, .nav a:focus-visible { background-size: 100% 1px; }

.wordmark { display: block; width: min(13.5rem, 46vw); }
.wordmark svg { display: block; width: 100%; height: auto; overflow: visible; }
.wm-heim { fill: var(--wm-heim, var(--slate)); transition: fill 0.5s var(--ease); }
.wm-travel { fill: var(--wm-travel, var(--mist)); transition: fill 0.5s var(--ease); }

.lang { display: flex; justify-content: flex-end; gap: 1.1rem; font-size: 0.8125rem; }

.lang button {
  font: inherit;
  color: inherit;
  opacity: 0.75;
  background: none;
  border: 0;
  padding: 0.35rem 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.lang button:hover { opacity: 1; }
.lang button[aria-pressed="true"] { opacity: 1; border-bottom-color: currentColor; }

/* Hero film */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: clip;
  background: var(--slate);
  color: var(--ecru);
  text-align: center;
}

.hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(43 46 48 / 0.55) 0%, rgb(43 46 48 / 0.18) 26%, rgb(43 46 48 / 0.3) 60%, rgb(43 46 48 / 0.62) 100%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  pointer-events: none;
  padding: 7rem var(--gutter) 6rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.line > span { display: block; }

.link {
  position: relative;
  display: inline-block;
  padding-bottom: 0.4em;
  font-weight: 500;
  text-decoration: none;
}
/* No line at rest. On hover and keyboard focus it draws in from the left;
   on leaving it continues out to the right. */
.link::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.7s var(--ease);
}
.link:hover::after, .link:focus-visible::after {
  transform: none;
  transform-origin: left;
}

.hero-link { margin-top: clamp(2rem, 4vw, 3rem); font-size: 1.0625rem; pointer-events: auto; }
.hero-link:focus-visible { outline-color: var(--ecru); }

.hero-foot {
  position: absolute;
  z-index: 2;
  inset: auto var(--gutter) 1.25rem var(--gutter);
  font-size: 0.8125rem;
  text-align: left;
  pointer-events: none;
}

/* The whole film is the pause control */
.film-toggle {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.film-toggle:focus-visible { outline: 2px solid var(--ecru); outline-offset: -8px; }

/* Statement */

.statement {
  padding: var(--section) var(--gutter);
  text-align: center;
}

.statement-lead {
  max-width: 24ch;
  margin-inline: auto;
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Inspiration: full-screen images alternate with framed ones */

.section-head {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem);
  text-align: center;
}

.section-head h2, .story h2, .contact h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.section-head p { margin-top: 1.25rem; color: var(--slate); text-wrap: pretty; }

.frame { position: relative; overflow: hidden; background: var(--sand); }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Film grain over every photograph, to match the hero film. */
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.45;
}

.panel {
  position: relative;
  height: 100svh;
  color: var(--ecru);
}
.panel .frame { position: absolute; inset: 0; background: var(--slate); }
.panel .frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(43 46 48 / 0.6) 0%, rgb(43 46 48 / 0.06) 34%, rgb(43 46 48 / 0.06) 62%, rgb(43 46 48 / 0.66) 100%);
}

.panel figcaption {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: clamp(5.5rem, 12vh, 7.5rem) var(--gutter) clamp(2rem, 6vh, 3.5rem);
  text-align: center;
}

.panel h3, .plate h3 {
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.plate h3 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); }

.panel p { max-width: 34ch; font-size: clamp(1rem, 1.4vw, 1.1875rem); text-wrap: balance; }

.pair {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: start;
  gap: clamp(1.5rem, 7vw, 8rem);
  padding: var(--section) clamp(1.25rem, 9vw, 11rem);
}
.pair .plate:last-child { margin-top: clamp(4rem, 14vw, 13rem); }
.pair .frame { aspect-ratio: 4 / 5; }

.plate figcaption { margin-top: 1.5rem; text-align: center; }
.plate p {
  margin: 0.6rem auto 0;
  max-width: 32ch;
  color: var(--slate);
  text-wrap: balance;
}


/* Story */

.story {
  position: relative;
  background: var(--sand);
  padding: var(--section) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
}

.story-img { aspect-ratio: 4 / 5; background: var(--line); }

.story-text { max-width: 34rem; }
.story-text p { margin-top: 1.4rem; text-wrap: pretty; }
.story-text h2 + p { margin-top: 2rem; }


/* Contact */

.contact {
  position: relative;
  background: var(--slate);
  color: var(--ecru);
  padding: var(--section) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  column-gap: clamp(2.5rem, 8vw, 8rem);
  row-gap: clamp(2.5rem, 5vw, 4rem);
}

.contact ::selection { background: var(--ecru); color: var(--ink); }
.contact :focus-visible { outline-color: var(--ecru); }

.contact-head { grid-column: 1 / -1; max-width: 44rem; }
.contact-head p { margin-top: 1.25rem; color: var(--mist-pale); font-size: clamp(1.0625rem, 1.5vw, 1.25rem); }

.brief {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem clamp(1.5rem, 3vw, 2.5rem);
  align-content: start;
}
.field-wide { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 0.875rem;
  color: var(--mist-pale);
  margin-bottom: 0.35rem;
}

.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1.125rem;
  color: var(--ecru);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--mist);
  border-radius: 0;
  padding: 0.4rem 0 0.65rem;
  caret-color: var(--ecru);
  resize: vertical;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.field input:hover, .field textarea:hover { border-bottom-color: var(--mist-pale); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--ecru);
  box-shadow: 0 1px 0 var(--ecru);
}
.field [aria-invalid="true"] { border-bottom-color: #F0B8A8; box-shadow: 0 1px 0 #F0B8A8; }
.field-error { display: block; margin-top: 0.4rem; font-size: 0.875rem; color: #F5C9BC; }

.brief-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 0.5rem; }

.button {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--ecru);
  border: 1px solid var(--ecru);
  padding: 0.95rem 1.9rem;
  cursor: pointer;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
}
.button:hover { background: transparent; color: var(--ecru); }
.button:active { transform: translateY(1px); }

.brief-status { flex: 1 1 16rem; font-size: 0.9375rem; color: var(--mist-pale); }
.brief-status a { color: var(--ecru); }

.details { font-style: normal; }
.details h3 { font-size: 1.5rem; line-height: 1.2; }
.details dl { margin-top: 1.5rem; }
.details dl > div { padding: 1rem 0; border-top: 1px solid var(--mist); }
.details dl > div:last-child { border-bottom: 1px solid var(--mist); }
.details dt { font-size: 0.875rem; color: var(--mist-pale); }
.details dd { margin-top: 0.15rem; font-size: 1.125rem; overflow-wrap: anywhere; }
.details a { text-decoration: none; }
.details a:hover { text-decoration: underline; }

/* Footer */

.footer {
  position: relative;
  background: var(--ecru);
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) 2.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--slate);
}
.wordmark-small { width: min(12rem, 50vw); margin: 0 auto 1.75rem; }
.footer p + p { margin-top: 0.3rem; }

/* Language change: the copy breathes out and back in */

main, .footer, .nav { transition: opacity 0.28s ease; }
.is-swapping main, .is-swapping .footer, .is-swapping .nav { opacity: 0; }

/* Motion. Everything is visible without JavaScript and with reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  /* Opening: the two lines rise out of their own baseline, then the link */
  .js .line > span {
    transform: translateY(108%);
    transition: transform 1.5s var(--ease);
  }
  .js .line:nth-child(2) > span { transition-delay: 0.14s; }
  .js .hero-link, .js .hero-foot {
    opacity: 0;
    transition: opacity 1.4s var(--ease) 0.7s;
  }
  .js .hero video { transform: scale(1.08); transition: transform 3.2s var(--ease); }
  .js.is-loaded .line > span { transform: none; }
  .js.is-loaded .hero-link, .js.is-loaded .hero-foot { opacity: 1; }
  .js.is-loaded .hero video { transform: none; }

  /* Copy and framed images ease up a short distance, staggered by --i */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  /* Images sit a little taller than their frames and travel slower than the page.
     The offset is set from scroll position in script.js. */
  .js [data-parallax] {
    inset: auto;
    left: 0;
    top: -11%;
    width: 100%;
    height: 122%;
    will-change: transform;
  }

  /* The story photograph fades up once it has loaded */
  .js .story-img img { opacity: 0; transition: opacity 1.6s var(--ease); }
  .js .story-img.is-in img { opacity: 1; }

  /* The last image widens to the full page as it is reached */
  .js #growFrame { clip-path: inset(0 calc((1 - var(--g, 1)) * 9%)); }

  @supports (animation-timeline: view()) {
    /* The film sinks and dims as the page leaves it */
    .hero-copy {
      animation: hero-leave linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 70%;
    }
    @keyframes hero-leave {
      to { opacity: 0; transform: translateY(-4rem); }
    }
  }
}

/* Smaller screens */

@media (max-width: 859px) {
  .site-head {
    grid-template-columns: 1fr auto;
    row-gap: 0.6rem;
    padding-block: 0.8rem;
  }
  .site-head .wordmark { grid-row: 1; grid-column: 1; width: min(10.5rem, 46vw); }
  .lang { grid-row: 1; grid-column: 2; }
  .nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; }

  .hero-copy { padding-top: 8rem; }
  .panel figcaption { padding-top: 7.5rem; }

  .pair { grid-template-columns: 1fr; padding-inline: var(--gutter); gap: clamp(3rem, 12vw, 5rem); }
  .pair .plate { width: 84%; }
  .pair .plate:last-child { margin-top: 0; margin-left: auto; }

  .story, .contact { grid-template-columns: 1fr; }
  .story-img { aspect-ratio: 4 / 3; }
}

@media (max-width: 520px) {
  .brief { grid-template-columns: 1fr; }
  .button { width: 100%; }
}

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