/* ============================================================
   Kuchenwelt Beeldfeedback — design tokens + components
   Palette: ink #171717 + white + single gold accent #D4AF37.
   Goal: calm, premium, images are the hero. Inter throughout.
   ============================================================ */

:root {
  --ink: #171717;
  --ink-soft: #404040;
  --muted: #57534e;          /* stone-600, passes 4.5:1 on white */
  --faint: #a8a29e;          /* stone-400, decorative only */
  --line: #e7e5e4;           /* stone-200 borders */
  --line-strong: #d6d3d1;    /* stone-300 */
  --bg: #ffffff;
  --surface: #faf9f7;        /* warm off-white card bg */
  --surface-2: #f5f4f2;
  --gold: #d4af37;
  --gold-deep: #a8861f;      /* darker gold for text/contrast */
  --gold-soft: #faf3dd;      /* gold tint backgrounds */
  --up: #15803d;             /* green-700 */
  --down: #b91c1c;           /* red-700 */

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 23, .05);
  --shadow: 0 6px 24px rgba(23, 23, 23, .07);
  --shadow-lg: 0 16px 48px rgba(23, 23, 23, .12);
  --container: 1120px;
  --tap: 44px;               /* min touch target */
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* safety net against accidental horizontal scroll */
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin: 0; overflow-wrap: break-word; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
/* default icon size — components below override with explicit sizes.
   Prevents an un-sized inline SVG from expanding to fill its container. */
svg { width: 1em; height: 1em; flex: none; }

a { color: var(--gold-deep); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---- accessibility helpers ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Top bar + progress
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex; align-items: center; gap: 16px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand__dot { width: 12px; height: 12px; border-radius: 3px; background: var(--gold); }
.brand small { color: var(--muted); font-weight: 400; }
.topbar__spacer { flex: 1; }
.saved {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
  opacity: 0; transition: opacity .3s var(--ease);
}
.saved.show { opacity: 1; }
.saved svg { color: var(--up); }

.progress { height: 4px; background: var(--surface-2); }
.progress__bar {
  height: 100%; width: 0; background: var(--gold);
  transition: width .4s var(--ease);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 11px 22px;
  font: inherit; font-weight: 600; font-size: 15px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--gold { background: var(--gold); color: #1c1407; }
.btn--gold:hover { background: #e0bd49; box-shadow: var(--shadow); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn--ghost:disabled { color: var(--faint); border-color: var(--line); cursor: not-allowed; background: #fff; }
.btn--lg { padding: 15px 30px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }

/* ============================================================
   Intro screen
   ============================================================ */
.intro { padding: clamp(48px, 9vw, 96px) 0 80px; }
.intro__lead { max-width: 680px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-deep); margin-bottom: 16px;
}
.intro h1 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 20px; }
.intro__sub { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-soft); max-width: 620px; }
.intro__lead-p { font-size: 16px; color: var(--muted); max-width: 640px; margin-top: 14px; }
.intro__lead-p b { color: var(--ink); font-weight: 600; }

.steps {
  list-style: none; padding: 0; margin: 40px 0;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--gold-soft); color: var(--gold-deep);
  font-weight: 700; font-size: 16px; margin-bottom: 14px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14.5px; color: var(--muted); margin: 0; }

.note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--gold-soft); border: 1px solid #ecd98a;
  border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 36px;
  max-width: 680px; font-size: 14.5px; color: #5b4a12;
}
.note svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--gold-deep); }
.note + .note { margin-top: -20px; } /* tighten stacked notes */
.note--soft { background: var(--surface); border-color: var(--line); color: var(--muted); }
.note--soft svg { color: var(--muted); }
.intro__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.intro__resume { font-size: 14px; color: var(--muted); }

/* ============================================================
   Scene view
   ============================================================ */
.scene { padding: 32px 0 120px; }
.scene__head { margin-bottom: 8px; }
.scene__count { font-size: 14px; font-weight: 600; color: var(--gold-deep); letter-spacing: .02em; }
.scene__title { font-size: clamp(22px, 3.4vw, 30px); margin: 6px 0 4px; }
.scene__hint { color: var(--muted); font-size: 15px; max-width: 640px; }

