/* ==========================================================================
   Terra Series — umbrella site additions
   Layered on top of the shared Applied Intuition brand system (styles.css).
   Adds only what the umbrella needs beyond the template: the landing hero,
   the equal-weight project index grid, and the alternating project spreads.
   It deliberately reuses the template's light editorial language — white page,
   a single blue accent, gray-soft alternating sections, dark footer only — so
   this site is indistinguishable in style from every Terra project's own page.
   ========================================================================== */

/* ----- Floating pill header ---------------------------------------------- *
 * Ports the SPACeR project page's menu bar so the umbrella matches its members:
 * a centered, frosted, rounded "pill" that floats over the page (fixed), rather
 * than the template's full-width sticky bar. styles.css stays untouched; these
 * rules override its .site-header / .nav block (site.css loads after it). */
:root { --header-gap: 14px; }
html { scroll-padding-top: calc(var(--header-h) + var(--header-gap) + 16px); }

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: auto; padding: var(--header-gap) 16px;
  background: none; backdrop-filter: none; border-bottom: 0;
  pointer-events: none;
}
.header-pill {
  position: relative; pointer-events: auto;
  max-width: var(--wide); margin-inline: auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--space-3);
  padding-inline: 22px;
}
.header-pill::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgba(17,17,17,.07);
  box-shadow: var(--shadow);
}
.brand-mark, .nav, .nav-toggle { position: relative; z-index: 1; }
.brand-word {
  max-width: 12em; overflow: hidden; white-space: nowrap;
  transition: max-width .4s cubic-bezier(.22,.61,.36,1), opacity .3s ease, margin .4s ease;
}

/* ----- Hero -------------------------------------------------------------- *
 * The template's masthead, reused: white field, ink headline with one blue
 * accent phrase, and a serif standfirst (the abstract line). The project index
 * sits directly beneath it. No dark fields, no gradients — the page background
 * is the page background. The top padding also clears the floating pill header
 * (which is fixed and so sits outside the document flow). */
.hero {
  padding-top: calc(var(--header-h) + var(--header-gap) + var(--space-4));
  padding-bottom: var(--space-5);
}
.hero-intro { max-width: 60rem; }
.hero h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.9rem);
  letter-spacing: -0.022em;
  line-height: 1.03;
}
.hero h1 .accent { color: var(--blue); }
.hero .lead { max-width: 62ch; }

/* ----- Project index ----------------------------------------------------- *
 * A scannable set of cards directly under the abstract line, one per project,
 * ordered by priority. Cards are anchor links to the spread below. */
.series-lead { max-width: 70ch; }
.series-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.series-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  border: 1px solid var(--gray-line);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-3) var(--space-2);
  background: var(--white);
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.series-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.series-card .sc-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink);
}
.series-card .sc-tag {
  font-family: var(--font-sans); font-size: var(--fs-meta);
  color: var(--gray); line-height: 1.45; flex: 1 1 auto;
}
.series-card .sc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5em;
  margin-top: 0.2rem;
}
.series-card .sc-arrow {
  font-family: var(--font-sans); font-weight: 600; color: var(--blue);
  transition: transform .18s ease;
}
.series-card:hover .sc-arrow { transform: translateX(3px); }

/* ----- Project spreads --------------------------------------------------- *
 * Magazine rhythm: a column of prose beside a 16:9 video, sides alternating
 * row to row (.spread--rev puts the media on the left). The media frame and
 * video reuse the brand's .intg-media / .intg-video styling from styles.css. */
.spread {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.12fr);
  gap: clamp(1.75rem, 4.5vw, var(--space-5));
  align-items: center;
}
.spread-body > :first-child { margin-top: 0; }
.spread-body h2 { margin-top: 0.2rem; }
.spread-body h2 .accent { color: var(--blue); }
.spread-lead { max-width: 56ch; }
.spread .intg-media { width: 100%; }
.spread--rev .spread-media { order: -1; }

@media (max-width: 860px) {
  .spread { grid-template-columns: 1fr; gap: var(--space-3); }
  /* always show prose above its video on narrow screens, regardless of side */
  .spread--rev .spread-media { order: 0; }
}

.spread .eyebrow { margin-bottom: var(--space-2); }

/* ----- Closing CTA band -------------------------------------------------- *
 * Kept in the same light language as everything else; a 2px blue top rule is
 * the only thing that sets it apart, marking it as the call to action. */
.band { border-top: 2px solid var(--blue); }
.band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 20ch; }
.band .lead { max-width: 58ch; }
.band .actions { margin-top: var(--space-3); }

/* ----- Mobile pill header ------------------------------------------------ *
 * applied.co-style: drop the connecting bar and show two standalone frosted
 * circles (brand left, hamburger right), opening a full-screen overlay menu.
 * Overrides the template's slide-down dropdown (styles.css @820px). */
@media (max-width: 820px) {
  :root { --header-h: 52px; }
  .header-pill::before { opacity: 0 !important; }
  .header-pill { padding-inline: 6px; gap: 0; }

  .brand-mark {
    width: var(--header-h); height: var(--header-h); justify-content: center;
    gap: 0; z-index: 2; border-radius: 999px;
    background: rgba(255,255,255,.82); border: 1px solid rgba(17,17,17,.07);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }
  .brand-word { max-width: 0; opacity: 0; margin: 0; }

  .nav-toggle {
    display: inline-flex; margin-left: auto; z-index: 2;
    width: var(--header-h); height: var(--header-h); border-radius: 999px;
    align-items: center; justify-content: center; flex-direction: column; gap: 5px;
    background: rgba(255,255,255,.82); border: 1px solid rgba(17,17,17,.07);
    box-shadow: var(--shadow); cursor: pointer; padding: 0;
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }
  .nav-toggle span {
    width: 20px; height: 2px; background: var(--ink); display: block; border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    position: fixed; inset: 0; margin: 0; z-index: 0;
    flex-direction: column; align-items: stretch; justify-content: center; gap: 0;
    padding: max(16vh, 110px) 34px calc(env(safe-area-inset-bottom) + 32px);
    background: rgba(255,255,255,.88);
    -webkit-backdrop-filter: saturate(160%) blur(22px);
    backdrop-filter: saturate(160%) blur(22px);
    border: 0; box-shadow: none; transform: none;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .28s ease, visibility 0s linear .28s;
  }
  .nav.open {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    transition: opacity .28s ease;
  }
  .nav a {
    font-family: var(--font-display); font-size: 1.7rem; font-weight: 600;
    color: var(--ink); padding: 0.55em 0; border-bottom: 1px solid var(--gray-line);
  }
  .nav a:last-child { border-bottom: none; }

  .hero { padding-top: calc(var(--header-h) + var(--header-gap) + var(--space-3)); }
}
body.nav-open { overflow: hidden; }
