/* =========================================================================
   Ncazelo Barbershop — shared stylesheet
   Palette & rules from research/design-language.md
   "Black and yellow, fresh for the occasion."
   ========================================================================= */

/* ---- Tokens: light (default) ---- */
:root {
  --ground: #F3F2EC;
  --surface: #FFFFFF;
  --surface-border: #D8D6CC;
  --ink: #0D0D0D;
  --muted: #4A4A45;
  --brand: #FFD100;          /* CTA fill — always yellow */
  --brand-text: #6F5500;     /* accent text/links/ticks on normal surfaces (light) */
  --accent-dark: #FFD100;    /* accent text on always-dark bands — fixed */
  --sun: #FFD100;            /* highlight fill */
  --ink-fixed: #0D0D0D;      /* dark text on sun/brand — fixed */
  --on-brand: #0D0D0D;       /* text on brand fills — fixed, NOT white */
  --cream: #F5F3EA;          /* text on always-dark bands — fixed */
  --band: #0D0D0D;           /* always-dark header/hero/footer/CTA/planner panel */
  --note-bg: #FFF3BF;        /* chip tint (light) */
  --note-text: #5A4600;      /* chip text on tint, >=4.5:1 */

  --maxw: 1100px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);

  --font-head: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

/* ---- Tokens: dark override ---- */
[data-theme="dark"] {
  --ground: #0E0E0E;
  --surface: #1A1A1A;
  --surface-border: #333331;
  --ink: #F5F3EA;
  --muted: #C9C7BC;
  --brand: #FFD100;
  --brand-text: #FFD100;     /* links/ticks on normal surfaces (dark) */
  --accent-dark: #FFD100;
  --sun: #FFD100;
  --ink-fixed: #0D0D0D;
  --on-brand: #0D0D0D;
  --cream: #F5F3EA;
  --band: #000000;
  --note-bg: #2A2410;
  --note-text: #FFD100;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: normal;
}
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;
  line-height: 1.02;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.2rem, 7vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.section { padding-block: clamp(40px, 7vw, 84px); }
