/* Premium finish: one shared layer linked last on every page.
   Uses class names the pages already have. Nothing here touches the homepage hero (#hero), painter or billboard.
   Motion only runs when site-finish.js has added .js-finish to <html> and the visitor allows motion. */

@view-transition { navigation: auto; }

:root {
  --fx-cobalt: #0d47c9;
  --fx-ink: #0a1838;
  --fx-line: #dbe4f2;
  --fx-ease: cubic-bezier(.22, 1, .36, 1);
  --fx-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(10,24,56,.05), 0 8px 24px -12px rgba(10,24,56,.18);
  --fx-shadow-up: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 4px rgba(10,24,56,.06), 0 22px 44px -20px rgba(13,71,201,.32);
  --fx-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.04 0 0 0 0 0.09 0 0 0 0 0.22 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html { scroll-behavior: smooth; }
::selection { background: var(--fx-cobalt); color: #fff; }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--fx-cobalt);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Faint printed grain over the whole ground, under everything else */
body { position: relative; }
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--fx-grain);
  opacity: .035;
}

/* 1. One ground: service heroes drop the beige and share the homepage's blue-white light */
.hero.audit-hero {
  background:
    radial-gradient(50% 70% at 0% 0%, rgba(13,71,201,.16), transparent 62%),
    radial-gradient(40% 60% at 100% 10%, rgba(56,208,255,.16), transparent 60%),
    transparent;
  border-bottom: 1px solid var(--fx-line);
  color: var(--fx-ink);
}
section.booking-section, section.related-services {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(238,243,251,.2));
  border-top: 1px solid var(--fx-line);
}
.hero.audit-hero .audit-kicker, .hero.audit-hero .audit-byline { color: rgba(10,24,56,.66); }

/* Section rhythm: sections sit flat on the cream page (no tinted bands, no divider lines) */
main > section.section:nth-of-type(even):not(#hero):not(.audit-next):not(.closing) {
  background: transparent;
  border-block: 0;
}

/* 3. Signature: the evidence stamp */
.evidence-tag, .checkpoint-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.2;
  transform: rotate(-2deg);
  box-shadow: 0 0 0 3px rgba(255,255,255,.7), inset 0 0 0 1px rgba(255,255,255,.4);
}
.evidence-tag::before, .checkpoint-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* 4. Surfaces that respond */
:where(.info-card, .price-card, .timeline-item, .booking-card, .svh-card, .cr-item, .faq-item,
       .related-guides, .author-box, .workbook-card, .specialist-card, .workflow-step, .callout) {
  box-shadow: var(--fx-shadow);
}
.audit-demo { box-shadow: var(--fx-shadow-up) !important; border-radius: 20px; }
.audit-related .info-card, .svh-card, .audit-answer {
  border: 1px solid var(--fx-line) !important;
  border-radius: 16px !important;
}
.audit-answer { box-shadow: var(--fx-shadow); }

:where(.info-card, .price-card, .svh-card, .cr-item, .specialist-card, .workbook-card, .related-guides li a, a.card) {
  position: relative;
  isolation: isolate;
  transition: transform .45s var(--fx-ease), box-shadow .45s var(--fx-ease), border-color .3s;
}
:where(.info-card, .price-card, .svh-card, .cr-item, .specialist-card, .workbook-card):hover {
  transform: translateY(-4px);
  box-shadow: var(--fx-shadow-up);
  border-color: rgba(13,71,201,.28);
}
/* Cursor-following light (position set by site-finish.js) */
:where(.info-card, .price-card, .svh-card, .cr-item, .specialist-card, .workbook-card)::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(56,208,255,.16), transparent 65%);
}
:where(.info-card, .price-card, .svh-card, .cr-item, .specialist-card, .workbook-card):hover::after { opacity: 1; }
.price-card.featured { box-shadow: var(--fx-shadow-up); }

/* Guide cards: image zoom on hover */
a.card .card-media img { transition: transform .8s var(--fx-ease); }
a.card:hover .card-media img { transform: scale(1.04); }

/* Buttons: tactile press and a sliding arrow */
.button, .button-dark, .button-ghost {
  transition: transform .2s var(--fx-ease), background-color .2s, box-shadow .3s, color .2s;
}
.button:hover, .button-dark:hover { transform: translateY(-1px); }
.button:active, .button-dark:active, .button-ghost:active { transform: translateY(1px) scale(.98); }
.button .arrow, .button-dark .arrow, .text-link .arrow { display: inline-block; transition: transform .3s var(--fx-ease); }
.button:hover .arrow, .button-dark:hover .arrow, .text-link:hover .arrow { transform: translateX(4px); }

