/* ============================================
   Hickory & Vine — Level 2 Demo
   CSS Scroll-Driven Animations + Animated Gradients
   ============================================ */

/* --- Custom Properties --- */
:root {
  --forest: #2D5016;
  --cream: #F5E6C8;
  --amber: #C4722B;
  --walnut: #3B2314;
  --offwhite: #FAF7F2;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--walnut);
  background: var(--offwhite);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* --- Scroll Progress Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--amber);
  transform-origin: left;
  transform: scaleX(0);
  animation: progressFill linear both;
  animation-timeline: scroll();
  z-index: 9999;
}

@keyframes progressFill {
  to {
    transform: scaleX(1);
  }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(59, 35, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  color: rgba(245, 230, 200, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.25s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--cream);
}

.nav-back {
  background: rgba(196, 114, 43, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  border: 1px solid rgba(196, 114, 43, 0.4);
}

.nav-back:hover {
  background: rgba(196, 114, 43, 0.4);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(59, 35, 20, 0.7) 0%, rgba(26, 15, 8, 0.65) 40%, rgba(45, 80, 22, 0.5) 100%),
    url('https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=1920&q=80') center/cover no-repeat;
  animation: heroZoom linear both;
  animation-timeline: scroll();
  animation-range: 0vh 100vh;
  will-change: transform;
}

@keyframes heroZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.15);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6.5rem);
  color: var(--cream);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(245, 230, 200, 0.8);
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  background: var(--amber);
  color: var(--offwhite);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 4px;
  transition: background 0.3s, transform 0.2s;
}

.hero-cta:hover {
  background: #d9832f;
  transform: translateY(-2px);
}

/* --- Our Story --- */
.story {
  padding: 6rem 1.5rem;
  background: var(--offwhite);
}

.story-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.story-text {
  animation: slideInLeft linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 100%;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.story-text h2 {
  font-size: 2.5rem;
  color: var(--forest);
  margin-bottom: 1.5rem;
}

.story-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--walnut);
  margin-bottom: 1rem;
}

.story-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-gradient {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(245, 230, 200, 0.15), rgba(59, 35, 20, 0.25)),
    url('https://images.unsplash.com/photo-1606787366850-de6330128bfc?w=800&q=80') center/cover no-repeat;
  box-shadow: 0 8px 32px rgba(59, 35, 20, 0.2);
}

/* --- Menu --- */
.menu {
  padding: 6rem 1.5rem;
  background: var(--cream);
}

.menu-inner {
  max-width: 900px;
  margin: 0 auto;
}

.menu-inner > h2 {
  font-size: 2.5rem;
  color: var(--forest);
  text-align: center;
  margin-bottom: 1rem;
}

/* Tab system */
.menu-tabs {
  display: flex;
  position: relative;
  gap: 0;
  margin: 2rem 0;
  border-bottom: 2px solid rgba(59, 35, 20, 0.15);
}

.menu-tab {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--walnut);
  padding: 0.75rem 1rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s, color 0.3s;
  position: relative;
}

.menu-tab:hover,
.menu-tab:focus-visible {
  opacity: 0.85;
}

.menu-tab.active {
  opacity: 1;
  color: var(--forest);
}

.menu-tab:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
  border-radius: 4px;
}

.tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 3px;
  background: var(--amber);
  border-radius: 2px;
  transition: left 0.3s ease, width 0.3s ease;
}

/* Menu panels */
.menu-panel {
  display: none;
}

.menu-panel.active {
  display: block;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(59, 35, 20, 0.1);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--walnut);
}

.menu-item-price {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--amber);
  flex-shrink: 0;
  margin-left: 1rem;
}

/* Scroll-reveal for menu items */
.scroll-reveal {
  animation: menuItemReveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 60%;
  animation-delay: calc(var(--item-index, 0) * 80ms);
}

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

/* --- Daily Specials --- */
.specials {
  padding: 0 1.5rem;
  position: relative;
}