.section--tight { padding-block: clamp(28px, 4vw, 48px); }
.eyebrow {
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .8rem;
  color: var(--brand-text);
  margin: 0 0 .6rem;
}
.muted { color: var(--muted); }
.lede { font-size: 1.12rem; max-width: 62ch; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ---- Hazard-stripe divider ---- */
.hazard {
  height: 14px;
  border: 0;
  margin: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--ink-fixed) 0, var(--ink-fixed) 16px,
    var(--brand) 16px, var(--brand) 32px
  );
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  padding: .85rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .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: #ffdb33; color: var(--on-brand); }
.btn--sun {
  background: var(--sun);
  color: var(--ink-fixed);
  border-color: var(--sun);
}
.btn--sun:hover { background: #ffdb33; color: var(--ink-fixed); }
.btn--ghost {
  background: transparent;
  color: var(--brand-text);
  border-color: currentColor;
}
.btn--ghost:hover { background: rgba(0,0,0,.05); color: var(--brand-text); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* =========================================================================
   Always-dark bands: header, hero, .band, footer, planner panel
   Explicit light-on-dark colours for every text role (bug 1).
   ========================================================================= */
.site-header,
.hero,
.band,
.site-footer,
.plan-panel,
.msg-panel {
  background: var(--band);
  color: var(--cream);
}
.site-header h1, .site-header h2, .site-header h3, .site-header h4,
.hero h1, .hero h2, .hero h3, .hero h4,
.band h1, .band h2, .band h3, .band h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4,
.plan-panel h1, .plan-panel h2, .plan-panel h3, .plan-panel h4,
.msg-panel h1, .msg-panel h2, .msg-panel h3, .msg-panel h4 { color: var(--cream); }

.site-header p, .hero p, .band p, .site-footer p,
.plan-panel p, .msg-panel p,
.site-header li, .hero li, .band li, .site-footer li,
.plan-panel li, .msg-panel li { color: var(--cream); }

/* accent text on dark bands uses fixed --accent-dark, never --brand-text (bug 1) */
.site-header .eyebrow, .hero .eyebrow, .band .eyebrow,
.site-footer .eyebrow, .plan-panel .eyebrow, .msg-panel .eyebrow { color: var(--accent-dark); }

.hero .muted, .band .muted, .site-footer .muted,
.plan-panel .muted, .msg-panel .muted,
.site-header .muted { color: var(--cream); opacity: .82; }

/* generic (non-button) links on dark bands */
.hero a:not(.btn), .band a:not(.btn), .site-footer a:not(.btn),
.plan-panel a:not(.btn), .msg-panel a:not(.btn),
.site-header a:not(.btn) { color: var(--accent-dark); }

/* NAP list on dark bands (bug 1) */
.site-footer dl.nap dt, .band dl.nap dt,
.site-footer dl.nap dd, .band dl.nap dd { color: var(--cream); }
.site-footer dl.nap dt, .band dl.nap dt { color: var(--accent-dark); }

/* img-note / notes / stat text on dark bands */
.hero .img-note, .band .img-note, .site-footer .img-note { color: var(--cream); opacity: .78; }

/* Button-text exceptions inside dark bands so link rules don't bleed (bug 6).
   Includes :hover and both a. and button. ghost variants. */
.hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary,
.site-header a.btn--primary, .plan-panel a.btn--primary, .msg-panel a.btn--primary,
.hero a.btn--primary:hover, .band a.btn--primary:hover, .site-footer a.btn--primary:hover,
.site-header a.btn--primary:hover, .plan-panel a.btn--primary:hover, .msg-panel a.btn--primary:hover {
  color: var(--on-brand);
}
.hero a.btn--sun, .band a.btn--sun, .site-footer a.btn--sun,
.site-header a.btn--sun, .plan-panel a.btn--sun, .msg-panel a.btn--sun,
.hero a.btn--sun:hover, .band a.btn--sun:hover, .site-footer a.btn--sun:hover,
.site-header a.btn--sun:hover, .plan-panel a.btn--sun:hover, .msg-panel a.btn--sun:hover {
  color: var(--ink-fixed);
}

/* Ghost buttons on dark bands: yellow border + text, both a. and button., incl :hover (bug 1, extra note) */
.hero a.btn--ghost, .hero button.btn--ghost,
.band a.btn--ghost, .band button.btn--ghost,
.site-footer a.btn--ghost, .site-footer button.btn--ghost,
.site-header a.btn--ghost, .site-header button.btn--ghost,
.plan-panel a.btn--ghost, .plan-panel button.btn--ghost,
.msg-panel a.btn--ghost, .msg-panel button.btn--ghost {
  color: var(--accent-dark);
  border-color: var(--accent-dark);
  background: transparent;
}
.hero a.btn--ghost:hover, .hero button.btn--ghost:hover,
.band a.btn--ghost:hover, .band button.btn--ghost:hover,
.site-footer a.btn--ghost:hover, .site-footer button.btn--ghost:hover,
.site-header a.btn--ghost:hover, .site-header button.btn--ghost:hover,
.plan-panel a.btn--ghost:hover, .plan-panel button.btn--ghost:hover,
.msg-panel a.btn--ghost:hover, .msg-panel button.btn--ghost:hover {
  color: var(--ink-fixed);
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 3px solid var(--brand); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: .7rem;
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; }
.brand-mark {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--brand);
  color: var(--ink-fixed);
  font-family: var(--font-head);
  font-size: 1.5rem;
  border-radius: 8px;
}
.brand-name {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--cream);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-top: .22rem;
}
.site-nav { margin-left: auto; }
.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  margin: 0; padding: 0;
}
.site-nav a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  padding: .35rem .2rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--accent-dark); }
.site-nav a[aria-current="page"] { color: var(--accent-dark); border-bottom-color: var(--accent-dark); }
.header-actions { display: flex; align-items: center; gap: .5rem; }

/* theme toggle */
.theme-toggle {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: transparent;
  color: var(--cream);
  border: 2px solid var(--accent-dark);
  border-radius: 10px;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--accent-dark); color: var(--ink-fixed); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding-block: clamp(44px, 7vw, 92px);
}
.hero-grid > * { min-width: 0; }
.hero-media { position: relative; }
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 3px solid var(--brand);
}
.img-note {
  font-size: .78rem;
  margin-top: .5rem;
  font-weight: 600;
}

/* =========================================================================
   Cards
   ========================================================================= */
