/* ==========================================================================
   Fantasia Copy and Print Centre — shared stylesheet
   Palette & rules per research/design-language.md. CMYK registration-dot motif.
   Light default on :root; dark override gated on [data-theme="dark"] on <html>.
   ========================================================================== */

/* ---- Tokens: light (default) ---- */
:root {
  --ground: #F6F7FB;
  --surface: #FFFFFF;
  --ink: #14152B;
  --muted: #4C4F6E;
  --brand: #3D3FB8;
  --brand-text: #34369E;

  --cmyk-c: #17B8D4;
  --cmyk-m: #E0287A;
  --cmyk-y: #F5C518;
  --cmyk-k: #14152B;

  /* Fixed in BOTH themes — text/accents on always-dark surfaces */
  --on-brand: #FFFFFF;
  --accent-on-dark: #7FE6F6;
  --band: #16173A;

  --border: #E2E4F0;
  --shadow: 0 1px 2px rgba(20, 21, 43, .06), 0 8px 24px rgba(20, 21, 43, .06);

  --radius: 14px;
  --maxw: 1120px;
  --gap: clamp(16px, 3vw, 28px);

  --font-head: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
}

/* ---- Tokens: dark override ---- */
[data-theme="dark"] {
  --ground: #0F1020;
  --surface: #2B2D4E;   /* ≥1.35:1 vs #0F1020 ground (≈1.42) */
  --ink: #EEF0FB;
  --muted: #B4B8D8;
  --brand: #3D3FB8;     /* same indigo identity */
  --brand-text: #A9ACFF;

  /* --on-brand, --accent-on-dark intentionally NOT remapped */
  --band: #090A18;

  --border: #3C3F66;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-text); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.section { padding-block: clamp(42px, 7vw, 76px); }
.section-tight { padding-block: clamp(30px, 5vw, 52px); }
.eyebrow {
  font-family: var(--font-head);
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-text); margin: 0 0 .5rem;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 56ch; }
.visually-hidden {
  position: absolute !important; 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(--accent-on-dark); outline-offset: 2px; border-radius: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .72em 1.2em; border-radius: 10px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-primary:hover { background: #3335a4; }
.btn-ghost { background: transparent; color: var(--brand-text); border-color: var(--brand); }
.btn-ghost:hover { background: rgba(61, 63, 184, .08); }
.btn-wide { width: 100%; justify-content: center; }
.btn svg { width: 1.1em; height: 1.1em; flex: 0 0 auto; }

/* Ghost buttons on always-dark surfaces — fixed light tokens in BOTH themes.
   Explicit rules for: header, hero, CTA band, drawer, call bar, footer, page intros. */
.site-header .btn-ghost,
.hero .btn-ghost,
.cta-band .btn-ghost,
.drawer .btn-ghost,
.callbar .btn-ghost,
.site-footer .btn-ghost,
.page-intro .btn-ghost {
  color: var(--on-brand);
  border-color: rgba(255, 255, 255, .55);
  background: transparent;
}
.site-header .btn-ghost:hover,
.hero .btn-ghost:hover,
.cta-band .btn-ghost:hover,
.drawer .btn-ghost:hover,
.callbar .btn-ghost:hover,
.site-footer .btn-ghost:hover,
.page-intro .btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: var(--on-brand); }

/* ---- CMYK registration-dot divider/motif ---- */
.cmyk-dots { display: inline-flex; align-items: center; gap: .55rem; }
.cmyk-dots span { width: 12px; height: 12px; border-radius: 50%; display: block; flex: 0 0 auto; }
.cmyk-dots .c { background: var(--cmyk-c); }
.cmyk-dots .m { background: var(--cmyk-m); }
.cmyk-dots .y { background: var(--cmyk-y); }
.cmyk-dots .k { background: var(--cmyk-k); }
[data-theme="dark"] .cmyk-dots .k { background: #EEF0FB; } /* keep K dot visible on deep ground */

.divider-cmyk { display: flex; align-items: center; justify-content: center; gap: 1rem; padding-block: clamp(20px, 4vw, 36px); }
.divider-cmyk::before, .divider-cmyk::after {
  content: ""; height: 2px; flex: 1 1 auto; max-width: 180px;
  background: linear-gradient(90deg, transparent, var(--border));
}
.divider-cmyk::before { background: linear-gradient(90deg, var(--border), transparent); }

/* ---- [TO CONFIRM] / status chips (readable in both themes) ---- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-head); font-size: .74rem; font-weight: 600; letter-spacing: .04em;
  padding: .3em .7em; border-radius: 999px;
  background: rgba(224, 40, 122, .12); color: var(--brand-text);
  border: 1px solid rgba(224, 40, 122, .4);
  white-space: normal;
}
[data-theme="dark"] .chip { background: rgba(224, 40, 122, .2); color: var(--on-brand); border-color: rgba(224, 40, 122, .55); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cmyk-m); flex: 0 0 auto; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--band); color: var(--on-brand);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header .container { display: flex; align-items: center; gap: 1rem; min-height: 66px; }

/* Wordmark */
.brand { display: inline-flex; align-items: baseline; gap: .55rem; text-decoration: none; color: var(--on-brand); flex: 0 1 auto; min-width: 0; margin-right: auto; }
.brand .wordmark { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.05rem, 2.4vw, 1.4rem); letter-spacing: .02em; white-space: nowrap; }
.brand .sublabel { font-family: var(--font-head); font-weight: 500; font-size: .74rem; color: var(--accent-on-dark); white-space: nowrap; letter-spacing: .02em; }

/* Inline nav only from >=1200px so wordmark never clips */
.main-nav { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.main-nav a:not([class]) { color: var(--on-brand); text-decoration: none; font-family: var(--font-head); font-weight: 500; white-space: nowrap; padding-block: .3rem; border-bottom: 2px solid transparent; }
.main-nav a:not([class]):hover { color: var(--accent-on-dark); }
.main-nav a[aria-current="page"] { color: var(--accent-on-dark); border-bottom-color: var(--accent-on-dark); }

.header-actions { display: none; align-items: center; gap: .6rem; }

/* Theme toggle + burger */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto;
  background: rgba(255, 255, 255, .1); color: var(--on-brand);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .18); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-toggle { display: inline-flex; }

@media (min-width: 1200px) {
  .main-nav { display: block; }
  .header-actions { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* ---- Off-canvas drawer ---- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(9, 10, 24, .55);
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 100; height: 100%;
  width: min(86vw, 340px);
  background: var(--band); color: var(--on-brand);
  transform: translateX(100%); transition: transform .24s ease;
  display: flex; flex-direction: column; padding: 1.1rem; gap: .4rem;
  box-shadow: -10px 0 40px rgba(0, 0, 0, .4);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.drawer-head .wordmark { font-family: var(--font-head); font-weight: 700; }
.drawer nav ul { list-style: none; margin: .4rem 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.drawer nav a:not([class]) { color: var(--on-brand); text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; display: block; padding: .7rem .4rem; border-radius: 8px; }
.drawer nav a:not([class]):hover { background: rgba(255, 255, 255, .08); color: var(--accent-on-dark); }
.drawer nav a[aria-current="page"] { color: var(--accent-on-dark); }
.drawer .drawer-cta { display: flex; flex-direction: column; gap: .55rem; margin-top: auto; }

@media (min-width: 1200px) { .drawer, .drawer-backdrop { display: none; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; background: var(--band); color: var(--on-brand); overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(22, 23, 58, .94) 0%, rgba(22, 23, 58, .86) 46%, rgba(22, 23, 58, .5) 100%);
}
.hero .container { position: relative; z-index: 1; padding-block: clamp(56px, 10vw, 110px); }
.hero-inner { max-width: 640px; }
.hero h1 { color: var(--on-brand); }
.hero .lead { color: rgba(238, 240, 251, .9); }
.hero .eyebrow { color: var(--accent-on-dark); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }

/* ==========================================================================
   Generic grids & cards — every grid: min-width:0 children, 1 col <=480px
   ========================================================================== */
.grid { display: grid; gap: var(--gap); }
.grid > * { min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow);
}
.card h3 { margin: .2rem 0 .4rem; color: var(--ink); }
.card p { color: var(--muted); margin: 0; }

/* Tile row ("What you can get here") */
.tiles { display: flex; flex-wrap: wrap; gap: .7rem; }
.tile {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .55rem 1rem; font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  box-shadow: var(--shadow);
}
.tile .ico { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--brand-text); }
[data-theme="dark"] .tile .ico { color: var(--accent-on-dark); }
.tile .ico svg { width: 20px; height: 20px; }
.tile .confirm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cmyk-m); flex: 0 0 auto; }

