/* ============================================================
   Ink Culture — shared styles
   Palette from research/design-language.md §2 ("Salt & tide")
   Obeys the known-bugs list in design-language.md §2.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --ground: #F6F0E4;
  --surface: #FFFFFF;
  --ink: #0F2038;
  --muted: #4F5E73;
  --brand: #1D55A0;         /* CTA fill; white on it ~5.9:1 */
  --brand-text: #1D55A0;    /* small accent text on light */
  --gold: #E3A82B;          /* highlight fill; dark ink text on it, never white */
  --gold-text: #7A5400;     /* gold as small text / icons on light (>=4.5:1) */
  --on-brand: #FFFFFF;      /* text on brand/dark bands — fixed white */
  --sand: #F2EBDD;          /* text on always-dark bands — fixed light */
  --band: #0F2038;          /* always-dark header/hero/footer/CTA/planner panel */

  --border: #E2D8C4;
  --border-dark: rgba(242,235,221,.16);

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

  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --ground: #0B1626;
  --surface: #1D3354;       /* >=1.3:1 vs dark ground (1.43:1) */
  --ink: #F2EBDD;
  --muted: #B3BFD0;
  --brand: #1D55A0;         /* dark-mode fill kept dark enough for white >=4.5:1 */
  --brand-text: #8FBDF5;
  --gold: #E3A82B;
  --gold-text: #E3A82B;     /* gold text ok on dark ground */
  --on-brand: #FFFFFF;
  --sand: #F2EBDD;
  --band: #060E1A;
  --border: #24354D;
  --border-dark: rgba(242,235,221,.16);
}

/* ---------- 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-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  overflow-x: hidden;              /* bug (e): no horizontal overflow */
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); margin: 0 0 .6em; }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin: 0 0 .5em; }
h4 { font-size: 1.05rem; margin: 0 0 .4em; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(2.5rem, 7vw, 5rem); }   /* bug (d): vertical-only, never padding:X 0 on .container */
.muted { color: var(--muted); }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 54ch; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 200;
  background: var(--band); color: var(--sand); padding: .6rem 1rem; border-radius: 8px;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .75rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: transform .08s ease, filter .15s 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 { filter: brightness(1.08); color: var(--on-brand); }
.btn--ghost { background: transparent; color: var(--brand-text); border-color: var(--brand); }
.btn--ghost:hover { background: var(--brand); color: var(--on-brand); }
.btn--gold { background: var(--gold); color: #0F2038; border-color: var(--gold); }  /* bug (8): dark ink on gold */
.btn--gold:hover { filter: brightness(1.05); color: #0F2038; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem);
}
.grid { display: grid; gap: var(--gap); }
.grid > * { min-width: 0; }                 /* bug (e): min-width:0 on grid children */
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 600; line-height: 1.3;
  padding: .3rem .7rem; border-radius: 999px;
  background: rgba(29,85,160,.1); color: var(--brand-text);
  border: 1px solid rgba(29,85,160,.25);
}
.chip--gold { background: rgba(227,168,43,.16); color: var(--gold-text); border-color: rgba(227,168,43,.4); }

/* ---------- Image notes / demo note ---------- */
.img-note { font-size: .78rem; color: var(--muted); margin-top: .4rem; }
.demo-note {
  background: var(--band); color: var(--sand);        /* bug (a): solid dark bg + light text */
  border-radius: 10px; padding: .85rem 1.1rem; font-size: .85rem;
}
.demo-note a { color: var(--sand); text-decoration: underline; }

/* ---------- Rating stars (light bg) ---------- */
.stars { color: var(--gold-text); letter-spacing: 2px; }   /* bug (g): >=4.5:1 on light */

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--band); color: var(--sand);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border-dark);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
  padding-block: .8rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; flex-direction: column; text-decoration: none;
  color: var(--sand); line-height: 1.05; margin-right: auto;
}
.brand__name {
  font-family: var(--font-head); font-weight: 700; font-size: 1.35rem;
  letter-spacing: .5px; white-space: normal;        /* bug (e): brand name wraps */
}
.brand__tag { font-size: .72rem; color: var(--sand); opacity: .85; letter-spacing: 1px; text-transform: uppercase; }
.main-nav ul { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
  display: inline-block; padding: .5rem .7rem; border-radius: 8px;
  color: var(--sand); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.main-nav a:hover { background: rgba(242,235,221,.12); color: var(--sand); }
.main-nav a[aria-current="page"] { color: var(--gold); font-weight: 700; }
.header-cta { display: inline-flex; }
.theme-toggle {
  background: transparent; border: 1px solid var(--border-dark);
  color: var(--sand); width: 42px; height: 42px; border-radius: 10px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1; flex: none;
}
.theme-toggle:hover { background: rgba(242,235,221,.12); }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: inline; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ============================================================
   HERO & always-dark BANDS
   ============================================================ */
.hero, .band {
  background: var(--band); color: var(--sand);
  position: relative; isolation: isolate;
}
.hero { overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
  opacity: .32;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(15,32,56,.55), rgba(15,32,56,.9));
}
.hero .container { padding-block: clamp(3rem, 10vw, 6rem); position: relative; }

