/* Eager — "Now in purple" Blackcurrant launch page.
   Core palette from the Eager Brand: yellow, charcoal, white; black and green
   are site-level colours. Blackcurrant purple and lilac are the new
   flavour's own packaging colours, so they appear only in the product
   photography, never in the page's type or interface. */

@font-face {
  font-family: "P22 Mackinac Pro";
  src: url("/examples/eager/fonts/p22-mackinac-pro-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "P22 Mackinac Pro";
  src: url("/examples/eager/fonts/p22-mackinac-pro-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Italian Plate No2";
  src: url("/examples/eager/fonts/italian-plate-no2-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --yellow: #fff064;
  --charcoal: #3a3a3a;
  --white: #ffffff;
  --black: #000000;
  --green: #1d8927;
  --display: "P22 Mackinac Pro", Georgia, serif;
  --label: "Italian Plate No2", "Arial Narrow", sans-serif;
  --gutter: clamp(20px, 4vw, 64px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.45;
  color: var(--black);
  background: var(--yellow);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
p,
figure,
ol {
  margin: 0;
}

a {
  color: inherit;
}

/* ---------- shared ---------- */

/* Labels, buttons and links follow eagerdrinks.com: Italian Plate No2 in bold
   uppercase with 1px tracking; links in Eager green with a 2px underline. */

.eyebrow {
  font-family: var(--label);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 18px;
}

.eyebrow--light {
  color: var(--white);
}

.button {
  appearance: none;
  border: 2px solid var(--green);
  border-radius: 0;
  background: var(--green);
  color: var(--white);
  font-family: var(--label);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 17px 28px 15px;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}

.button:hover {
  background: var(--white);
  color: var(--green);
}

.button:focus-visible,
.text-link:focus-visible,
.site-header a:focus-visible,
.maths__tabs button:focus-visible,
.range__scroller:focus-visible,
.list-dialog input:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}

.button--small {
  font-size: 15px;
  padding: 11px 16px 9px;
}

.button--large {
  font-size: 21px;
  padding: 20px 36px 18px;
}

.text-link {
  font-family: var(--label);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--green);
  text-decoration: none;
  border-bottom: 2px solid var(--green);
  transition: border-color 200ms ease;
}

.text-link:hover {
  border-color: transparent;
}

/* ---------- announcement + header ---------- */

.announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--green);
  color: var(--white);
  font-family: var(--label);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px var(--gutter);
}

.announcement img {
  width: 20px;
  height: 20px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px var(--gutter);
  background: var(--yellow);
}

.site-header__logo img {
  width: 104px;
  height: auto;
}

.site-header__nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-family: var(--label);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.site-header__nav a {
  text-decoration: none;
}

.site-header__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(48px, 7vw, 96px);
  background: var(--yellow);
  overflow: hidden;
}

