:root {
  --green: #2f5d46;
  --green-dark: #224634;
  --green-soft: #e3ece4;
  --cream: #f6f1e6;
  --paper: #fffdf8;
  --ink: #1e2a23;
  --muted: #66736b;
  --line: #ddd6c6;
  --gold: #c99a3a;
  --navy: #1f3a5f;
  --radius: 14px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

code {
  font: 0.86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

.eyebrow--navy {
  color: var(--navy);
}

/* ---- Banner & header ---------------------------------------------------- */

.demo-banner {
  background: var(--ink);
  color: #d9e2dc;
  font-size: 12.5px;
  text-align: center;
  padding: 6px 16px;
  overflow-wrap: anywhere;
}

.demo-banner code {
  color: #fff;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--green);
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex: none;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__name {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand__tag {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.site-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--ink);
  border-color: var(--green);
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px 7px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.cart-pill svg {
  width: 18px;
  height: 18px;
}

.cart-pill__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.cart-pill.bump .cart-pill__count {
  animation: bump 0.35s ease;
}

@keyframes bump {
  50% {
    transform: scale(1.35);
  }
}

/* ---- Intro -------------------------------------------------------------- */

.intro {
  padding-top: 44px;
  padding-bottom: 24px;
}

.intro h1 {
  font-size: clamp(32px, 5vw, 50px);
  color: var(--green-dark);
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  margin: 12px 0 0;
}

/* ---- Designer ----------------------------------------------------------- */

.designer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.builder-host {
  height: 640px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(34, 70, 52, 0.45);
  position: relative;
}

/*
 * Workaround for the library's compact palette: .bb-product is flex: 0 0 96px but has no
 * min-width: 0, so long (nowrap) product names stretch cards to uneven widths. Only reachable
 * for the light-DOM mount(); the <bouquet-builder> element's shadow root can't be styled from here.
 */
#builder .bb-palette--compact .bb-product {
  min-width: 0;
}

.builder-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

.builder-loading--error {
  color: #9c2f2f;
}

.designer__buy {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 92px;
}

.buy__title {
  font-size: 24px;
  color: var(--green-dark);
}

.price {
  display: flex;
  flex-direction: column;
  margin: 14px 0 12px;
}

.price__value {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.price__value.flash {
  animation: flash 0.5s ease;
}

@keyframes flash {
  from {
    color: var(--gold);
  }
}

.price__meta {
  color: var(--muted);
  font-size: 13.5px;
}

.selection {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 14px;
}

.selection li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px dashed var(--line);
}

.selection li span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 13px 20px;
  border: 0;
  cursor: pointer;
  width: 100%;
}

.btn--primary {
  background: var(--green);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--green-dark);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--link {
  width: auto;
  padding: 4px 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: underline;
}

.perks {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--muted);
}

.perks li {
  padding-left: 22px;
  position: relative;
  margin: 6px 0;
}

.perks li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-soft);
  box-shadow: 0 0 0 2px var(--green);
}

/* ---- Cart --------------------------------------------------------------- */

.cart {
  margin-top: 40px;
}

.cart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--green);
  padding-bottom: 8px;
}

.cart__head h2 {
  font-size: 26px;
}

.cart__total {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

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

.cart__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 14px;
}

.cart-item.is-new {
  animation: arrive 0.4s ease;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.cart-item__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.cart-item__head h3 {
  font-size: 19px;
}

.cart-item__meta {
  color: var(--muted);
  font-size: 13px;
}

.lines {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 6px;
  font-size: 14px;
}

.lines th,
.lines td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.lines th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.lines .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lines tfoot td {
  border-bottom: 0;
  font-weight: 700;
}

.sku {
  white-space: nowrap;
  font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}

.cart-item__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.raw {
  flex: 1 1 100%;
  font-size: 13.5px;
}

.raw summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
  width: max-content;
}

.raw pre {
  max-height: 360px;
  overflow: auto;
  background: #1c2620;
  color: #d7e6dc;
  border-radius: 10px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0 0;
}

/* ---- Evening (declarative) --------------------------------------------- */

.evening {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: center;
  margin-top: 64px;
  padding-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
}

.evening h2 {
  font-size: 30px;
  color: var(--navy);
  margin-bottom: 8px;
}

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

.snippet {
  background: #13203a;
  color: #cfdbf0;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12.5px;
  overflow-x: auto;
}

.evening__readout strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.evening__builder bouquet-builder {
  height: 580px;
  border-radius: 12px;
  box-shadow: 0 18px 40px -24px rgba(31, 58, 95, 0.55);
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--green-dark);
  color: #cfe0d4;
  font-size: 13.5px;
  padding: 28px 0;
  margin-top: 24px;
}

.site-footer p {
  margin: 4px 0;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 960px) {
  .designer {
    grid-template-columns: minmax(0, 1fr);
  }

  .designer__buy {
    position: static;
  }

  .evening {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .site-nav {
    display: none;
  }

  .cart-pill {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 14px;
  }

  .intro {
    padding-top: 28px;
  }

  .builder-host {
    height: 580px;
  }

  .evening__builder bouquet-builder {
    height: 560px;
  }

  .lines .col-unit {
    display: none;
  }

  .brand__name {
    font-size: 20px;
  }
}
