@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* Colour palette variables for a cohesive and edgy aesthetic */
:root {
  --bg-col: #0d0d0d;            /* Primary background */
  --section-bg-col: #1b1b1b;    /* Background for content sections */
  --card-bg-col: #1f1f1f;       /* Background for cards */
  --accent-col: #2CEE3A;        /* Vivid orange-red accent */
  --accent-hover-col: #21B52C;  /* Darker accent on hover */
  --text-col: #eaeaea;          /* Main text colour */
  --muted-col: #a7a7a7;         /* Muted text for secondary details */
}

/* Global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  color: var(--text-col);
  background-color: var(--bg-col);
}

/* Header and navigation */
/* Make the header slightly transparent so the animated starfield can peek
   through. We hardcode the RGBA values derived from our palette for
   consistency. */
header {
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.95) 0%, rgba(27, 27, 27, 0.75) 100%);
  color: var(--text-col);
  position: relative;
}

.navbar {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-col);
  letter-spacing: 1px;
}

.navbar .menu {
  list-style: none;
  display: flex;
  gap: 20px;
}

.navbar .menu li a {
  color: var(--text-col);
  text-decoration: none;
  padding: 10px 0;
  position: relative;
  transition: color 0.3s;
}

.navbar .menu li a:hover,
  .navbar .menu li a:focus {
  color: var(--accent-col);
}

/* Hero section */
.hero {
  text-align: center;
  padding: 120px 20px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--text-col);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 25px;
  opacity: 0.8;
  color: var(--muted-col);
}

/* Animated can displayed in the hero section */
/* Container for the hero product animation */
.product-animation {
  margin: 40px auto;
  text-align: center;
  /*
   * Establish a positioning context so that our decorative pseudo‑element
   * (used below) can be absolutely positioned relative to this container.
   */
  position: relative;
}

/*
 * Add a subtle yet flashy halo effect behind the can image. A radial
 * gradient expands and contracts, creating a pulsing glow that follows
 * the product animation. The blur softens the edges, and pointer‑events
 * are disabled to ensure the pseudo‑element doesn’t interfere with
 * interactions on the image itself.
 */
.product-animation::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-col) 0%, rgba(44, 238, 58, 0) 60%);
  opacity: 0.35;
  filter: blur(20px);
  pointer-events: none;
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.3;
  }
}

/* Image displayed in the animation. A class .animate is added via JavaScript to
   trigger a zoom/rotate effect on each slide change. */
.product-image {
  width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  /*
   * Add a dark background behind the hero can image in the landing
   * animation.  This ensures that any transparent areas in the PNG
   * don’t reveal the starfield and gives the can a consistent
   * presentation across the site.
   */
  background-color: var(--section-bg-col);
  padding: 12px;
  border-radius: 8px;
}

/*
 * When a new product is shown, the can image now performs a more elaborate
 * animation rather than the simple zoom/rotate effect. The new animation
 * combines scaling, 3D rotations and a subtle jump to create a flashy,
 * attention‑grabbing motion. The filter and box‑shadow adjustments add
 * vibrancy and a sense of depth without overpowering the product artwork.
 */
.product-image.animate {
  animation: flashyCan 4s ease-in-out;
  animation-fill-mode: both;
}

/*
 * The flashyCan keyframes animate the beer can through a variety of
 * transformations: it scales up and down, rotates on the Y and Z axes to
 * simulate a 3D spin, and translates slightly up and down to create a
 * bouncing sensation. Colour filters and drop shadows accentuate the
 * movement, while the final frame resets everything to a neutral state.
 */
@keyframes flashyCan {
  0% {
    transform: perspective(600px) rotateY(0deg) rotateZ(0deg) scale(1) translateY(0);
    filter: drop-shadow(0 0 0px var(--accent-col));
  }
  15% {
    transform: perspective(600px) rotateY(15deg) rotateZ(5deg) scale(1.1) translateY(-6px);
    filter: drop-shadow(0 0 8px var(--accent-col));
  }
  30% {
    transform: perspective(600px) rotateY(-25deg) rotateZ(-10deg) scale(0.95) translateY(8px);
    filter: drop-shadow(0 0 12px var(--accent-hover-col));
  }
  50% {
    transform: perspective(600px) rotateY(20deg) rotateZ(15deg) scale(1.2) translateY(-4px);
    filter: drop-shadow(0 0 20px var(--accent-col));
  }
  70% {
    transform: perspective(600px) rotateY(-15deg) rotateZ(-5deg) scale(1.05) translateY(6px);
    filter: drop-shadow(0 0 10px var(--accent-hover-col));
  }
  85% {
    transform: perspective(600px) rotateY(5deg) rotateZ(0deg) scale(1.1) translateY(-2px);
    filter: drop-shadow(0 0 6px var(--accent-col));
  }
  100% {
    transform: perspective(600px) rotateY(0deg) rotateZ(0deg) scale(1) translateY(0);
    filter: drop-shadow(0 0 0px var(--accent-col));
  }
}

