/* Self-hosted fonts (Latin subsets). Licences live alongside them in fonts/. */
@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/anton-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Yellowtail";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/yellowtail-latin.woff2") format("woff2");
}

:root {
  --bg: #f6f0e2;
  --bg-dots: rgba(214, 40, 40, 0.07);
  --surface: #fffaf0;
  --text: #161412;
  --muted: #5d5850;
  --line: rgba(22, 20, 18, 0.14);
  --red: #d62828;
  --pink: #ff3e9a;
  --cyan: #1fb5c9;
  --yellow: #ffd60a;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 10px 30px rgba(60, 30, 10, 0.12);

  --font-display: "Anton", "Impact", "Haettenschweiler", sans-serif;
  --font-script: "Yellowtail", "Brush Script MT", cursive;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151312;
    --bg-dots: rgba(255, 62, 154, 0.07);
    --surface: #1f1c1a;
    --text: #f6f0e2;
    --muted: #b3aca0;
    --line: rgba(246, 240, 226, 0.14);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --bg: #151312;
  --bg-dots: rgba(255, 62, 154, 0.07);
  --surface: #1f1c1a;
  --text: #f6f0e2;
  --muted: #b3aca0;
  --line: rgba(246, 240, 226, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1.2px, transparent 1.4px);
  background-size: 9px 9px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; line-height: 1; margin: 0; }
h2 { font-size: clamp(34px, 5vw, 56px); text-transform: uppercase; }

.muted { color: var(--muted); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
}
.topbar nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.topbar nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.topbar nav a:hover { color: var(--red); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--text);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--text); }
.btn:active { transform: none; box-shadow: none; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { box-shadow: 3px 3px 0 var(--text); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) clamp(16px, 4vw, 40px) clamp(32px, 6vw, 72px);
}
.kicker {
  margin: 0 0 14px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

/* Screenprint: the slightly off-register colour layers of a silkscreen. */
.screenprint {
  position: relative;
  font-size: clamp(64px, 11vw, 150px);
  text-transform: uppercase;
  line-height: 0.88;
  color: var(--text);
  isolation: isolate;
}
.screenprint::before,
.screenprint::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.screenprint::before { color: var(--pink); transform: translate(0.05em, 0.035em); }
.screenprint::after { color: var(--cyan); transform: translate(-0.035em, -0.02em); mix-blend-mode: multiply; opacity: 0.85; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .screenprint::after { mix-blend-mode: screen; }
}
:root[data-theme="dark"] .screenprint::after { mix-blend-mode: screen; }
.screenprint.small { font-size: clamp(48px, 8vw, 96px); }

.lede {
  max-width: 34ch;
  margin: 24px 0 28px;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.4;
}
.lede em { font-family: var(--font-script); font-style: normal; color: var(--red); font-size: 1.35em; line-height: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-cans {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 300px;
}
.hero-can { width: 36%; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.18)); }
.hero-can svg { display: block; width: 100%; height: auto; }
.hero-can-0 { transform: rotate(-7deg) translateY(10px); margin-right: -6%; z-index: 1; }
.hero-can-1 { transform: translateY(-18px) scale(1.12); z-index: 2; }
.hero-can-2 { transform: rotate(7deg) translateY(10px); margin-left: -6%; z-index: 1; }

/* ---------- the shelf of cans ---------- */

.cans-section,
.list-section,
.about {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 40px);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 24px;
}
.section-head .muted { max-width: 52ch; margin: 10px 0 0; }
.controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.progress { margin: 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 2px solid var(--text);
  border-radius: 999px;
}
.segmented button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.shelf {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(4px, 0.8vw, 10px);
  padding: clamp(12px, 2vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.can {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: can-in 0.5s cubic-bezier(.2, .9, .3, 1.3) both;
  animation-delay: var(--d, 0ms);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.can svg { display: block; width: 100%; height: auto; }
.can:hover,
.can:focus-visible { transform: translateY(-6px) rotate(-2deg); filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.22)); z-index: 1; }
.can:focus-visible { outline-offset: 2px; border-radius: 8px; }
.can.is-opened::after {
  content: "";
  position: absolute;
  top: 0;
  right: 8%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23141414' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
  box-shadow: 0 0 0 1.5px #141414;
}

@keyframes can-in {
  from { opacity: 0; transform: translateY(14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* SVG label typography */
.can-script { font-family: var(--font-script); font-size: 25px; }
.can-flavour { font-family: var(--font-display); letter-spacing: 0.02em; }
.can-small { font-family: var(--font-body); font-weight: 800; font-size: 6.2px; letter-spacing: 1.1px; }
.can-seal { font-family: var(--font-display); font-size: 10px; }

/* ---------- the list ---------- */

.list-section > .muted { margin: 10px 0 28px; }
.goodlist {
  list-style: none;
  counter-reset: thing;
  margin: 0;
  padding: 0;
  columns: 3 280px;
  column-gap: 36px;
}
.goodlist li {
  counter-increment: thing;
  position: relative;
  break-inside: avoid;
  padding: 12px 10px 12px 52px;
  border-top: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.goodlist li:hover { background: color-mix(in srgb, var(--yellow) 22%, transparent); }
.goodlist li::before {
  content: counter(thing, decimal-leading-zero);
  position: absolute;
  left: 6px;
  top: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
  color: var(--red);
}
.goodlist li b { font-weight: 800; }

/* ---------- about ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 24px 48px;
  align-items: start;
}
.about-copy p { margin: 0 0 16px; font-size: 19px; max-width: 56ch; }

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

.footer {
  padding: 32px clamp(16px, 4vw, 40px) 48px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
}
.footer p { margin: 4px 0; }

/* ---------- opened can dialog ---------- */

.opened {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 3px solid var(--text);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 10px 10px 0 var(--red);
}
.opened::backdrop { background: rgba(20, 16, 12, 0.6); backdrop-filter: blur(3px); }
.opened-inner {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
}
.opened-can svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.2)); }
.opened-can.pop { animation: can-pop 0.45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes can-pop {
  0% { transform: scale(0.85) rotate(-6deg); }
  60% { transform: scale(1.05) rotate(2deg); }
  100% { transform: none; }
}
.opened-no {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}
.opened-flavour { font-size: clamp(40px, 6vw, 64px); text-transform: uppercase; }
.opened-text { margin: 16px 0 24px; font-size: 20px; line-height: 1.45; }
.opened-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.opened-nav .btn-primary { margin-left: auto; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .shelf { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-cans { min-height: 0; max-width: 420px; margin: 8px auto 0; width: 100%; }
  .about { grid-template-columns: 1fr; }
  .controls { align-items: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar nav a:nth-child(3) { display: none; }
  .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .opened-inner { grid-template-columns: 1fr; padding: 20px; gap: 12px; text-align: center; }
  .opened-can { width: 130px; margin: 0 auto; }
  .opened-nav { justify-content: center; }
  .opened-nav .btn-primary { margin-left: 0; }
  .opened-text { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
