:root {
  --color-abyss: #010407;
  --color-bg-dark: #031926;
  --color-primary: #468189;
  --color-secondary: #77aca2;
  --color-bg-light: #f8f0de;
  --color-text-light: #f8f0de;
  --color-text-dark: #031926;
  --color-accent: #ffc145;

  --color-cap-text: color-mix(in srgb, var(--color-text-light) 75%, black 25%);

  --font-serif: 'Newsreader', Georgia, "Times New Roman", serif;
  --font-sans: 'Karla', system-ui, -apple-system, "Segoe UI", sans-serif;

  --reading-max: 900px;

  --measure-quote: 23ch;

  --art-fade: 5%;

  --cap-left: 9%;
  --cap-top: 4rem;
  --gutter: 1.5rem;

  --reading-box: calc(var(--reading-max) + 2 * var(--gutter));

  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --text-xs: 0.78rem;
  --text-s: 0.95rem;

  --text-m: clamp(1.1rem, 1.5vw, 1.2rem);
  --text-l: clamp(1.5rem, 2.4vw, 2rem);

  --text-xl: clamp(1.25rem, min(3vw, 6vh), 2.4rem);

  --text-2xl: clamp(2rem, 3.6vw, 2.9rem);
  --text-3xl: clamp(3.5rem, 11vw, 7rem);
}

@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/Newsreader-Variable.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/Newsreader-Italic-Variable.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Karla';
  src: url('assets/fonts/Karla-Variable.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Karla';
  src: url('assets/fonts/Karla-Italic-Variable.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg-light);
  color: var(--color-text-dark);
  line-height: 1.5;
}

h1, h2 { line-height: 1.15; font-family: var(--font-serif); }

h2 {
  font-size: var(--text-2xl);
  font-weight: 400;
  margin: 0 0 var(--space-m);
  text-wrap: balance;
}

.section-rule {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  margin-bottom: var(--space-m);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;

  padding: calc(1rem - 3px) var(--gutter);

  background: var(--color-abyss);
  color: var(--color-text-light);
}

.nav-wordmark { font-weight: 700; font-family: var(--font-serif); }
.nav-links { display: flex; gap: var(--space-m); }
.nav-links a { color: var(--color-text-light); text-decoration: none; font-size: var(--text-s); }
.nav-links a:hover { color: var(--color-accent); }

.nav-burger {
  display: none;
  color: var(--color-text-light);
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 720px) {

  .nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    padding: 0.75rem var(--gutter);
  }

  .nav-burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.4rem;
  }

  .nav-close { display: none; }

  #menu:target { display: none; }
  #menu:target ~ .nav-close { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: var(--space-s);
    background: var(--color-abyss);

    padding: var(--gutter);
    font-size: var(--text-m);
  }

  #menu:target ~ .nav-links { display: flex; }
}

.hero {
  position: relative;

  min-height: 100vh;
  display: flex;
  flex-direction: column;

  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: var(--space-l);

  padding-top: calc(clamp(3rem, 10vh, 6rem) + 2.5in);
  color: var(--color-text-light);
  opacity: 1;

  background: var(--color-abyss);
}
.hero h1 { font-size: var(--text-3xl); margin: 0 0 var(--space-m); }

.hero-copy {
  max-width: 50ch;
  font-size: var(--text-l);
  opacity: 0.9;
}
.hero-copy p { margin: 0; }

@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero {
    animation: hero-fade-in 900ms ease-out both;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translate(-50%, 0);
  color: var(--color-text-light);
  opacity: 0.6;
}
.scroll-cue svg {
  display: block;
  width: 28px;
  height: 28px;
}
@keyframes scroll-cue-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 10px); }
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue {
    animation: scroll-cue-bounce 2s ease-in-out infinite;
  }
}

@media (max-height: 700px) {
  .scroll-cue {
    display: none;
  }
}

.intro {
  min-height: auto;
  padding: var(--space-3xl) var(--gutter) var(--space-2xl);
  background: var(--color-abyss);
  color: var(--color-text-light);
}

.intro-text {
  max-width: var(--reading-max);
  margin: 0 auto;
}
.intro-text p {

  font-weight: 400;
  font-size: var(--text-l);
  line-height: 1.45;
  margin: 0 0 1em;
}
.intro-text p:last-child { margin-bottom: 0; }

