/* =============================================================
   Middle Rock Management - pages.css
   Page-specific composition: hero, intro, values, contact band,
   page headers, 404. Grid-based with moments of asymmetry.
   ============================================================= */

/* ------------------------- Hero (home) -------------------------
   The logo is the brand moment. Tagline + lede sit beneath it,
   centred and vertically balanced within the first screen. */
.hero { position: relative; border-bottom: 1px solid var(--rule); }
.hero__grid {
  min-height: calc(100svh - var(--header-h));
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: clamp(1.5rem, 3.2vh, 3rem);
  padding-block: clamp(2.5rem, 6vh, 5.5rem);
}
.hero__logo-link { display: inline-block; }
.hero__logo { height: clamp(170px, 32vw, 360px); width: auto; }
.hero__tagline {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero__tagline .word { display: inline-block; }
.hero__lede {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.3;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-inline: auto;
}
.hero__meta {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-m); flex-wrap: wrap;
  margin-top: var(--space-xs);
}

/* Subtle scroll cue anchored to the bottom of the first screen. */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 3vh, 2rem);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease);
}
.hero__scroll:hover, .hero__scroll:focus-visible { color: var(--ink); }
.hero__scroll svg { width: 32px; height: 32px; animation: hero-bob 1.9s var(--ease) infinite; }
@keyframes hero-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .hero__scroll svg { animation: none; } }

/* Mobile-first hero: sized for the phone, not a shrunk desktop. */
@media (max-width: 640px) {
  .hero__grid { gap: var(--space-l); padding-block: clamp(2rem, 5vh, 3.5rem); }
  .hero__logo { height: clamp(200px, 62vw, 300px); }
  .hero__tagline { font-size: clamp(2.4rem, 12vw, 3.4rem); line-height: 1.02; }
  .hero__lede { font-size: var(--step-1); max-width: 34ch; }
  .hero__scroll { display: none; }   /* content fills the screen on phones - no room needed */
}

/* --------------------------- Intro -----------------------------
   Distinct from the hero: a labelled, larger editorial lead so the
   second screen doesn't echo the first. */
.intro__label { margin-bottom: var(--space-m); }
/* ========================= About page ===========================
   A left-justified hero statement, then the team. */
.about-hero { padding-block: clamp(1.75rem, 1rem + 2.5vw, 3.5rem) clamp(0.75rem, 0.5rem + 1vw, 1.75rem); }
.about-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  max-width: 36ch;   /* left-justified hero statement */
}
.about-team { padding-block: clamp(2rem, 1.25rem + 2.5vw, 3.5rem); }
.about-hero .section-label,
.about-team .section-label { margin-bottom: clamp(1rem, 0.6rem + 1.5vw, 2rem); }

/* ------------------- Statement panel (home "What we do") --------
   A full-bleed dark editorial band: the deliberate contrast moment
   right after the light hero. Monochrome, framed by hairlines. */
.section--statement {
  background: var(--panel-dark);
  color: var(--ink-invert);
  padding-block: clamp(3.5rem, 2.5rem + 6vw, 8rem);
}
/* Shared section label: an eyebrow with a full-width rule under it.
   Used by "What we do" (dark) and "What we value" (light) so their
   headers match. */
.section-label {
  display: block;
  padding-bottom: var(--space-s);
  margin-bottom: clamp(2rem, 1rem + 4vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.section--statement .section-label {
  color: color-mix(in srgb, var(--ink-invert) 60%, transparent);
  border-bottom-color: color-mix(in srgb, var(--ink-invert) 20%, transparent);
}
.statement__grid { display: grid; gap: var(--space-l); }
.statement__lead {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--ink-invert);
  max-width: 20ch;
}
.statement__body {
  color: color-mix(in srgb, var(--ink-invert) 82%, transparent);
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: 46ch;
}
.statement__body p + p { margin-top: var(--space-m); }
@media (min-width: 860px) {
  .statement__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--space-2xl);
    align-items: start;
  }
  .statement__body {
    padding-left: var(--space-xl);
    border-left: 1px solid color-mix(in srgb, var(--ink-invert) 20%, transparent);
  }
}

/* Section heading pattern with eyebrow + numeral */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-m); flex-wrap: wrap;
  margin-bottom: var(--space-l);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--rule);
}
.section-head__title { font-size: var(--step-4); }
.section-head__aside { display: flex; align-items: center; gap: var(--space-s); }

/* ------------------- Lexicon (home "What we value") -------------
   MOBILE: tap-to-expand accordion - one entry open at a time.
   DESKTOP: a full glossary, nothing to click - the word + its
   definition on the left, a vertical hairline, "At Middle Rock"
   on the right. Enhanced by main.js; without JS every entry shows. */
.lexicon { /* no top rule here - the section label's underline is the top boundary */ }
.lex { border-bottom: 1px solid var(--rule); }