/* --- bug (a): explicit light-on-dark for EVERYTHING inside dark sections --- */
.hero, .hero h1, .hero h2, .hero h3, .hero h4, .hero p, .hero li, .hero .muted,
.band, .band h1, .band h2, .band h3, .band h4, .band p, .band li, .band .muted,
.site-header, .site-footer, .site-footer h1, .site-footer h2, .site-footer h3,
.site-footer h4, .site-footer p, .site-footer li, .site-footer .muted {
  color: var(--sand);
}
.hero .lead, .band .lead, .site-footer .lead { color: var(--sand); opacity: .9; }

/* links inside dark sections */
.hero a, .band a, .site-header a, .site-footer a { color: var(--gold); }
.hero a:hover, .band a:hover, .site-footer a:hover { color: var(--gold); }

/* bug (b)/(6): button exceptions must NOT be overridden by dark-section link colour, incl :hover */
.hero a.btn--primary, .band a.btn--primary, .site-footer a.btn--primary,
.hero a.btn--primary:hover, .band a.btn--primary:hover, .site-footer a.btn--primary:hover {
  color: var(--on-brand);
}
.hero a.btn--ghost, .band a.btn--ghost, .site-footer a.btn--ghost {
  color: var(--sand); border-color: var(--sand);
}
.hero a.btn--ghost:hover, .band a.btn--ghost:hover, .site-footer a.btn--ghost:hover {
  color: #0F2038; background: var(--sand);
}
.hero a.btn--gold, .band a.btn--gold, .site-footer a.btn--gold, .site-header a.btn--gold,
.hero a.btn--gold:hover, .band a.btn--gold:hover, .site-footer a.btn--gold:hover, .site-header a.btn--gold:hover {
  color: #0F2038;
}
.site-header a.btn--primary, .site-header a.btn--primary:hover { color: var(--on-brand); }
.site-header a.btn--ghost { color: var(--sand); border-color: var(--sand); }

/* proof strip inside dark bands */
.hero .proof__big, .band .proof__big, .site-footer .proof__big { color: var(--sand); }
.hero .proof__label, .band .proof__label, .site-footer .proof__label { color: var(--sand); opacity: .85; }

/* chips inside dark sections */
.hero .chip, .band .chip, .site-footer .chip {
  background: rgba(242,235,221,.12); color: var(--sand); border-color: rgba(242,235,221,.3);
}
.hero .chip--gold, .band .chip--gold, .site-footer .chip--gold {
  background: rgba(227,168,43,.2); color: var(--gold); border-color: rgba(227,168,43,.5);
}

/* ghost buttons already covered; notes inside dark sections */
.hero .img-note, .band .img-note, .site-footer .img-note { color: rgba(242,235,221,.8); }

/* dl.nap (NAP list) inside dark sections — bug (a) dt AND dd */
.band dl.nap dt, .band dl.nap dd,
.hero dl.nap dt, .hero dl.nap dd,
.site-footer dl.nap dt, .site-footer dl.nap dd { color: var(--sand); }

/* stars on dark bands may use bright gold (contrast fine on dark) */
.hero .stars, .band .stars, .site-footer .stars { color: var(--gold); }

/* ---------- NAP definition list ---------- */
dl.nap { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; }
dl.nap dt { font-weight: 700; color: var(--ink); }
dl.nap dd { margin: 0; color: var(--muted); }

/* ============================================================
   PROOF STRIP
   ============================================================ */
.proof {
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: center;
  align-items: center; text-align: center;
}
.proof__item { display: flex; flex-direction: column; gap: .15rem; }
.proof__big { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.proof__label { font-size: .85rem; color: var(--muted); }

/* ============================================================
   SERVICE PATHS
   ============================================================ */
.path-card { display: flex; flex-direction: column; gap: .5rem; height: 100%; }
.path-card h3 { margin-bottom: .2rem; }
.path-card .btn { margin-top: auto; align-self: flex-start; }
.media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--band); color: var(--sand); margin-top: auto; }
.site-footer .container { padding-block: clamp(2.5rem, 6vw, 4rem); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid > * { min-width: 0; }
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--gold); }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border-dark);
  font-size: .85rem; color: rgba(242,235,221,.8);
}
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }

