/* Livsta. Mobile first; the layout opens up to 12 columns at 860px.
   One type family throughout: hierarchy comes from size, weight and spacing,
   with the italic reserved for captions and the lines that sit beside a title. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-italic.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f4f1e9;
  --paper-2: #eae7df;
  --ink: #252925;
  --muted: #62675c;
  --rule: rgba(37, 41, 37, 0.18);
  --brand: #1c3030; /* from the Livsta logo */
  --deep: #1c3030;
  --on-deep: #eceee4; /* the logo's off-white */
  --on-deep-muted: #a9b3ab;
  --flag: #7a4a1f;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --margin: clamp(16px, 3vw, 44px);
  --gutter: clamp(12px, 1.6vw, 24px);
  --space-s: clamp(40px, 5vw, 72px);
  --space-m: clamp(72px, 9vw, 136px);
  --space-l: clamp(104px, 14vw, 216px);

  --text-small: 0.8125rem;
  --text-body: 1.0625rem;
  --text-lead: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  --text-h3: clamp(1.375rem, 1.2rem + 0.7vw, 1.875rem);
  --text-h2: clamp(1.75rem, 1.35rem + 1.6vw, 2.875rem);
  --text-statement: clamp(1.875rem, 1.1rem + 3.1vw, 4.125rem);

  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 12px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, figure, blockquote { margin: 0; padding: 0; border: 0; }
ul { list-style: none; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h1, h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); letter-spacing: -0.015em; }
h1 a, h2 a, h3 a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.5s var(--ease); }
h1 a:hover, h2 a:hover, h3 a:hover { background-size: 100% 1px; }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 1px; }
.skip-link {
  position: absolute; left: var(--margin); top: -60px; z-index: 10;
  padding: 8px 14px; background: var(--ink); color: var(--paper); font-size: var(--text-small);
}
.skip-link:focus { top: 10px; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* Links and labels */
.section-label {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--muted);
}
.link {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.link:hover { background-size: 35% 1px; }
.link--quiet { color: var(--muted); }
.link--large { font-size: var(--text-lead); font-weight: 400; letter-spacing: -0.01em; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  padding: 8px var(--margin);
  min-height: var(--header-h);
}
.logo {
  display: block;
  width: 76px;
  aspect-ratio: 604 / 378;
  background: var(--brand);
  -webkit-mask: url("../brand/livsta-logo.png") center / contain no-repeat;
  mask: url("../brand/livsta-logo.png") center / contain no-repeat;
}
.logo--footer { width: 104px; background: var(--on-deep); }
.logo-link { display: block; }
.site-nav { display: flex; gap: clamp(12px, 2vw, 28px); font-size: clamp(0.875rem, 0.82rem + 0.2vw, 0.9375rem); }
.site-nav a {
  text-decoration: none;
  padding-block: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease);
}
.site-nav a:hover { background-size: 100% 1px; }
.site-nav__contact { color: var(--muted); margin-left: clamp(0px, 2vw, 28px); }

/* Photographs */
.photo { min-width: 0; }
.photo__frame {
  display: block;
  overflow: hidden;
  background: var(--ph, var(--paper-2));
}
.photo img {
  aspect-ratio: var(--ratio);
  object-fit: cover;
  object-position: var(--focus);
}
.photo a.photo__frame img { transition: transform 1.4s var(--ease); }
.photo a.photo__frame:hover img { transform: scale(1.015); }
.photo figcaption {
  margin-top: 8px;
  font-size: var(--text-small);
  font-style: italic;
  color: var(--muted);
}
.photo__credit { white-space: nowrap; }
.js .reveal img { opacity: 0; transition: opacity 1s var(--ease), transform 1.4s var(--ease); }
.js .reveal.is-in img { opacity: 1; }

/* Rows of photographs at different sizes (People, Made together) */
.seq-row { row-gap: var(--space-s); align-items: start; }
.seq-row__item--small:nth-child(odd) { grid-column: 1 / 5; }
.seq-row__item--small:nth-child(even) { grid-column: 3 / -1; }

/* Opening */
.opening__photo img {
  height: min(calc(100svh - var(--header-h) - 96px), 140vw);
  min-height: 360px;
  aspect-ratio: auto;
}
.opening__id {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 24px;
  padding: 14px var(--margin) 0;
  font-size: var(--text-small);
}
.opening__title { font-weight: 500; }
.opening__id p:not(.opening__title) { color: var(--muted); }