.specials-banner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
  border-radius: 12px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(196, 114, 43, 0.85), rgba(59, 35, 20, 0.8), rgba(45, 80, 22, 0.75)),
    url('https://images.unsplash.com/photo-1544025162-d76694265947?w=1920&q=80') center/cover no-repeat;
  color: var(--offwhite);
}

.specials-banner h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.specials-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.special-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.special-day {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.special-desc {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.special-price {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.special-divider {
  font-size: 1.5rem;
  opacity: 0.5;
}

/* --- Reservation CTA --- */
.reservation {
  padding: 6rem 1.5rem;
  background: var(--walnut);
  text-align: center;
}

.reservation-inner {
  max-width: 700px;
  margin: 0 auto;
}

.reservation-inner h2 {
  font-size: 2.5rem;
  color: var(--cream);
  margin-bottom: 1rem;
}

.reservation-inner > p {
  font-size: 1.15rem;
  color: rgba(245, 230, 200, 0.75);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* Morphing button */
.reserve-btn {
  display: inline-block;
  position: relative;
  padding: 1rem 2.5rem;
  background: var(--amber);
  color: var(--offwhite);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.3s, transform 0.2s;
}

.reserve-btn:hover {
  background: #d9832f;
  transform: scale(1.04);
}

.reserve-btn-default,
.reserve-btn-hover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: opacity 0.3s, transform 0.3s;
}

.reserve-btn-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
}

.reserve-btn:hover .reserve-btn-default {
  opacity: 0;
  transform: translateY(-8px);
}

.reserve-btn:hover .reserve-btn-hover {
  opacity: 1;
  transform: translateY(0);
}

.reserve-btn:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

/* --- Location & Hours --- */
.location {
  padding: 5rem 1.5rem;
  background: var(--offwhite);
}

.location-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.location h2 {
  font-size: 2rem;
  color: var(--forest);
  margin-bottom: 1.5rem;
}

.location address {
  font-style: normal;
  font-size: 1.1rem;
  line-height: 1.8;
}

.location address a {
  color: var(--amber);
  font-weight: 600;
}

.location address a:hover {
  text-decoration: underline;
}

.hours-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(59, 35, 20, 0.1);
}

.hours-row dt {
  font-weight: 600;
  color: var(--walnut);
}

.hours-row dd {
  color: var(--forest);
  font-weight: 600;
}

/* --- Footer --- */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--walnut);
  color: rgba(245, 230, 200, 0.5);
  font-size: 0.9rem;
}

.footer a {
  color: var(--amber);
}

.footer a:hover {
  text-decoration: underline;
}

/* --- WebForge Badges --- */
.wf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: rgba(45, 80, 22, 0.1);
  border: 1px solid rgba(45, 80, 22, 0.2);
  color: var(--forest);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.wf-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.wf-badge-icon {
  font-size: 1.1rem;
}

.wf-badge-close {
  background: none;
  border: none;
  color: var(--forest);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.wf-badge-close:hover {
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(59, 35, 20, 0.97);
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .story-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .story-visual {
    order: -1;
  }

  .story-gradient {
    aspect-ratio: 16 / 9;
  }

  .menu-tabs {
    flex-wrap: wrap;
  }

  .menu-tab {
    flex: 1 1 45%;
    font-size: 1rem;
  }

  .specials-list {
    flex-direction: column;
    gap: 1.5rem;
  }

  .special-divider {
    display: none;
  }

  .location-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-title {
    font-size: clamp(2.2rem, 10vw, 4rem);
  }

  .reserve-btn-default {
    display: none;
  }

  .reserve-btn-hover {
    position: static;
    opacity: 1;
    transform: none;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress {
    animation: none;
    transform: scaleX(0);
  }

  .hero-bg {
    animation: none;
    transform: none;
  }

  .story-text {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .scroll-reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .specials-banner {
    background-attachment: scroll;
  }

  .reserve-btn-default,
  .reserve-btn-hover {
    transition: none;
  }

  .tab-indicator {
    transition: none;
  }

  .wf-badge {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