.original {
  margin: 24px 0 36px;
  display: grid; grid-template-columns: 1fr; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
@media (min-width: 720px) { .original { grid-template-columns: minmax(0, 1.4fr) 1fr; align-items: center; } }
.original__img { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.original__img img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: contain; }
.original__meta .tag { margin-bottom: 12px; }
.original__meta h3 { font-size: 18px; margin-bottom: 8px; }
.original__meta p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* tag / badge */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.tag--render { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.tag--people { background: var(--gold-soft); color: var(--gold-deep); border-color: #ecd98a; }
.tag--nopeople { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.tag svg { width: 13px; height: 13px; }

/* ---- variant grid ---- */
.variants {
  display: grid; gap: 22px;
  grid-template-columns: 1fr;
}
/* wide ~2:1 images: 2-up on desktop so each is big enough to judge */
@media (min-width: 760px) { .variants { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card.is-rated { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.card__imgwrap {
  position: relative; background: var(--surface-2);
  cursor: zoom-in; aspect-ratio: 2 / 1; overflow: hidden;
}
.card__imgwrap img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s var(--ease); }
.card__imgwrap:hover img { transform: scale(1.03); }
.card__zoom {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(23,23,23,.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s var(--ease);
}
.card__imgwrap:hover .card__zoom, .card__imgwrap:focus-within .card__zoom { opacity: 1; }
.card__zoom svg { width: 18px; height: 18px; }
.saved svg { width: 14px; height: 14px; }
.card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.card__body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__title { font-size: 15.5px; font-weight: 600; }
.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.bullets li { position: relative; padding-left: 16px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.card__tokens { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.card__tokens svg { width: 14px; height: 14px; color: var(--gold-deep); }
.card__tokens b { color: var(--muted); font-weight: 600; }

.card__rate { margin-top: auto; border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 10px; }
.rate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rate-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

/* ---- stars ---- */
.stars { display: inline-flex; gap: 2px; }
.star {
  width: var(--tap); height: 34px; min-width: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--line-strong);
  transition: color .12s var(--ease), transform .12s var(--ease);
}
.star:hover { transform: scale(1.12); }
.star svg { width: 24px; height: 24px; }
.star.on, .star.hovpre { color: var(--gold); }   /* selected or hover-preview */

/* ---- thumbs ---- */
.thumbs { display: inline-flex; gap: 8px; }
.thumb {
  width: 38px; height: 38px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line-strong); cursor: pointer;
  color: var(--muted); transition: all .15s var(--ease);
}
.thumb svg { width: 18px; height: 18px; }
.thumb:hover { border-color: var(--ink); }
.thumb.on--up { background: #ecfdf5; border-color: var(--up); color: var(--up); }
.thumb.on--down { background: #fef2f2; border-color: var(--down); color: var(--down); }

/* ---- comment ---- */
.comment-toggle {
  align-self: flex-start; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--gold-deep);
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
}
.comment-toggle svg { width: 15px; height: 15px; }
.comment-box { display: none; }
.comment-box.open { display: block; }
textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; resize: vertical; min-height: 64px; background: #fff;
}
textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

/* ============================================================
   Scene nav (sticky bottom)
   ============================================================ */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.navbar__inner { display: flex; align-items: center; gap: 12px; height: 68px; }
.navbar__status { flex: 1; font-size: 13.5px; color: var(--muted); text-align: center; }
.navbar__status b { color: var(--ink); }
@media (max-width: 560px) {
  .navbar__inner { gap: 8px; }
  .navbar__status { display: none; }            /* free up room so both buttons fit */
  .navbar .btn { flex: 1 1 0; padding: 11px 12px; font-size: 14px; }
}

/* ============================================================
   Global questions
   ============================================================ */
.questions { padding: 40px 0 140px; max-width: 760px; }
.questions h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 8px; }
.questions__sub { color: var(--muted); margin-bottom: 36px; }
.field { margin-bottom: 32px; }
.field > label, .field__legend { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.field__help { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.field--fs { border: 0; padding: 0; margin: 0 0 32px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; font-size: 14.5px; color: var(--ink-soft);
  transition: all .15s var(--ease);
}
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ============================================================
   Done / export screen
   ============================================================ */
.done { padding: clamp(48px, 8vw, 90px) 0 120px; max-width: 720px; }
.done__check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
}
.done__check svg { width: 32px; height: 32px; color: var(--gold-deep); }
.done h1 { font-size: clamp(28px, 4.5vw, 40px); margin-bottom: 14px; }
.done p { color: var(--ink-soft); }
.summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px;
  margin: 32px 0; padding: 0; list-style: none;
}
.summary li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.summary .num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.summary .lbl { font-size: 13px; color: var(--muted); }
.send-note {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-top: 16px;
}
.send-note strong { color: var(--ink); }
.send-note code { background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 8px; font-size: 14px; }
.done__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(15,15,15,.92); padding: 24px;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 88vh; width: auto; border-radius: 8px; box-shadow: var(--shadow-lg); }
.lightbox__close {
  position: absolute; top: 18px; right: 18px; width: 46px; height: 46px; border-radius: 10px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox__cap { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; opacity: .85; }

/* loading / error states */
.state { padding: 100px 0; text-align: center; color: var(--muted); }
.spinner {
  width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 18px;
  border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
