/* ZOVIA demo – style.css */

:root {
  /* Neutrals */
  --cream: #F6F0E4;
  --ivory: #FBF8F2;
  --ink: #2B2F36;
  --silver: #B8BCC4;

  /* Accents */
  --navy: #1F3A5F;
  --teal: #2E8B8B;

  /* Flavor tokens, set by script.js */
  --light: #F7B6A8;
  --deep: #C2483F;

  --font-head: "Syne", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --pad-x: clamp(1.25rem, 6vw, 5rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

/* ---------- Wordmark (logo bạc) ---------- */
.wordmark {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  margin: 0;
  color: var(--silver); /* fallback */
  background: linear-gradient(100deg,
    #858a94 0%, #c9cdd4 18%, #f4f6f9 32%, #a6abb4 48%,
    #e6e9ee 64%, #8a8f99 80%, #d3d6dc 100%);
  background-size: 260% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18));
}
.wordmark--sm { font-size: 2rem; }
.wordmark--gold {
  background: linear-gradient(100deg, #a67c1f, #f0d27a, #b88a2a, #f6e19a);
  background-clip: text;
  -webkit-background-clip: text;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--deep);
  color: var(--cream);
  padding: 1.25rem var(--pad-x) clamp(3rem, 8vw, 6rem);
  transition: background-color 0.6s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: clamp(2rem, 6vw, 4rem);
}
.nav__brand {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}
.nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.nav__links a { text-decoration: none; opacity: 0.85; }
.nav__links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.hero__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: var(--gap);
}

.hero .wordmark {
  font-size: clamp(3.5rem, 15vw, 10rem);
  letter-spacing: 0.08em;
}
.hero__sub { margin-top: 1.25rem; font-size: 1.2rem; max-width: 34ch; }
.hero__flavor { margin-top: 0.5rem; opacity: 0.9; }

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
.picker__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(246, 240, 228, 0.45);
  border-radius: 999px;
  padding: 0.45rem 1rem 0.45rem 0.5rem;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.picker__btn:hover { background: rgba(255, 255, 255, 0.18); }
.picker__btn[aria-pressed="true"] {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}
.picker__dot {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--cream);
  background: var(--dot);
}
.hero :focus-visible { outline-color: var(--cream); }

/* ---------- Can ---------- */
.hero__can { display: flex; justify-content: center; perspective: 900px; }

.can {
  --w: 120px;
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 2.25);
  display: flex;
  flex-direction: column;
  flex: none;
}
.can--lg { --w: clamp(130px, 20vw, 200px); }
.can__rim {
  height: 7%;
  border-radius: 50% / 100% 100% 0 0;
  background: linear-gradient(90deg, #8a8f99, #eceef2 40%, #9aa0a9 70%, #d6d9de);
}
.can__rim--bottom { border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.can__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 14% 0 12%;
  background: var(--can-light, var(--light));
  box-shadow: inset -10px 0 18px rgba(0, 0, 0, 0.08), inset 8px 0 14px rgba(255, 255, 255, 0.35);
  transition: background-color 0.6s ease;
}
.can__logo {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: calc(var(--w) * 0.26);
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #858a94, #f1f3f6 30%, #a0a5ae 55%, #e3e6eb 80%, #8a8f99);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 var(--can-deep, var(--deep)));
}
.can__name {
  font-size: calc(var(--w) * 0.11);
  font-weight: 700;
  color: var(--can-deep, var(--deep));
  text-align: center;
  transition: color 0.6s ease;
}
.can__icon {
  width: calc(var(--w) * 0.2);
  height: calc(var(--w) * 0.2);
  border-radius: 50%;
  border: 2px solid var(--can-deep, var(--deep));
  position: relative;
}
.can__icon::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: var(--can-deep, var(--deep));
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 8vw, 6rem) var(--pad-x); }
.section--tint { background: var(--ivory); }