/* ============================================================
   SESSION PLANNER
   ============================================================ */
.planner { display: grid; gap: 2rem; grid-template-columns: 1.3fr 1fr; align-items: start; }
.planner__form { display: grid; gap: 1.75rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 0; padding: 1.1rem 1.25rem 1.3rem; }
legend { font-family: var(--font-head); font-weight: 700; padding-inline: .4rem; font-size: 1.05rem; }
.hint { font-size: .85rem; color: var(--muted); margin: .2rem 0 .9rem; }

/* radio tiles / chip toggles — label-based, NO nested buttons (bug h/10) */
.tiles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tiles > * { min-width: 0; }
.tile {
  position: relative; display: flex; align-items: center; gap: .6rem;
  border: 2px solid var(--border); border-radius: 12px; padding: .75rem .9rem;
  cursor: pointer; background: var(--surface); font-weight: 500;
}
.tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.tile:hover { border-color: var(--brand); }
.tile:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.tile:has(input:checked) { border-color: var(--brand); background: rgba(29,85,160,.08); }
.tile__mark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.tile:has(input:checked) .tile__mark { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.tile:has(input[type="checkbox"]) .tile__mark { border-radius: 5px; }

.chips-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-toggle { position: relative; cursor: pointer; }
.chip-toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip-toggle span {
  display: inline-flex; align-items: center; padding: .45rem .85rem; border-radius: 999px;
  border: 2px solid var(--border); font-weight: 600; font-size: .9rem; background: var(--surface);
}
.chip-toggle:hover span { border-color: var(--brand); }
.chip-toggle:has(input:focus-visible) span { outline: 3px solid var(--gold); outline-offset: 2px; }
.chip-toggle:has(input:checked) span { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }

.field { display: grid; gap: .35rem; margin-top: .9rem; }
.field label { font-weight: 600; font-size: .92rem; }
input[type="text"], input[type="date"], textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--border); border-radius: 10px; padding: .6rem .7rem; width: 100%;
}
textarea { resize: vertical; min-height: 72px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; margin-top: .9rem; }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.flex-date { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }

/* session card — always-dark panel (bug a) */
.session-card {
  background: var(--band); color: var(--sand);
  border-radius: var(--radius); padding: 1.4rem; position: sticky; top: 90px;
}
.session-card, .session-card h2, .session-card h3, .session-card h4,
.session-card p, .session-card li, .session-card .muted, .session-card dt, .session-card dd {
  color: var(--sand);
}
.session-card a { color: var(--gold); }
.session-card a.btn--primary, .session-card a.btn--primary:hover { color: var(--on-brand); }
.session-card a.btn--ghost { color: var(--sand); border-color: var(--sand); }
.session-card a.btn--ghost:hover { color: #0F2038; background: var(--sand); }
.session-card .summary {
  font-size: 1.05rem; font-weight: 500; line-height: 1.5;
  background: rgba(242,235,221,.08); border: 1px solid var(--border-dark);
  border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1rem;
}
.session-card ul.ready { margin: .3rem 0 1.2rem; padding-left: 1.1rem; }
.session-card ul.ready li { margin-bottom: .3rem; }
.session-card .btn-row { margin-top: .4rem; }
.session-card .demo-note {
  background: rgba(242,235,221,.08); border: 1px solid var(--border-dark);
  color: var(--sand); margin-top: 1.1rem;
}
.copied-note { font-size: .82rem; color: var(--gold); margin-top: .5rem; min-height: 1.1em; }

/* gallery placeholder */
.placeholder {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); background: transparent;
}
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.gallery-grid > * { min-width: 0; }

/* what-to-send list */
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tips li { display: flex; gap: .6rem; align-items: flex-start; }
.tips li::before { content: "•"; color: var(--brand-text); font-weight: 700; flex: none; }

/* contact methods */
.contact-methods { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.contact-methods > * { min-width: 0; }

/* wave divider */
.wave-rule { height: 2px; background: linear-gradient(90deg, transparent, var(--brand-text), transparent); opacity: .4; border: 0; margin: 0; }

/* ============================================================
   RESPONSIVE — bug (e) / (3)
   ============================================================ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .planner { grid-template-columns: 1fr; }
  .session-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  /* nav on its own row below the brand/toggle */
  .site-header .container { flex-wrap: wrap; }
  .main-nav { order: 3; flex-basis: 100%; }
  .main-nav ul { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }   /* bug (e): hide header CTA <=480px */
}
@media (max-width: 360px) {
  .btn { padding: .7rem 1rem; font-size: .95rem; }
  .brand__name { font-size: 1.15rem; }
}
