/* Castillo Media: shared styles. Tokens in DESIGN.md. */
:root {
  --ink: #0f0f0f;
  --ink-2: #1b1b1b;
  --paper: #ffffff;
  --mist: #f2f2f1;
  --line: #dcdcda;
  --line-dark: #2e2e2e;
  --graphite: #555555;
  --fog: #b4b4b4;
  --star: #f5b301;
  --alert: #c62828;          /* the problem, on light (5.6:1 on white) */
  --alert-on-dark: #ff6b5e;  /* the problem, on dark */

  --display: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-weight: 600;
  --display-em-weight: 500;
  --display-track: -.025em;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --radius: 18px;

  --shadow-1: 0 1px 2px rgba(15,15,15,.06), 0 12px 32px -12px rgba(15,15,15,.18);
  --shadow-2: 0 2px 4px rgba(15,15,15,.06), 0 24px 56px -16px rgba(15,15,15,.28);
  --shadow-3: 0 4px 8px rgba(15,15,15,.08), 0 40px 80px -24px rgba(15,15,15,.38);
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Type */
.eyebrow {
  font: 600 .75rem/1.2 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--graphite);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.dark .eyebrow { color: var(--fog); }
.h1 {
  font-family: var(--display); font-optical-sizing: auto; font-weight: var(--display-weight, 500);
  font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.04; letter-spacing: var(--display-track, -.015em);
}
.h2 {
  font-family: var(--display); font-optical-sizing: auto; font-weight: var(--display-weight, 500);
  font-size: clamp(2.05rem, 3.7vw, 3.15rem); line-height: 1.08; letter-spacing: var(--display-track, -.01em);
}
.h1 em, .h2 em { font-style: italic; font-weight: var(--display-em-weight, 400); }
.h3 { font: 600 1.25rem/1.3 var(--body); letter-spacing: -.005em; }
.lede { font-size: clamp(1.0625rem, 1.4vw, 1.2rem); line-height: 1.6; color: var(--graphite); max-width: 36em; }
.dark .lede, .dark .muted { color: var(--fog); }
.muted { color: var(--graphite); }
.small { font-size: .9rem; }

/* Sections */
.section { padding: var(--s8) 0; }
.section-head { display: grid; gap: var(--s3); max-width: 760px; margin-bottom: var(--s6); }
.dark { background: var(--ink); color: #fff; }
.mist { background: var(--mist); }
@media (max-width: 760px) { .section { padding: var(--s7) 0; } .section-head { margin-bottom: var(--s5); } }

/* Buttons */
.btn {
  --bg: var(--ink); --fg: #fff; --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1.5px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 600 1rem/1 var(--body); text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,15,15,.1), 0 8px 20px -10px rgba(15,15,15,.45);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), opacity .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15,15,15,.12), 0 14px 28px -12px rgba(15,15,15,.55); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(15,15,15,.12); }
.btn:focus-visible, .link:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 3px;
}
.dark .btn:focus-visible, .dark a:focus-visible, .dark summary:focus-visible { outline-color: #fff; }
.btn-ghost { --bg: transparent; --fg: var(--ink); box-shadow: none; }
.btn-ghost:hover { box-shadow: 0 8px 20px -14px rgba(15,15,15,.4); }
.dark .btn { --bg: #fff; --fg: var(--ink); --bd: #fff; box-shadow: 0 8px 24px -12px rgba(0,0,0,.6); }
.dark .btn-ghost { --bg: transparent; --fg: #fff; --bd: rgba(255,255,255,.55); }
.btn-arrow::after { content: "→"; transition: transform .18s var(--ease); }
.btn-arrow:hover::after { transform: translateX(3px); }
.link { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.link:hover { text-decoration-thickness: 2.5px; }

/* Stars: the only colour on the site */
.stars { display: inline-flex; gap: 2px; color: var(--star); line-height: 1; }
.stars svg { width: 1em; height: 1em; fill: currentColor; }
.stars .off { color: #d4d4d2; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: var(--s3); }
.logo { display: block; flex: none; }
.logo img { height: 42px; width: auto; }
.nav { display: flex; align-items: center; gap: var(--s4); }
.nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--graphite); transition: color .15s; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav .btn { min-height: 44px; padding: 0 20px; font-size: .95rem; }
@media (max-width: 900px) { .nav a:not(.btn) { display: none; } .site-header .wrap { height: 64px; } .logo img { height: 34px; } }

/* Forms */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field label span { font-weight: 400; color: var(--graphite); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid #c9c9c6; background: #fff; color: var(--ink); font: 400 1rem/1.4 var(--body);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input::placeholder { color: #8a8a8a; }
.field input:hover { border-color: #9a9a97; }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,15,15,.14); }
.field input[aria-invalid="true"] { border-color: #b3261e; }
.field-error { color: #b3261e; font-size: .88rem; font-weight: 500; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Cal.com embed */
.cal-shell {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
  min-height: 560px; overflow: hidden; position: relative;
}
.cal-shell iframe { border-radius: var(--radius); }
.cal-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; gap: var(--s3); text-align: center; padding: var(--s5);
}
.cal-fallback .h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-size: 1.7rem; }
.cal-fallback .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (max-width: 760px) { .cal-shell:has(.cal-fallback) { min-height: 360px; } }

/* Footer */
.site-footer { background: var(--ink); color: #fff; padding: var(--s7) 0 var(--s5); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s5); }
.site-footer img { height: 30px; width: auto; }
.site-footer h4 { margin: 0 0 var(--s2); font: 600 .75rem/1.2 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--fog); }
.site-footer li + li { margin-top: 10px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-base { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line-dark); display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; color: var(--fog); font-size: .9rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: var(--s4); } }

/* Sticky mobile action bar */
.action-bar { display: none; }
@media (max-width: 760px) {
  body.has-bar { padding-bottom: 76px; }
  .action-bar {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -12px 32px -16px rgba(15,15,15,.25);
  }
  .action-bar a {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 999px;
    border: 1.5px solid var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--ink);
    transition: transform .15s var(--ease);
  }
  .action-bar a:active { transform: scale(.97); }
  .action-bar a.primary { background: var(--ink); color: #fff; }
  .action-bar svg { width: 18px; height: 18px; fill: currentColor; }
}

/* Simple pages (thank-you, booked, privacy) */
.page-hero { padding: var(--s7) 0 var(--s6); }
.page-hero .h1 { max-width: 14em; }
.prose { max-width: 720px; }
.prose h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-size: 1.7rem; margin: var(--s5) 0 var(--s2); }
.prose p, .prose li { color: #2a2a2a; }
.prose p + p { margin-top: var(--s2); }
.prose ul { list-style: disc; padding-left: 1.2em; margin-top: var(--s2); }
.prose li + li { margin-top: 6px; }

/* Scroll reveal: only when JS has run, so content never hides without it */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