/* FAQ: smooth open where supported */
.faq-item summary, details summary { cursor: pointer; }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  details::details-content {
    height: 0; overflow: clip;
    transition: height .4s var(--fx-ease), content-visibility .4s allow-discrete;
  }
  details[open]::details-content { height: auto; }
}

/* 5. Guides: reading progress bar and current contents link */
.fx-progress {
  position: fixed; left: 0; top: 0; z-index: 1000;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, #0d47c9, #38d0ff);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  pointer-events: none;
}
.toc a.is-current { color: var(--fx-cobalt); border-left-color: var(--fx-cobalt); font-weight: 600; }
.prose table { border-radius: 14px; overflow: hidden; box-shadow: var(--fx-shadow); }
.prose blockquote {
  margin: 1.6em 0; padding: 0;
  font-size: 1.2em; line-height: 1.45; color: var(--fx-ink);
}

/* Images fade in once loaded (class added by site-finish.js) */
.js-finish img.fx-img { opacity: 0; transition: opacity .6s ease; }
.js-finish img.fx-img.is-loaded { opacity: 1; }

/* 7. Footer: the oversized wordmark people remember */
.site-footer {
  position: relative;
  overflow: hidden;
  background: radial-gradient(60% 80% at 15% 0%, rgba(30,107,255,.28), transparent 60%), linear-gradient(180deg, #061a4d, #061331 70%);
}
.site-footer::after {
  content: "ClaroSi" / "";
  display: block;
  font-family: "Anton", "Impact", sans-serif;
  font-size: clamp(88px, 21vw, 320px);
  line-height: .8;
  letter-spacing: -.01em;
  text-align: center;
  margin: 40px 0 -.12em;
  color: rgba(203,215,238,.09);
  pointer-events: none;
  user-select: none;
}
.sf-inner { position: relative; z-index: 1; }

/* 8. Process diagram: real text, readable on phones and by search and AI tools.
   Markup: <figure class="fx-flow"><ol class="fx-flow-steps"><li class="fx-flow-step">
   <span class="fx-flow-num">01</span><strong class="fx-flow-title">..</strong><p>..</p>
   optional <span class="evidence-tag">Observed</span> (evidence only) or <span class="fx-decision">You approve</span> (decisions only)
   </li></ol><figcaption class="fx-flow-note">..</figcaption></figure> */
.fx-flow { margin: 32px 0 0; }
.fx-flow-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  counter-reset: none;
}
.fx-flow-step {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 20px 18px 18px;
  background: #fff;
  border: 1px solid var(--fx-line);
  border-radius: 16px;
  box-shadow: var(--fx-shadow);
  color: var(--fx-ink);
}
.fx-flow-num {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  color: var(--fx-cobalt);
}
.fx-flow-title { font-size: 17px; line-height: 1.3; }
.fx-flow-step p { margin: 0; font-size: 15px; line-height: 1.5; color: rgba(10,24,56,.78); }
.fx-flow-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.fx-flow .evidence-tag { color: var(--fx-cobalt); background: #fff; }
.fx-decision {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--fx-ink); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1.2;
}
.fx-flow-note { margin-top: 14px; font-size: 15px; line-height: 1.5; color: rgba(10,24,56,.72); max-width: 68ch; }

/* 2 + 5. Motion, only with JS and only when motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .js-finish .fx-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .8s var(--fx-ease), transform .8s var(--fx-ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .js-finish .fx-reveal.is-in { opacity: 1; transform: none; }

  .js-finish .fx-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
  .js-finish .fx-line > span {
    display: block;
    transform: translateY(105%);
    animation: fx-rise .9s var(--fx-ease) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 80ms);
  }
  @keyframes fx-rise { to { transform: none; } }

  .js-finish .evidence-tag.is-in, .js-finish .checkpoint-tag.is-in { animation: fx-stamp .5s var(--fx-ease) both; }
  @keyframes fx-stamp {
    0% { transform: rotate(-8deg) scale(1.6); opacity: 0; }
    60% { transform: rotate(-1deg) scale(.94); opacity: 1; }
    100% { transform: rotate(-2deg) scale(1); }
  }

  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