/* Introduction */
.intro { padding-block: var(--space-l); row-gap: clamp(32px, 5vw, 64px); }
.intro__statement {
  font-size: var(--text-statement);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.intro__a, .intro__b { display: block; }
.intro__a { color: var(--muted); }
.intro__b { padding-left: calc((100% + var(--gutter)) / 6); }
.intro__body { max-width: 28em; grid-column: 2 / -1; display: grid; gap: 0.9em; }

/* Section heads */
.chapters__head, .people__head { row-gap: 10px; }
.people__body { max-width: 32em; margin-top: 6px; }

/* Chapters */
.chapters { padding-bottom: var(--space-l); }
.chapters__head h2 { max-width: 17em; }
.chapter { margin-top: var(--space-m); row-gap: 22px; }
.chapter__text { display: grid; justify-items: start; align-content: start; gap: 12px; }
.chapter__number { font-size: var(--text-small); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter h3 { font-size: var(--text-h2); letter-spacing: -0.025em; }
.chapter__body { display: grid; gap: 0.7em; max-width: 30em; }
.chapter__statement { max-width: 20em; margin-top: 10px; font-size: var(--text-lead); line-height: 1.3; letter-spacing: -0.012em; text-wrap: balance; }
.chapter__inquire { margin-top: 10px; }
.chapter--1 .chapter__photo { margin-inline: calc(var(--margin) * -1); }
.chapter--2 .chapter__photo, .chapter--4 .chapter__photo { grid-column: 2 / -1; }
.chapter__secondary { grid-column: 3 / -1; margin-top: 18px; }
/* Cities Along the Way: a coda after the three journeys, text first under a rule, the city below. */
.chapter--editorial { margin-top: var(--space-l); }
.chapter--editorial .chapter__text { order: -1; padding-top: 18px; border-top: 1px solid var(--rule); }
.chapter--editorial .chapter__photo { margin-top: 10px; }

/* People */
.people { padding-block: var(--space-m) var(--space-l); background: var(--paper-2); }
.people__photos { display: grid; row-gap: var(--space-s); margin-top: var(--space-s); }

/* Studio */
.studio { padding-block: var(--space-l); }
.studio__lead { row-gap: 28px; }
.studio__text { display: grid; justify-items: start; align-content: start; gap: 12px; }
.studio__text h2 { max-width: 15em; }
.studio__body { max-width: 30em; }
.together { margin: var(--space-m) var(--margin) 0; padding: 18px 0 0; border-top: 1px solid var(--rule); row-gap: 14px; }
.together h3 { font-size: var(--text-h3); }
.together__body { display: grid; gap: 0.8em; max-width: 32em; }
.together__photos { display: grid; row-gap: var(--space-s); margin-top: var(--space-s); }
.together__photos figcaption { font-style: normal; color: var(--ink); font-weight: 500; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.together__photos .photo__credit { font-style: italic; font-weight: 400; color: var(--muted); }
.together__photos .photo__text p { max-width: 30em; }
.together__photos .photo__text { flex-basis: 100%; display: grid; gap: 0.9em; margin-top: 14px; padding-bottom: 8px; font-size: var(--text-body); font-weight: 400; line-height: 1.6; color: var(--ink); }

/* Contact */
.invitation {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: var(--space-l) var(--margin) var(--space-m);
  background: var(--deep);
  color: var(--on-deep);
}
.invitation h2 { font-size: var(--text-statement); letter-spacing: -0.03em; line-height: 1.06; max-width: 14em; }
.invitation p { max-width: 30em; color: var(--on-deep-muted); }
.contact__ways { display: grid; gap: 10px; margin-top: 18px; }
.contact__way { display: inline-flex; align-items: center; gap: 0.6em; font-size: var(--text-lead); letter-spacing: -0.01em; text-decoration: none; }
.contact__icon { flex: none; width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.contact__way span { min-width: 0; overflow-wrap: anywhere; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size 0.5s var(--ease); }
.contact__way:hover span { background-size: 35% 1px; }

/* Footer */
.site-footer {
  background: var(--deep);
  color: var(--on-deep);
  padding: 28px var(--margin) 28px;
  display: grid;
  gap: 16px;
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
}
.site-footer__row:first-child { padding-top: 22px; border-top: 1px solid rgba(236, 238, 228, 0.2); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9375rem; }
.site-footer__nav a { text-decoration: none; }
.site-footer__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__row--small { font-size: var(--text-small); color: var(--on-deep-muted); }

/* Not found */
.page-head { padding-block: var(--space-m); row-gap: 14px; }
.page-head h1 { font-size: var(--text-statement); letter-spacing: -0.03em; line-height: 1.06; }
.page-head__body { max-width: 34em; margin-top: 8px; }

/* Desktop composition */
@media (min-width: 860px) {
  :root { --header-h: 72px; }
  .logo:not(.logo--footer) { width: 88px; }
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .opening__photo img { height: calc(100svh - var(--header-h) - 52px); min-height: 460px; }
  .opening__id { flex-wrap: nowrap; }

  .intro__statement { grid-column: 1 / 12; }
  .intro__b { padding-left: calc((100% + var(--gutter)) * 3 / 11); }
  .intro__body { grid-column: 9 / 13; }

  .chapters__head h2 { grid-column: 1 / 9; }
  .people__head { align-items: end; }
  .people__head .section-label, .people__head h2 { grid-column: 1 / 7; }
  .people__body { grid-column: 8 / 13; grid-row: 2; }

  .seq-row > .photo { grid-column: var(--start) / span var(--span); grid-row: 1; }
  .seq-row__item--drop { margin-top: clamp(64px, 10vw, 180px); }

  /* Each Chapter sits differently: the glacier wide, MAPU to the right, the road offset left. */
  .chapter { row-gap: 0; align-items: end; }
  .chapter--1 { row-gap: 28px; }
  .chapter--1 .chapter__photo { grid-column: 1 / -1; margin-inline: 0; }
  .chapter--1 .chapter__text { grid-column: 7 / 12; grid-row: 2; }
  .chapter--1 .chapter__secondary { grid-column: 2 / 6; grid-row: 2; align-self: start; margin-top: clamp(48px, 7vw, 110px); }
  .chapter--2 .chapter__photo, .chapter--4 .chapter__photo { grid-column: 5 / -1; grid-row: 1; }
  .chapter--2 .chapter__text, .chapter--4 .chapter__text { grid-column: 1 / 5; grid-row: 1; padding-right: var(--gutter); }
  .chapter--3 .chapter__photo { grid-column: 2 / 9; grid-row: 1; }
  .chapter--3 .chapter__text { grid-column: 9 / 13; grid-row: 1; padding-left: var(--gutter); }
  .chapter--editorial { align-items: start; }
  .chapter--editorial .chapter__text { grid-column: 1 / -1; grid-row: 1; grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter); align-items: baseline; }
  .chapter--editorial h3 { grid-column: 1 / 5; grid-row: 1 / span 2; }
  .chapter--editorial .chapter__body { grid-column: 6 / 11; }
  .chapter--editorial .chapter__statement { grid-column: 6 / 12; }
  .chapter--editorial .chapter__photo { grid-column: 3 / -1; grid-row: 2; margin: clamp(40px, 5vw, 80px) calc(var(--margin) * -1) 0 0; }

  .studio__lead { align-items: end; row-gap: 0; }
  .studio__photo { grid-column: 1 / 9; grid-row: 1; }
  .studio__text { grid-column: 10 / 13; grid-row: 1; padding-bottom: 2.2em; }
  .together { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: baseline; }
  .together h3 { grid-column: 1 / 4; }
  .together__body { grid-column: 4 / 10; }
  .together__photos .photo__text p { max-width: min(27em, 78%); }

  .invitation { padding-inline: var(--margin); grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .invitation h2 { grid-column: 3 / -1; }
  .invitation p, .contact__ways { grid-column: 3 / 10; }

  .page-head .section-label { grid-column: 1 / 3; padding-top: 0.9em; }
  .page-head h1 { grid-column: 3 / 12; }
  .page-head__body { grid-column: 3 / 9; }
}

@media (max-width: 349px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .site-nav__contact { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal img { opacity: 1; }
}