@keyframes zoomRotate {
  0% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.15) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Product label below the image */
.product-label {
  margin-top: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffbf00;
}

.btn-primary {
  background: var(--accent-col);
  color: #000;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: var(--accent-hover-col);
}

/* Beers section */
/* Slightly transparent background so the starfield is visible underneath */
.beers {
  padding: 60px 20px;
  text-align: center;
}

.beers h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  font-weight: 600;
  color: var(--text-col);
}

.beer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.beer-card {
  background: var(--card-bg-col);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
  /* Ensure text inside cards inherits the light text colour */
  color: var(--text-col);
}

.beer-card:hover {
  transform: translateY(-5px);
}

.beer-card img {
  width: 100%;
  height: auto;
  /*
   * Provide a dark backdrop behind beer images so any transparent
   * portions of the PNGs don’t reveal the starfield.  Without this
   * background colour users could see through the image into the
   * animated background, which was distracting.  Padding creates
   * breathing room around the cans and ensures the rounded corners are
   * visually consistent with the card itself.
   */
  background-color: var(--section-bg-col);
  padding: 12px;
  border-radius: 8px;
}

.beer-card h3 {
  margin: 15px 0 5px;
  font-size: 1.5rem;
  /* Use the accent colour for beer names to make them pop */
  color: var(--accent-col) !important;
}

.beer-card .details {
  font-size: 0.85rem;
  color: var(--muted-col) !important;
  margin-bottom: 8px;
}

.beer-card p {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: white !important;
}

.btn-order {
  display: inline-block;
  background: var(--accent-col);
  color: #000;
  padding: 8px 18px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-order:hover {
  background: var(--accent-hover-col);
}

/* About & Contact sections */
.about,
.contact,
.newsletter {
  padding: 60px 20px;
  text-align: center;
}

/* Background colours for informational sections */
.about {
  padding: 60px 20px;
  text-align: center;
  background: rgba(27, 27, 27, 0.95);
}
.contact {
  background: rgba(31, 31, 31, 0.95);
}
.newsletter {
  background: rgba(27, 27, 27, 0.95);
}

.about h2,
.contact h2,
.newsletter h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--text-col);
}

.about p,
.contact p {
  max-width: 800px;
  margin: 0 auto 20px;
  font-size: 1rem;
  color: var(--muted-col);
}

.partner-list {
  list-style: none;
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
}

.partner-list li {
  margin: 6px 0;
  font-size: 0.95rem;
  color: var(--muted-col);
}

/* Newsletter */
.newsletter form {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.newsletter input[type='email'] {
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #555;
  border-radius: 4px;
  flex: 1 1 250px;
  background: var(--card-bg-col);
  color: var(--text-col);
}

.newsletter button {
  background: var(--accent-col);
  color: #000;
  padding: 12px 25px;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s;
}

.newsletter button:hover {
  background: var(--accent-hover-col);
}

.newsletter-message {
  margin-top: 15px;
  color: var(--accent-col);
  font-weight: 600;
  display: none;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.95);
  color: var(--text-col);
  padding: 15px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 100;
}

.cookie-banner button {
  background: var(--accent-col);
  border: none;
  padding: 10px 15px;
  color: #000;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.3s;
}

.cookie-banner button:hover {
  background: var(--accent-hover-col);
}

/* Age verification overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Dark translucent backdrop with a subtle blur to soften the page
     behind the overlay. The high z-index keeps the overlay above all
     other content. */
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  color: var(--text-col);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

/* Show the age gate only when the early head script marks it as needed.
   This prevents the confirmation modal from flashing on already-confirmed page loads. */
