/* ══════════════════════════════════════════════════════════════
   Case Study — Shared Editorial Stylesheet
   Design system: PP Editorial New (serif) + PP Radio Grotesk (sans)
   Mirrors /about layout grid and sidebar conventions
   ══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'PP Editorial New';
  src: url('/assets/fonts/PPEditorialNew.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Radio Grotesk';
  src: url('/assets/fonts/PPRadioGrotesk.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ── */
:root {
  --font-serif: 'PP Editorial New', Georgia, serif;
  --font-sans: 'PP Radio Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --color-bg: #FAFAF7;
  --color-text: #1A1A17;
  --color-secondary: #6B6B63;
  --color-tertiary: #9B9B91;
  --color-border: #E0DFD8;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

/* ── Pre-animation states ── */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
}

.reveal-word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
}

/* ── Layout ── */
.page {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 64px;
  padding: 0 40px;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 120px 0 48px;
  display: flex;
  flex-direction: column;
  opacity: 0.45;
  transition: opacity 0.3s;
}

.sidebar:hover { opacity: 1; }

.sidebar-name {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
  display: block;
}

.sidebar-name:hover { color: var(--color-text); }

.sidebar-title {
  font-size: 0.75rem;
  color: var(--color-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.sidebar-sections {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.sidebar-sections a {
  font-size: 0.8125rem;
  color: var(--color-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-sections a:hover,
.sidebar-sections a.active { color: var(--color-text); }

.sidebar-divider { width: 24px; height: 1px; background: var(--color-border); margin: 0 0 16px; }

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.sidebar-links a {
  font-size: 0.8125rem;
  color: var(--color-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-links a:hover { color: var(--color-text); }

.sidebar-bottom {
  list-style: none;
  margin-top: auto;
}

.sidebar-bottom a {
  font-size: 0.75rem;
  color: var(--color-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-bottom a:hover { color: var(--color-text); }

/* ── Content ── */
.content {
  max-width: 640px;
  padding: 120px 0 80px;
}

.heading-display {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  overflow: hidden;
}

.heading-section {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.block { margin-bottom: 80px; }
.divider { height: 1px; background: var(--color-border); margin: 80px 0; }

/* ── Hero image ── */
.hero-image {
  margin: 40px 0;
  border-radius: 6px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-caption {
  font-size: 0.75rem;
  color: var(--color-tertiary);
  margin-top: 12px;
  line-height: 1.5;
}

/* ── Project metadata bar ── */
.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}

.meta-pill {
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  border-radius: 100px;
  color: var(--color-secondary);
  white-space: nowrap;
}

.meta-link {
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  border-radius: 100px;
  color: var(--color-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.meta-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* ── Section layout ── */
.section {
  margin-bottom: 48px;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-tertiary);
  margin-bottom: 16px;
}

.section-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-secondary);
}

.section-content p + p {
  margin-top: 16px;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-tertiary);
  line-height: 1.4;
}

/* ── Process list (numbered) ── */
.process-list {
  list-style: none;
  counter-reset: process;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.process-step {
  counter-increment: process;
  padding-left: 32px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--color-secondary);
  line-height: 1.7;
}

.process-step::before {
  content: counter(process);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-text);
}

/* ── Checklist ── */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist li {
  padding-left: 28px;
  position: relative;
  font-size: 0.9375rem;
  color: var(--color-secondary);
  line-height: 1.7;
}

.checklist li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-text);
  font-size: 0.875rem;
}

/* ── Design artifacts ── */
.artifact-full {
  margin: 32px 0;
}

.artifact-full img {
  width: 100%;
  border-radius: 6px;
}

.artifact-full figcaption {
  font-size: 0.75rem;
  color: var(--color-tertiary);
  margin-top: 12px;
  line-height: 1.5;
}

.artifact-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}

.artifact-pair img {
  width: 100%;
  border-radius: 6px;
}

.artifact-placeholder {
  font-size: 0.875rem;
  color: var(--color-tertiary);
  font-style: italic;
  padding: 32px 0;
}

/* ── Prev / Next navigation ── */
.study-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 80px;
}

.study-nav-link {
  font-size: 0.875rem;
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.study-nav-link:hover { color: var(--color-text); }

.study-nav-link--next { margin-left: auto; }

/* ── CTA card ── */
.cta-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 48px;
  text-align: center;
  margin-top: 48px;
}

.cta-heading {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 12px;
}

.cta-text {
  font-size: 0.9375rem;
  color: var(--color-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: center;
}

.cta-email {
  font-size: 1.0625rem;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: border-color 0.15s;
}

.cta-email:hover { border-color: var(--color-text); }

.cta-sep { color: var(--color-border); font-size: 0.875rem; }

.cta-link {
  font-size: 0.8125rem;
  color: var(--color-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.cta-link:hover { color: var(--color-text); }

/* ── Footer ── */
.footer {
  margin-top: 40px;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer a {
  font-size: 0.8125rem;
  color: var(--color-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover { color: var(--color-text); }
.footer span { font-size: 0.8125rem; color: var(--color-tertiary); }

/* ── Work listing (index page) ── */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.work-card {
  text-decoration: none;
  display: block;
}

.work-card-image {
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.work-card-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.work-card:hover .work-card-image img {
  transform: scale(1.02);
}

.work-card-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 300;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.work-card-role {
  font-size: 0.8125rem;
  color: var(--color-tertiary);
  margin-bottom: 8px;
}

.work-card-desc {
  font-size: 0.9375rem;
  color: var(--color-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.work-card-link {
  font-size: 0.8125rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.work-card:hover .work-card-link { border-color: var(--color-text); }

/* ── Mobile ── */
@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 24px;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 32px 0 0;
    opacity: 1;
  }

  .sidebar-sections,
  .sidebar-divider,
  .sidebar-links,
  .sidebar-bottom { display: none; }

  .sidebar-title { margin-bottom: 0; }

  .content {
    max-width: 100%;
    padding: 32px 0 64px;
  }

  .heading-display { font-size: 2.5rem; }
  .block { margin-bottom: 56px; }
  .divider { margin: 56px 0; }

  .project-meta { gap: 6px; }

  .stats-grid { grid-template-columns: 1fr; gap: 24px; }

  .artifact-pair { grid-template-columns: 1fr; }

  .study-nav { flex-direction: column; gap: 16px; align-items: flex-start; }
  .study-nav-link--next { margin-left: 0; }

  .cta-card { padding: 32px 24px; }
  .cta-heading { font-size: 1.75rem; }
  .cta-links { flex-direction: column; gap: 12px; }
  .cta-sep { display: none; }

  .footer { flex-direction: column; gap: 12px; text-align: center; }
}

/* ── Noscript fallback ── */
noscript + .page .animate-in,
noscript + .page .reveal-word span {
  opacity: 1 !important;
  transform: none !important;
}
