/* =============================================================================
   CASE STUDY STYLES  —  loaded AFTER /app.css
   -----------------------------------------------------------------------------
   Contains only what is specific to a case study:
     - case components (.back-btn, .meta-grid, .case-img, .card-box, .tradeoff-*, ...)
     - the deliberate case rhythm overrides (bigger h1 gap, section spacing, ...)
     - the resets below, which neutralise base-sheet properties that the case
       rhythm must NOT inherit.

   Design tokens, reset, shell and shared components live in /app.css ONLY.
   Generated from templates/case-template.html by scripts/split-case-css.cjs.
   ========================================================================== */

/* --- Rhythm resets: pin what /app.css would otherwise leak in ---
   Specificity must match the base rules, otherwise these lose. */
header:not(.about-hero) {
  margin-bottom: 0;
}

header:not(.about-hero) h1 {
  margin: 0 0 12px 0;
}

h2 {
  display: block;
  align-items: normal;
  gap: normal;
}

.nav-actions {
  margin-left: 0;
}

footer {
  align-items: normal;
}

nav {
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: -48px -32px 36px -32px;
        padding: 16px 32px;
        font-size: var(--text-base);
        gap: 12px;
        background: transparent;
        border-bottom: 1px solid transparent;
        transition: background-color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
      }

.back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 28px;
        box-sizing: border-box;
        line-height: 1;
        background: transparent;
        border: 1px solid var(--color-border-subtle);
        border-radius: 6px;
        font-family: var(--font-mono);
        font-size: var(--text-sm);
        color: var(--color-text-primary);
        padding: 0 10px;
        text-decoration: none;
        cursor: pointer;
        transition: all 0.15s ease;
        white-space: nowrap;
        flex-shrink: 0;
      }

.back-btn:hover {
        background: var(--color-surface-hover);
        border-color: var(--color-border-hover);
        color: var(--color-text-primary);
      }

.nav-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
      }

h1 {
        font-size: var(--text-2xl);
        font-weight: 600;
        letter-spacing: var(--tracking-tighter);
        line-height: var(--leading-tight);
        margin: 0 0 12px 0;
        color: var(--color-text-primary);
      }

.live-link-wrapper {
        margin: 0 0 24px;
      }

.live-link-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-family: var(--font-mono);
        font-size: var(--text-xs);
        color: var(--color-text-primary);
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 9999px;
        padding: 5px 12px;
        text-decoration: none;
        transition: all 0.15s ease;
      }

.live-link-pill:hover {
        background: var(--color-surface-hover);
        border-color: var(--color-border-hover);
      }

.live-link-pill .live-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: var(--color-accent-green);
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
      }

.meta-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 14px;
        padding: 18px 0;
        border-top: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
        margin: 24px 0 32px;
        font-size: var(--text-sm);
        font-family: var(--font-mono);
      }

@media (max-width: 540px) {
        .meta-item:nth-child(3),
        .meta-item:nth-child(4) {
          grid-column: 1 / -1;
        }
      }

@media (min-width: 541px) {
        .meta-grid {
          grid-template-columns: repeat(4, 1fr);
          gap: 16px;
        }
      }

.meta-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
      }

.meta-label {
        color: var(--color-text-muted);
        font-size: var(--text-xs);
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }

.meta-val {
        color: var(--color-text-primary);
        font-weight: 500;
        font-size: var(--text-sm);
        line-height: var(--leading-snug);
      }

.lead {
        font-size: var(--text-lg);
        color: var(--color-text-secondary);
        line-height: var(--leading-relaxed);
        margin-bottom: 32px;
      }

h2 {
        font-size: var(--text-xl);
        font-weight: 600;
        letter-spacing: var(--tracking-tight);
        line-height: var(--leading-snug);
        margin: 40px 0 16px 0;
        color: var(--color-text-primary);
      }

p {
        font-size: var(--text-base);
        color: var(--color-text-secondary);
        line-height: var(--leading-relaxed);
        margin: 0 0 20px 0;
      }

.img-figure {
        margin: 32px 0;
        position: relative;
        background-color: var(--color-skeleton);
        background-image: linear-gradient(
          90deg,
          rgba(255, 255, 255, 0) 0,
          rgba(255, 255, 255, 0.08) 50%,
          rgba(255, 255, 255, 0) 100%
        );
        background-size: 200% 100%;
        animation: skeleton-shimmer 2s infinite ease-in-out;
        border-radius: 8px;
        min-height: 180px;
        overflow: hidden;
      }

[data-theme="light"] .img-figure {
        background-image: linear-gradient(
          90deg,
          rgba(0, 0, 0, 0) 0,
          rgba(0, 0, 0, 0.04) 50%,
          rgba(0, 0, 0, 0) 100%
        );
      }

.img-figure.media-loaded {
        background: transparent !important;
        animation: none !important;
        min-height: auto;
      }

