* {
  box-sizing: border-box;
  margin: 0;
}

:root {
  --content-background: #fff;
  --content-text: #17231f;
  --content-muted: #60706a;
  --viewport-height: 100dvh;
}

@media (prefers-color-scheme: dark) {
  :root {
    --content-background: #080808;
    --content-text: #f5f6f2;
    --content-muted: #b7c2bb;
  }
}

/* A percentage (not px) so the browser's text size setting still applies. */
html {
  font-size: 125%;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--content-background);
  color: var(--content-text);
  font-family: Arial, Helvetica, sans-serif;
}

/* Hidden on screen but still read by screen readers. */
.visually-hidden {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Sections are focused after a nav jump; no ring needed around a whole section. */
[tabindex="-1"]:focus {
  outline: none;
}

.image-window {
  bottom: 0;
  clip-path: inset(calc(100% - var(--window-height, 0px)) 0 0);
  filter: blur(min(calc(var(--scroll-progress, 0) * 28px), 14px));
  height: var(--viewport-height);
  left: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  position: fixed;
  transform: scale(calc(1 + (var(--scroll-progress, 0) * 0.08)));
  width: 100%;
  z-index: 20;
}

.hero-scroll {
  --horizontal-progress: min(calc(var(--scroll-progress, 0) * 1), 1);
  --content-width: calc(76% + (var(--horizontal-progress) * 24%));
  --content-inset: calc((100% - var(--content-width)) / 2);
  min-height: 200vh;
  position: relative;
}

.hero {
  height: var(--viewport-height);
  inset: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  width: 100%;
}

#hero-image {
  filter: blur(min(calc(var(--scroll-progress, 0) * 28px), 14px));
  height: var(--viewport-height);
  object-fit: cover;
  object-position: center;
  transform: scale(calc(1 + (var(--scroll-progress, 0) * 0.08)));
  width: 100%;
}

.hero-logo {
  border-radius: 50%;
  color: #fff;
  display: block;
  filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.5));
  left: 50%;
  opacity: calc(1 - min(var(--scroll-progress, 0) * 2, 1));
  position: absolute;
  top: 40%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
  width: min(25vw, 200px);
}

.hero-logo:hover,
.hero-logo:focus-visible {
  transform: translate(-50%, -50%) scale(1.05);
}

.hero-logo img {
  display: block;
  height: auto;
  width: 100%;
}

.hero-panel {
  background: transparent;
  border: 0;
  bottom: calc(8% - (var(--scroll-progress, 0) * 8%));
  height: calc(
    105px + (var(--scroll-progress, 0) * (var(--viewport-height) - 105px))
  );
  left: var(--content-inset);
  pointer-events: none;
  position: absolute;
  width: var(--content-width);
  z-index: 2;
}

.page-content {
  color: var(--hero-nav-color, var(--content-text));
  isolation: isolate;
  margin-top: -135px;
  padding-inline: var(--content-inset);
  position: relative;
  width: 100%;
  z-index: 3;
}

.page-content.is-scrolling .hero-nav,
.page-content.is-scrolling .site-section {
  background: var(--content-background);
  color: var(--content-text);
}

.page-content > * {
  position: relative;
  z-index: 1;
}

/* The nav sticks to the top of the screen once it scrolls up there. */
.page-content > .hero-nav {
  position: sticky;
  top: 0;
  z-index: 2;
}

.page-content .hero-nav a {
  color: inherit;
}

/* The shadow keeps nav text readable over bright or busy parts of a photo. */
:root.image-theme-dark {
  --hero-nav-color: #fff;
  --hero-nav-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  --hero-icon-shadow: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6));
}