html.age-check-needed #age-overlay {
  display: flex;
}

html.age-confirmed #age-overlay {
  display: none !important;
}


.overlay-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
  background: rgba(27, 27, 27, 0.95);
  border: 1px solid var(--accent-col);
  border-radius: 8px;
}

.overlay h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.overlay p {
  margin-bottom: 20px;
  font-size: 1rem;
}

.overlay button {
  margin: 10px 15px;
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.overlay #yes-btn {
  background: var(--accent-col);
  color: #000;
}

.overlay #no-btn {
  background: #444;
  color: #fff;
}

/* Footer */
footer {
  /* Make the footer slightly transparent so the starfield peeks through */
  background: rgba(13, 13, 13, 0.95);
  color: var(--text-col);
  text-align: center;
  padding: 25px 15px;
  font-size: 0.9rem;
}

footer a {
  color: var(--accent-col);
  text-decoration: none;
  margin: 0 5px;
  transition: text-decoration 0.2s;
}

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

/* Responsive design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 15px;
  }
  .navbar .menu {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .beers h2 {
    font-size: 2rem;
  }
}

/* Product detail pages */
.product-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
  background: var(--section-bg-col);
  border-radius: 8px;
}

.product-detail h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--accent-col);
}

.product-detail img {
  width: 250px;
  height: auto;
  margin: 20px auto;
  /*
   * Add a solid backdrop behind individual product cans to prevent
   * transparent edges from showing the starfield.  This also adds a
   * modest amount of padding so the can isn’t flush against the edge
   * of its container.
   */
  background-color: var(--section-bg-col);
  padding: 16px;
  border-radius: 8px;
}

.product-detail .details {
  font-size: 0.9rem;
  color: var(--muted-col);
  margin: 5px 0;
}

.product-detail p {
  font-size: 1.2rem;
  color: white;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Dedicated About and Contact pages */
.about-page,
.contact-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 20px;
  background: var(--section-bg-col);
  border-radius: 8px;
  text-align: center;
}

.about-page h1,
.contact-page h1 {
  font-size: 2.5rem;
  margin-bottom: 25px;
  color: var(--accent-col);
}

.about-page p,
.contact-page p {
  font-size: 1.2rem;
  color: white;
  margin-bottom: 20px;
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.about-page img,
.contact-page img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 30px 0;
}

/* Contact page specific styles */
.contact-page .contact-info {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted-col);
}

.contact-page .contact-info h3 {
  color: var(--accent-col);
  margin-top: 25px;
  margin-bottom: 10px;
}

/* Page transition effects
   When navigating between pages we fade the page out before redirecting
   and fade the new page in on load. These classes are toggled via
   JavaScript in script.js. */
