/* ═══════════════════════════════════════════════════════════
   Scanabowl — custom styles, components & animation
   Werkt bovenop Tailwind (Play CDN). Tokens:
   brand #065f46 · cream #faf7f0 · ink #1e293b
   ═══════════════════════════════════════════════════════════ */

:root {
  --brand: #065f46;
  --brand-mid: #0b7a57;
  --cream: #faf7f0;
  --cream-line: #e6dfd0;
  --ink: #1e293b;
}

html { scroll-behavior: smooth; }
::selection { background: #d9eee4; color: #04412f; }

/* ── Focus zichtbaar voor toetsenbordgebruikers ── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-mid);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Navigatie ── */
.nav-link {
  padding: .5rem .85rem;
  border-radius: 9999px;
  font-size: .9rem;
  font-weight: 500;
  color: #475569;
  transition: color .15s, background-color .15s;
}
.nav-link:hover { color: var(--brand); background: #e7f4ed; }
.nav-link.active { color: var(--brand); background: #d9eee4; font-weight: 600; }

/* ── Knoppen ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--brand); color: #fff;
  padding: .8rem 1.5rem; border-radius: 9999px;
  font-weight: 600; font-size: .95rem;
  box-shadow: 0 8px 20px -8px rgba(6, 95, 70, .55);
  transition: background-color .15s, transform .15s, box-shadow .15s;
}
.btn-primary:hover { background: var(--brand-mid); transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(6,95,70,.6); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; color: var(--brand);
  border: 1.5px solid #cfe6da;
  padding: .8rem 1.5rem; border-radius: 9999px;
  font-weight: 600; font-size: .95rem;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.btn-secondary:hover { border-color: var(--brand); background: #f2faf6; transform: translateY(-1px); }

/* ── Hero raster & scan-animatie ── */
.hero-grid {
  background-image:
    linear-gradient(rgba(6,95,70,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,95,70,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 40%, transparent 100%);
}
.scanbeam { animation: scan 3.2s ease-in-out infinite; }
@keyframes scan {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(110px); }
}
.logo-scanline { animation: logoscan 2.6s ease-in-out infinite; }
@keyframes logoscan {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50%      { transform: translateY(6px); opacity: .5; }
}
.chip { animation: float 5s ease-in-out infinite; }
.chip-2 { animation-delay: -1.4s; }
.chip-3 { animation-delay: -2.6s; }
.chip-4 { animation-delay: -3.8s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ── Methode-kaarten ── */
.method-card {
  background: #fff;
  border: 1px solid var(--cream-line);
  border-radius: 1.25rem;
  padding: 1.75rem;
  transition: transform .2s, box-shadow .2s;
}
.method-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -16px rgba(6,95,70,.25); }
.method-icon {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  font-size: 1.4rem;
  background: #e7f4ed; border-radius: .9rem;
  margin-bottom: 1rem;
}

/* ── Formulieren & filters ── */
.input-base {
  width: 100%;
  border: 1.5px solid var(--cream-line);
  border-radius: .7rem;
  background: #fff;
  padding: .6rem .85rem;
  font-size: .92rem;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input-base:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(11,122,87,.14); outline: none; }
.filter-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: #64748b;
  margin-bottom: .55rem;
}
.check-row {
  display: flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--ink);
  padding: .2rem 0; cursor: pointer;
}
.check-input { width: 1rem; height: 1rem; accent-color: var(--brand); cursor: pointer; }
.pill-toggle {
  flex: 1; text-align: center;
  border: 1.5px solid var(--cream-line);
  border-radius: 9999px;
  padding: .45rem .6rem;
  font-size: .85rem; font-weight: 600;
  color: #475569; background: #fff;
  cursor: pointer;
  transition: all .15s;
}
.pill-toggle[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ── Productkaarten ── */
.product-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--cream-line);
  border-radius: 1.25rem;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.product-card:hover { transform: translateY(-4px); border-color: #bcd9cc; box-shadow: 0 20px 44px -18px rgba(6,95,70,.32); }
.product-card:hover .card-img { transform: scale(1.045); }
.card-img-wrap { aspect-ratio: 4 / 3; background: #f3eee3; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; transition: transform .3s ease; }
.score-badge {
  position: absolute; top: .8rem; right: .8rem;
  display: inline-flex; align-items: baseline; gap: .15rem;
  background: var(--brand); color: #fff;
  border-radius: .7rem;
  padding: .3rem .55rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .85rem; font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(6,95,70,.5);
}
.score-badge small { font-size: .6rem; opacity: .75; }
.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .22rem .5rem;
  border-radius: .45rem;
  background: #f3eee3; color: #475569;
}
.badge-green { background: #e7f4ed; color: var(--brand); }
.badge-amber { background: #fef3c7; color: #b45309; }

/* ── Skeleton laadstatus ── */
.skeleton {
  border-radius: 1.25rem;
  background: linear-gradient(100deg, #f3eee3 40%, #faf7f0 50%, #f3eee3 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 340px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Modal ── */
#product-modal.open { display: block; }
#modal-panel { animation: modal-in .22s cubic-bezier(.2,.9,.3,1.2); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
body.modal-open { overflow: hidden; }

/* ── Ingrediëntenlijst: eerste 5 vet ── */
.ingredient-top5 { font-weight: 700; color: var(--brand); }

/* ── Macro-chart ── */
.macro-seg { transition: opacity .15s, stroke-width .15s; cursor: pointer; }
.macro-seg:hover, .macro-seg.hl { opacity: 1 !important; }
.macro-legend-row { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: .5rem; cursor: pointer; transition: background .15s; }
.macro-legend-row:hover, .macro-legend-row.hl { background: #f2faf6; }
.macro-dot { width: .7rem; height: .7rem; border-radius: 3px; flex-shrink: 0; }

/* ── Wizard ── */
.wizard-dot { height: .4rem; flex: 1; border-radius: 9999px; background: var(--cream-line); transition: background .25s; }
.wizard-dot.done { background: var(--brand); }
.wizard-step { animation: step-in .25s ease; }
@keyframes step-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.option-card {
  display: flex; align-items: center; gap: .75rem;
  border: 1.5px solid var(--cream-line);
  border-radius: .9rem;
  padding: .85rem 1rem;
  font-weight: 500; font-size: .95rem;
  background: #fff; cursor: pointer; width: 100%;
  transition: all .15s;
}
.option-card:hover { border-color: #bcd9cc; background: #f8fbf9; }
.option-card[aria-pressed="true"] { border-color: var(--brand); background: #e7f4ed; color: var(--brand); font-weight: 600; }

/* ── Blogkaarten & artikel ── */
.blog-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--cream-line);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px -18px rgba(6,95,70,.28); }
.blog-card:hover .card-img { transform: scale(1.05); }
.article-body h2 { font-family: 'Fraunces', serif; font-size: 1.45rem; font-weight: 600; color: var(--ink); margin: 2rem 0 .75rem; }
.article-body h3 { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 1.5rem 0 .5rem; }
.article-body p { margin: 0 0 1.1rem; line-height: 1.75; color: #334155; }
.article-body ul { margin: 0 0 1.1rem 1.25rem; list-style: disc; color: #334155; line-height: 1.7; }
.article-body strong { color: var(--ink); }

/* ── Footer ── */
.footer-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.footer-link { transition: color .15s; }
.footer-link:hover { color: #fff; text-decoration: underline; }

/* ── Statusbanner ── */
.status-banner {
  max-width: 80rem; margin: 1rem auto 0; padding: .8rem 1.2rem;
  border-radius: .9rem; font-size: .88rem;
  display: flex; align-items: center; gap: .6rem; justify-content: space-between;
}
.status-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
