:root {
  --ink: #1c1333;
  --muted: #5c5378;
  --paper: #fffdf6;
  --cream: #ffe8a3;
  --yellow: #ffd400;
  --magenta: #ff2d6a;
  --cyan: #00c2d1;
  --lime: #8fe31a;
  --orange: #ff7a18;
  --violet: #7b4dff;
  --line: rgba(28, 19, 51, 0.12);
  --shadow: 0 18px 0 rgba(28, 19, 51, 0.12);
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --radius: 28px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(255, 45, 106, 0.22), transparent 55%),
    radial-gradient(700px 380px at 110% 8%, rgba(0, 194, 209, 0.28), transparent 50%),
    radial-gradient(800px 420px at 80% 110%, rgba(143, 227, 26, 0.22), transparent 55%),
    #fff3c4;
  letter-spacing: 0.01em;
}

.splats {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 8% 72%, var(--magenta) 0 18px, transparent 19px),
    radial-gradient(circle at 14% 76%, var(--yellow) 0 10px, transparent 11px),
    radial-gradient(circle at 92% 18%, var(--cyan) 0 22px, transparent 23px),
    radial-gradient(circle at 86% 24%, var(--lime) 0 9px, transparent 10px),
    radial-gradient(circle at 78% 88%, var(--orange) 0 16px, transparent 17px),
    radial-gradient(circle at 4% 12%, var(--violet) 0 12px, transparent 13px);
  opacity: 0.85;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

[hidden] {
  display: none !important;
}

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

.topbar,
main {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(880px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 0;
}

.brand {
  appearance: none;
  border: 3px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 0.9rem 0.45rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  box-shadow: 4px 5px 0 var(--ink);
}

.brand-blob {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--yellow) 0 40%, transparent 41%),
    radial-gradient(circle at 70% 35%, var(--magenta) 0 38%, transparent 39%),
    radial-gradient(circle at 50% 75%, var(--cyan) 0 42%, var(--lime) 43%);
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plan-link {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.plan-link.is-accent {
  background: var(--cyan);
}

.plan-link span {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
}

main {
  width: min(880px, calc(100% - 1.5rem));
  margin: 0 auto 4rem;
}

.hero {
  text-align: center;
  padding: 1.4rem 0 2rem;
}

.kicker {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.28rem 0.7rem;
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  transform: rotate(-2deg);
}

.quick-bar {
  margin: 0 0 1.4rem;
}

.quick-scroller {
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-scroller::-webkit-scrollbar {
  display: none;
}

.quick-filters {
  display: flex;
  gap: 0.45rem;
  width: max-content;
  margin: 0 auto;
  padding: 0.2rem;
}

.quick-chip {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.quick-chip.is-on {
  background: var(--magenta);
  color: #fff;
}

.btn-hero {
  appearance: none;
  width: min(100%, 420px);
  border: 4px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  padding: 1.15rem 1.4rem 1.05rem;
  cursor: pointer;
  box-shadow: 0 14px 0 var(--ink);
  transform: translateY(-4px);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-hero:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 0 var(--ink);
}

.btn-hero:active {
  transform: translateY(8px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-hero-label {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
}

.btn-hero-hint {
  display: block;
  margin-top: 0.35rem;
  font-weight: 800;
  font-size: 0.92rem;
}

.hero-split {
  margin: 1.1rem 0 0.7rem;
  font-weight: 800;
  color: var(--muted);
}

.craving {
  width: min(100%, 420px);
  margin: 0 auto;
  text-align: left;
}

.craving-label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.craving input {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  background: var(--paper);
}

.catalog-note,
.hero-note {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.3rem;
  box-shadow: var(--shadow);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--cyan);
}

.pill.is-age { background: var(--lime); }
.pill.is-time { background: var(--yellow); }
.pill.is-place { background: var(--orange); color: #fff; }
.pill.is-mess { background: #fff; }

.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.05;
  margin: 0 0 0.45rem;
}

.card-lead,
.card-pitch {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.45;
}

.card-art {
  margin: 0 0 1rem;
  border: 3px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  background: #1c1333;
}

.card-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.card-times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-bottom: 1rem;
  font-weight: 800;
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }
}

.card-block {
  background: #fff8dc;
  border: 2px dashed var(--ink);
  border-radius: 20px;
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 0.9rem;
}

.card-block h3,
.plan-title {
  font-family: var(--font-display);
  margin: 0 0 0.7rem;
}

.card-block.is-warn {
  background: #ffe1ea;
}

.ingredients,
.steps,
.variantes,
.astuces,
.plan-list,
.shop-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredients li,
.plan-list li,
.shop-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.ingredients .qty,
.shop-item .qty {
  font-weight: 800;
  color: var(--magenta);
  min-width: 4.5rem;
}

.mat-note,
.shop-note {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.mat-store {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--yellow);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.steps {
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.55rem 0 0.55rem 2.4rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--magenta);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  border: 2px solid var(--ink);
}

.steps strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.variantes li,
.astuces li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.variantes strong {
  display: inline-block;
  background: var(--violet);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.card-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  appearance: none;
  border: 3px solid var(--ink);
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--lime);
  box-shadow: 4px 5px 0 var(--ink);
}

.btn-primary.is-on {
  background: var(--magenta);
  color: #fff;
}

.btn-secondary {
  background: var(--paper);
}

.plan-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1.2rem 0 0.8rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-weight: 800;
  color: var(--magenta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.plan-title {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
}

.plan-list li {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.6rem;
  box-shadow: 4px 5px 0 var(--ink);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.plan-list button.linkish {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  flex: 1;
}

.shop-group {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  padding: 0.85rem 1rem 0.4rem;
  margin-bottom: 0.85rem;
}

.shop-group h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
}

.shop-group .hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.shop-item label {
  display: contents;
  cursor: pointer;
}

.shop-item input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--magenta);
}

.shop-item.is-done .nom {
  text-decoration: line-through;
  opacity: 0.55;
}

.shop-empty {
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 22px;
  padding: 1.2rem;
  font-weight: 700;
}

.local-banner {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  padding-bottom: 2rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  z-index: 9;
}

.craving-results {
  margin-top: 0.5rem;
}

.home-list {
  list-style: none;
  margin: 1.3rem 0 0;
  padding: 0;
  text-align: left;
}

.home-card {
  appearance: none;
  width: 100%;
  border: 4px solid var(--ink);
  background: var(--paper);
  border-radius: 24px;
  padding: 1rem 1.1rem 1.1rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow: 6px 8px 0 var(--ink);
}

.home-card .eyebrow {
  color: var(--violet);
}

.home-card h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0.15rem 0 0.4rem;
}

