﻿/* ════════════════════════════════════════════════════════════════════════
   CATEGORIES — featured chapters
   v6 — full rebuild.  Editorial dark "contact-sheet" with a principal
   hero plate and two counter-weights.  Refined gold hairline frame,
   corner brackets, slow film-grain ambient, and a thumb-friendly
   responsive collapse.  Keeps the existing class API so the JS that
   injects cards needs no changes.
   ════════════════════════════════════════════════════════════════════════ */

.categories {
  position: relative;
  background: var(--ink);
  color: var(--warm-white);
  overflow: hidden;
  isolation: isolate;
}

/* ─ Ambient backdrop ───────────────────────────────────────────────────── */
.categories-atmos { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.categories-mesh  { position: absolute; inset: -10%; }
.categories-mesh::before,
.categories-mesh::after {
  content: '';
  position: absolute; inset: 0;
}
.categories-mesh::before {
  background:
    radial-gradient(ellipse 70% 50% at 18% 28%, rgba(176, 141, 87, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 60% at 82% 78%, rgba(120,  95, 60,  0.07), transparent 65%);
  filter: blur(34px);
  animation: meshDrift 56s ease-in-out infinite alternate;
}
.categories-mesh::after {
  /* 1px noise overlay — barely visible, gives the dark plane texture */
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
  opacity: 0.45;
}

/* ─ Header ─────────────────────────────────────────────────────────────── */
.categories-header {
  position: relative; z-index: 3;
  max-width: var(--content-max);
  margin: 0 auto clamp(20px, 3.2vh, 36px);
  padding: 0 var(--page-gutter);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  column-gap: clamp(40px, 6vw, 84px);
  row-gap: 12px;
  align-items: end;
}
.categories-header .section-kicker { grid-column: 1 / -1; justify-content: flex-start; }
.categories-heading {
  grid-column: 1;
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--warm-white);
  max-width: 18ch;
  text-wrap: balance;
  padding-bottom: 0.08em;
}
.categories-heading em {
  font-style: italic;
  color: var(--bronze-pale);
  font-weight: 400;
}
.categories-lede {
  grid-column: 2;
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(14.5px, 1.05vw, 16px);
  line-height: 1.78;
  color: rgba(232, 226, 214, 0.66);
  max-width: 40ch;
  align-self: end;
}
@media (max-width: 860px) {
  .categories-header {
    grid-template-columns: 1fr;
    row-gap: clamp(20px, 3vh, 32px);
  }
  .categories-heading,
  .categories-lede { grid-column: 1; max-width: none; }
  .categories-heading { margin-bottom: clamp(8px, 1.4vh, 16px); }
  .categories-lede { margin-top: 4px; }
}

/* ─ Grid: hero + two counters ─────────────────────────────────────────── */
.ch-grid {
  position: relative; z-index: 3;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
}

/* ─ Card frame ─ shared shell, intentionally restrained ─────────────────── */
.ch-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0c0b0a;
  border: 1px solid rgba(196, 167, 108, 0.10);
  isolation: isolate;
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity   0.95s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    transform 0.95s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    border-color 0.55s ease;
}
.ch-card.is-visible { opacity: 1; transform: none; }
.ch-card:nth-child(2) { transition-delay: 0.12s; }
.ch-card:nth-child(3) { transition-delay: 0.24s; }
@media (hover: hover) {
  .ch-card:hover { border-color: rgba(196, 167, 108, 0.34); }
}

.ch-card--hero    { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.ch-card--counter { aspect-ratio: 4 / 3; min-width: 0; }

/* ─ Media ─────────────────────────────────────────────────────────────── */
.ch-card-media { position: absolute; inset: 0; overflow: hidden; }
.ch-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  filter: saturate(0.88) brightness(0.58) contrast(1.02);
  transition:
    opacity   0.9s ease,
    transform 2.4s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    filter    1s ease;
}
.ch-card-media img.is-loaded { opacity: 1; }
@media (hover: hover) {
  .ch-card:hover .ch-card-media img {
    transform: scale(1.05);
    filter: saturate(1.0) brightness(0.72) contrast(1.04);
  }
}

/* Dark wash for legibility */
.ch-card-wash {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 9, 8, 0.10) 0%,
    rgba(10, 9, 8, 0.34) 48%,
    rgba(10, 9, 8, 0.92) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Translucent roman numeral floating behind text */
.ch-card-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(5rem, 11vw, 11rem);
  line-height: 0.9;
  color: rgba(196, 167, 108, 0.07);
  user-select: none;
  pointer-events: none;
  transition: color 1s ease, transform 1.2s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
  white-space: nowrap;
}
@media (hover: hover) {
  .ch-card:hover .ch-card-num {
    color: rgba(196, 167, 108, 0.13);
    transform: translate(-50%, -50%) scale(1.04);
  }
}

/* ─ Corner brackets (cinematic plate accent) ──────────────────────────── */
.ch-card::before,
.ch-card::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.ch-card::before {
  top: 10px; left: 10px;
  border-top: 1px solid rgba(196, 167, 108, 0.55);
  border-left: 1px solid rgba(196, 167, 108, 0.55);
}
.ch-card::after {
  bottom: 10px; right: 10px;
  border-bottom: 1px solid rgba(196, 167, 108, 0.55);
  border-right: 1px solid rgba(196, 167, 108, 0.55);
}
@media (hover: hover) {
  .ch-card:hover::before,
  .ch-card:hover::after { opacity: 1; }
}