.narrative .pin-wrap {
  height: auto;
}
.narrative .pin-frame {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  min-height: 60vh;
}

.pin-frame .stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100%, calc(100vh * 16 / 9));
  aspect-ratio: 16 / 9;

  -webkit-mask-image: linear-gradient(to right,
    transparent 0, black var(--art-fade),
    black calc(100% - var(--art-fade)), transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0, black var(--art-fade),
    black calc(100% - var(--art-fade)), transparent 100%);
}
.pin-frame .stage img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0, black var(--art-fade),
    black calc(100% - var(--art-fade)), transparent 100%);
  mask-image: linear-gradient(to bottom,
    transparent 0, black var(--art-fade),
    black calc(100% - var(--art-fade)), transparent 100%);
  display: none;
}
.pin-frame .stage img:nth-of-type(3) {
  display: block;
  opacity: 1;
}

.pin-frame .captions {
  position: absolute;
  display: grid;
  align-content: start;

  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100%, calc(100vh * 16 / 9));
  aspect-ratio: 16 / 9;
  justify-items: start;

  grid-template-columns: var(--cap-left) 1fr;
  padding: var(--cap-top) var(--gutter) var(--space-l) 0;
}

.pin-frame .cap {
  opacity: 1;

  grid-area: 1 / 2;
  align-self: start;

  justify-self: start;
  width: 100%;
  max-width: var(--measure-quote);
  margin: 0;
  padding: var(--space-2xs) 0;

  color: var(--color-cap-text);

  text-shadow:
    0 0 1px color-mix(in srgb, var(--color-abyss) 100%, transparent),
    0 1px 4px color-mix(in srgb, var(--color-abyss) 92%, transparent),
    0 0 10px color-mix(in srgb, var(--color-abyss) 75%, transparent);

  font-size: var(--text-xl);
  line-height: 1.35;
  font-weight: 500;

  display: flex;
  flex-direction: column;
  gap: 0.4em;
}
.pin-frame .cap p { margin: 0; }

.pin-frame .cap p:first-child {
  font-weight: 700;
  font-size: 1.25em;
  margin-bottom: 0.3em;
}