.note-confirm { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; color: var(--muted); font-size: .95rem; }

/* Icon wrapper (service cards) — display:flex per guard 6 */
.svc-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 12px;
  background: rgba(61, 63, 184, .1); color: var(--brand-text); margin-bottom: .9rem;
}
[data-theme="dark"] .svc-icon { background: rgba(127, 230, 246, .14); color: var(--accent-on-dark); }
.svc-icon svg { width: 26px; height: 26px; }

.card-tag { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); margin-bottom: .5rem; }
[data-theme="dark"] .card-tag { color: var(--accent-on-dark); }
.card-media { border-radius: 12px; overflow: hidden; margin-bottom: .9rem; aspect-ratio: 4 / 3; border: 1px solid var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   "Find the shop" / dark bands  (guard 10 — must not leak into .card)
   ========================================================================== */
.band-dark { background: var(--band); color: var(--on-brand); }
.band-dark h1, .band-dark h2, .band-dark h3 { color: var(--on-brand); }
.band-dark p { color: rgba(238, 240, 251, .88); }
.band-dark .eyebrow { color: var(--accent-on-dark); }
.band-dark ul:not([class]) { color: rgba(238, 240, 251, .9); }
.band-dark a:not([class]) { color: var(--accent-on-dark); }

.find-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.find-grid > * { min-width: 0; }
@media (max-width: 760px) { .find-grid { grid-template-columns: 1fr; } }

.nap-list { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.nap-list li { display: flex; gap: .7rem; align-items: flex-start; }
.nap-list .ico { width: 26px; height: 26px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: var(--accent-on-dark); }
.nap-list .ico svg { width: 22px; height: 22px; }
.nap-list a { color: var(--on-brand); text-decoration: none; font-weight: 600; }
.nap-list a:hover { color: var(--accent-on-dark); }
.nap-list .sub { color: rgba(238, 240, 251, .72); font-size: .92rem; }

/* Map */
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255, 255, 255, .14); background: #000; aspect-ratio: 4 / 3; }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* [NEEDS CONTENT] placeholder band */
.needs-content {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--muted);
  padding: clamp(28px, 6vw, 56px); text-align: center;
}
.needs-content .tag { font-family: var(--font-head); font-weight: 700; color: var(--brand-text); letter-spacing: .02em; }
[data-theme="dark"] .needs-content .tag { color: var(--accent-on-dark); }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band { background: var(--brand); color: var(--on-brand); }
.cta-band .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.4rem; }
.cta-band h2 { color: var(--on-brand); }
.cta-band p { color: rgba(255, 255, 255, .9); margin: .3rem 0 0; }
.cta-band .btn-primary { background: var(--on-brand); color: var(--brand); border-color: var(--on-brand); }
.cta-band .btn-primary:hover { background: #eef0fb; }
.cta-band .cta-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

/* ==========================================================================
   Page intro band (services/contact)
   ========================================================================== */
.page-intro { background: var(--band); color: var(--on-brand); }
.page-intro .container { padding-block: clamp(42px, 7vw, 72px); }
.page-intro h1 { color: var(--on-brand); max-width: 20ch; }
.page-intro .lead { color: rgba(238, 240, 251, .9); }
.page-intro .eyebrow { color: var(--accent-on-dark); }

/* ==========================================================================
   Enquiry form
   ========================================================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid > * { min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .7em .8em; width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61, 63, 184, .25); }
.form-note { color: var(--muted); font-size: .92rem; margin-top: .4rem; }

/* ==========================================================================
   Sticky mobile call bar
   ========================================================================== */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; gap: .6rem; padding: .6rem; padding-bottom: calc(.6rem + env(safe-area-inset-bottom));
  background: var(--band); border-top: 1px solid rgba(255, 255, 255, .1);
}
.callbar .btn { flex: 1 1 0; justify-content: center; }
.callbar .btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
body { padding-bottom: 76px; } /* room for call bar on mobile */

