/* =========================================================
   KAILYAN Craft Beer — styles
   ========================================================= */

/* ---------- Brand tokens ---------- */
:root {
  /* Core palette (from the brand brief) */
  --sage: #D8D8C5;      /* Sage Label Green — backgrounds, product surfaces */
  --pine: #292B1B;      /* Deep Pine Olive — logo, headings, contrast */
  --forest: #74785D;    /* Forest Sage — accents, illustration */
  --mist: #A4A68A;      /* Mist Green — borders, secondary details */
  --ivory: #F1EBDD;     /* Warm Ivory — light backgrounds, reverse text */

  /* Derived tones */
  --text: var(--pine);
  --text-muted: #55583F;      /* darker Forest Sage, passes AA on ivory + sage */
  --pine-deep: #222416;
  --line: rgba(41, 43, 27, .18);

  /* Type */
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 140px);
  --header-h: 68px;
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, figure, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--pine);
  color: var(--ivory);
  font-family: var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* ---------- Shared pieces ---------- */
.wordmark { width: 100%; height: auto; aspect-ratio: 771 / 183; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The short centred line from the can label */
.rule {
  display: block;
  width: 44px;
  height: 2px;
  background: currentColor;
}

/* Chevron border, echoing the top of the can */
.band {
  /* artwork from kailyan-pattern-source.svg: one repeat, base line included */
  height: clamp(34px, 3.4vw, 46px);
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: center top;
}
.band--dark { background-image: url("../assets/band-dark.svg"); }
.band--light { background-image: url("../assets/band-light.svg"); }

.ornament { width: 36px; height: 36px; color: var(--mist); flex: none; }

.section-head { display: grid; gap: 18px; max-width: 720px; }
.section-head p:not(.eyebrow) { color: var(--text-muted); font-size: 1.125rem; max-width: 56ch; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head--light .eyebrow { color: var(--mist); }
.section-head--light h2 { color: var(--ivory); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions--center { justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 1.5px solid var(--pine);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn--solid { background: var(--pine); color: var(--ivory); }
.btn--solid:hover { background: transparent; color: var(--pine); }
.btn--ghost { color: var(--pine); }
.btn--ghost:hover { background: var(--pine); color: var(--ivory); }
.btn--light { background: var(--ivory); border-color: var(--ivory); color: var(--pine); }
.btn--light:hover { background: transparent; color: var(--ivory); }
.btn--ghost-light { border-color: var(--mist); color: var(--ivory); }
.btn--ghost-light:hover { background: var(--ivory); border-color: var(--ivory); color: var(--pine); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory);
  transition: box-shadow .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.site-header__brand { display: block; width: 124px; color: var(--pine); }

.site-nav ul { display: flex; gap: clamp(20px, 3vw, 40px); }
.site-nav a {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 8px;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--pine);
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 24px; height: 1.5px;
  margin-inline: auto;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
  }
  .site-nav a { display: block; padding-block: 14px; border-top: 1px solid var(--line); }
  .site-nav li:first-child a { border-top: 0; }
  .site-nav a::after { display: none; }
}

/* ---------- 1. Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--header-h));
  background: var(--ivory);
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 0 auto; /* any spare height goes above the mountains, never below */
  padding-top: clamp(48px, 8vh, 96px);
}

.hero__logo { width: min(100%, 680px); margin-top: 22px; color: var(--pine); }
.hero .rule { margin-top: clamp(22px, 3vh, 32px); color: var(--pine); }

.hero__title {
  margin-top: clamp(20px, 3vh, 28px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  letter-spacing: .14em;
  line-height: 1.15;
  text-transform: uppercase;
}

.hero__lede {
  max-width: 44ch;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
}

.hero .actions { justify-content: center; margin-top: 32px; }

.hero__mountains {
  width: 100%;
  height: auto;
  min-height: 240px;
  object-fit: cover;
  object-position: 30% bottom;
  /* the artwork's plain sky matches the ivory background, so tuck it under the copy */
  margin-top: max(-8vw, -96px);
  margin-bottom: -1px;
}

/* soften the hand-off from the artwork's foreground into the dark section below */
.hero::after,
.cordilleras::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(16px, 2.5vw, 36px);
  background: linear-gradient(rgba(41, 43, 27, 0), var(--pine));
  pointer-events: none;
}

@media (max-width: 560px) {
  .hero .actions { flex-direction: column; width: 100%; max-width: 320px; }
  .hero .btn { width: 100%; }
}

/* ---------- 2. Our beers ---------- */
.beers {
  position: relative;
  padding-block: var(--section-y);
  background: var(--pine) url("../assets/topo.svg") center / 520px repeat;
  color: var(--ivory);
}

.beer-list { display: grid; gap: clamp(40px, 6vw, 72px); margin-top: clamp(48px, 7vw, 88px); }

.beer {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 7vw, 110px);
  align-items: center;
}
.beer + .beer { padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid rgba(241, 235, 221, .14); }
.beer:nth-of-type(even) .beer__can { order: 2; }

