/* AI Caramba — Mockup D (Classic Featured + Grid)
   DESIGN-ONLY · mockup-local tokens · handmade HTML/CSS
   Motion: transform/opacity only; respects prefers-reduced-motion */

:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6dc;
  --ink: #141210;
  --ink-soft: #2a2622;
  --mute: #6b6560;
  --hairline: rgba(20, 18, 16, 0.12);
  --accent: #ff4d3a;
  --accent-soft: rgba(255, 77, 58, 0.12);
  --card: #fffdf9;
  --shadow: 0 1px 2px rgba(20, 18, 16, 0.04), 0 8px 24px rgba(20, 18, 16, 0.06);
  --radius: 10px;
  --max: 1120px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* —— Top nav —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span { color: var(--accent); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--accent);
}

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
}

/* —— Shell / opener —— */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

.opener {
  max-width: 42rem;
  margin: 0 0 1.15rem;
}

.opener__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.65rem;
}

.opener__dek {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.opener__dek strong { color: var(--ink); font-weight: 600; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.15rem;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--card);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.chip.is-active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}

/* —— Featured hero (full-bleed overlay) —— */
.featured {
  position: relative;
  display: block;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: #f4f1ea;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.featured:hover {
  color: #f4f1ea;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(20, 18, 16, 0.05), 0 16px 36px rgba(20, 18, 16, 0.12);
}

.featured__media {
  position: relative;
  width: 100%;
  height: 260px;
  background: var(--ink);
  overflow: hidden;
}

.featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured__body {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
  padding: 3.5rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(20,18,16,0.92) 0%, rgba(20,18,16,0.55) 55%, transparent 100%);
}

.featured__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(244, 241, 234, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.featured__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #f4f1ea;
  max-width: 36rem;
}

.featured:hover .featured__title { color: #fff; }

.featured__dek {
  margin: 0;
  color: rgba(244, 241, 234, 0.78);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 36rem;
}

.featured .cat {
  background: rgba(255, 77, 58, 0.22);
  color: #ff8a7a;
}

.featured .ph {
  background: rgba(244, 241, 234, 0.14);
  color: rgba(244, 241, 234, 0.7);
}

@media (max-width: 700px) {
  .featured__media { height: 220px; }
  .featured__body { padding: 2.5rem 1.1rem 1rem; }
}

/* —— Latest grid —— */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.15rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head__note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(20, 18, 16, 0.05), 0 14px 32px rgba(20, 18, 16, 0.1);
}

.card__media {
  aspect-ratio: 16 / 10;
  max-height: 160px;
  background: var(--ink);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.card:hover .card__media img {
  transform: scale(1.03);
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem 0.95rem;
  flex: 1;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card__date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mute);
}

.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.card:hover .card__title { color: var(--accent); }

.card__dek {
  margin: 0;
  font-size: 0.875rem;
  color: var(--mute);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Filter hide (JS) */
.card-grid > li.is-hidden { display: none; }

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 1rem;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--mute);
}

.site-footer strong { color: var(--ink-soft); font-weight: 600; }

/* —— Essay page —— */
.essay-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.essay-hero__media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.essay-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.essay {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.essay__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.essay h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.essay__dek {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.essay__body p {
  margin: 0 0 1.15rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.essay__body p.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
}

.essay__note {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  font-size: 0.9rem;
  color: var(--mute);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--mute);
}

.back-link:hover { color: var(--accent); }

/* —— Responsive —— */
@media (max-width: 900px) {
  .featured {
    grid-template-columns: 1fr;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .featured__body { padding: 1.25rem; }
}
