/* ============================================
   LUMINARIES — Editorial Design System
   A magazine-style website celebrating influential women
   ============================================ */

/* --------------------------------------------
   CSS CUSTOM PROPERTIES (Design Tokens)
   -------------------------------------------- */
:root {
  /* Typography Scale */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette — Warm, editorial neutrals */
  --color-ink: #1a1a1a;
  --color-ink-light: #4a4a4a;
  --color-ink-muted: #767676;
  --color-paper: #faf9f7;
  --color-paper-warm: #f5f3ef;
  --color-paper-dark: #eae7e1;
  --color-accent: #8b4513;
  --color-accent-light: #a0522d;
  --color-border: #e0dcd4;
  --color-border-light: #edeae4;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;
  
  /* Layout */
  --max-width: 1400px;
  --content-width: 720px;
  --nav-height: 80px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* --------------------------------------------
   RESET & BASE STYLES
   -------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-ink);
  background-color: var(--color-paper);
  min-height: 100vh;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------
   TYPOGRAPHY
   -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-ink);
}

.headline-xl {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.headline-lg {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

.headline-md {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.headline-sm {
  font-size: 1.25rem;
}

.subheadline {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 400;
  color: var(--color-ink-light);
  line-height: 1.6;
}

.body-lg {
  font-size: 1.125rem;
  line-height: 1.8;
}

.body-sm {
  font-size: 0.875rem;
  line-height: 1.6;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.caption {
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
  font-style: italic;
}

/* --------------------------------------------
   LAYOUT UTILITIES
   -------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--content-width);
}

.section {
  padding: var(--space-3xl) 0;
}

.section--tight {
  padding: var(--space-xl) 0;
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

/* --------------------------------------------
   NAVIGATION
   -------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav__logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.nav__links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-ink-light);
  transition: color var(--transition-fast);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav__link:hover {
  color: var(--color-ink);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link--active {
  color: var(--color-ink);
}

.nav__link--active::after {
  width: 100%;
}

.nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.nav__mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-ink);
  transition: transform var(--transition-fast);
}

@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-paper);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
  }

  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav__mobile-toggle {
    display: flex;
  }
}

/* Main content offset for fixed nav */
main {
  padding-top: var(--nav-height);
}

/* --------------------------------------------
   HERO SECTIONS
   -------------------------------------------- */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: var(--space-3xl) 0;
}

.hero--full {
  min-height: 100vh;
}

.hero--centered {
  text-align: center;
}

.hero__content {
  max-width: 900px;
}

.hero--centered .hero__content {
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-block;
  margin-bottom: var(--space-md);
}

.hero__title {
  margin-bottom: var(--space-lg);
}

.hero__subtitle {
  max-width: 640px;
}

.hero--centered .hero__subtitle {
  margin: 0 auto;
}

/* --------------------------------------------
   PROFILE CARDS
   -------------------------------------------- */
.profile-card {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
  cursor: pointer;
  overflow: hidden;
}

.profile-card:hover {
  border-color: var(--color-ink-muted);
  transform: translateY(-2px);
}

.profile-card__image {
  aspect-ratio: 3 / 4;
  background: var(--color-paper-dark);
  overflow: hidden;
}

.profile-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: all var(--transition-slow);
}

.profile-card:hover .profile-card__image img {
  filter: grayscale(0%);
  transform: scale(1.02);
}

.profile-card__content {
  padding: var(--space-lg);
}

.profile-card__field {
  margin-bottom: var(--space-sm);
}

.profile-card__name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.profile-card__years {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.profile-card__excerpt {
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  color: var(--color-ink-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured card variant */
.profile-card--featured {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  border: none;
  background: none;
}

.profile-card--featured .profile-card__image {
  aspect-ratio: 4 / 5;
}

.profile-card--featured .profile-card__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl);
}

.profile-card--featured .profile-card__name {
  font-size: 1.75rem;
}

.profile-card--featured .profile-card__excerpt {
  -webkit-line-clamp: 5;
}

@media (max-width: 768px) {
  .profile-card--featured {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------
   PROFILE PAGE (Feature Article)
   -------------------------------------------- */
.profile-hero {
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-2xl) 0;
}

.profile-hero__image {
  aspect-ratio: 3 / 4;
  background: var(--color-paper-dark);
  max-height: 600px;
}

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

.profile-hero__content {
  padding-right: var(--space-xl);
}

.profile-hero__field {
  margin-bottom: var(--space-md);
}

.profile-hero__name {
  margin-bottom: var(--space-lg);
}

.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.profile-hero__meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

@media (max-width: 900px) {
  .profile-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: var(--space-xl) 0;
  }

  .profile-hero__image {
    max-height: 500px;
    order: -1;
  }

  .profile-hero__content {
    padding-right: 0;
  }
}

/* Profile article content */
.profile-article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.profile-section {
  margin-bottom: var(--space-3xl);
}

.profile-section__title {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.profile-section p {
  margin-bottom: var(--space-lg);
}

.profile-section p:last-child {
  margin-bottom: 0;
}

/* Counterfactual split layout */
.split-narrative {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: var(--space-2xl) 0;
  border: 1px solid var(--color-border);
}

.split-narrative__panel {
  padding: var(--space-xl);
}

.split-narrative__panel--with {
  background: var(--color-paper);
  border-right: 1px solid var(--color-border);
}

.split-narrative__panel--without {
  background: var(--color-paper-warm);
}

.split-narrative__title {
  margin-bottom: var(--space-lg);
  font-size: 1.125rem;
}

.split-narrative__content {
  font-size: 0.9375rem;
  color: var(--color-ink-light);
}

@media (max-width: 768px) {
  .split-narrative {
    grid-template-columns: 1fr;
  }

  .split-narrative__panel--with {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) - 4px);
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
}

.timeline__year {
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.timeline__text {
  color: var(--color-ink-light);
}

/* Reflection/Quote block */
.reflection {
  background: var(--color-paper-warm);
  padding: var(--space-2xl);
  margin: var(--space-2xl) 0;
  border-left: 3px solid var(--color-accent);
}

.reflection__text {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-ink-light);
}

/* --------------------------------------------
   EXPLORE PAGE
   -------------------------------------------- */
.explore-header {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.filter-btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-ink-light);
  border: 1px solid var(--color-border);
  background: var(--color-paper);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--color-ink-muted);
  color: var(--color-ink);
}

.filter-btn.is-active {
  background: var(--color-ink);
  color: var(--color-paper);
  border-color: var(--color-ink);
}

.explore-grid {
  padding: var(--space-2xl) 0;
}

/* --------------------------------------------
   ABOUT PAGE
   -------------------------------------------- */
.about-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.about-content p {
  margin-bottom: var(--space-lg);
}

.about-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

.about-content blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-xl);
  border-left: 3px solid var(--color-accent);
  background: var(--color-paper-warm);
  font-style: italic;
  color: var(--color-ink-light);
}