.beer__can { display: flex; justify-content: center; }

.beer__info { max-width: 520px; }
.beer__info .eyebrow { color: var(--mist); }

.beer__name {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 2rem + 4vw, 5.5rem);
  line-height: .92;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.notes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mist);
}
.notes li { display: flex; align-items: center; gap: 14px; }
.notes li + li::before { content: "•"; letter-spacing: 0; }

.beer__desc {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(241, 235, 221, .18);
  font-size: 1.125rem;
  color: rgba(241, 235, 221, .86);
  max-width: 46ch;
}

.beer__specs { display: flex; gap: 40px; margin-top: 28px; }
.beer__specs dt {
  font-family: var(--font-display);
  font-size: .8125rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mist);
}
.beer__specs dd { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }

.beer-soon {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border: 1px solid rgba(164, 166, 138, .4);
  color: rgba(241, 235, 221, .8);
}
.beer-soon strong {
  color: var(--ivory);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-right: 4px;
}

@media (max-width: 820px) {
  .beer { grid-template-columns: 1fr; text-align: center; }
  .beer:nth-of-type(even) .beer__can { order: 0; }
  .beer__info { margin-inline: auto; }
  .notes { justify-content: center; }
  .beer__desc { margin-inline: auto; }
  .beer__specs { justify-content: center; }
}

/* Product photo: a cut-out can with a transparent background */
.beer__photo { display: block; width: min(300px, 60vw); }
.beer__photo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 34px 34px rgba(0, 0, 0, .45));
  transition: transform .5s var(--ease);
}
.beer:hover .beer__photo img { transform: translateY(-6px); }

/* ---------- The can (CSS product render) ---------- */
/* Stand-in for beers that do not have a photo yet. */
.can {
  --label-bg: var(--sage);
  container-type: inline-size;
  position: relative;
  width: min(300px, 70vw);
  filter: drop-shadow(0 30px 30px rgba(0, 0, 0, .35));
  transition: transform .5s var(--ease);
}
.beer[data-label="ivory"] .can { --label-bg: var(--ivory); }
.beer[data-label="mist"] .can { --label-bg: var(--mist); }
.beer:hover .can { transform: translateY(-6px); }

.can__lid,
.can__base {
  position: relative;
  height: 7cqw;
  margin-inline: 5cqw;
  background: linear-gradient(90deg, #8d8f86, #e6e6e1 22%, #b4b5ae 50%, #f2f2ee 72%, #8a8c83);
}
.can__lid { border-radius: 40% 40% 0 0 / 100% 100% 0 0; }
.can__base { border-radius: 0 0 40% 40% / 0 0 100% 100%; }

.can__label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 100 / 205;
  background: var(--label-bg);
  color: var(--pine);
  text-align: center;
  overflow: hidden;
  border-radius: 3cqw / 1.5cqw;
}
/* subtle cylindrical shading */
.can__label::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 16%,
    rgba(255, 255, 255, .16) 32%, rgba(255, 255, 255, 0) 46%,
    rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .26));
}

.can__band {
  width: 100%;
  height: 13cqw;
  margin-top: 5cqw;
  background: url("../assets/band-dark.svg") center top / auto 100% repeat-x;
}

