/* =========================================================================
   Kreamy Kreations — styles.css
   "The patisserie counter": ivory ground, cocoa-plum ink, rose action,
   butter highlight. Gloock headings + Hanken Grotesk body.
   Palette + roles follow research/design-language.md §2.
   Every token below maps to exactly ONE role (see steering: don't give one
   CSS variable two jobs).
   ========================================================================= */

/* ---- Palette tokens (light = default) ---------------------------------- */
:root {
  --ground:       #FBF6F1; /* page background */
  --surface:      #FFFFFF; /* card fill (visible border in light) */
  --ink:          #2B1B22; /* body text */
  --muted:        #5F4A54; /* secondary text */
  --brand:        #A23A5C; /* CTA fill */
  --brand-text:   #A23A5C; /* accent text / ticks / links on NORMAL surfaces */
  --accent-dark:  #F6BCD0; /* accent text on ALWAYS-DARK bands (fixed) */
  --butter:       #F6DE9A; /* highlight fill */
  --ink-fixed:    #2B1B22; /* dark text on butter (fixed, both themes) */
  --on-brand:     #FFFFFF; /* text on brand fills (fixed, both themes) */
  --cream:        #F7EEE8; /* text on always-dark bands (fixed, both themes) */
  --band:         #2B1B22; /* always-dark header/hero/footer/CTA/brief panel */

  --border:       #E6D8DD; /* card/divider border in light */
  --note-bg:      #F6E6EC; /* small "note" chip tint (light) */
  --note-text:    #7A2E47; /* note chip text — ≥4.5:1 on --note-bg (light) */

  --radius:       14px;
  --radius-sm:    9px;
  --maxw:         1120px;
  --gap:          clamp(1rem, 2.5vw, 2rem);

  --font-head: "Gloock", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
}

/* ---- Dark overrides ---------------------------------------------------- */
[data-theme="dark"] {
  --ground:       #1B1016;
  --surface:      #2A1A23; /* ≥1.2:1 vs ground in dark */
  --ink:          #F7EEE8;
  --muted:        #D2BFC8;
  --brand:        #A23A5C; /* identical in dark; white ≥4.5:1 on it */
  --brand-text:   #F2A9C0; /* accent text/links on normal (dark) surfaces */
  /* --accent-dark, --butter, --ink-fixed, --on-brand, --cream, --band
     are FIXED across themes and intentionally not remapped here, except
     --band which goes a touch deeper so bands read as bands in dark. */
  --band:         #0F080C;

  --border:       #43303A;
  --note-bg:      #3A2530;
  --note-text:    #F6BCD0; /* ≥4.5:1 on dark note tint */
}

/* ---- Reset / base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere; /* bug (3): long text never overflows */
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.05rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-text); }
img { max-width: 100%; display: block; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin-bottom: .35rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---- Layout ------------------------------------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
/* bug (4): a .container element must never also carry vertical padding;
   vertical rhythm lives on .section / .band wrappers instead. */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.eyebrow { font-family: var(--font-body); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; color: var(--brand-text); margin: 0 0 .5rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* scallop divider motif */
.scallop { height: 12px; border: 0; background:
  radial-gradient(circle at 10px -4px, transparent 9px, var(--brand) 10px) repeat-x;
  background-size: 20px 12px; opacity: .25; margin: 0; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: .72rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.1; transition: filter .15s, background .15s, color .15s;
}
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { filter: brightness(1.08); color: var(--on-brand); }
.btn--ghost { background: transparent; color: var(--brand-text); border-color: currentColor; }
.btn--ghost:hover { background: rgba(162,58,92,.08); color: var(--brand-text); }
.btn--butter { background: var(--butter); color: var(--ink-fixed); border-color: var(--butter); }
.btn--butter:hover { filter: brightness(1.04); color: var(--ink-fixed); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---- Header (always-dark band) ----------------------------------------- */
.site-header { background: var(--band); color: var(--cream); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; color: var(--cream); min-width: 0; }
.brand .brand-name { font-family: var(--font-head); font-size: 1.4rem; color: var(--cream); overflow-wrap: anywhere; } /* bug (3): wraps */
.brand .brand-tag { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); }
.site-nav ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--cream); text-decoration: none; font-weight: 500; padding: .25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--accent-dark); color: var(--cream); }
.header-tools { display: flex; align-items: center; gap: .6rem; }