.hero__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(64px, 9.4vw, 156px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero__purple {
  white-space: nowrap;
}

.hero__lede {
  font-size: clamp(19px, 1.6vw, 23px);
  max-width: 30ch;
  margin-top: 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  margin-top: 36px;
}

.hero__media {
  /* The generated photograph shares the brand yellow, so a soft edge mask
     lets the carton sit on the page rather than inside a box. */
  --edge: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: var(--edge);
  -webkit-mask-composite: source-in;
  mask-image: var(--edge);
  mask-composite: intersect;
  margin: -4% -4% -4% 0;
}

.hero__media img {
  width: 100%;
  animation: carton-in 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes carton-in {
  from {
    opacity: 0;
    transform: translateX(8%) rotate(4deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- range ---------- */

.range {
  background: var(--green);
  color: var(--white);
  padding: clamp(56px, 8vw, 112px) 0;
}

.range__head {
  padding: 0 var(--gutter);
}

.range__title {
  font-weight: 500;
  font-size: clamp(38px, 5.4vw, 84px);
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.range__title span {
  color: var(--yellow);
}

.range__scroller {
  margin-top: clamp(24px, 4vw, 48px);
  overflow-x: auto;
  scrollbar-width: none;
}

.range__scroller::-webkit-scrollbar {
  display: none;
}

.range__scroller img {
  width: 100%;
  min-width: 760px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.range__list {
  list-style: none;
  padding: 0 var(--gutter);
  margin-top: clamp(24px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
  counter-reset: flavour;
}

.range__list li {
  counter-increment: flavour;
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 12px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid rgb(255 255 255 / 0.35);
  font-family: var(--label);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.range__list li::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--swatch);
  outline: 1px solid rgb(255 255 255 / 0.5);
  grid-row: span 2;
  align-self: start;
  margin-top: 4px;
}

.range__list li span {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
  display: block;
}

.range__new {
  color: var(--yellow);
}

.range__new em {
  font-family: var(--label);
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  vertical-align: 4px;
  margin-left: 8px;
  padding: 2px 6px 1px;
  border: 1px solid currentColor;
}

/* ---------- no maths ---------- */

.maths {
  background: var(--white);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  padding: clamp(64px, 9vw, 128px) var(--gutter);
}

.maths__title {
  font-weight: 500;
  font-size: clamp(32px, 3.8vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.maths__tabs {
  display: flex;
  border: 2px solid var(--green);
}

.maths__tabs button {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--label);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 12px;
  cursor: pointer;
  color: var(--black);
}

.maths__tabs button[aria-selected="true"] {
  background: var(--green);
  color: var(--white);
}

.maths__steps {
  list-style: none;
  padding: 8px 0 0;
  counter-reset: step;
  min-height: 300px;
}

.maths__steps li {
  counter-increment: step;
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid #d8d8d8;
  font-weight: 500;
  font-size: clamp(22px, 2vw, 28px);
}

.maths__steps li::before {
  content: counter(step);
  font-family: var(--label);
  font-size: 15px;
  color: var(--charcoal);
  min-width: 1.4em;
}

.maths__steps--short li {
  font-size: clamp(40px, 4.4vw, 64px);
  padding: 18px 0;
}

/* ---------- store ---------- */

.store {
  background: var(--charcoal);
  color: var(--white);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}

.store__media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.store__copy {
  padding: clamp(40px, 6vw, 96px) var(--gutter);
  max-width: 640px;
}

.store__title {
  font-weight: 500;
  font-size: clamp(40px, 4.6vw, 72px);
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.store__copy p {
  font-size: clamp(19px, 1.5vw, 22px);
}

.store__small {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgb(255 255 255 / 0.3);
  font-family: var(--label);
  font-weight: 700;
  font-size: 15px !important;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- cta ---------- */

.cta {
  background: var(--yellow);
  text-align: center;
  padding: clamp(72px, 10vw, 144px) var(--gutter);
}

.cta__title {
  font-weight: 500;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.cta__lede {
  font-size: clamp(19px, 1.6vw, 23px);
  margin: 24px auto 40px;
  max-width: 34ch;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--green);
  color: var(--white);
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 40px var(--gutter);
}

.site-footer img {
  width: 104px;
  flex: none;
}

.site-footer__line {
  font-family: var(--label);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- list dialog ---------- */

.list-dialog {
  border: 0;
  border-radius: 0;
  padding: 40px;
  width: min(92vw, 460px);
  background: var(--yellow);
  color: var(--black);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}

.list-dialog::backdrop {
  background: rgb(58 58 58 / 0.6);
}

.list-dialog h2 {
  font-weight: 500;
  font-size: 36px;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.list-dialog p {
  font-size: 19px;
  margin-bottom: 24px;
}

.list-dialog label {
  display: block;
  font-family: var(--label);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.list-dialog input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 19px;
  padding: 12px 14px;
  border: 2px solid var(--black);
  border-radius: 0;
  background: var(--white);
  margin-bottom: 20px;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .site-header__nav {
    display: none;
  }
  .site-header .button--small {
    margin-left: auto;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__media {
    order: -1;
    margin: -6% -10% -10%;
  }
  .range__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .maths,
  .store {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 17px;
  }
  .announcement {
    font-size: 13px;
    gap: 12px;
  }
  .announcement img {
    width: 16px;
    height: 16px;
  }
  .site-header {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .site-header__logo img {
    width: 84px;
  }
  .site-header .button--small {
    font-size: 12px;
    padding: 10px 12px;
  }
  .hero__title {
    font-size: 64px;
  }
  .hero__actions .button {
    width: 100%;
  }
  .range__list {
    grid-template-columns: 1fr;
  }
  .maths__steps {
    min-height: 0;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero__media img {
    animation: none;
  }
  .button {
    transition: none;
  }
}
