/* =========================================================
   history.css — VioLev "History" section (proof)

   History's job: proof, via the work itself. The LANDING is a single-screen
   curated "featured work" portal (a few large tiles → real case-study pages).
   The case-study pages are INNER pages that SCROLL.

   IMPORTANT: case-study pages load this same file, so the single-screen shell
   is SCOPED to the landing via :has(.section-stage). Pages with .page-hero
   (the case studies) are left to scroll normally. This is where history.css
   DIVERGES from journey.css (whose file is never shared with a scrolling page).

   Scaling: the landing stays single-screen and shows only featured work. When
   the roster outgrows the screen, the landing keeps the featured few and adds a
   "See all work →" link to a scrolling archive (an inner page — scroll is legal
   there). Hook left in the markup; archive not built until the roster needs it.

   Bones at rest, violet on interaction — the house thesis.
   ========================================================= */

/* ---- single-screen shell — SCOPED to the landing only (case studies scroll) ---- */
body:has(.section-stage) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body:has(.section-stage) main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body:has(.section-stage) .site-footer { flex: 0 0 auto; }

/* ---- the stage (landing): content pulled up, grid fills the reclaimed height ---- */
.section-stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: clamp(10px, 1.6vh, 16px); text-align: center;
  padding: clamp(80px, 9vh, 96px) clamp(24px, 6vw, 64px) clamp(20px, 3vh, 30px);
}
.section-stage h1 {
  font-size: clamp(1.8rem, 4.4vw, 2.9rem); color: var(--mist); letter-spacing: -.015em;
}
.section-stage .lead {
  max-width: 54ch; color: var(--text-secondary);
  font-size: clamp(.95rem, 1.3vw, 1.08rem); line-height: 1.6;
}

/* ---- the featured work grid: large tiles that fill the screen, each → a case page.
        grid-auto-rows:1fr means 2 tiles fill one row; 3–4 wrap to a second row and
        split the height; beyond that, switch to a featured subset + archive link. ---- */
.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr;
  gap: clamp(14px, 1.8vw, 22px);
  width: 100%; max-width: 960px;
  flex: 1 1 auto; min-height: 0;
  margin-top: clamp(8px, 1.8vh, 18px);
}
.work-tile {
  display: flex; flex-direction: column; overflow: hidden; text-align: left;
  background: var(--bg-panel); border: 1px solid var(--border-primary);
  border-radius: var(--radius-md); cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}
.work-tile:hover, .work-tile:focus-visible {
  transform: translateY(-3px); border-color: var(--border-active); box-shadow: var(--glow-violet-soft);
}
/* the screenshot fills the tile; object-fit:cover keeps it clean at any tile height */
.work-tile .tile-shot { flex: 1 1 auto; min-height: 60px; width: 100%; object-fit: cover; object-position: top center; display: block; }
.work-tile .tile-meta {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px;
  padding: clamp(14px, 2vh, 20px) clamp(16px, 1.8vw, 24px);
  border-top: 1px solid var(--border-secondary);
}
.work-tile .tile-meta h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem); color: var(--mist); letter-spacing: -.01em;
}
.work-tile .tile-meta p { font-size: clamp(.84rem, 1.1vw, .94rem); color: var(--text-secondary); line-height: 1.45; }
.work-tile .open-hint {
  margin-top: 2px; font-family: var(--mono); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-muted); transition: color var(--transition-fast);
}
.work-tile:hover .open-hint, .work-tile:focus-visible .open-hint { color: var(--violet-bright); }
/* a tile whose case body isn't ready yet — quiet, clearly "in progress", not a dead link */
.work-tile.is-soon { cursor: default; }
.work-tile.is-soon:hover { transform: none; border-color: var(--border-primary); box-shadow: none; }
.work-tile.is-soon .open-hint { color: var(--text-muted); }

/* ---- portrait gate (landing only): rotate-to-landscape wall ---- */
.rotate-nag { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-nag {
    display: flex; position: fixed; inset: 0; z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 40px; text-align: center; background: var(--void);
  }
  .rotate-nag-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 7vw, 2rem); color: var(--mist); }
  .rotate-nag-sub  { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--haze); max-width: 32ch; line-height: 1.7; }
}

/* =========================================================
   CASE STUDY inner pages (scroll) — securelynx.php / wildridge.php
   Built on .section / .container / .page-hero / .slot from main.css.
   ========================================================= */

/* sticky footer for case pages: pins the footer to the bottom on short pages
   (e.g. Wildridge's thin in-progress skeleton) while tall pages scroll. Scoped
   to .page-hero so it only touches the case studies, never the landing. */
body:has(.page-hero) { display: flex; flex-direction: column; min-height: 100vh; }
body:has(.page-hero) main { flex: 1 0 auto; }
body:has(.page-hero) .site-footer { flex: 0 0 auto; }

.case-live {
  display: inline-flex; align-items: center; gap: .5em; margin-top: 18px;
  font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet-bright); transition: text-shadow var(--transition-fast);
}
.case-live:hover { text-shadow: var(--glow-violet-soft); }

.case-block { max-width: 760px; }
.case-block + .case-block { margin-top: clamp(40px, 6vh, 72px); }
.case-block h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--mist); margin-bottom: 16px; }
.case-block p  { color: var(--text-secondary); line-height: 1.75; }
.case-block p + p { margin-top: 14px; }

/* what-we-built list */
.case-points { display: grid; gap: 18px; margin-top: 8px; }
.case-point h3 { font-family: var(--display); font-size: 1.05rem; font-weight: 600; color: var(--mist); margin-bottom: 5px; }
.case-point p  { color: var(--text-secondary); line-height: 1.65; }

/* screens gallery — .slot placeholders until real shots land in images/<client>/ */
.case-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 22px); margin-top: 8px; }
.case-shots .slot { aspect-ratio: 16 / 10; }
.case-shots .slot.wide { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
.case-shots img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center top; border-radius: var(--radius-md); border: 1px solid var(--border-primary); display: block; }
.case-shots img.wide { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
@media (max-width: 640px) { .case-shots { grid-template-columns: 1fr; } }
