/* Line Ready — the library, the module landing, and the lesson hero band.
 *
 * ONE STYLESHEET, THREE PAGES. academy.html (the library), module.html (a module that is not
 * built yet) and the lesson pages all show the same pictures in the same frames, so the frames
 * are defined once. A page carries a class on a wrapper and nothing else; the same principle
 * the lesson sky uses in lr-lesson.css, for the same reason -- it is what stops module 09
 * inventing its own card in 2027.
 *
 * Every colour is a --cd-* token from brand.js. check-brand.sh scans this file.
 */

/* ---- the picture frame every module wears ------------------------------------------ */
.lrCard { display: flex; flex-direction: column; background: var(--cd-white); border-radius: 10px;
  overflow: hidden; text-decoration: none; color: inherit; position: relative;
  box-shadow: rgba(18,22,30,.024) 0 1px 4px 0, rgba(18,22,30,.05) 0 1px 0 0, rgba(18,22,30,.024) 0 0 0 1px;
  transition: box-shadow .22s ease, transform .22s ease; }
.lrCard:hover, .lrCard:focus-within { text-decoration: none; transform: translateY(-3px);
  box-shadow: rgba(0,33,77,.10) 0 14px 30px -12px, rgba(18,22,30,.05) 0 1px 0 0, rgba(0,33,77,.18) 0 0 0 1px; }
.lrCard-img { position: relative; aspect-ratio: 16 / 9; background: var(--cd-navy); overflow: hidden; }
.lrCard-img img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.lrCard:hover .lrCard-img img { transform: scale(1.04); }
/* the number, stamped on the picture like a hangar door */
.lrCard-num { position: absolute; left: 14px; bottom: 12px; font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--cd-white);
  background: rgba(0,33,77,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); }
.lrCard-chip { position: absolute; right: 12px; top: 12px; }
.lrCard-body { padding: 18px 20px 12px; flex: 1; }
.lrCard-title { font-weight: 600; font-size: 1.06rem; color: var(--cd-navy); line-height: 1.25; margin-bottom: 8px; }
.lrCard-sum { font-size: .9rem; color: var(--cd-ink-soft); line-height: 1.55; text-wrap: pretty; }
.lrCard-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px 16px; border-top: 1px solid var(--cd-line-soft); font-size: .82rem; color: var(--cd-ink-soft); }
.lrCard-cta { margin-left: auto; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 10.5px;
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cd-red); white-space: nowrap; }
.lrCard:hover .lrCard-cta { color: var(--cd-navy); }
/* a card that is listed but not built stays a real card, dimmed, and still opens its landing */
.lrCard[data-status="listed"] .lrCard-img img { filter: saturate(.72); opacity: .88; }

.lrChip { display: inline-block; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 10px;
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap; }
.lrChip[data-k="live"]    { background: var(--cd-green-bg); color: var(--cd-green); }
.lrChip[data-k="free"]    { background: var(--cd-red-bg);   color: var(--cd-red); }
.lrChip[data-k="preview"] { background: var(--cd-amber-bg); color: var(--cd-amber-text); }
.lrChip[data-k="listed"]  { background: rgba(255,255,255,.86); color: var(--cd-ink-soft); border-color: var(--cd-line-soft); }
.lrChip[data-k="lab"]     { background: var(--cd-navy); color: var(--cd-white); }

.lrGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
@media (max-width: 640px) { .lrGrid { grid-template-columns: 1fr; gap: 16px; } }

/* ---- a wing: one block of the syllabus ---------------------------------------------- */
.lrWing { padding: 46px 0 0; }
.lrWing-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.lrWing-n { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cd-red); }
.lrWing-tally { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--cd-ink-soft); margin-left: auto; }

/* ---- the hero: a photograph the page stands on --------------------------------------- */
.lrHero { position: relative; background: var(--cd-navy); color: var(--cd-white); overflow: hidden; isolation: isolate; }
.lrHero-img { position: absolute; inset: 0; z-index: 0;
  /* a templated picture rides here as a background: see module.html for why not <img src> */
  background-size: cover; background-position: var(--lr-focus, 50% 50%); background-repeat: no-repeat; }
.lrHero-img img { width: 100%; height: 100%; object-fit: cover; object-position: var(--lr-focus, 50% 50%); display: block; }
/* navy from the left so the copy sits on a calm field and the picture is left to breathe on the right */
.lrHero-scrim { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(0,33,77,.94) 0%, rgba(0,33,77,.82) 38%, rgba(0,33,77,.38) 68%, rgba(0,33,77,.12) 100%); }
.lrHero-in { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 72px 32px 64px; }
.lrHero-in h1 { color: var(--cd-white); }
.lrHero-in p  { color: var(--cd-ink-on-navy); }
.lrHero--band .lrHero-in { padding: 44px 32px 40px; }
.lrHero--band { min-height: 220px; }
@media (max-width: 720px) {
  .lrHero-scrim { background: linear-gradient(180deg, rgba(0,33,77,.90) 0%, rgba(0,33,77,.86) 70%, rgba(0,33,77,.70) 100%); }
  .lrHero-in { padding: 52px 24px 44px; }
}

/* the kicker row: wordmark · descriptor */
.lrKick { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.lrKick-word { font-family: 'Instrument Sans', 'Segoe UI', Arial, sans-serif; font-size: 1.5rem; font-weight: 600;
  color: var(--cd-white); letter-spacing: -.02em; }
.lrKick-word b { font-weight: 700; }
.lrKick-sep { color: var(--cd-red); font-size: 1.05rem; }
.lrKick-desc { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cd-ink-on-navy); }