/* theme toggle */
.theme-toggle {
  background: transparent; border: 2px solid var(--accent-dark); color: var(--cream);
  width: 42px; height: 42px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.theme-toggle:hover { background: rgba(246,188,208,.14); color: var(--cream); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

/* bug (6): in header band, button text must not be overridden by link rules */
.site-header a.btn--primary { color: var(--on-brand); }
.site-header a.btn--ghost { color: var(--accent-dark); border-color: var(--accent-dark); }
.site-header a.btn--ghost:hover { color: var(--accent-dark); background: rgba(246,188,208,.14); }
.site-header a.btn--butter { color: var(--ink-fixed); }

/* ---- Hero (always-dark band) ------------------------------------------- */
.hero { background: var(--band); color: var(--cream); }
.hero .container { padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero h1 { color: var(--cream); }
.hero p { color: var(--cream); }
.hero .eyebrow { color: var(--accent-dark); } /* bug: accent on dark band = --accent-dark */
.hero .lead { color: var(--cream); opacity: .92; }
.hero .img-note { color: var(--accent-dark); }
.hero a { color: var(--accent-dark); }
.hero a.btn--primary { color: var(--on-brand); }
.hero a.btn--ghost { color: var(--accent-dark); border-color: var(--accent-dark); }
.hero a.btn--ghost:hover { color: var(--accent-dark); background: rgba(246,188,208,.14); }
.hero a.btn--butter { color: var(--ink-fixed); }

/* framed portrait photos: fixed aspect-ratio + object-fit cover */
.frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame--portrait { aspect-ratio: 4 / 5; }
.frame--landscape { aspect-ratio: 4 / 3; }
.frame--square { aspect-ratio: 1 / 1; }
.img-note { font-size: .74rem; color: var(--muted); margin: .5rem 0 0; }

/* ---- Proof strip ------------------------------------------------------- */
.proof { background: var(--surface); border-block: 1px solid var(--border); }
.proof .container { padding-block: 1.1rem; }
.proof-list { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: center; margin: 0; padding: 0; }
.proof-list li { margin: 0; font-weight: 500; color: var(--ink); }
.proof-list strong { font-family: var(--font-head); font-weight: 400; color: var(--brand-text); }
.proof-attr { text-align: center; font-size: .8rem; color: var(--muted); margin: .6rem 0 0; }

/* ---- Cards ------------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border); /* bug (16): light cards rely on visible border */
  border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.card .card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--muted); margin: 0; }

/* note chip — bug (17): ≥4.5:1 text on tint in light */
.note-chip { display: inline-block; background: var(--note-bg); color: var(--note-text); font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; letter-spacing: .02em; }

/* NEEDS CONTENT placeholder block (clearly marked, never fact) */
.needs-content { border: 1px dashed var(--border); background: transparent; border-radius: var(--radius-sm); padding: 1rem 1.1rem; color: var(--muted); font-size: .9rem; }
.needs-content strong { color: var(--brand-text); }

/* ---- Generic always-dark band ------------------------------------------ */
.band { background: var(--band); color: var(--cream); }
.band .container { padding-block: clamp(2.5rem, 6vw, 4rem); }
.band h1, .band h2, .band h3, .band h4 { color: var(--cream); }
.band p, .band li { color: var(--cream); }
.band .lead { color: var(--cream); opacity: .92; }
.band .muted { color: var(--accent-dark); }
.band .eyebrow { color: var(--accent-dark); }
.band a { color: var(--accent-dark); }
.band .img-note { color: var(--accent-dark); }
.band a.btn--primary { color: var(--on-brand); }
.band a.btn--ghost, .band button.btn--ghost { color: var(--accent-dark); border-color: var(--accent-dark); }
.band a.btn--ghost:hover, .band button.btn--ghost:hover { color: var(--accent-dark); background: rgba(246,188,208,.14); }
.band a.btn--butter { color: var(--ink-fixed); }

/* butter band variant — bug (8): ghost buttons inside butter use ink-fixed */
.band--butter { background: var(--butter); color: var(--ink-fixed); }
.band--butter h1, .band--butter h2, .band--butter h3, .band--butter h4,
.band--butter p, .band--butter li, .band--butter .lead { color: var(--ink-fixed); }
.band--butter .eyebrow { color: var(--ink-fixed); }
.band--butter a { color: var(--ink-fixed); }
.band--butter a.btn--primary { color: var(--on-brand); }
.band--butter a.btn--ghost, .band--butter button.btn--ghost { color: var(--ink-fixed); border-color: var(--ink-fixed); }
.band--butter a.btn--ghost:hover, .band--butter button.btn--ghost:hover { color: var(--ink-fixed); background: rgba(43,27,34,.08); }
.band--butter a.btn--butter { color: var(--ink-fixed); }

/* ---- How to order steps ------------------------------------------------ */
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(3, 1fr); }
.steps li { margin: 0; padding: 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.steps li::before { counter-increment: step; content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-family: var(--font-head); margin-bottom: .6rem; }
.steps h3 { margin: 0 0 .3rem; }
.steps p { color: var(--muted); margin: 0; }

/* =========================================================================
   Cake brief — Signature Feature
   ========================================================================= */
.planner-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start; }
.planner-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem 1.3rem; margin: 0 0 1.25rem; min-width: 0; background: var(--surface); }
.planner-form legend { font-family: var(--font-head); font-size: 1.15rem; padding: 0 .4rem; color: var(--ink); }