.home-card p {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
}

.btn-hero.drawing .btn-hero-label::after {
  content: " …";
}

.shop-item {
  grid-template-columns: auto auto 1fr;
  align-items: start;
}

.have-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  padding-top: calc(0.9rem + env(safe-area-inset-top));
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.quick-chip,
.plan-link,
.btn-primary,
.btn-secondary,
.btn-hero,
.home-card {
  min-height: 44px;
  touch-action: manipulation;
}

.quick-scroller {
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 1rem;
  padding-inline: 0.15rem;
}

.home-list {
  display: grid;
  gap: 1rem;
}

.home-list li {
  min-width: 0;
}

.home-card h2 {
  overflow-wrap: anywhere;
}

.toast {
  max-width: calc(100% - 2rem);
  text-align: center;
  bottom: calc(1rem + env(safe-area-inset-bottom));
}

.card-toolbar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: linear-gradient(transparent, var(--paper) 18%);
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
}

@media (max-width: 719px) {
  .quick-filters {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }

  .quick-scroller {
    overflow: visible;
  }
  .topbar {
    flex-wrap: wrap;
    width: min(880px, calc(100% - 1rem));
    gap: 0.55rem;
  }

  .brand {
    font-size: 1rem;
    padding: 0.4rem 0.7rem 0.4rem 0.45rem;
    max-width: 100%;
  }

  .top-actions {
    width: 100%;
    margin-left: 0;
  }

  .plan-link {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    padding: 0.55rem 0.45rem;
  }

  main {
    width: min(880px, calc(100% - 1rem));
    margin-bottom: 2.5rem;
  }

  .hero {
    padding: 1rem 0 1.3rem;
  }

  .kicker {
    font-size: 0.7rem;
    max-width: 100%;
    line-height: 1.3;
    transform: none;
  }

  .btn-hero {
    width: 100%;
    box-shadow: 0 10px 0 var(--ink);
    padding: 0.95rem 0.9rem 0.9rem;
  }

  .btn-hero-hint {
    font-size: 0.82rem;
  }

  .card {
    padding: 0.9rem 0.8rem 1rem;
    border-width: 3px;
    border-radius: 22px;
  }

  .card-lead,
  .card-pitch {
    font-size: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .ingredients .qty,
  .shop-item .qty {
    min-width: 3.4rem;
  }

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

  .shop-item .qty {
    grid-column: 2;
    grid-row: 1;
  }

  .shop-item > div {
    grid-column: 2;
  }

  .plan-head {
    align-items: stretch;
  }

  .plan-head .btn-primary,
  .plan-head .btn-secondary {
    width: 100%;
  }

  .plan-list li {
    flex-direction: column;
    align-items: stretch;
  }

  .card-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .card-toolbar .btn-primary,
  .card-toolbar .btn-secondary {
    width: 100%;
  }

  .splats {
    opacity: 0.45;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  .home-list {
    grid-template-columns: 1fr 1fr;
  }

  .top-actions {
    width: auto;
  }
}

@media (min-width: 900px) {
  .home-list {
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
  }
}

@media (hover: none) {
  .btn-hero:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 0 var(--ink);
  }
}