/* the tally chips under the hero copy */
.lrStat { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lrStat b { font-size: 1.35rem; font-weight: 700; color: var(--cd-white); letter-spacing: -.02em; }
.lrStat span { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cd-ink-on-navy); }

/* ---- the way back: always on offer, never in the way ---------------------------------- */
.lrBack { display: inline-flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cd-navy-link);
  text-decoration: none; padding: 8px 0; }
.lrBack:hover { color: var(--cd-navy); text-decoration: none; }

/* ---- the door ----------------------------------------------------------------------- */
/* Two navy leaves, parted from a red seam, over the whole viewport. Rendered by academy.html's
   helmet script -- never by the DC template, because a re-render would bring it back mid-visit.
   Once per session; not at all under reduced motion. The leaves are removed from the DOM when
   the transition ends, so nothing stays in the tab order or over the page. */
.lrDoor { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: flex; }
.lrDoor-leaf { flex: 1 1 50%; background: var(--cd-navy); position: relative;
  transition: transform 1.05s cubic-bezier(.76, 0, .24, 1); will-change: transform; }
.lrDoor-leaf::after { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--cd-red);
  opacity: .9; box-shadow: 0 0 18px rgba(178,34,52,.7); }
.lrDoor-leaf[data-side="l"]::after { right: 0; }
.lrDoor-leaf[data-side="r"]::after { left: 0; }
.lrDoor-word { position: absolute; top: 50%; transform: translateY(-50%); font-family: 'Instrument Sans', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 600; letter-spacing: -.02em; color: var(--cd-white); white-space: nowrap;
  transition: opacity .35s ease; }
.lrDoor-leaf[data-side="l"] .lrDoor-word { right: 26px; }
.lrDoor-leaf[data-side="r"] .lrDoor-word { left: 26px; color: var(--cd-ink-on-navy); font-weight: 400; }
.lrDoor[data-open="true"] .lrDoor-leaf[data-side="l"] { transform: translateX(-102%); }
.lrDoor[data-open="true"] .lrDoor-leaf[data-side="r"] { transform: translateX(102%); }
.lrDoor[data-open="true"] .lrDoor-word { opacity: 0; }
/* the page under the door starts a touch below and settles up as the leaves part */
.lrRise { animation: lrRise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes lrRise { from { opacity: .0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .lrCard, .lrCard-img img, .lrDoor-leaf, .lrDoor-word { transition: none; }
  .lrCard:hover { transform: none; }
  .lrCard:hover .lrCard-img img { transform: none; }
  .lrRise { animation: none; }
}

/* ---- the three blocks: one picture each, the Academy's front room ---------------------- */
/* A block card is a module card at a larger scale, so it inherits the frame and only sets what
   differs. Three across on a desk, one deep on a phone. */
.lrBlocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 8px; }
@media (max-width: 1100px) { .lrBlocks { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .lrBlocks { grid-template-columns: 1fr; gap: 18px; } }
/* the elective wears a navy hairline so it reads as a room of its own among the three blocks */
.lrBlock[data-elective="true"] { box-shadow: rgba(18,22,30,.024) 0 1px 4px 0, rgba(18,22,30,.05) 0 1px 0 0, rgba(0,33,77,.32) 0 0 0 1px; }
.lrChip[data-k="elective"] { background: var(--cd-navy); color: var(--cd-white); }
.lrBlock .lrCard-img { aspect-ratio: 16 / 10; }
.lrBlock .lrCard-title { font-size: 1.35rem; margin-bottom: 10px; }
.lrBlock .lrCard-body { padding: 22px 24px 14px; }
.lrBlock .lrCard-foot { gap: 8px; }
/* the way back and the way sideways, inside an open block */
.lrMenu { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 6px; }
.lrMenu-sep { color: var(--cd-line-soft); }
.lrMenu a[data-on="true"] { color: var(--cd-ink-soft); pointer-events: none; }
.lrHero .lrBack { color: var(--cd-ink-on-navy); margin-bottom: 14px; }
.lrHero .lrBack:hover { color: var(--cd-white); }

/* ---- the transition: the military frame dissolves into its airline outcome ---------------- */
/* The card the reader clicked showed the military frame; the page it opens carries that frame as
   an overlay above the airline frame and fades it out once, after a beat. The fade is keyed to
   `data-lr-arrived` on <html>, set by `window.cdArrive()` a beat after arrival -- NOT to the
   element's own creation, because these pages re-render when auth settles and a fresh overlay
   would start the fade over (the block band inside academy.html sat at full opacity for exactly
   that reason). A re-render mid-fade lands on the finished state, which is the right answer.
   Under reduced motion the overlay is simply not shown and the airline frame stands alone. */
/* Reset is instant (the flag comes off and the military frame is simply back, under the door);
   the fade runs only in the arrived direction, and visibility flips after the fade has finished. */
.lrHero-before { z-index: 1; opacity: 1; visibility: visible; pointer-events: none; transition: none; }
html[data-lr-arrived] .lrHero-before { opacity: 0; visibility: hidden;
  transition: opacity 1.8s ease, visibility 0s linear 1.8s; }
@media (prefers-reduced-motion: reduce) { .lrHero-before { display: none; } }