/* --------------------------------------------
   CONTRIBUTE PAGE
   -------------------------------------------- */
.form-section {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.form-intro {
  margin-bottom: var(--space-2xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--color-ink);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-ink);
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
}

.form-help {
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
  margin-top: var(--space-xs);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
}

.btn--primary {
  background: var(--color-ink);
  color: var(--color-paper);
  border: 1px solid var(--color-ink);
}

.btn--primary:hover {
  background: var(--color-ink-light);
  border-color: var(--color-ink-light);
}

.btn--secondary {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-ink);
}

/* Form success state */
.form-success {
  padding: var(--space-xl);
  background: var(--color-paper-warm);
  border: 1px solid var(--color-border);
  text-align: center;
}

.form-success__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-lg);
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-paper);
}

/* --------------------------------------------
   FOOTER
   -------------------------------------------- */
.footer {
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
}

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

.footer__links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.footer__link {
  font-size: 0.875rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.footer__link:hover {
  opacity: 1;
}

.footer__copyright {
  width: 100%;
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8125rem;
  opacity: 0.5;
}

/* --------------------------------------------
   LOADING STATES
   -------------------------------------------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-paper-dark) 0%,
    var(--color-paper-warm) 50%,
    var(--color-paper-dark) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

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

.skeleton-text {
  height: 1em;
  border-radius: 4px;
  margin-bottom: 0.5em;
}

.skeleton-text--title {
  height: 2em;
  width: 60%;
}

.skeleton-text--body {
  width: 100%;
}

.skeleton-text--short {
  width: 40%;
}

/* Error state */
.error-message {
  padding: var(--space-xl);
  background: #fdf2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  color: #991b1b;
  text-align: center;
}

/* Empty state */
.empty-state {
  padding: var(--space-3xl);
  text-align: center;
  color: var(--color-ink-muted);
}

.empty-state__title {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--color-ink-light);
}

/* --------------------------------------------
   SCROLL ANIMATIONS
   -------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------
   UTILITY CLASSES
   -------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-ink-muted); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------
   PRINT STYLES
   -------------------------------------------- */
@media print {
  .nav,
  .footer,
  .filter-bar {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  main {
    padding-top: 0;
  }

  .profile-hero {
    page-break-after: avoid;
  }

  .profile-section {
    page-break-inside: avoid;
  }
}
