/* Other Labs: all black, simple and bare */

:root {
  --black: #000;
  --white: #f5f5f2;
  --text: #d4d6d9;
  --soft: #b3b6bb;
  --muted: #9a9ea4;
  --rule: rgba(255, 255, 255, 0.14);
  --green: #3ad96a;
  --deco: "Italiana", Didot, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { background: var(--black); }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font: 300 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--green); color: var(--black); }

a { color: inherit; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.nowrap { white-space: nowrap; }

h1 {
  font-family: var(--deco);
  font-weight: 400;
  font-size: clamp(2.8rem, 7.4vw, 6rem);
  line-height: 1.04;
  max-width: 18ch;
  margin: 0 auto 28px;
  text-wrap: balance;
}

/* Word highlight (words are wrapped by main.js) */

.word {
  opacity: 0.18;
  transition: opacity 0.4s ease;
}

.word.on { opacity: 1; }

/* Jungle inside the O: a slow walk along the path */

.jungle {
  transform-box: fill-box;
  transform-origin: center;
  animation: canopy 70s ease-in-out infinite alternate;
}

@keyframes canopy {
  0%   { transform: translateX(300px) scale(1.02); filter: brightness(0.95); }
  50%  { transform: translateX(0) scale(1.08); filter: brightness(1.1); }
  100% { transform: translateX(-300px) scale(1.03); filter: brightness(1); }
}

/* Hero */

.hero {
  position: relative;
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
  text-align: center;
}

.top-nav {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 12px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 0.85;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.logo {
  display: block;
  width: clamp(140px, 22vw, 220px);
  height: auto;
  margin: 0 auto 56px;
}

.wordmark-ol {
  font-family: var(--deco);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin: -28px 0 48px;
  padding-left: 0.42em;
}

.intro-only {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  letter-spacing: 0.02em;
  color: var(--soft);
  margin: 0 0 28px;
}

/* Goal line */

.block { padding: 32px 0 96px; }

.keyline {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
  max-width: 34ch;
  margin: 0 auto;
}

/* Areas of focus. Without JS (or with reduced motion) it is a simple stacked list. */

.focus { position: relative; }

.focus-stage {
  max-width: 1040px;
  margin: 0 auto;
  padding: 96px 24px;
}

.focus-visual,
.focus-ticks { display: none; }

.focus-items {
  display: grid;
  gap: 64px;
}

.focus-item h2 {
  font-family: var(--deco);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 18px;
}

.focus-item p {
  max-width: 24rem;
  margin: 0;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  color: var(--text);
  text-wrap: balance;
}

/* Pinned mode (added by main.js) */

.is-pinned { height: 520vh; }

.is-pinned .focus-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  max-width: 1200px;
  padding: 0 24px 0 72px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 48px;
  overflow: hidden;
}

.is-pinned .focus-items {
  position: relative;
  height: 60vh;
  display: block;
}

.is-pinned .focus-item {
  position: absolute;
  inset: 50% 0 auto;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(calc(-50% + 70px));
  transition: opacity 0.8s var(--ease), filter 0.8s var(--ease), transform 0.9s var(--ease);
  pointer-events: none;
}

.is-pinned .focus-item.is-before { transform: translateY(calc(-50% - 70px)); }

.is-pinned .focus-item.is-active {
  opacity: 1;
  filter: none;
  transform: translateY(-50%);
  pointer-events: auto;
}

.is-pinned .focus-item h2 {
  position: relative;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  margin: 0;
  padding-bottom: 28px;
}

/* Thin green line that draws in under the active heading */
.is-pinned .focus-item h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 96px;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease) 0.25s;
}

.is-pinned .focus-item.is-active h2::after { transform: scaleX(1); }

.is-pinned .focus-item p { margin-top: 28px; }

/* The O, its orbit and the progress dot. --p is scroll progress from 0 to 1. */

.is-pinned .focus-visual {
  display: block;
  justify-self: center;
  width: min(44vw, 72vh, 560px);
}

.focus-visual svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.orbit {
  fill: none;
  stroke: var(--rule);
  stroke-width: 0.4;
  stroke-dasharray: 1 3;
}

.orbit-dot-wrap { transform: rotate(calc(var(--p, 0) * 360deg)); }

.orbit-dot {
  fill: var(--green);
  filter: drop-shadow(0 0 3px var(--green));
}

.focus-o { transform: rotate(calc(var(--p, 0) * -24deg)) scale(calc(0.92 + var(--p, 0) * 0.1)); }

.focus-jungle {
  transform-box: fill-box;
  transform-origin: center;
  transform: translateX(calc(320px - var(--p, 0) * 640px)) scale(1.06);
}

