/* ===================================================================
   Holy Joe Coffee — Global Stylesheet
   =================================================================== */

/* --- Design Tokens --- */
:root {
  /* Colors */
  --bg: #fbf8f2;
  --bg-alt: #f5efe5;
  --bg-dark: #2e2720;
  --bg-green: #403F2B;
  --bg-green-light: #edecd6;
  --overlay-dark: rgba(46, 39, 32, 0.65);
  --overlay-green: rgba(64, 63, 43, 0.85);
  --overlay-warm: rgba(166, 124, 82, 0.12);
  --text: #2e2720;
  --text-light: #f5efe5;
  --muted: #7a6f66;
  --accent: #a67c52;
  --highlight: #c9a86a;
  --green: #403F2B;
  --green-light: #5a5938;
  --card-bg: #ffffff;
  --border: #e0d3c2;

  /* Spacing scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 120px;

  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-display: 'Playfair Display', serif;
  --text-sm: 0.875rem;
  --text-base: 1.05rem;
  --text-lg: 1.2rem;
  --text-xl: 1.4rem;
  --text-2xl: clamp(1.8rem, 3vw, 2.2rem);
  --text-3xl: clamp(2.2rem, 4vw, 3rem);
  --text-hero: clamp(3rem, 6vw, 5rem);

  /* Layout */
  --max-width: 1180px;
  --nav-height: 80px;
  --nav-height-shrunk: 64px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 50px;

  /* Effects */
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.07);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 12px 36px rgba(201, 168, 106, 0.35);
  --transition: all 0.35s ease;
  --transition-fast: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
  overflow: hidden;
}

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

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

ul {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  margin: 16px auto 0;
  border-radius: 2px;
}

.section-title-light {
  color: var(--text-light);
}

.section-title-light::after {
  background: linear-gradient(90deg, var(--highlight), var(--accent));
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto var(--space-lg);
  line-height: 1.8;
}

.label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.text-accent {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(251, 248, 242, 0.92);
  border-bottom: 1px solid rgba(224, 211, 194, 0.5);
  transition: var(--transition);
}

.nav.scrolled {
  --nav-height: var(--nav-height-shrunk);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.35s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 101;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  transition: var(--transition);
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
  transform: translateX(-50%);
}

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

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

.nav-links a.active {
  color: var(--accent);
}

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

.nav-cta {
  display: inline-flex;
}

.nav-cta::after {
  display: none;
}

/* Nav Book button (styled, replaces coffee bean gif) */
.btn-nav {
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-nav:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-nav::after {
  display: none;
}

/* Hamburger */
.nav-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 101;
  padding: 8px;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-toggle span {
  position: relative;
}

.nav-toggle span::before {
  content: '';
  position: absolute;
  top: -8px;
}

.nav-toggle span::after {
  content: '';
  position: absolute;
  top: 8px;
}

/* Hamburger → X */
.nav-toggle.open span {
  background: transparent;
}

.nav-toggle.open span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.open span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: #fff;
  padding: 16px 40px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: 0.02em;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  padding: 14px 36px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-base);
  border: 2px solid var(--accent);
  transition: var(--transition);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

.btn-light {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  padding: 16px 40px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-base);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn-light:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* --- Layout Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-2xl) var(--space-md);
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.section-green {
  background: var(--bg-green);
  color: #fff;
}

.section-green .section-title::after {
  background: linear-gradient(90deg, var(--highlight), #fff);
}

.section-green .section-subtitle {
  color: rgba(255, 255, 255, 0.75);
}

.section-green .label {
  color: var(--highlight);
}

.section-green-light {
  background: var(--bg-green-light);
}

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

/* --- Image Treatment --- */
.image-frame {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.image-frame img {
  transition: transform 0.6s ease;
  border-radius: 0;
}

.image-frame:hover img {
  transform: scale(1.05);
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: var(--transition);
}

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

/* --- Page Hero Banner --- */
.page-hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  color: #fff;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(64, 63, 43, 0.7) 0%,
    rgba(46, 39, 32, 0.6) 100%
  );
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.page-hero .section-title {
  color: #fff;
  font-size: var(--text-hero);
  margin-bottom: 0;
}

.page-hero .section-title::after {
  background: linear-gradient(90deg, var(--highlight), #fff);
}

/* --- CTA Banner --- */
.cta-banner {
  background: var(--bg-green);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--text-light);
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
  color: #fff;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-lg);
  font-size: var(--text-lg);
}

/* --- Instagram Feed --- */
.instagram-section {
  background: var(--bg-green);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: #fff;
}

.instagram-section .section-title {
  color: #fff;
}

.instagram-section .section-title::after {
  background: linear-gradient(90deg, var(--highlight), #fff);
}

.instagram-section .section-subtitle {
  color: rgba(255, 255, 255, 0.75);
}

.instagram-section .label {
  color: var(--highlight);
}

.instagram-feed {
  max-width: var(--max-width);
  margin: 0 auto var(--space-md);
}

.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto var(--space-lg);
  justify-items: center;
}

.instagram-grid-item {
  width: 100%;
  max-width: 400px;
  height: 480px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.instagram-grid-item .instagram-media {
  min-height: 100% !important;
}

.instagram-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 600;
  font-size: var(--text-lg);
  transition: var(--transition);
  border-bottom: 2px solid rgba(255,255,255,0.3);
  padding-bottom: 2px;
}

.instagram-follow:hover {
  color: var(--highlight);
  border-color: var(--highlight);
}

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xl) var(--space-md) 0;
  border-top: 4px solid var(--bg-green);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.footer-brand .brand-title {
  color: #fff;
  margin-bottom: var(--space-xs);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: 1.7;
  max-width: 300px;
}

.footer h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-sm);
  padding: 4px 0;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--highlight);
}

.footer-contact p,
.footer-contact a {
  font-size: var(--text-sm);
  line-height: 2;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.6);
  transition: var(--transition-fast);
}

.footer-contact a:hover {
  color: var(--highlight);
}

.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-md) 0;
  text-align: center;
  font-size: var(--text-sm);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-bar a {
  color: rgba(255, 255, 255, 0.5);
  transition: var(--transition-fast);
}

.footer-bar a:hover {
  color: var(--highlight);
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.24s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.36s; }

/* --- Responsive: Tablet & below --- */
@media (max-width: 840px) {
  :root {
    --space-2xl: 80px;
    --space-xl: 60px;
  }

  /* Mobile menu — full-screen overlay */
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    background: #fbf8f2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    font-size: 1.2rem;
    z-index: 100;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Keep hamburger above the menu so users can close it */
  .nav-toggle {
    display: flex;
    z-index: 101;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p {
    max-width: 100%;
  }

  .instagram-grid {
    grid-template-columns: 1fr 1fr;
  }

  .instagram-grid-item {
    height: 420px;
  }
}

@media (max-width: 640px) {
  :root {
    --space-2xl: 60px;
    --space-xl: 48px;
    --space-lg: 32px;
  }

  .instagram-grid {
    grid-template-columns: 1fr;
  }

  .instagram-grid-item {
    height: 460px;
  }
}
