/* Variant C — Bands (ref: cassettemusic.com)
   Four full-bleed grain bands, one per operating system (each includes the
   shared Course Overviews download). Clicking a band expands it in place;
   one open at a time.

   Grid: a hanging indent. The logo owns its own column; the title, tagline,
   description, and resources all hang from one shared left edge (--axis),
   so the collapsed and expanded states read as one composition. */

:root {
  /* Notch-safe gutter: bands stay full-bleed under the notch in landscape,
     content never does (needs viewport-fit=cover in index.html). */
  --gutter: max(clamp(16px, 3.3vw, 48px), env(safe-area-inset-left), env(safe-area-inset-right));
  --ink: #111;
  --research: #f0f0f0; /* Research Papers band: lonerock.io research page background */
  --research-accent: #173fe8; /* Lone Rock blue, sampled from LRL_Logo_Blue.png */
  --logo: 132px;
  --logo-gap: clamp(28px, 3vw, 44px);
  --axis: calc(var(--gutter) + var(--logo) + var(--logo-gap));
}

body { background: var(--ink); color: var(--white); }

::selection { background: var(--white); color: var(--ink); }
.band ::selection { background: var(--on); color: var(--c); }
html { scrollbar-color: #444 var(--ink); }

/* ---------- Intro ---------- */
.intro {
  background-color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 9vw, 120px);
  padding: 28px var(--gutter) clamp(48px, 5vw, 64px);
}
.intro__nav { display: flex; justify-content: space-between; align-items: center; }
.intro__nav img { height: 40px; width: auto; }
.intro__nav a { display: inline-flex; align-items: center; min-height: 44px; }
.intro__tag { font-size: 12px; border: 1px solid currentColor; padding: 5px 8px; }
.intro__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: clamp(40px, 5vw, 72px);
}
.intro__headline { font-size: clamp(64px, 10.4vw, 150px); line-height: 0.84; white-space: nowrap; }
.intro__sub {
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.1;
  max-width: 460px;
  padding-bottom: 0.35em;
  text-wrap: pretty;
  color: color-mix(in srgb, var(--white) 78%, var(--ink));
}

/* ---------- Bands ---------- */
.band {
  background-color: var(--c);
  color: var(--on);
}

.band__head {
  width: 100%;
  font-weight: 400;
  display: grid;
  grid-template-columns: var(--logo) minmax(0, 1fr) minmax(0, 1fr) auto;
  column-gap: var(--logo-gap);
  align-items: center;
  text-align: left;
  padding: 24px var(--gutter);
}

/* OS marketing logo, unaltered, on a white disc so it reads on its own color */
.badge {
  display: block;
  box-sizing: border-box;
  width: var(--logo);
  height: var(--logo); /* explicit: iOS Safari stretched aspect-ratio into an oval when the title wrapped */
  flex-shrink: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--white);
  padding: calc(var(--logo) * 0.045);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 55%, #000 45%);
  transition: transform 0.6s var(--ease-out);
}
.badge img { width: 100%; height: 100%; object-fit: contain; }
#research .badge { padding: calc(var(--logo) * 0.16); } /* LRL mark is solid; inset it to sit like the OS rings */
#research .band__desc { color: var(--ink); } /* description in black; tagline stays blue */
#research .tile__dl { background: var(--research-accent); color: var(--white); } /* light band: Lone Rock blue buttons */

.band__title {
  display: block;
  font-size: clamp(56px, 5.4vw, 80px);
  line-height: 0.86;
}
/* C-specific ™ size: 30px against the 78px title (≈0.385em) */
.band__title sup.tm { font-size: 30px; top: 0.06em; margin-left: 0.04em; }

/* Tagline preview on the band's midline; hands off to the big tagline on open */
.band__hint {
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.005em;
  max-width: 34ch;
  justify-self: start;
  opacity: 0.88;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
}
.band.is-open .band__hint { opacity: 0; transform: translateY(8px); }

/* Circular toggle: + turns into × and fills on hover/open */
.band__toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s;
}
.band__toggle .icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.5;
  transition: transform 0.6s var(--ease-out);
}
.band.is-open .band__toggle { background: var(--on); color: var(--c); border-color: var(--on); }
.band.is-open .band__toggle .icon { transform: rotate(135deg); }
#research.is-open .band__toggle { background: var(--research-accent); color: var(--white); border-color: var(--research-accent); }
.band__head:focus-visible { outline: 2px solid var(--on); outline-offset: -8px; }

/* Drawer. Height is animated in app.js (Web Animations API) so the opening
   drawer, the closing drawer and the page scroll share one curve and one
   duration. CSS only holds the resting states. */
:root {
  --drawer-ease: cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart, mirrored in app.js */
}
.band__panel { height: 0; overflow: hidden; }
.band.is-open .band__panel { height: auto; }

/* Expanded body hangs from the same axis as the title. It slides down a
   touch as the drawer opens, so the content feels pulled out, not revealed. */
.band__body {
  padding: 8px var(--gutter) clamp(40px, 4vw, 56px) var(--axis);
  display: grid;
  gap: clamp(28px, 3vw, 40px);
  transform: translateY(-28px);
  transition: transform 0.45s var(--drawer-ease);
}
.band.is-open .band__body { transform: none; transition-duration: 0.8s; }

.band__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: end;
  gap: 16px clamp(32px, 4vw, 64px);
}
.band__tagline { font-size: clamp(52px, 5.2vw, 76px); line-height: 0.88; text-wrap: balance; color: var(--deep); }
.band__desc { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.1; max-width: 430px; text-wrap: pretty; color: var(--deep); }