/* Headword row: a reset button (no box) so it can toggle on mobile. */
.lex__summary {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--space-m);
  align-items: center;
  padding-block: clamp(1.15rem, 0.9rem + 1vw, 1.9rem);
}
.lex__summary:focus-visible { outline: var(--focus); outline-offset: 4px; }
.lex__headword { grid-column: 1; display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.lex__word {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.05;                 /* tight - no empty band under the word */
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color var(--dur-fast) var(--ease);
}
/* dictionary syllable dots + light primary-stress mark, kept legible */
.lex__sep { color: var(--ink-faint); padding-inline: 0.06em; font-size: 0.7em; vertical-align: 0.12em; }
.lex__stress { color: var(--ink-muted); }
.lex__pos { font-family: var(--font-display); font-style: italic; font-size: var(--step-0); color: var(--ink-muted); }
.lex__summary:hover .lex__word { color: var(--ink-soft); }

/* + / − toggle (mobile only) */
.lex__toggle { grid-column: 2; position: relative; width: 22px; height: 22px; color: var(--ink-muted); }
.lex__toggle::before, .lex__toggle::after { content: ""; position: absolute; background: currentColor; }
.lex__toggle::before { top: 50%; left: 0; right: 0; height: 1.5px; transform: translateY(-50%); }
.lex__toggle::after { left: 50%; top: 0; bottom: 0; width: 1.5px; transform: translateX(-50%); transition: opacity var(--dur-fast) var(--ease); }
.lex.is-open .lex__toggle::after { opacity: 0; }
.lex.is-open .lex__toggle { color: var(--ink); }

.lex__panel { padding: 0 0 var(--space-l); max-width: 54ch; }
.lex__def {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--ink-muted);
  margin-bottom: var(--space-m);
}
.lex__mrm {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--ink);
  max-width: 44ch;
}
.lex__mrm-label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}
@keyframes lex-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* MOBILE accordion: collapse the panel; tighten headword→panel. */
@media (max-width: 759.98px) {
  .js .lex__panel { display: none; }
  .js .lex.is-open .lex__summary { padding-bottom: var(--space-2xs); }
  .js .lex.is-open .lex__panel { display: block; animation: lex-in 0.4s var(--ease); }
}

/* DESKTOP: full glossary - word + definition left, "At Middle Rock"
   right, split by a vertical hairline. Nothing collapses. */
@media (min-width: 760px) {
  .lex {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-template-rows: min-content 1fr;   /* word row hugs the word; slack falls below the definition */
    column-gap: var(--space-xl);
    row-gap: var(--space-2xs);
    align-items: start;
    padding-block: var(--space-l);
  }
  .lex__summary { grid-column: 1; grid-row: 1; padding: 0; cursor: default; pointer-events: none; }
  .lex__toggle { display: none; }
  .lex__panel { display: contents; }             /* let def + mrm flow into the grid */
  .lex__def { grid-column: 1; grid-row: 2; margin: 0; max-width: 42ch; align-self: start; }
  .lex__mrm {
    grid-column: 2; grid-row: 1 / span 2;
    padding-left: var(--space-xl);
    border-left: 1px solid var(--rule);
    align-self: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lex__word, .lex__toggle::after { transition: none; }
  .js .lex.is-open .lex__panel { animation: none; }
}

/* ----------------------- Team preview --------------------------
   Portrait card: image, then name + title (no bio - full bios on /about/). */
.team-preview__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); }
.mini-member { display: flex; flex-direction: column; }
.mini-member__media { margin-bottom: var(--space-s); }
.mini-member__name { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.05; color: var(--ink); }
.mini-member__role {
  font-size: clamp(0.68rem, 0.6rem + 0.35vw, 0.82rem);
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-muted); margin-top: 0.5rem;
}
.team-preview__more { margin-top: var(--space-l); text-align: right; }
/* Keep both members side by side on mobile so both are visible at once */
@media (max-width: 560px) {
  .team-preview__grid { gap: clamp(0.9rem, 3vw, 1.5rem); }
  .mini-member__name { font-size: var(--step-1); }
  .mini-member__role { letter-spacing: 0.1em; margin-top: 0.4rem; }
}

/* --------------------------- Contact band ---------------------- */
.contact-band__grid { display: grid; gap: var(--space-l); align-items: end; }
.contact-band__email {
  font-family: var(--font-display);
  font-size: var(--step-4);
  color: var(--ink);
  word-break: break-word;
}
.contact-band__policy { color: var(--ink-muted); max-width: 46ch; }
.contact-band__policy strong { color: var(--ink-soft); }
@media (min-width: 820px) {
  .contact-band__grid { grid-template-columns: 1.4fr 1fr; gap: var(--space-2xl); }
}

/* ----------------------- Page header (subpages) ---------------- */
.page-header { padding-block: clamp(3.5rem, 2rem + 7vw, 7rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.page-header__title { font-size: var(--step-5); line-height: 0.98; }
.page-header__lede {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--ink-soft);
  max-width: 34ch;
  margin-top: var(--space-m);
  line-height: 1.28;
}
.page-header__eyebrow { margin-bottom: var(--space-m); display: inline-block; }

/* --------------------------- Contact page ---------------------- */
/* Contact is a minimal hero (eyebrow + title + copy) reusing the
   .about-hero title/deck styles; the footer CTA carries the action. */

/* --------------------------- 404 ------------------------------- */
.error-page {
  min-height: 70vh;
  display: grid; place-content: center;
  text-align: center;
  padding-block: var(--space-2xl);
}
.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 2rem + 14vw, 10rem);
  line-height: 0.9;
  color: var(--ink);
}
.error-page__msg { font-size: var(--step-2); color: var(--ink-soft); margin-block: var(--space-m) var(--space-l); font-family: var(--font-display); }

/* --------------------- Reveal-on-scroll ------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
/* If JS is off, never hide content */
.no-js [data-reveal] { opacity: 1; transform: none; }