.grid { display: grid; gap: clamp(16px, 3vw, 28px); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid > * { min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);   /* visible border in light (bug 16) */
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.card h3 { margin-bottom: .2rem; }
.card .btn { margin-top: auto; align-self: flex-start; }
.card-media {
  margin: -1.4rem -1.4rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.card-media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }

/* =========================================================================
   Proof strip / stats
   ========================================================================= */
.proof {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem 1rem;
  justify-content: center;
  text-align: center;
}
.proof .stat {
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: var(--accent-dark);
  line-height: 1;
}
.proof .stat-label { font-weight: 700; }

/* =========================================================================
   Note chip (>=4.5:1 — bug 17)
   ========================================================================= */
.chip {
  display: inline-block;
  background: var(--note-bg);
  color: var(--note-text);
  font-weight: 700;
  font-size: .8rem;
  padding: .28rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(111,85,0,.35);
}
[data-theme="dark"] .chip { border-color: rgba(255,209,0,.4); }
.demo-note {
  background: var(--band);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: .9rem;
}
.demo-note strong { color: var(--accent-dark); }

/* =========================================================================
   Find-us / NAP block
   ========================================================================= */
.findus { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; }
.findus > * { min-width: 0; }
dl.nap { margin: 0; display: grid; gap: .8rem; }
dl.nap dt {
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
  color: var(--brand-text);
  margin-bottom: .1rem;
}
dl.nap dd { margin: 0; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { border-top: 3px solid var(--brand); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  padding-block: clamp(36px, 5vw, 56px);
}
.footer-grid > * { min-width: 0; }
.footer-grid h3 { color: var(--accent-dark); font-size: 1.1rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-links a { color: var(--cream); text-decoration: none; }
.footer-links a:hover { color: var(--accent-dark); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14);
  padding-block: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--cream);
}
.footer-bottom .demo-note { background: transparent; padding: 0; }
.footer-bottom .demo-note strong { color: var(--accent-dark); }

/* =========================================================================
   Fresh-for-it planner
   ========================================================================= */
.planner-layout {
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}
.planner-layout > * { min-width: 0; }

.planner-form fieldset {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.3rem;
  margin: 0 0 1.1rem;
  background: var(--surface);
}
.planner-form legend {
  font-family: var(--font-head);
  font-size: 1.15rem;
  text-transform: uppercase;
  padding-inline: .4rem;
  color: var(--ink);
}
.help { font-size: .85rem; color: var(--muted); margin: -.2rem 0 .8rem; }

/* option tiles */
.tiles { display: flex; flex-wrap: wrap; gap: .6rem; }
.tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 2px solid var(--surface-border);
  border-radius: 10px;
  padding: .6rem .85rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--ground);
  color: var(--ink);
}
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile .tick { font-weight: 800; color: var(--brand-text); visibility: hidden; }
/* selected: outline + tick, not colour alone (bug 13) */
.tile:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.tile:has(input:checked) .tick { visibility: visible; }
.tile:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }

.field { margin-top: .4rem; }
.field label { display: block; font-weight: 700; margin-bottom: .3rem; }
.field input[type="date"],
.field textarea {
  width: 100%;
  font: inherit;
  padding: .6rem .7rem;
  border: 2px solid var(--surface-border);
  border-radius: 10px;
  background: var(--ground);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 72px; }
.charcount { font-size: .8rem; color: var(--muted); }
[hidden] { display: none !important; }

/* live plan panel (always dark) */
.plan-panel, .msg-panel {
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  border: 3px solid var(--brand);
}
.msg-panel { margin-top: 1.1rem; }
.plan-panel h2, .msg-panel h2 { font-size: 1.4rem; }
dl.plan { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; }
dl.plan dt { color: var(--accent-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; align-self: center; }
dl.plan dd { margin: 0; color: var(--cream); min-width: 0; overflow-wrap: anywhere; }
.countdown { display: inline-block; background: var(--brand); color: var(--ink-fixed); font-weight: 800; padding: .05rem .5rem; border-radius: 999px; font-size: .85rem; margin-left: .4rem; }
.plan-empty { color: var(--cream); opacity: .85; }
.msg-preview {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,209,0,.35);
  border-radius: 10px;
  padding: .9rem 1rem;
  color: var(--cream);
  white-space: pre-wrap;
  font-size: .98rem;
  margin: .4rem 0 1rem;
}
.copy-status { font-size: .85rem; color: var(--accent-dark); min-height: 1.2em; margin-top: .5rem; font-weight: 700; }

/* =========================================================================
   Gallery
   ========================================================================= */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 3vw, 24px); }
.gallery > * { min-width: 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--surface-border); }
.gallery figcaption { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

/* placeholder block for NEEDS CONTENT */
.placeholder {
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius);
  padding: 1.3rem;
  background: var(--surface);
  color: var(--muted);
}
.placeholder strong { color: var(--ink); }

/* =========================================================================
   Skip link
   ========================================================================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--ink-fixed);
  padding: .6rem 1rem;
  font-weight: 800;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* =========================================================================
   Responsive (bug 3: 320px safe)
   ========================================================================= */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .planner-layout { grid-template-columns: 1fr; }
  .plan-panel, .msg-panel { position: static; }
}
@media (max-width: 760px) {
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { margin-left: 0; order: 3; width: 100%; }   /* nav own row <=700px */
  .site-nav ul { gap: .2rem .7rem; }
}
@media (max-width: 620px) {
  .findus { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }        /* hide header CTA <=480px */
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand-name { font-size: 1.05rem; white-space: normal; }  /* brand name wraps */
  dl.plan { grid-template-columns: 1fr; gap: .15rem .5rem; }
  dl.plan dt { margin-top: .5rem; }
}

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