.res-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  column-gap: 14px;
  row-gap: 14px;
}

/* Resource cards: white, like A2 and B3, so the course color frames them.
   Each card spans 4 subgrid rows (cover / type / title / button), so those
   rows line up across the whole row regardless of cover shape. */
.tile {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 10px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--c) 40%, #000 22%);
}

/* Cover: the full asset cover, uncropped, at its own aspect ratio, filling
   the card width. The cover row is as tall as the tallest cover (the portrait
   docs); shorter covers (16:9 decks) sit centered in it on both axes. */
.tile__well {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile__well img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  /* hairline + soft lift so white covers (the decks) still read on the white card */
  box-shadow: 0 0 0 1px rgba(10, 15, 63, 0.1), 0 8px 18px rgba(10, 15, 63, 0.12);
  transition: transform 0.5s var(--ease-out);
}
.tile__type { font-size: 11px; padding: 4px 4px 0; color: color-mix(in srgb, var(--ink) 62%, var(--white)); }
.tile__title { font-weight: 500; font-size: 17px; line-height: 1.15; min-height: 2.4em; padding: 0 4px; text-wrap: balance; }
.tile__dl {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 4px;
  background: var(--c);
  color: var(--on);
  font-weight: 500;
  font-size: 14px;
  transition: filter 0.2s;
}
.tile__dl .icon { width: 15px; height: 15px; transition: transform 0.3s var(--ease-out); }
.tile__dl:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* One authored moment: on open, the intro then the cards rise in sequence.
   On close, everything fades fast (no delay) so the drawer shuts clean. */
.tile,
.band__intro {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.18s ease-out, transform 0.3s var(--drawer-ease);
}
.band.is-open .band__intro,
.band.is-open .tile {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--drawer-ease), transform 0.8s var(--drawer-ease);
}
.band.is-open .band__intro { transition-delay: 0.1s; }
.band.is-open .tile:nth-child(1) { transition-delay: 0.18s; }
.band.is-open .tile:nth-child(2) { transition-delay: 0.24s; }
.band.is-open .tile:nth-child(3) { transition-delay: 0.3s; }
.band.is-open .tile:nth-child(4) { transition-delay: 0.36s; }

/* ---------- Touch + hover ---------- */
/* Hover effects only where a real pointer can hover; touch gets :active feedback. */
@media (hover: hover) and (pointer: fine) {
  .band__head:hover .badge { transform: rotate(-8deg) scale(1.03); }
  .band__head:hover .band__toggle { background: var(--on); color: var(--c); border-color: var(--on); }
  #research .band__head:hover .band__toggle { background: var(--research-accent); color: var(--white); border-color: var(--research-accent); }
  .tile:hover .tile__well img { transform: translateY(-6px); }
  .tile__dl:hover { filter: brightness(0.92); }
  .tile__dl:hover .icon { transform: translateY(2px); }
  .foot a:hover { color: var(--white); }
}
.band__head, .tile__dl, .intro__nav a, .foot a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.band__head:active .band__toggle { transform: scale(0.92); }
.band__head:active .badge { transform: scale(0.97); }
.tile__dl:active { filter: brightness(0.88); }
.band__toggle { transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s, transform 0.15s var(--ease-out); }

/* Open drawer: its header sticks to the top while you scroll the drawer, so
   close / switch is always one tap away (drawers run taller than a phone screen). */
.band.is-open > h2 {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: var(--c);
}

/* ---------- Footer ---------- */
.foot {
  background-color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px var(--gutter);
  font-size: 14px;
  color: color-mix(in srgb, var(--white) 70%, var(--ink));
}
.foot a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .band__head { grid-template-columns: var(--logo) minmax(0, 1fr) auto; }
  .band__hint { display: none; }
  .band__intro { grid-template-columns: 1fr; }
  .res-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --logo: 76px; --logo-gap: 16px; }
  .intro { gap: 56px; padding-top: 20px; padding-bottom: 40px; }
  .intro__nav img { height: 32px; }
  .intro__row { grid-template-columns: 1fr; gap: 18px; }
  .intro__headline { font-size: clamp(56px, 17vw, 96px); }
  .band__head { grid-template-columns: var(--logo) minmax(0, 1fr) 44px; padding: 18px var(--gutter); }
  .band__hint { display: none; }
  .band__title { font-size: 44px; }
  .band__title sup.tm { font-size: 17px; }
  .band__desc { font-size: 24px; } /* stays large text (≥24px) so the tonal colors keep passing */
  .band__toggle { width: 44px; height: 44px; }
  .band__toggle .icon { width: 18px; height: 18px; }
  .band__body { padding-left: var(--gutter); padding-top: 4px; }
  .res-row { column-gap: 10px; row-gap: 10px; }
  .tile__title { font-size: 15px; }
  .tile__type { font-size: 12px; }
  .tile__dl { font-size: 13px; padding: 0 10px; }
}

/* Short screens (phones in landscape): compact band headers so the sticky
   header of an open drawer doesn't eat half the screen. */
@media (max-height: 520px) {
  :root { --logo: 68px; --logo-gap: 20px; }
  .band__head { padding-top: 12px; padding-bottom: 12px; }
  .band__title { font-size: 44px; }
  .band__title sup.tm { font-size: 17px; }
  .band__hint { font-size: 18px; }
  .band__toggle { width: 44px; height: 44px; }
  .band__toggle .icon { width: 18px; height: 18px; }
  .intro { gap: 40px; padding-bottom: 32px; }
  .intro__headline { font-size: clamp(56px, 9vw, 96px); }
}