.can__origin {
  margin-top: 11cqw;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 6.4cqw;
  line-height: 1.1;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.can__origin span { display: block; font-size: 4.2cqw; font-weight: 500; letter-spacing: .2em; }

.can__logo { width: 80%; height: auto; aspect-ratio: 771 / 183; margin-top: 9cqw; }

.can__sub {
  margin-top: 2.5cqw;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 5.6cqw;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.can__name {
  margin-top: 13cqw;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 8.2cqw;
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.can__notes {
  margin-top: 2cqw;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 4.6cqw;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--forest);
}

.can__art {
  width: 100%;
  height: auto;
  margin-top: auto;
}

/* ---------- 3. Our story ---------- */
.story { padding-block: var(--section-y); background: var(--sage); }

.story__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(48px, 7vw, 110px);
  align-items: center;
}

.story__text h2 { margin-top: 18px; max-width: 14ch; }
.story__lead {
  margin-top: 28px;
  font-size: clamp(1.1875rem, 1.05rem + .5vw, 1.4375rem);
  line-height: 1.5;
  color: var(--pine);
}
.story__text > p:not(.eyebrow):not(.story__lead) { margin-top: 18px; color: var(--text-muted); max-width: 54ch; }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pillars svg { width: 48px; height: 24px; color: var(--forest); }
.pillars h3 {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.pillars p { margin-top: 4px; font-size: .9375rem; line-height: 1.5; color: var(--text-muted); }

.story__media { position: relative; display: grid; }
.story__photo { overflow: hidden; background: var(--sage); }
.story__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.story__photo:hover img { transform: scale(1.03); }
.story__photo--a { aspect-ratio: 4 / 3.4; margin-right: 18%; }
.story__photo--b {
  aspect-ratio: 431 / 210;
  width: 72%;
  justify-self: end;
  margin-top: -16%;
  outline: 10px solid var(--sage);
}

@media (max-width: 900px) {
  .story__grid { grid-template-columns: 1fr; }
  .story__media { max-width: 560px; }
}
@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; gap: 22px; }
  .pillars li { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; }
  .pillars svg { grid-row: span 2; align-self: start; margin-top: 4px; }
  .pillars h3 { margin-top: 0; }
}

/* ---------- 4. Inspired by the mountains ---------- */
.cordilleras {
  position: relative;
  background: var(--ivory);
  overflow: hidden;
}
.cordilleras .container { padding-top: clamp(64px, 9vw, 120px); }
.cordilleras .section-head p:not(.eyebrow) { color: var(--text-muted); }

.cordilleras__art {
  width: 100%;
  height: auto;
  min-height: 280px;
  object-fit: cover;
  object-position: 30% bottom;
  transform: scaleX(-1); /* mirrored so it doesn't repeat the hero exactly */
  margin-top: clamp(-80px, -5vw, -16px);
  margin-bottom: -1px;
}
.cordilleras .container { position: relative; z-index: 1; }

/* ---------- 5. Closing ---------- */
.closing {
  background: var(--pine);
  color: var(--ivory);
  padding-block: clamp(72px, 10vw, 140px);
}
.closing__inner { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.closing h2 { font-size: clamp(2.75rem, 1.6rem + 5vw, 6rem); line-height: .95; }

/* ---------- 6. Footer ---------- */
.site-footer {
  background: var(--pine-deep);
  color: var(--ivory);
}
.site-footer .band { opacity: .9; }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-block: 56px 40px;
}
.site-footer__brand .wordmark { width: 200px; color: var(--ivory); }
.site-footer__brand p {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .9375rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mist);
}

.site-footer__nav ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-footer__nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(241, 235, 221, .85);
}
.site-footer__nav a:hover { color: var(--ivory); text-decoration: underline; text-underline-offset: 6px; }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 22px 32px;
  border-top: 1px solid rgba(241, 235, 221, .12);
  font-size: .875rem;
  color: var(--mist);
}

/* ---------- Gentle reveal on scroll (JS adds .reveal) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