/* radio/checkbox tile options — bug (13): selection shown by outline+tick, not colour alone */
.options { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt label {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  border: 2px solid var(--border); border-radius: 999px;
  padding: .55rem 1rem; font-weight: 500; background: var(--ground); color: var(--ink);
  min-width: 0;
}
.opt .tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.opt .tick::after { content: "✓"; font-size: .72rem; line-height: 1; opacity: 0; color: var(--brand-text); font-weight: 700; }
.opt input:checked + label { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 700; }
.opt input:checked + label .tick { border-color: var(--brand); }
.opt input:checked + label .tick::after { opacity: 1; }
.opt input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 2px; }

.field { margin-top: .9rem; }
.field label.field-label { display: block; font-weight: 500; margin-bottom: .35rem; }
.field input[type="text"], .field input[type="date"], .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--ground);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .7rem; min-width: 0;
}
.field textarea { resize: vertical; min-height: 4.5rem; }
.field .hint { font-size: .78rem; color: var(--muted); margin: .3rem 0 0; }
[hidden] { display: none !important; } /* bug (14): dependent fields fully hidden */

/* stepper — bug (10): no nested buttons; separate −/+ buttons */
.stepper { display: inline-flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.stepper button { width: 42px; height: 42px; border-radius: 999px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand-text); font-size: 1.3rem; line-height: 1; cursor: pointer; font-weight: 700; }
.stepper button:hover { background: rgba(162,58,92,.08); }
.stepper .stepper-value { font-family: var(--font-head); font-size: 1.25rem; min-width: 7.5rem; text-align: center; color: var(--ink); }