:root.image-theme-light {
  --hero-nav-color: #17231f;
  --hero-nav-shadow: 0 0 12px rgba(255, 255, 255, 0.8),
    0 1px 3px rgba(255, 255, 255, 0.7);
  --hero-icon-shadow: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

.hero-nav {
  align-items: flex-start;
  background: transparent;
  display: flex;
  flex: 0 0 96px;
  font-size: 1rem;
  justify-content: space-between;
  line-height: 1.15;
  padding: 1rem 1rem;
  text-shadow: var(--hero-nav-shadow, none);
  text-transform: uppercase;
  transition: background-color 0.5s ease, color 0.5s ease,
    text-shadow 0.5s ease;
}

.page-content.is-scrolling .hero-nav {
  text-shadow: none;
}

a:hover,
a:focus-visible {
  font-style: italic;
}

.hero-nav a {
  color: inherit;
  text-decoration: none;
}

.hero-title {
  font-size: inherit;
  font-weight: inherit;
  max-width: 260px;
}

/* Bobbing arrow hinting that the page scrolls; hidden once it does. */
.scroll-cue {
  left: 50%;
  padding: 0.5rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s ease;
}

.scroll-cue svg {
  animation: scroll-cue-bob 2s ease-in-out infinite;
  display: block;
  filter: var(--hero-icon-shadow, none);
  height: 16px;
  width: 28px;
}

.page-content.is-scrolling .scroll-cue {
  opacity: 0;
  pointer-events: none;
}

@keyframes scroll-cue-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue svg {
    animation: none;
  }

  /* No scroll-linked blur and zoom, or logo hover growth. */
  #hero-image,
  .image-window {
    filter: none;
    transform: none;
  }

  .hero-logo:hover,
  .hero-logo:focus-visible {
    transform: translate(-50%, -50%);
  }
}

.hero-links {
  display: flex;
  gap: clamp(0.75rem, 2vw, 2rem);
}

.hero-links a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-section {
  background: transparent;
  color: inherit;
  padding: 2rem 1rem;
  /* Keeps section headings clear of the sticky nav when jumped to
     (read by script.js). */
  scroll-margin-top: calc(3 * 1.15rem + 2rem);
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Desktop: labels in a narrow left column, content on the right. */
.section-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
}

.section-label {
  color: inherit;
  font-weight: bold;
  font-size: 1rem;
  grid-column: 1;
  letter-spacing: normal;
  line-height: 1.15;
  text-transform: uppercase;
}

.section-body {
  grid-column: 2;
}

.about-section .section-body {
  grid-column: 1 / -1;
  text-align: center;
  max-width: 600px;
  padding: 0 1rem;
  margin: 0 auto;
}
.about-section .section-body p {
  font-size: 1.5rem;
  color: var(--content-muted);
  /* line-height: 1.5; */
}
.about-section .section-body img {
  margin-top: 1rem;
  width: 50%;
  max-width: 400px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.person {
  padding: 1rem 0;
}

.person:nth-child(odd) {
  margin-right: 1.5rem;
}

.person h3 {
  color: inherit;
  font-size: 1rem;
  font-weight: normal;
  margin-bottom: 0.25rem;
}

.person p {
  color: var(--content-muted);
  font-size: 1rem;
  text-transform: uppercase;
}

.site-footer {
  background: var(--content-background);
  border-top: 10px solid var(--content-text);
  padding: 1.25rem 1rem;
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-grid p {
  line-height: 2;
  color: var(--content-muted);
}
#footer-quote {
  font-family: Georgia, serif;
  font-style: italic;
}

/* Content fades and rises into place as it scrolls into view (script.js). */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 700px) {
  /* Mobile drops the image strip, width change, blur and zoom: the nav sits
     over the photo and a background fades in once the page is scrolled. */
  .image-window {
    display: none;
  }

  .hero-scroll {
    --content-width: 100%;
  }

  .hero {
    height: 100vh;
    height: 100svh;
    overflow: visible;
  }

  /* Hangs below the screen so it also fills behind Safari's address bar. */
  #hero-image {
    filter: none;
    height: 125vh;
    height: calc(100svh + 25vh);
    transform: none;
  }

  .page-content > :not(.hero-nav) {
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  .page-content.is-scrolling > * {
    opacity: 1;
  }

  .hero-nav {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Only the links row stays on screen; the title scrolls away above it. */
  .page-content > .hero-nav {
    top: calc(-1 * (3 * 1.15rem + 1.5rem));
  }

  .site-section {
    scroll-margin-top: calc(1.15rem + 2rem);
  }

  .hero-links {
    gap: 1rem;
    width: 100%;
  }

  /* Sits at the right end of the links row. */
  .scroll-cue {
    bottom: 0.5rem;
    left: auto;
    right: 0.5rem;
    top: auto;
    transform: none;
  }

  .section-grid {
    display: block;
  }

  .section-label {
    margin-bottom: 1.5rem;
  }

  .people-grid {
    grid-template-columns: 1fr;
  }

  .person:nth-child(odd) {
    margin-right: 0;
  }
}
