/* ==========================================================================
   Whyso Starter — base application styles
   Mockup Spec: 0.1.1
   Everything in this file is global. Per-block styles live at blocks/{slug}/style.css
   ========================================================================== */

/* --- Base reset + typography -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--brand-font-body);
  font-weight: var(--brand-font-body-weight);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--brand-font-heading);
  font-weight: var(--brand-font-heading-weight);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 var(--space-sm); text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; }
img { max-width: 100%; height: auto; display: block; }

/* --- Surface theming via data-surface ----------------------------------- */
.section[data-surface="light"] { background: var(--color-bg); color: var(--color-text); }
.section[data-surface="alt"]   { background: var(--color-bg-alt); color: var(--color-text); }
.section[data-surface="dark"]  { background: var(--color-bg-dark); color: var(--color-text-inverse); }
.section[data-surface="dark"] ::selection { background: var(--brand-red); color: #fff; }
.section { position: relative; }

/* --- Containers --------------------------------------------------------- */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.container--narrow   { max-width: var(--container-narrow); }
.container--standard { max-width: var(--container-standard); }
.container--wide     { max-width: var(--container-wide); }
.container--max      { max-width: var(--container-max); }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.9em 1.4em;
  font-family: var(--brand-font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--brand-red);
  color: #fff;
}
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--ghost {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
}
.btn--ghost:hover {
  background: var(--brand-black);
  color: #FAFAF7;
  border-color: var(--brand-black);
}
.section[data-surface="dark"] .btn--ghost:hover {
  background: #FAFAF7;
  color: var(--brand-black);
  border-color: #FAFAF7;
}
.btn--sm { padding: 0.6em 1.1em; font-size: var(--text-xs); }
.btn__arrow { display: inline-block; transition: transform .2s ease; }
.btn:hover .btn__arrow { transform: translateX(2px); }

/* --- Utility: eyebrow --------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--brand-font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-sm);
}
.eyebrow::before {
  content: "";
  width: 1.25em;
  height: 1px;
  background: currentColor;
}

/* --- Shared heading-line utility ---------------------------------------- */
/* Forces a display heading onto multiple lines without orphaning words.
   Each clause becomes its own block. */
.heading-line { display: block; }

/* --- Reveal on scroll --------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-group > .reveal { transition-delay: 0s; }
.reveal-group.is-visible > .reveal:nth-child(1) { transition-delay: 0.00s; }
.reveal-group.is-visible > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-group.is-visible > .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-group.is-visible > .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-group.is-visible > .reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal-group.is-visible > .reveal:nth-child(6) { transition-delay: 0.40s; }

html.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* --- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- Shared Whyso logo class -------------------------------------------- */
.whyso-logo {
  display: block;
  width: auto;
  color: currentColor;
  flex-shrink: 0;
}
.whyso-logo--nav    { height: 40px; }
.whyso-logo--footer { height: 56px; }

/* --- Image placeholder (used in editor only while assets are TBD) ------- */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--brand-neutral-200);
  color: var(--color-text-muted);
  font-family: var(--brand-font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-md);
}
