/* =========================================================================
   033 Barbers — shared stylesheet
   Palette & rules from research/design-language.md.
   Separate tokens for text-on-dark-band vs card surface (see bug list).
   ========================================================================= */

:root {
  /* Page / surfaces */
  --ground: #F5F1E8;
  --surface: #FFFFFF;
  --surface-border: #E4DDCD;

  /* Text */
  --ink: #15171A;
  --muted: #4B5058;

  /* Brand / action */
  --brand: #B45309;           /* CTA fill — white text ok */
  --brand-text: #9A4507;      /* accent text / ticks / links on normal surfaces */
  --sun: #F2A516;             /* highlight fill — dark text only */

  /* Fixed roles (never remapped between themes) */
  --accent-dark: #F2A516;     /* accent text on always-dark bands */
  --ink-fixed: #15171A;       /* dark text on sun */
  --on-brand: #FFFFFF;        /* text on brand fills */
  --cream: #F3EDE0;           /* text on always-dark bands */
  --band: #15171A;            /* always-dark header/hero/footer/CTA/panel */
  --band-muted: #C6C1B6;      /* muted text on dark bands */
  --band-border: #30343A;     /* borders inside dark bands */

  --maxw: 1080px;
  --radius: 10px;
  --gap: clamp(1rem, 3vw, 2rem);

  --font-head: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --ground: #121416;
  --surface: #1C1F23;
  --surface-border: #2C3137;
  --ink: #F3EDE0;
  --muted: #C6C1B6;
  --brand: #B45309;
  --brand-text: #FFB45C;
  --sun: #F2A516;
  --band: #0B0C0E;
  --band-border: #2A2E34;
}

/* ---------- Reset ---------- */
*, *::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);
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-text); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.02;
  margin: 0 0 0.4em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 8vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h3 { font-size: clamp(1.4rem, 3.5vw, 1.8rem); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
/* never `padding: X 0` on a .container element — use a wrapper */
.section { padding-block: clamp(2.5rem, 7vw, 4.5rem); }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--brand-text);
  margin: 0 0 0.6rem;
}

/* ---------- Barber-pole diagonal divider ---------- */
.pole-divider {
  height: 10px;
  border: 0;
  margin: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--brand) 0, var(--brand) 12px,
    var(--sun) 12px, var(--sun) 24px,
    var(--band) 24px, var(--band) 36px
  );
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s ease, background-color .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: #9a4607; border-color: #9a4607; color: var(--on-brand); }

.btn--sun { background: var(--sun); color: var(--ink-fixed); border-color: var(--sun); }
.btn--sun:hover { background: #d8920b; border-color: #d8920b; color: var(--ink-fixed); }

.btn--ghost { background: transparent; color: var(--brand-text); border-color: currentColor; }
.btn--ghost:hover { background: rgba(180,83,9,0.08); color: var(--brand-text); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--band);
  color: var(--cream);
  border-bottom: 1px solid var(--band-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.75rem;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
  min-width: 0;
}
.brand__name {
  font-family: var(--font-head);
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  color: var(--cream);
  overflow-wrap: anywhere;
}
.brand__sub {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.62rem;
  color: var(--accent-dark);
}
.site-nav {
  display: flex;
  gap: 0.25rem 1.1rem;
  flex-wrap: wrap;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-dark); }
.site-nav a[aria-current="page"] { color: var(--accent-dark); border-bottom-color: var(--accent-dark); }

/* theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--band-border);
  color: var(--cream);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.theme-toggle:hover { border-color: var(--accent-dark); color: var(--accent-dark); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.header-cta { flex: none; }

/* Header is an always-dark band — protect button text colours (bug 6) */
.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(242,165,22,0.12); }

/* ---------- Hero (always-dark band) ---------- */
.hero {
  position: relative;
  background: var(--band);
  color: var(--cream);
}
.hero__media { position: relative; }
.hero__media img { width: 100%; height: clamp(220px, 40vw, 420px); object-fit: cover; opacity: 0.55; }
.hero__inner {
  display: grid;
  gap: 1.2rem;
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
}
.hero h1 { color: var(--cream); }
.hero p { color: var(--cream); }
.hero .eyebrow { color: var(--accent-dark); }
.hero .img-note { color: var(--band-muted); }