@media (min-width: 1200px) {
  .callbar { display: none; }
  body { padding-bottom: 0; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--band); color: var(--on-brand); padding-block: clamp(36px, 6vw, 56px); }
.site-footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); }
.site-footer .footer-grid > * { min-width: 0; }
@media (max-width: 760px) { .site-footer .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: var(--on-brand); font-size: 1rem; }
.site-footer p { color: rgba(238, 240, 251, .82); }
.site-footer ul { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.site-footer a:not([class]) { color: var(--on-brand); text-decoration: none; }
.site-footer a:not([class]):hover { color: var(--accent-on-dark); }
.footer-brand .wordmark { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; }
.footer-brand .sublabel { color: var(--accent-on-dark); font-family: var(--font-head); font-size: .8rem; }
.footer-disclaimer { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .86rem; color: rgba(238, 240, 251, .72); }
.footer-disclaimer p { color: rgba(238, 240, 251, .72); }
.footer-bottom { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; justify-content: space-between; font-size: .84rem; color: rgba(238, 240, 251, .6); }

/* Trust / info strip (items must wrap) */
.info-strip { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; }
.info-strip .item { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .95rem; }

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

/* QA fixes: wordmark sub-label hidden on small screens (it spilled past the wordmark at 320-360px);
   chips and ghost buttons on the always-dark band use fixed light colours in both themes. */
@media (max-width: 520px) {
  .brand .sublabel { display: none; }
}
.band-dark .chip {
  background: rgba(255, 255, 255, .12);
  color: var(--on-brand);
  border-color: rgba(255, 255, 255, .4);
}
.band-dark .btn-ghost {
  color: var(--on-brand);
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .08);
}
.band-dark .btn-ghost:hover { background: rgba(255, 255, 255, .18); color: var(--on-brand); }