body {
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

body.fade-out {
  opacity: 0;
}

body.fade-in {
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------------------------------------------
   Swoosh page transition

   To elevate the navigation experience we introduce a dynamic "swoosh"
   effect that sweeps across the screen whenever the user navigates to
   another page. The effect is implemented via a pseudo‑element on
   the <body> that animates from left to right on exit and, if
   desired, from right to left on page load. The skewed shape and
   vivid accent colour create a modern, energetic feel without
   obscuring or altering page content. See script.js for the event
   handler that triggers these classes.
------------------------------------------------------------------ */

/* Swoosh exit: covers the page with a skewed band that slides
   horizontally across the screen. The width of 200% ensures full
   coverage even with the 20° skew applied. */
body.swoosh-out::before {
  content: '';
  position: fixed;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: var(--accent-col);
  transform: skewX(-20deg);
  z-index: 10000;
  animation: swooshOut 0.5s forwards ease-in-out;
  pointer-events: none;
}

/* Swoosh enter: optionally applied on page load to reveal the page
   with the same skewed band moving in the opposite direction. */
body.swoosh-enter::before {
  content: '';
  position: fixed;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: var(--accent-col);
  transform: skewX(-20deg);
  z-index: 10000;
  animation: swooshIn 0.5s forwards ease-in-out;
  pointer-events: none;
}

@keyframes swooshOut {
  from {
    left: -100%;
  }
  to {
    left: 100%;
  }
}

@keyframes swooshIn {
  from {
    left: 100%;
  }
  to {
    left: -100%;
  }
}

/* Enable smooth scrolling for anchor links so section navigation glides
   rather than jumping abruptly. */
html {
  scroll-behavior: smooth;
}

/* Starfield background */
/*
  The #universe element sits behind all page content and contains hundreds of
  animated stars. It uses our colour palette: the gradient moves from the
  primary background to the accent colour, and the stars themselves are
  tinted with the accent colour for cohesion. The stars are created and
  animated via JavaScript in script.js.
*/
#universe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Place the universe behind all page content. We set a negative z-index so
     that other elements (which default to auto/0) naturally stack above
     it. The pointer-events property prevents the stars from capturing
     mouse interactions. */
  z-index: -1;
  pointer-events: none;
  /* Use a dark gradient drawn from our palette instead of the original
     blue‑orange gradient. This allows the vivid accent‑coloured stars to
     stand out clearly while still tying into the overall colour scheme. */
  background: linear-gradient(to right, var(--bg-col), var(--section-bg-col));
}

/* Individual star styles. Each star is absolutely positioned and tinted
   using the accent colour so that it pops against the dark gradient. */
.star0,
.star1,
.star2,
.star3 {
  position: absolute;
  border-radius: 50%;
  /* Increase opacity so stars stand out more against the dark gradient */
  opacity: 1;
  /* Use the accent colour for stars – this provides a cohesive yet
     high‑contrast appearance on the dark gradient. */
  background-color: var(--accent-col);
}

.star0 {
  /* Increase sizes slightly so stars are more noticeable */
  width: 4px;
  height: 4px;
}
.star1 {
  width: 5px;
  height: 5px;
}
.star2 {
  width: 6px;
  height: 6px;
}
.star3 {
  width: 7px;
  height: 7px;
}


/* === Responsive Header & Mobile Nav === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.6));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.site-header .brand {
  color: var(--text-col);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-header .brand .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-col);
  box-shadow: 0 0 12px var(--accent-col);
}

.nav-toggle {
  background: transparent;
  border: none;
  padding: 10px;
  display: none;
  cursor: pointer;
  border-radius: 10px;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent-col);
  outline-offset: 2px;
}

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-col);
  margin: 5px 0;
  transition: transform 240ms ease, opacity 240ms ease;
}

/* Desktop nav */
.site-nav {
  display: flex;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
}

.site-nav a {
  color: var(--text-col);
  text-decoration: none;
  padding: 10px 6px;
  border-radius: 8px;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.site-nav a:hover {
  color: #000;
  background: var(--accent-col);
  box-shadow: 0 0 16px rgba(44, 238, 58, 0.4);
}

/* Mobile menu (off-canvas) */
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: fixed;
    inset: 0 0 0 35%;
    background: rgba(0,0,0,0.95);
    transform: translateX(100%);
    transition: transform 280ms cubic-bezier(.2,.7,.2,1);
    display: block;
    padding: 80px 24px 24px 24px;
    border-left: 1px solid rgba(255,255,255,0.06);
  }
  .site-nav.open { transform: translateX(0%); }
  .site-nav ul {
    flex-direction: column;
    gap: 14px;
background: black;
  }
  .site-nav a {
    display: block;
    padding: 14px 10px;
    font-size: 1.05rem;
  }
  body.menu-open {
    overflow: hidden; /* prevent background scroll */
  }
  /* Animate hamburger to X */
  .nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /*
   * When the mobile navigation is active (i.e. the `.open` class is applied
   * via JavaScript), ensure the off‑canvas panel uses a solid black
   * background. The previous semi‑transparent fill (rgba(0,0,0,0.95))
   * allowed the underlying starfield and page content to bleed through,
   * which reduced legibility of the menu items. Setting a fully opaque
   * black background here makes the white menu text stand out clearly.
   */
  .site-nav.open {
    background: #000;
  }




  
}


/* Final nav/image polish: keep the Beers link visible and highlighted on product pages. */
.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: #000;
  background: var(--accent-col);
  box-shadow: 0 0 16px rgba(44, 238, 58, 0.4);
}

/* Prevent beer images from appearing cropped inside cards/detail pages. */
.beer-card img,
.product-detail img {
  object-fit: contain;
  display: block;
}

/* Keep product pages comfortably below the sticky top navigation. */
.product-detail {
  margin-top: 24px;
}