/* ---------- Generic always-dark band ---------- */
.band { background: var(--band); color: var(--cream); }
.band h1, .band h2, .band h3, .band h4 { color: var(--cream); }
.band p, .band li { color: var(--cream); }
.band .muted { color: var(--band-muted); }
.band .eyebrow { color: var(--accent-dark); }
.band a:not(.btn) { color: var(--accent-dark); }

/* button text inside dark bands (bug 6) */
.hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary { color: var(--on-brand); }
.hero a.btn--sun, .band a.btn--sun, .site-footer a.btn--sun { color: var(--ink-fixed); }
.hero a.btn--ghost, .band a.btn--ghost, .site-footer a.btn--ghost,
.hero button.btn--ghost, .band button.btn--ghost, .site-footer button.btn--ghost {
  color: var(--accent-dark); border-color: var(--accent-dark);
}
.hero a.btn--ghost:hover, .band a.btn--ghost:hover, .site-footer a.btn--ghost:hover,
.hero button.btn--ghost:hover, .band button.btn--ghost:hover, .site-footer button.btn--ghost:hover {
  color: var(--accent-dark); background: rgba(242,165,22,0.12);
}

/* ---------- Proof strip ---------- */
.proof {
  background: var(--band);
  color: var(--cream);
  border-top: 1px solid var(--band-border);
}
.proof .container { padding-block: 1.4rem; }
.proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  align-items: baseline;
}
.proof-stat { display: flex; flex-direction: column; }
.proof-stat b {
  font-family: var(--font-head);
  font-size: 1.9rem;
  color: var(--accent-dark);
  line-height: 1;
}
.proof-stat span { color: var(--band-muted); font-size: 0.85rem; }
.proof-attrib { color: var(--band-muted); font-size: 0.8rem; margin-left: auto; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card-grid > * { min-width: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border); /* visible border in light (bug 16) */
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card__media img { width: 100%; height: 190px; object-fit: cover; }
.card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card__body h3 { margin-bottom: 0.2rem; }

/* ---------- Image note chip ---------- */
.img-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
}
.note-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(242,165,22,0.18);
  color: #7a4e05;              /* ≥4.5:1 on the tint in light (bug 17) */
  border: 1px solid rgba(242,165,22,0.4);
}
html[data-theme="dark"] .note-chip { color: var(--accent-dark); background: rgba(242,165,22,0.12); }
/* On dark bands the chip stays readable */
.band .note-chip, .hero .note-chip { color: var(--accent-dark); background: rgba(242,165,22,0.14); }

/* ---------- Find-us / NAP ---------- */
.findus { display: grid; gap: var(--gap); grid-template-columns: 1.2fr 1fr; align-items: start; }
.findus > * { min-width: 0; }
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
dl.nap dt { font-weight: 700; color: var(--muted); min-width: 0; }
dl.nap dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.band dl.nap dt { color: var(--band-muted); }
.band dl.nap dd { color: var(--cream); }

.chip {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(180,83,9,0.12);
  color: var(--brand-text);
  border: 1px solid rgba(180,83,9,0.3);
  margin-top: 0.3rem;
}
.band .chip { color: var(--accent-dark); border-color: rgba(242,165,22,0.4); background: rgba(242,165,22,0.12); }

/* ---------- Teaser CTA band ---------- */
.teaser { display: grid; gap: 1rem; }
.teaser .btn-row { margin-top: 0.5rem; }

/* ---------- Footer (always-dark) ---------- */
.site-footer {
  background: var(--band);
  color: var(--cream);
  border-top: 1px solid var(--band-border);
}
.site-footer .container { padding-block: 2.5rem; }
.footer-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer-grid > * { min-width: 0; }
.site-footer h4 { color: var(--cream); }
.site-footer p, .site-footer li, .site-footer a:not(.btn) { color: var(--cream); }
.site-footer a:not(.btn) { color: var(--accent-dark); text-decoration: none; }
.site-footer a:not(.btn):hover { text-decoration: underline; }
.site-footer .muted { color: var(--band-muted); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }

.footer-bottom {
  background: var(--band);
  color: var(--band-muted);
  border-top: 1px solid var(--band-border);
}
.footer-bottom .container { padding-block: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
.footer-bottom p { margin: 0; color: var(--band-muted); font-size: 0.82rem; }
.demo-note {
  background: #1f2228;
  color: var(--band-muted);
  border: 1px solid var(--band-border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-size: 0.82rem;
}
.demo-note strong { color: var(--accent-dark); }

/* ---------- NEEDS CONTENT placeholder ---------- */
.needs-content {
  border: 2px dashed var(--brand-text);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: rgba(180,83,9,0.06);
  color: var(--muted);
  font-size: 0.92rem;
}
.needs-content b { color: var(--brand-text); font-weight: 700; }
.band .needs-content { border-color: var(--accent-dark); background: rgba(242,165,22,0.08); color: var(--band-muted); }
.band .needs-content b { color: var(--accent-dark); }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gallery > * { min-width: 0; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: 220px; object-fit: cover; }
.gallery figcaption { padding: 0.7rem 0.9rem; font-size: 0.8rem; color: var(--muted); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--sun); color: var(--ink-fixed);
  padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ==================== Cut-brief planner ==================== */
.planner-grid { display: grid; gap: var(--gap); grid-template-columns: 1.3fr 1fr; align-items: start; }
.planner-grid > * { min-width: 0; }

.q { border: 1px solid var(--surface-border); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0 0 1.1rem; background: var(--surface); }
.q legend { font-family: var(--font-head); font-size: 1.3rem; letter-spacing: 0.03em; padding: 0 0.3rem; color: var(--ink); }
.q .hint { font-size: 0.85rem; color: var(--muted); margin: 0.2rem 0 0.9rem; }

.opt-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* option tile */
.opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  user-select: none;
  background: var(--ground);
  font-weight: 500;
}
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .tick { width: 1.1em; display: inline-block; color: transparent; font-weight: 700; }
.opt:hover { border-color: var(--brand-text); }
/* selected state — outline + tick, not colour alone (bug 13) */
.opt:has(input:checked) { border-color: var(--brand-text); background: rgba(180,83,9,0.08); }
.opt:has(input:checked) .tick { color: var(--brand-text); }
.opt:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 2px; }

.q input[type="date"], .q textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink);
}
.q textarea { resize: vertical; min-height: 70px; }
.char-count { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.dependent[hidden] { display: none; }

/* The live cut card + message panel are ALWAYS-DARK panels */
.cut-panel {
  position: sticky;
  top: 1rem;
  background: var(--band);
  color: var(--cream);
  border: 1px solid var(--band-border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
}
.cut-panel h2, .cut-panel h3 { color: var(--cream); }
.cut-panel .eyebrow { color: var(--accent-dark); }
.cut-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; margin: 0.6rem 0 0; }
.cut-card dt { color: var(--accent-dark); font-weight: 700; font-size: 0.9rem; }
.cut-card dd { margin: 0; color: var(--cream); min-width: 0; overflow-wrap: anywhere; }
.cut-empty { color: var(--band-muted); font-style: italic; }
.msg-preview {
  background: #0b0c0e;
  border: 1px solid var(--band-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--cream);
  font-size: 0.95rem;
  margin: 1rem 0;
  white-space: pre-wrap;
}
.cut-panel a.btn--ghost, .cut-panel button.btn--ghost {
  color: var(--accent-dark); border-color: var(--accent-dark);
}
.cut-panel a.btn--ghost:hover, .cut-panel button.btn--ghost:hover {
  color: var(--accent-dark); background: rgba(242,165,22,0.12);
}
.cut-panel a.btn--primary { color: var(--on-brand); }
.copy-status { font-size: 0.82rem; color: var(--accent-dark); margin-top: 0.4rem; min-height: 1.1em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .findus, .planner-grid { grid-template-columns: 1fr; }
  .cut-panel { position: static; }
}
@media (max-width: 700px) {
  .site-header .container { flex-wrap: wrap; }
  .site-nav { margin-left: 0; order: 3; width: 100%; flex-basis: 100%; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }   /* hide header CTA on narrow screens (bug 3) */
  h1 { font-size: clamp(2rem, 11vw, 2.6rem); }
  .proof-attrib { margin-left: 0; width: 100%; }
}

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