.case-img {
        width: 100%;
        border-radius: 8px;
        border: 1px solid var(--color-border-subtle);
        display: block;
        opacity: 0;
        transition: opacity 0.35s ease;
      }

.case-img.loaded,
      .case-img:not([loading="lazy"]) {
        opacity: 1;
      }

@keyframes skeleton-shimmer {
        0% {
          background-position: 200% 0;
        }
        100% {
          background-position: -200% 0;
        }
      }

.img-caption {
        font-size: var(--text-sm);
        font-family: var(--font-mono);
        color: var(--color-text-tertiary);
        margin-top: 8px;
      }

.card-box {
        background: transparent;
        border: none;
        border-top: 1px solid var(--color-border);
        border-radius: 0;
        padding: 18px 0 20px 0;
        margin: 0;
      }

.card-box:last-of-type {
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 28px;
      }

.card-block,
      div[style*="grid-template-columns"] > .card-box {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 16px 18px;
        margin: 0;
        transition: border-color 0.15s ease;
      }

.card-block:hover,
      div[style*="grid-template-columns"] > .card-box:hover {
        border-color: var(--color-border-hover);
      }

.tags-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 24px;
      }

.tag {
        font-size: var(--text-xs);
        font-family: var(--font-mono);
        background: var(--color-surface);
        padding: 4px 10px;
        border-radius: 4px;
        color: var(--color-text-secondary);
      }

/* Trade-offs List (Unboxed with Dividers) */
      .tradeoffs-list {
        display: flex;
        flex-direction: column;
        margin: 16px 0 36px 0;
      }

.tradeoff-card {
        background: transparent;
        border: none;
        border-top: 1px solid var(--color-border);
        border-radius: 0;
        padding: 20px 0 22px 0;
        transition: none;
      }

.tradeoff-card:last-child {
        border-bottom: 1px solid var(--color-border);
      }

.tradeoff-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin-bottom: 8px;
        padding-bottom: 0;
        border-bottom: none;
      }

.tradeoff-choice-side {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
      }

.tradeoff-pill {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        height: auto;
        padding: 0;
        border: none;
        font-family: var(--font-mono);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        line-height: 1;
        flex-shrink: 0;
      }

.choice-pill {
        background: transparent;
        color: var(--color-accent-green);
      }

[data-theme="dark"] .choice-pill {
        background: transparent;
        color: #4ade80;
      }

.tradeoff-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
        display: inline-block;
        box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
      }

.tradeoff-choice-title {
        font-family: var(--font-sans);
        font-size: 15px;
        font-weight: 600;
        color: var(--color-text-primary);
        letter-spacing: var(--tracking-tight);
        line-height: 1.3;
      }

.tradeoff-desc {
        font-size: var(--text-base);
        color: var(--color-text-secondary);
        line-height: var(--leading-relaxed);
        margin: 6px 0 0 0;
      }

/* Mobile Layout & 44px Navigation */
      @media (max-width: 560px) {
        .container {
          padding: 28px 18px 48px;
          border-left: none;
          border-right: none;
        }
        nav {
          margin: -28px -18px 24px -18px;
          padding: 12px 18px;
          gap: 8px;
        }
        .back-btn {
          height: 40px;
          min-height: 40px;
          padding: 0 14px;
          font-size: 13px;
          border-radius: 8px;
        }
        .nav-actions {
          display: none;
        }

        h2 {
          margin-top: 32px;
          margin-bottom: 12px;
        }
        .card-box {
          padding: 16px 0 18px 0;
        }
        .tradeoff-card {
          padding: 16px 0 18px 0;
        }
        .tradeoff-header {
          flex-direction: column;
          align-items: flex-start;
          gap: 4px;
          margin-bottom: 8px;
        }
        .tradeoff-choice-side {
          width: 100%;
        }
        .tradeoff-choice-title {
          font-size: 14.5px;
        }
        .tradeoff-desc {
          font-size: 14px;
          margin-top: 6px;
        }
      }

footer {
        margin-top: 64px;
        padding-top: 32px;
        border-top: 1px solid var(--color-border);
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        font-size: var(--text-sm);
        color: var(--color-text-tertiary);
      }

footer a {
        color: var(--color-text-tertiary);
        text-decoration: none;
        white-space: nowrap;
      }

footer a:hover { color: var(--color-text-primary); }

@view-transition {
        navigation: auto;
      }

/* Scroll & Mount Reveal from Blur */
      .reveal {
        opacity: 0;
        filter: blur(12px);
        transform: translateY(14px);
        transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                    filter 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: opacity, filter, transform;
      }

@media (prefers-reduced-motion: reduce) {
        .reveal {
          opacity: 1 !important;
          filter: none !important;
          transform: none !important;
          transition: none !important;
        }
      }

/* The case nav carries the back arrow, so it stays on screen at every width.
   app.css hides the page menu under 768px; this file loads after it, so the
   same selector wins here without needing extra specificity. */
@media (max-width: 767px) {
  nav {
    display: flex;
  }
}