.is-pinned .focus-ticks {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.focus-ticks span {
  width: 12px;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.5s ease, background 0.5s ease;
}

.focus-ticks span.on {
  width: 28px;
  background: var(--green);
}

/* Site end: values line and footer over the jungle */

.site-end {
  background:
    linear-gradient(to bottom, var(--black), rgba(0, 0, 0, 0.92) 35%, rgba(0, 0, 0, 0.7)),
    url("/assets/jungle.jpg") center 70% / cover no-repeat;
}

.human {
  padding: 120px 24px 104px;
  text-align: center;
}

.human .join-link {
  margin: 0 0 40px;
  text-decoration: none;
}

.human p {
  font-family: var(--deco);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: 0.04em;
  margin: 0;
}

footer {
  padding: 40px 0 56px;
  font-size: 0.8rem;
  color: var(--soft);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

footer a { text-decoration: none; }
footer a:hover { color: var(--white); }

/* About page */

.site-header { padding: 32px 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.section-nav { display: flex; gap: 20px; }
.section-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; text-decoration: none; }
.section-nav a:hover, .section-nav [aria-current] { text-decoration: underline; text-underline-offset: 6px; }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.home-link svg { width: 36px; height: auto; }

.home-link span {
  font-family: var(--deco);
  font-size: 0.95rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

.about { padding: 96px 0 120px; }

.about .wrap { max-width: 760px; }

.about h1 {
  max-width: none;
  margin: 0 0 56px;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.about h2 {
  font-family: var(--deco);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: 0.02em;
  margin: 96px 0 24px;
}

.about p {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 28px;
  text-wrap: pretty;
}

.about .lede {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.45;
  color: var(--white);
  margin-bottom: 48px;
}

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.people li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.people .name { font-size: clamp(1.05rem, 1.6vw, 1.2rem); }

.people .role {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (min-width: 640px) {
  .people li {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
  }
  .people .role { text-align: right; }
}

/* Join our universe */

.join-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 28px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--white);
  font-family: var(--deco);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.join-link span { transition: transform 0.25s ease; }
.join-link:hover span,
.join-link:focus-visible span { transform: translateX(4px); }
.join-link:hover,
.join-link:focus-visible { text-decoration: underline; text-underline-offset: 6px; }

.join {
  width: min(560px, 100%);
  max-height: 100dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--black);
  color: var(--white);
}

.join::backdrop { background: rgba(0, 0, 0, 0.8); }

.join-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 24px 32px;
}

.join-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.about .join-head h2 { margin: 0; }

.join-close {
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.join-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.join-form input,
.join-form textarea {
  font: inherit;
  font-size: 16px;
  color: var(--white);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0;
  padding: 10px 0;
  resize: vertical;
}

.join-form input:focus,
.join-form textarea:focus { outline: none; border-bottom-color: var(--white); }

.join-form .hp { position: absolute; left: -9999px; }

.join-submit {
  align-self: flex-start;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 28px;
  background: var(--white);
  color: var(--black);
  border: 0;
  font: inherit;
  cursor: pointer;
}

.join-submit:disabled { opacity: 0.6; cursor: progress; }

.about .join-status { margin: 0; font-size: 0.95rem; min-height: 1.5em; }

/* Small screens */

@media (max-width: 760px) {
  .hero { padding: 64px 0 32px; }
  .logo { width: 132px; margin-bottom: 44px; }
  .wordmark-ol { margin: -20px 0 36px; font-size: 0.95rem; }
  h1 { font-size: clamp(2.5rem, 11vw, 3.4rem); margin-bottom: 20px; }
  .intro-only { font-size: 1.05rem; margin: 0; }

  .block { padding: 16px 0 56px; }
  .keyline { font-size: 1.3rem; line-height: 1.5; }

  .focus-stage { padding: 72px 24px; text-align: center; }
  .focus-items { gap: 56px; }
  .focus-item p { margin: 0 auto; }

  .is-pinned .focus-stage {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 32px;
    padding: 0 24px 56px;
  }
  .is-pinned .focus-visual { width: min(52vw, 30vh); }
  .is-pinned .focus-items { width: 100%; height: 280px; }
  .is-pinned .focus-item { top: 0; transform: translateY(48px); }
  .is-pinned .focus-item.is-before { transform: translateY(-48px); }
  .is-pinned .focus-item.is-active { transform: none; }
  .is-pinned .focus-item h2 {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    line-height: 1.08;
    padding-bottom: 18px;
    text-wrap: balance;
  }
  .is-pinned .focus-item h2::after {
    left: calc(50% - 36px);
    width: 72px;
    transform-origin: center;
  }
  .is-pinned .focus-item p { margin: 18px auto 0; max-width: 22rem; }

  .is-pinned .focus-ticks {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    left: 50%;
    top: auto;
    bottom: 32px;
    transform: translateX(-50%);
  }
  .focus-ticks span { width: 16px; }
  .focus-ticks span.on { width: 32px; }

  .human { padding: 88px 24px 72px; }
  footer { padding: 32px 0 calc(40px + env(safe-area-inset-bottom)); }

  .site-header { padding: 24px 0; }
  .about { padding: 48px 0 88px; }
  .about h1 { margin-bottom: 36px; }
  .about h2 { margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .jungle { animation: none; }
}
