/* Story and legal pages only. Loaded after styles.css (legacy article layouts)
   and site.css (design system). Brings the article layouts onto the new system:
   neutral rules and cards, mono eyebrows, typography-only links, hero entrance,
   and a mobile layout that holds up at 390px. */

/* ---- Legacy header rules that site.css does not override ---- */
.site-header { inset: auto; top: 0; pointer-events: auto; }
.nav-link { font-size: inherit; }
.mega-menu { filter: none; }
@media (min-width: 861px) { .mobile-toggle, .mobile-menu { display: none; } }

/* ---- Shared ---- */
.inner-shell { width: min(calc(100% - (var(--side) * 2)), 1120px); }
.page-eyebrow { color: var(--mid); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.case-study-main--photo { padding-bottom: 0; }

/* ---- Hero ---- */
.case-hero--photo { background: var(--black); }
.case-hero--photo .page-eyebrow { color: rgba(255,255,255,.72); }
.case-hero--photo h1 { max-width: 14ch; }
.case-hero--photo .case-client-logo { margin-top: 36px; }
.case-client-name { margin-top: 36px; font-family: var(--display); font-size: clamp(28px, 2.8vw, 38px); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.case-tags { margin-top: 20px; }
.case-tags span { padding: 8px 14px; border-color: rgba(255,255,255,.3); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em; }
.case-hero__photo { transform-origin: center; }
/* Entrance: only once site.js has marked the page ready, so a failed script never hides the hero */
.is-ready .case-hero--photo .inner-shell > * { animation: storyIn .9s var(--spring) both; animation-delay: calc(var(--i, 0) * 110ms + 80ms); }
.is-ready .case-hero--photo .inner-shell > :nth-child(2) { --i: 1; }
.is-ready .case-hero--photo .inner-shell > :nth-child(3) { --i: 2; }
.is-ready .case-hero--photo .inner-shell > :nth-child(4) { --i: 3; }
.is-ready .case-hero__photo { animation: storyPhoto 1.8s var(--ease) both; }
@keyframes storyIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes storyPhoto { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* ---- Stats ---- */
.case-stats { padding-block: 64px 0; }
.case-stats article { min-height: 210px; border-radius: 20px; background: var(--card); box-shadow: none; }
.case-stats strong { letter-spacing: -.05em; }
.case-stats span { color: var(--mid); font-size: 14px; line-height: 1.5; }
/* Word stats (stories without a headline number for every card) */
.case-stats--words strong { font-size: clamp(36px, 3.6vw, 52px); letter-spacing: -.04em; }

/* ---- Narrative ---- */
.narrative-rows { margin-top: 96px; }
.story-eyebrow { display: block; margin-bottom: 22px; }
.narrative-row, .narrative-row:first-child { border-color: var(--line); }
.narrative-row:first-of-type { border-top: 1px solid var(--line); }
.narrative-num { color: #e9e6e1; }
.narrative-copy b { color: var(--mid); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .1em; }
.narrative-copy h2 { margin-top: 12px; }
.narrative-copy p { color: #4a4a4a; }

/* ---- Proof panel ---- */
.proof-panel { border-radius: 28px; }
.proof-panel .page-eyebrow { color: rgba(255,255,255,.6); }
.proof-gallery figure { position: relative; display: block; margin: 0; overflow: hidden; border-radius: 14px; background: rgba(255,255,255,.06); }
.proof-gallery figure.big { grid-row: 1 / 3; }
.proof-gallery figure img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .6s var(--ease); }
@media (hover: hover) and (pointer: fine) { .proof-gallery figure:hover img { transform: scale(1.04); } }
.proof-tag { font-family: var(--sans); }
.proof-gallery--single { display: block; height: auto; }
.proof-gallery .proof-tile--ph { display: grid; place-items: center; min-height: 320px; border-radius: 18px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); color: rgba(255,255,255,.7); font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* ---- Quote ---- */
.quote-section .quote-card { margin-top: 22px; border-radius: 28px; background: var(--card); }
.quote-card blockquote { letter-spacing: -.035em; }
.quote-card cite { margin-top: 26px; color: var(--mid); }

/* ---- More from Katars ---- */
.more-cases { margin-top: 96px; }
.case-capsules { margin-top: 24px; border-top-color: var(--line); }
.capsule { border-left-color: var(--line); }
.capsule-logo--majestic { height: 40px; }
.capsule-name { display: flex; align-items: center; height: 46px; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.capsule-stat--word { display: flex; align-items: flex-end; height: clamp(56px, 4.4vw, 70px); font-size: clamp(36px, 3vw, 46px); letter-spacing: -.04em; white-space: nowrap; }
.capsule-line { color: #4a4a4a; }
.capsule-facts, .capsule-facts li { border-color: var(--line); }
.capsule-facts li { color: var(--mid); }
.capsule-link { position: relative; gap: 0; padding-top: 26px; padding-bottom: 2px; }
.capsule-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(.35); transform-origin: left; transition: transform .45s var(--spring); }
@media (hover: hover) and (pointer: fine) { .capsule-link:hover::after { transform: none; } }

/* ---- Bottom CTA ---- */
.case-cta { margin-top: 96px; }
.case-cta .page-eyebrow { color: rgba(255,255,255,.6); }
.case-cta__sub { max-width: 540px; margin-top: 18px; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.7); }
.case-cta .btn { flex: none; }
.case-cta .btn--light { box-shadow: none; }
.case-study-main .site-footer, .legal-main + .page .site-footer { margin-top: 0; }

/* ---- Legal ---- */
.legal-header { border-bottom-color: var(--line); }
.legal-header > p:last-child { color: var(--mid); }
.legal-copy section { border-bottom-color: var(--line); }
.legal-copy p { color: #4a4a4a; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .case-hero--photo h1 { font-size: clamp(44px, 7vw, 72px); }
}
@media (max-width: 860px) {
  .case-hero--photo { min-height: 0; padding: 150px 0 40px; border-radius: 22px; }
  .case-hero--photo h1 { max-width: 12ch; font-size: clamp(38px, 10.2vw, 56px); letter-spacing: -.045em; }
  .case-hero--photo .case-client-logo, .case-hero--photo .case-client-logo--earth, .case-hero--photo .case-client-logo--majestic { height: 44px; max-width: 220px; margin-top: 28px; }
  .case-client-name { margin-top: 28px; font-size: 26px; }
  .case-tags { margin-top: 18px; gap: 6px; }
  .case-tags span { padding: 7px 11px; font-size: 10px; }

  .case-stats { grid-template-columns: 1fr; gap: 10px; padding-block: 36px 0; }
  .case-stats article { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; min-height: 0; padding: 22px 22px; border-radius: 18px; }
  .case-stats strong { font-size: 40px; }
  .case-stats span { max-width: none; font-size: 14px; }
  .case-stats article { grid-template-columns: 90px minmax(0, 1fr); }
  .case-stats--words article { grid-template-columns: 1fr; gap: 6px; }
  .case-stats--words strong { font-size: 32px; }

  .narrative-rows { margin-top: 64px; }
  .story-eyebrow { margin-bottom: 14px; }
  .narrative-row, .narrative-row--reverse { flex-direction: column; align-items: flex-start; gap: 14px; padding-block: 32px; text-align: left; }
  .narrative-row--reverse .narrative-copy { align-items: flex-start; }
  .narrative-num { font-size: 28px; line-height: 1; letter-spacing: -.03em; color: var(--muted); }
  .narrative-copy h2 { margin-top: 8px; font-size: 24px; line-height: 1.2; }
  .narrative-copy p { margin-top: 12px; font-size: 16px; line-height: 1.6; }

  .proof-panel { margin-top: 64px; padding: 26px 20px 20px; border-radius: 22px; }
  .proof-panel h2 { margin-top: 10px; font-size: 26px; }
  .proof-panel p.proof-sub { font-size: 15px; }
  .proof-gallery { grid-template-columns: 1fr; grid-template-rows: none; gap: 10px; height: auto; margin-top: 26px; }
  .proof-gallery figure.big { grid-row: auto; }
  .proof-gallery figure, .proof-gallery figure.big { height: 240px; border-radius: 12px; }
  .proof-gallery .proof-tile--ph { min-height: 220px; }
  .proof-tag { left: 12px; bottom: 12px; font-size: 11px; }

  .quote-section { margin-top: 64px; }
  .quote-section .quote-card { margin-top: 16px; padding: 28px 24px; border-radius: 22px; }
  .quote-card blockquote { font-size: 23px; line-height: 1.28; letter-spacing: -.03em; }
  .quote-card cite { margin-top: 22px; }

  .more-cases { margin-top: 64px; }
  .case-capsules { margin-top: 16px; }
  .capsule { padding: 28px 0; }
  .capsule-stat { margin-top: 22px; font-size: 48px; }
  .capsule-stat--word { height: 48px; font-size: 34px; }
  .capsule { border-bottom-color: var(--line); }
  .capsule-link { align-self: flex-start; }
  .capsule-link::after { transform: none; }

  .case-cta { flex-direction: column; align-items: flex-start; min-height: 0; margin-top: 64px; padding: 44px 24px; border-radius: 22px; }
  .case-cta h2 { font-size: clamp(32px, 9vw, 40px); }
  .case-cta__sub { margin-top: 14px; font-size: 15px; }
  .case-cta .btn { width: 100%; }

  .legal-main { padding: 48px 0 24px; }
  .legal-header { padding-bottom: 36px; }
  .legal-header h1 { margin: 12px 0 14px; font-size: clamp(40px, 11vw, 56px); }
  .legal-copy { padding-top: 12px; }
  .legal-copy section { padding-block: 24px; }
  .legal-copy h2 { font-size: 19px; }
  .legal-copy p { font-size: 15.5px; line-height: 1.65; }
}

@media (prefers-reduced-motion: reduce) {
  .is-ready .case-hero--photo .inner-shell > *, .is-ready .case-hero__photo { animation: none; }
  .proof-gallery figure img, .capsule-link::after { transition: none; }
}

/* Texas TCG Expo: the systems we built */
.tcg-systems { margin-top: 96px; }
.tcg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 22px; }
.tcg-grid article { display: flex; flex-direction: column; min-height: 220px; padding: 22px; border-radius: 18px; background: var(--card); }
.tcg-grid .mono { color: var(--mid); }
.tcg-grid h3 { margin-top: 56px; font: 500 20px/1.15 var(--display); letter-spacing: -.025em; }
.tcg-grid p { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--mid); }
@media (max-width: 1100px) { .tcg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .tcg-systems { margin-top: 64px; } .tcg-grid { grid-template-columns: 1fr; gap: 10px; } .tcg-grid article { min-height: 0; } .tcg-grid h3 { margin-top: 18px; } }

/* client logos without photos-derived styling */
.case-hero--photo .case-client-logo--crown { height: 64px; }
.case-hero--photo .case-client-logo--tcg { height: 96px; }
.capsule-logo--crown { height: 40px; }
.capsule-logo--tcg { height: 56px; }
@media (max-width: 860px) { .case-hero--photo .case-client-logo--crown { height: 48px; } .case-hero--photo .case-client-logo--tcg { height: 72px; } }
