/* Feast & Press - Graphic Evolution of Food Illustration
   Design System & Styling
*/

:root {
  /* Color Tokens */
  --bg-dark: #0f0d0e;
  --bg-card-dark: #181517;
  --bg-card-elevated: #221d20;
  --border-dark: #342c30;
  
  --gold-primary: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #997a15;
  --copper: #c86d51;
  --parchment: #f4ede2;
  
  --text-main: #f0eae1;
  --text-muted: #a399a2;
  --text-dark: #1a1718;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(212, 175, 55, 0.25);
  
  --font-serif: 'Cinzel', serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-academic: 'Spectral', serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
body.light-theme {
  --bg-dark: #f6f2eb;
  --bg-card-dark: #ffffff;
  --bg-card-elevated: #eae3d7;
  --border-dark: #d5c8b5;
  --text-main: #2b2426;
  --text-muted: #6b6167;
  --gold-primary: #aa8111;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 13, 14, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dark);
  padding: 1rem 0;
  transition: var(--transition);
}

body.light-theme .navbar {
  background: rgba(246, 242, 235, 0.9);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--gold-primary);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--gold-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.action-btn:hover {
  border-color: var(--gold-primary);
}

.btn-primary-sm {
  background: var(--gold-primary);
  color: var(--bg-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-primary-sm:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 5rem 2rem;
  background: radial-gradient(circle at center, rgba(200, 109, 81, 0.15) 0%, rgba(15, 13, 14, 1) 70%);
}

.hero-content {
  max-width: 900px;
  text-align: center;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-primary);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--gold-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
}

.hero-subtitle {
  font-family: var(--font-academic);
  font-size: 1.35rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto 2.5rem auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(24, 21, 23, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-dark);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  min-width: 180px;
}

body.light-theme .stat-card {
  background: rgba(255, 255, 255, 0.7);
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-primary);
}

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

.hero-cta-group {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: #000;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(212, 175, 55, 0.4);
}

.btn-hero-secondary {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.btn-hero-secondary:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* Sections */
.section-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--gold-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.section-desc {
  font-family: var(--font-academic);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Proposal Section */
.proposal-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
  .proposal-card {
    grid-template-columns: 1fr;
  }
}

.proposal-sidebar {
  background: var(--bg-card-elevated);
  padding: 2rem;
  border-right: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.curator-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.curator-avatar {
  width: 50px;
  height: 50px;
  background: var(--gold-primary);
  color: var(--bg-dark);
  font-family: var(--font-serif);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
}

.curator-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.curator-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.date-badge {
  font-size: 0.75rem;
  color: var(--gold-primary);
}

.proposal-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prop-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.8rem 1rem;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.prop-tab.active, .prop-tab:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.proposal-metrics {
  margin-top: auto;
  display: flex;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.btn-download-prop {
  background: var(--bg-card-dark);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
  margin-top: 1rem;
  width: 100%;
}

.btn-download-prop:hover {
  background: var(--gold-primary);
  color: var(--bg-dark);
}

/* MLA Works Cited Formatting */
.mla-works-cited {
  margin-top: 1rem;
}

.mla-entry {
  font-family: var(--font-academic);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  padding-left: 2rem;
  text-indent: -2rem;
  color: var(--text-main);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.metric-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.proposal-main-body {
  padding: 2.5rem;
  max-height: 650px;
  overflow-y: auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.proposal-text-block h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-primary);
  margin: 1.8rem 0 0.8rem 0;
}

.proposal-text-block h3:first-child {
  margin-top: 0;
}

.proposal-text-block p {
  font-family: var(--font-academic);
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  line-height: 1.7;
}

.proposal-text-block ul, .proposal-text-block ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.proposal-text-block li {
  font-family: var(--font-academic);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.quote-block {
  border-left: 3px solid var(--gold-primary);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  font-family: var(--font-academic);
  font-style: italic;
  color: var(--gold-light);
  font-size: 1.15rem;
}

/* Gallery Section */
.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.filter-btn {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
  background: var(--gold-primary);
  color: var(--bg-dark);
  border-color: var(--gold-primary);
  font-weight: 700;
}

.search-box input {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  outline: none;
  width: 280px;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--gold-primary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.art-card {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.art-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-lg);
}

.art-img-wrapper {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: #000;
}

.art-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.art-card:hover .art-img-wrapper img {
  transform: scale(1.08);
}

.era-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.era-tag.medieval {
  background: rgba(200, 109, 81, 0.9);
  color: #fff;
}

.era-tag.renaissance {
  background: rgba(212, 175, 55, 0.9);
  color: #000;
}

.art-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.art-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.art-source {
  font-size: 0.85rem;
  color: var(--gold-primary);
  margin-bottom: 1rem;
}

.art-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.art-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.btn-inspect {
  margin-top: auto;
  background: transparent;
  border: none;
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: var(--transition);
}

.btn-inspect:hover {
  color: var(--gold-light);
  transform: translateX(4px);
}

/* Comparison Section */
.comparison-container {
  max-width: 1000px;
  margin: 0 auto 3.5rem auto;
}

.comparison-slider {
  position: relative;
  height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--gold-primary);
  box-shadow: var(--shadow-lg);
  user-select: none;
}

.img-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

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

.img-right {
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.layer-caption {
  position: absolute;
  bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 320px;
}

.layer-caption.left { left: 1.5rem; }
.layer-caption.right { right: 1.5rem; text-align: right; }

.layer-caption h4 {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--gold-primary);
}

.layer-caption p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.slider-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: var(--gold-primary);
  cursor: ew-resize;
  z-index: 10;
}

.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: var(--gold-primary);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 16px rgba(0,0,0,0.5);
}

.comparator-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.breakdown-card {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.breakdown-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold-primary);
  margin-bottom: 1rem;
}

.breakdown-card ul {
  padding-left: 1.2rem;
}

.breakdown-card li {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Blueprint Section */
.blueprint-viewer {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

@media (max-width: 960px) {
  .blueprint-viewer {
    grid-template-columns: 1fr;
  }
}

.blueprint-canvas {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-dark);
}

.blueprint-img {
  width: 100%;
  display: block;
  filter: contrast(1.05);
}

.hotspot-pin {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--gold-primary);
  color: #000;
  border-radius: 50%;
  border: none;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 5;
  transition: transform 0.2s ease;
}

.hotspot-pin:hover {
  transform: translate(-50%, -50%) scale(1.25);
}

.pin-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  animation: ripple 1.8s infinite;
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.blueprint-details-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-dark);
  padding: 1.8rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.details-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.details-placeholder .icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.8rem;
}

/* Sources Section */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.source-card {
  background: var(--bg-card-dark);
  border: 1px solid var(--border-dark);
  padding: 2rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.source-card:hover {
  border-color: var(--gold-primary);
}

.source-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.source-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.source-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.source-link {
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.source-link:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-dark);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--bg-dark); /* Adapts to active theme */
}

.footer-brand h3 {
  font-family: var(--font-serif);
  color: var(--gold-primary);
  margin-bottom: 0.4rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card-dark);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--gold-primary);
}