@keyframes bg-lighten {
  0%    { background-color: var(--color-abyss); }
  37.5% { background-color: var(--color-bg-dark); }
  75%   { background-color: var(--color-primary); }
  100%  { background-color: var(--color-bg-light); }
}
@keyframes fade-out-frame {
  0%   { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fade-in-out-frame {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fade-in-out-late {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes cap-highlight {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

@media (min-width: 721px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {

    .narrative .pin-wrap {
      position: relative;
      height: 300vh;
      view-timeline-name: --pin-progress;
      view-timeline-axis: block;
    }
    .narrative .pin-frame {
      position: sticky;
      top: 0;
      height: 100vh;
      min-height: 0;
      overflow: hidden;
      animation: bg-lighten linear both;
      animation-timeline: --pin-progress;
      animation-range: 25% 75%;
    }
    .pin-frame .stage img {
      position: absolute;
      inset: 0;
      opacity: 0;
    }
    .pin-frame .stage img:nth-of-type(1) {
      display: block;
      animation: fade-out-frame linear both;
      animation-timeline: --pin-progress;
      animation-range: 25% 39%;
    }
    .pin-frame .stage img:nth-of-type(2) {
      display: block;
      animation: fade-in-out-frame linear both;
      animation-timeline: --pin-progress;
      animation-range: 35% 51%;
    }
    .pin-frame .stage img:nth-of-type(3) {
      opacity: 0;
      animation: fade-in-out-late linear both;
      animation-timeline: --pin-progress;
      animation-range: 46% 75%;
    }
    .pin-frame .cap { opacity: 0; }
    .pin-frame .captions .cap:nth-of-type(1) {
      animation: cap-highlight linear both;
      animation-timeline: --pin-progress;
      animation-range: 25% 39%;
    }
    .pin-frame .captions .cap:nth-of-type(2) {
      animation: cap-highlight linear both;
      animation-timeline: --pin-progress;
      animation-range: 35% 51%;
    }
    .pin-frame .captions .cap:nth-of-type(3) {
      animation: cap-highlight linear both;
      animation-timeline: --pin-progress;
      animation-range: 46% 64%;
    }
  }
}

@media (min-width: 721px) and (prefers-reduced-motion: no-preference) {
  .js-scrollytelling .narrative .pin-wrap {
    position: relative;

    height: 300vh;
  }
  .js-scrollytelling .narrative .pin-frame {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  .js-scrollytelling .pin-frame .stage img {
    position: absolute;
    inset: 0;
  }
  .js-scrollytelling .pin-frame .stage img:nth-of-type(1),
  .js-scrollytelling .pin-frame .stage img:nth-of-type(2) {
    display: block;
  }
}

@media (max-width: 720px) {
  .narrative .pin-wrap { height: auto; }
  .narrative .pin-frame {
    position: static;
    overflow: visible;

    display: flex;
    flex-direction: column;

    --art-fade: 14%;
    padding-bottom: 25vh;
    background: linear-gradient(
      to bottom,
      var(--color-abyss),
      var(--color-bg-dark) 33%,
      var(--color-primary) 70%,
      var(--color-primary) calc(100% - 25vh),
      var(--color-bg-light) 100%
    );
    min-height: 0;
  }

  .pin-frame .stage,
  .pin-frame .captions {
    display: contents;
  }

  .pin-frame .stage img {
    display: block !important;
    position: static;
    opacity: 1 !important;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 91% 50%;
    margin: 0;
  }
  .pin-frame .cap {

    opacity: 1 !important;
    background: none;
    max-width: none;
    margin: 0;

    color: var(--color-text-light);
    text-shadow: none;
    padding: var(--space-s) var(--gutter) var(--space-xl);

    font-size: 1.75rem;
  }

  .pin-frame .stage img:nth-of-type(1) { order: 1; }
  .pin-frame .captions .cap:nth-of-type(1) { order: 2; }
  .pin-frame .stage img:nth-of-type(2) { order: 3; }
  .pin-frame .captions .cap:nth-of-type(2) { order: 4; }
  .pin-frame .stage img:nth-of-type(3) { order: 5; }
  .pin-frame .captions .cap:nth-of-type(3) { order: 6; }
}

.section-intro, .how-different, .team {
  padding: var(--space-3xl) var(--gutter);
  max-width: var(--reading-box);
  margin: 0 auto;
}

.section-intro p, .how-different p {
  font-size: var(--text-m);

  line-height: 1.67;
  margin: 0 0 1.15em;
}
.section-intro p:last-child, .how-different p:last-child { margin-bottom: 0; }

.team-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  margin-top: var(--space-xl);
  text-align: left;
}
.team-member {
  display: flex;
  align-items: flex-start;
  gap: var(--space-m);
}
.team-photo {
  aspect-ratio: 1 / 1;

  width: 104px;
  flex: none;
  margin: 0;
  border-radius: 50%;
  background: var(--color-secondary);
  object-fit: cover;

  border: 5px solid var(--color-primary);
  box-sizing: border-box;
}

.team-member h3 { font-size: var(--text-m); margin: 0 0 var(--space-2xs); }

.team-member p {
  margin: 0;
  font-size: var(--text-s);
  line-height: 1.6;
}

@media (max-width: 720px) {

  .team-member {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "photo name"
      "bio   bio";
    align-items: center;
    column-gap: var(--space-m);
    row-gap: var(--space-s);
  }
  .team-photo {
    grid-area: photo;
    width: 80px;
    border-width: 4px;
  }

  .team-member h3 {
    grid-area: name;
    margin: 0;
  }
  .team-member p { grid-area: bio; }
}

.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-light);
  text-decoration: none;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
}
.contact-cta svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.contact-cta svg path {
  stroke: var(--color-accent);
}

.contact {
  background: var(--color-abyss);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  justify-content: center;

  padding: calc(1rem - 3px) var(--gutter);
}

.how-different, .team {
  opacity: 1;
  transform: none;
}

@keyframes fade-slide-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .how-different, .team {
      opacity: 0;
      animation: fade-slide-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 20%;
    }
  }
}