/* Your brief — ALWAYS-DARK panel */
.brief-panel { background: var(--band); color: var(--cream); border-radius: var(--radius); padding: 1.3rem 1.4rem; position: sticky; top: 1rem; }
.brief-panel h2, .brief-panel h3 { color: var(--cream); }
.brief-panel p, .brief-panel li { color: var(--cream); }
.brief-panel .eyebrow { color: var(--accent-dark); }
.brief-panel .muted { color: var(--accent-dark); }
.brief-panel .brief-text { background: rgba(255,255,255,.06); border: 1px solid rgba(246,188,208,.25); border-radius: var(--radius-sm); padding: .9rem 1rem; white-space: pre-wrap; min-height: 5rem; color: var(--cream); }
.brief-panel .brief-text.is-empty { color: var(--accent-dark); font-style: italic; }
.brief-panel a { color: var(--accent-dark); }
.brief-panel a.btn--primary { color: var(--on-brand); }
.brief-panel a.btn--butter, .brief-panel button.btn--butter { color: var(--ink-fixed); }
.brief-panel a.btn--ghost, .brief-panel button.btn--ghost { color: var(--accent-dark); border-color: var(--accent-dark); }
.brief-panel a.btn--ghost:hover, .brief-panel button.btn--ghost:hover { color: var(--accent-dark); background: rgba(246,188,208,.14); }
.brief-actions { display: grid; gap: .6rem; margin-top: 1rem; }
.brief-actions .btn { width: 100%; }
.copy-status { font-size: .82rem; color: var(--accent-dark); min-height: 1.2em; margin: .2rem 0 0; }
.wa-note { font-size: .82rem; color: var(--accent-dark); margin: .6rem 0 0; }

/* =========================================================================
   Contact / find us
   ========================================================================= */
.findus { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.findus > * { min-width: 0; } /* bug (3) */
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; }
dl.nap dt { font-weight: 700; color: var(--ink); min-width: 0; }
dl.nap dd { margin: 0; color: var(--muted); min-width: 0; overflow-wrap: anywhere; } /* bug (3) */
/* NAP inside an always-dark band */
.band dl.nap dt { color: var(--cream); }
.band dl.nap dd { color: var(--cream); }
.band dl.nap dd a { color: var(--accent-dark); }

.contact-actions { display: grid; gap: .7rem; max-width: 22rem; }
.contact-actions .btn { width: 100%; }

/* =========================================================================
   Footer (always-dark band)
   ========================================================================= */
.site-footer { background: var(--band); color: var(--cream); }
.site-footer .container { padding-block: clamp(2rem, 5vw, 3rem); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
.footer-grid > * { min-width: 0; } /* bug (3) */
.site-footer h3, .site-footer h4 { color: var(--cream); }
.site-footer p, .site-footer li { color: var(--cream); }
.site-footer .muted { color: var(--accent-dark); }
.site-footer .eyebrow { color: var(--accent-dark); }
.site-footer a { color: var(--accent-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--accent-dark); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer .brand-name { font-family: var(--font-head); font-size: 1.3rem; color: var(--cream); }
.site-footer dl.nap dt, .site-footer dl.nap dd { color: var(--cream); }
.site-footer dl.nap dd a { color: var(--accent-dark); }
/* bug (6): button text in footer not overridden by link rules */
.site-footer a.btn--primary { color: var(--on-brand); }
.site-footer a.btn--ghost { color: var(--accent-dark); border-color: var(--accent-dark); }
.site-footer a.btn--ghost:hover { color: var(--accent-dark); background: rgba(246,188,208,.14); text-decoration: none; }
.site-footer a.btn--butter { color: var(--ink-fixed); }

.footer-bottom { border-top: 1px solid rgba(246,188,208,.2); margin-top: 1.5rem; padding-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; }
.footer-bottom, .footer-bottom p { color: var(--cream); font-size: .85rem; }
/* demo note — solid dark background, explicit light text incl. its strong */
.demo-note { background: rgba(0,0,0,.35); border: 1px solid rgba(246,188,208,.2); border-radius: var(--radius-sm); padding: .7rem .9rem; color: var(--cream); font-size: .82rem; }
.demo-note strong { color: var(--accent-dark); }

/* =========================================================================
   Responsive — bug (3): 320px safe
   ========================================================================= */
@media (max-width: 860px) {
  .hero-grid, .planner-grid, .findus { grid-template-columns: 1fr; }
  .grid--3, .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .brief-panel { position: static; }
}
@media (max-width: 700px) {
  .site-header .container { flex-direction: column; align-items: stretch; }
  .site-nav { order: 3; width: 100%; } /* nav on its own row ≤700px */
  .site-nav ul { justify-content: flex-start; }
  .header-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
}
@media (max-width: 560px) {
  .grid--3, .grid--2, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .header-cta { display: none; } /* bug (3): hide header CTA ≤480px */
  .proof-list { gap: .5rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