/* ─ Top metadata band ─────────────────────────────────────────────────── */
.ch-card-meta-top {
  position: absolute;
  top: clamp(16px, 2vw, 22px);
  left:  clamp(18px, 2.4vw, 26px);
  right: clamp(18px, 2.4vw, 26px);
  z-index: 2;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-sc);
  font-size: 9.5px;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: rgba(196, 167, 108, 0.62);
  min-width: 0;
}
.ch-card-meta-top > span:first-child,
.ch-card-meta-top > span:last-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-card-meta-top .ch-index-line {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(196, 167, 108, 0.32) 0%,
    rgba(196, 167, 108, 0.08) 100%);
}

/* ─ Body — eyebrow / title / foot ─────────────────────────────────────── */
.ch-card-body {
  position: absolute;
  left:   clamp(18px, 2.4vw, 26px);
  right:  clamp(18px, 2.4vw, 26px);
  bottom: clamp(18px, 2.4vw, 24px);
  z-index: 2;
  display: flex; flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.ch-card-eyebrow {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: rgba(196, 167, 108, 0.78);
}
.ch-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--warm-white);
  text-wrap: balance;
  overflow-wrap: anywhere;
  padding-bottom: 0.06em;
}
.ch-card-title em { font-style: italic; color: var(--bronze-pale); }
.ch-card--hero .ch-card-title { font-size: clamp(1.85rem, 3.2vw, 2.8rem); }

.ch-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  min-width: 0;
}
.ch-card-count {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12.5px;
  color: rgba(232, 226, 214, 0.52);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-card-cta {
  display: inline-flex; align-items: center; gap: 9px;
  flex: 0 0 auto;
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--bronze-pale);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity   0.45s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    transform 0.45s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    gap       0.45s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    color     0.35s ease;
}
.ch-card-cta svg { stroke: currentColor; }
@media (hover: hover) {
  .ch-card:hover .ch-card-cta {
    opacity: 1; transform: none; gap: 14px;
    color: var(--warm-white);
  }
}

/* ─ Responsive collapse ───────────────────────────────────────────────── */
@media (max-width: 820px) {
  .ch-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ch-card--hero    { aspect-ratio: 16 / 9; }
  .ch-card--counter { aspect-ratio: 4 / 3; }
}
@media (max-width: 480px) {
  .ch-card--hero    { aspect-ratio: 5 / 4; }
  .ch-card--counter { aspect-ratio: 4 / 3; }
  .ch-card-meta-top { gap: 10px; }
  .ch-card-meta-top .ch-index-line { display: none; }
  .ch-card-meta-top > span:first-child,
  .ch-card-meta-top > span:last-child { max-width: 50%; }
  .ch-card-foot { align-items: flex-start; flex-direction: column; gap: 6px; }
  .ch-card-cta {
    opacity: 1; transform: none;
    letter-spacing: 0.30em;
    color: var(--bronze-pale);
  }
  .ch-card::before,
  .ch-card::after { opacity: 0.6; }
}

/* ─ Footer CTA ────────────────────────────────────────────────────────── */
.categories-foot {
  position: relative; z-index: 3;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(48px, 7vh, 84px) var(--page-gutter) clamp(56px, 9vh, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}
.cf-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 167, 108, 0.32), transparent);
  width: 100%;
}
.categories-cta {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 30px;
  border: 1px solid rgba(196, 167, 108, 0.30);
  background: rgba(255, 255, 255, 0.02);
  transition:
    background   0.5s var(--ease-out, cubic-bezier(0.16,1,0.3,1)),
    border-color 0.5s ease,
    transform    0.55s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
}
.categories-cta:hover {
  background: rgba(196, 167, 108, 0.10);
  border-color: rgba(196, 167, 108, 0.60);
  transform: translateY(-2px);
}
.cca-eye {
  font-family: var(--font-sc);
  font-size: 9px;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: rgba(196, 167, 108, 0.70);
}
.cca-line {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 19px);
  color: var(--warm-white);
  transition: gap 0.55s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
}
.cca-line svg { stroke: currentColor; }
.categories-cta:hover .cca-line { gap: 18px; }
@media (max-width: 720px) {
  .categories-foot { grid-template-columns: 1fr; gap: 24px; }
  .cf-rule:first-child { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .categories-mesh::before { animation: none !important; }
  .ch-card,
  .ch-card-media img,
  .ch-card-num,
  .ch-card-cta { transition: none !important; }
  .ch-card { opacity: 1 !important; transform: none !important; }
}

/* Shared keyframes — kept here because about.css / footer.css / contact.css
   reference them and this stylesheet always loads. */
@keyframes meshDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(28px, -20px) scale(1.06); }
}
@keyframes sectionGlow {
  0%, 100% { transform: translate(0, 0)   scale(1);    opacity: 1; }
  25%      { transform: translate(-10px, 6px)  scale(1.04); opacity: 0.82; }
  50%      { transform: translate(-18px, 14px) scale(1.09); opacity: 0.58; }
  75%      { transform: translate(14px, -10px) scale(0.96); opacity: 0.88; }
}
@keyframes contactGlow {
  0%, 100% { transform: translate(0, 0)   scale(1);    opacity: 0.88; }
  33%      { transform: translate(10px, -8px)  scale(1.05); opacity: 0.62; }
  66%      { transform: translate(-12px,  6px) scale(0.97); opacity: 0.48; }
}
