/* ===== DESIGN TOKENS ===== */
:root {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Brand Colors */
  --color-bg: #FFF5E1;
  --color-surface: #EDE8D9;
  --color-text: #3D2B1F;
  --color-text-muted: #6B5D50;
  --color-primary: #A0603A;
  --color-primary-hover: #8A5030;
  --color-border: #D4B495;
  --color-sage: #7A8B6F;
  --color-sage-light: rgba(122, 139, 111, 0.1);
  --color-cream: #FFF5E1;
  --color-linen: #EDE8D9;

  /* Font Families */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(61, 43, 31, 0.06);
  --shadow-md: 0 4px 12px rgba(61, 43, 31, 0.08);
  --shadow-lg: 0 12px 32px rgba(61, 43, 31, 0.12);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ===== GLOBAL ===== */
body {
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.3s ease;
}

.nav.scrolled {
  background: rgba(255, 245, 225, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3) 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .nav-inner {
    padding-inline: var(--space-8);
  }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.nav-logo svg {
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.15em;
  font-weight: 400;
  color: var(--color-text);
  transition: color 0.3s ease;
}

/* Nav on hero: light text */
.nav:not(.scrolled) .nav-logo-text {
  color: #FFF5E1;
}

.nav:not(.scrolled) .nav-links a {
  color: rgba(255, 245, 225, 0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.nav:not(.scrolled) .nav-links a:hover {
  color: #FFF5E1;
}

.nav:not(.scrolled) .nav-toggle span {
  background: #FFF5E1;
}

.nav:not(.scrolled) .nav-logo svg path {
  stroke: #FFF5E1;
}

.nav:not(.scrolled) .nav-logo svg ellipse {
  fill: #FFF5E1;
}

.nav-links {
  display: none;
  list-style: none;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-primary);
  transition: width 0.3s var(--ease-out);
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile menu */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 245, 225, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(61, 43, 31, 0.3) 0%,
    rgba(61, 43, 31, 0.55) 50%,
    rgba(61, 43, 31, 0.7) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: var(--space-8) var(--space-6);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: #FFF5E1;
  margin-bottom: var(--space-4);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: rgba(255, 245, 225, 0.85);
  margin-bottom: var(--space-8);
  font-weight: 300;
  line-height: 1.5;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  background: var(--color-primary);
  color: #FFF5E1;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: background var(--transition-interactive), transform var(--transition-interactive), box-shadow var(--transition-interactive);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ===== SECTION TITLES ===== */
.section-header {
  text-align: center;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.1;
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  max-width: 560px;
  margin-inline: auto;
}

/* ===== WHAT WE BAKE ===== */
.bake-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  background: var(--color-bg);
}

.bake-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 540px) {
  .bake-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .bake-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}

.bake-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.bake-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.bake-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.bake-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.bake-card:hover .bake-card-img img {
  transform: scale(1.05);
}

.bake-card-body {
  padding: var(--space-5) var(--space-6);
}

.bake-card-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-weight: 400;
}

.bake-card-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ===== PROCESS SECTION ===== */
.process-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  background: var(--color-linen);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .process-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 960px) {
  .process-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-4);
  }
}

.process-step {
  text-align: center;
  padding: var(--space-4);
}

.process-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(160, 96, 58, 0.08);
  border-radius: 50%;
}

.process-icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.process-step-num {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-1);
}

.process-step h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-weight: 400;
}

.process-step p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ===== SOURDOUGH 101 ===== */
.learn-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  background: var(--color-bg);
}

.learn-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  max-width: var(--content-default);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .learn-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: start;
  }
}

.learn-block h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  font-weight: 400;
}

.learn-block p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.tip-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.tip-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 139, 111, 0.12);
  border-radius: 50%;
  color: var(--color-sage);
}

.tip-icon svg {
  width: 20px;
  height: 20px;
}

.tip-content h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-1);
  font-weight: 400;
}

.tip-content p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ===== SOCIAL / FOLLOW ===== */
.social-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  background: var(--color-linen);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .social-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.social-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.social-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

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

.social-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(61, 43, 31, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease-out);
}

.social-card:hover .social-card-overlay {
  background: rgba(61, 43, 31, 0.3);
}

.social-card-overlay svg {
  color: white;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  width: 32px;
  height: 32px;
}

.social-card:hover .social-card-overlay svg {
  opacity: 1;
  transform: scale(1);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: border-color var(--transition-interactive), background var(--transition-interactive), transform var(--transition-interactive);
}

.social-link:hover {
  border-color: var(--color-primary);
  background: rgba(160, 96, 58, 0.05);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* ===== FOOTER ===== */
.footer {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  background: var(--color-text);
  color: rgba(255, 245, 225, 0.7);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-10);
    padding-inline: var(--space-8);
  }
}

.footer-brand .nav-logo {
  margin-bottom: var(--space-4);
}

.footer-brand .nav-logo-text {
  color: #FFF5E1;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-style: italic;
  color: rgba(255, 245, 225, 0.6);
  margin-bottom: var(--space-6);
}

.footer h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: #FFF5E1;
  margin-bottom: var(--space-4);
  font-weight: 400;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-nav a {
  text-decoration: none;
  color: rgba(255, 245, 225, 0.6);
  font-size: var(--text-sm);
  transition: color var(--transition-interactive);
}

.footer-nav a:hover {
  color: #FFF5E1;
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}

.footer-social a {
  color: rgba(255, 245, 225, 0.5);
  transition: color var(--transition-interactive);
}

.footer-social a:hover {
  color: var(--color-primary);
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 245, 225, 0.1);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 245, 225, 0.4);
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes reveal-fade {
  to {
    opacity: 1;
  }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .fade-in.visible {
    opacity: 1;
  }
}

/* ===== DIVIDER ===== */
.section-divider {
  width: 60px;
  height: 2px;
  background: var(--color-primary);
  margin: 0 auto var(--space-6);
  opacity: 0.4;
}

/* ===== WIDE IMAGE BREAK ===== */
.wide-image-break {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
}

.wide-image-break img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}