.section__head { max-width: 62ch; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section__head h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); }
.section__head p { margin-top: 0.75rem; }
.group-title { font-size: 1.05rem; margin: 2.25rem 0 0.9rem; }
.group-title:first-of-type { margin-top: 0; }

.btn {
  margin-top: 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--cream);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
.btn:hover { background: var(--deep); }
.btn { transition: background-color 0.3s ease; }

/* ---------- Flavor table ---------- */
.table-wrap { overflow-x: auto; }
.flavor-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.flavor-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0 1rem 0.75rem;
  color: rgba(43, 47, 54, 0.7);
}
.flavor-table td { padding: 0.9rem 1rem; border-top: 1px solid rgba(43, 47, 54, 0.14); }
.flavor-row { cursor: pointer; transition: background-color 0.25s ease; }
.flavor-row:hover, .flavor-row:focus-visible { background: rgba(43, 47, 54, 0.05); }
.flavor-row[aria-selected="true"] { background: var(--light); }
.flavor-row[aria-selected="true"] td { border-color: transparent; }
.flavor-name { font-family: var(--font-head); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 0.6rem; }
.chip__box {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid rgba(43, 47, 54, 0.2);
}
.chip code { font-size: 0.9rem; }
.ratio-pill {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--ink);
  color: var(--cream);
}

/* ---------- Shelf ---------- */
.shelf {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.75rem, 3vw, 2rem);
  flex-wrap: wrap;
  padding: 2.5rem 1rem 0;
  border-bottom: 10px solid var(--ink);
  border-radius: 4px;
}
.shelf .can { --w: clamp(70px, 12vw, 110px); }

/* ---------- Swatches ---------- */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.swatch {
  font: inherit;
  text-align: left;
  padding: 0;
  background: var(--ivory);
  border: 1px solid rgba(43, 47, 54, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s ease;
}
.swatch:hover { border-color: var(--ink); }
.swatch__color { display: block; height: 84px; background: var(--sw); }
.swatch__info { display: block; padding: 0.65rem 0.85rem 0.8rem; }
.swatch__name { display: block; font-weight: 700; font-size: 0.95rem; }
.swatch__hex { font-size: 0.85rem; opacity: 0.75; }

.ratio {
  display: flex;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(43, 47, 54, 0.2);
  font-size: 0.9rem;
  font-weight: 700;
}
.ratio span { display: flex; align-items: center; padding: 0 1rem; white-space: nowrap; overflow: hidden; }
.ratio__cream { flex: 60; background: var(--cream); }
.ratio__flavor { flex: 30; background: var(--deep); color: var(--cream); transition: background-color 0.6s ease; }
.ratio__accent { flex: 10; background: var(--navy); color: var(--cream); }

/* ---------- Logo grid ---------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}
.logo-card { margin: 0; }
.logo-stage {
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
}
.logo-stage--deep { background: var(--deep); transition: background-color 0.6s ease; }
.logo-stage--ink { background: var(--ink); }
.logo-stage--pale { background: #F7E9D4; }
.logo-card figcaption { margin-top: 0.75rem; font-size: 0.95rem; }
.logo-card--ok .logo-stage { outline: 3px solid var(--teal); outline-offset: 3px; }
.logo-card--no .logo-stage { outline: 3px dashed #b3261e; outline-offset: 3px; }

/* ---------- Type ---------- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}
.type-card {
  background: var(--ivory);
  border: 1px solid rgba(43, 47, 54, 0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.type-card__sample { font-size: 5rem; line-height: 1; color: var(--deep); margin-bottom: 1rem; transition: color 0.6s ease; }
.type-card__sample--head { font-family: var(--font-head); font-weight: 800; }
.type-card__sample--body { font-family: var(--font-body); font-weight: 500; }
.type-card h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--ink);
  color: var(--cream);
  padding: 2rem var(--pad-x);
  font-size: 0.9rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  background: var(--ink);
  color: var(--cream);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  z-index: 10;
  pointer-events: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__can { order: -1; justify-content: flex-start; }
  .nav__links { gap: 1rem; }
}
