/* ============================================
   BASE STYLES & TYPOGRAPHY
   ============================================ */

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Turbo stream sources should never affect layout */
turbo-cable-stream-source {
  display: none;
}

/* View Transitions — smooth crossfade between Turbo navigations */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
}

/* Base Elements */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    text-rendering: optimizeLegibility;
    scrollbar-gutter: stable;
}

body {
    min-block-size: 100vh;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--ink);
    background: var(--page);
    letter-spacing: 0;
    font-weight: 400;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Publishing typography - serif display headings */
:where(h1, h2, h3, h4, h5, h6) {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-wrap: balance;
    hyphens: auto;
    overflow-wrap: break-word;
}
:where(h1) {
    font-size: var(--text-4xl);
    margin-block: 0.4em;
    line-height: 1.1;
}
:where(h2) {
    font-size: var(--text-3xl);
    margin-block: 0.5em;
    line-height: 1.15;
}
:where(h3) {
    font-size: var(--text-2xl);
    margin-block: 0.6em;
    line-height: 1.25;
}
:where(h4) {
    font-size: var(--text-xl);
    margin-block: 0.6em;
    line-height: 1.3;
}
:where(p) {
    margin-block: 0.65lh;
    line-height: 1.6;
    letter-spacing: -0.005ch;
    text-wrap: pretty;
    hyphens: auto;
    overflow-wrap: break-word;
}
/* Links inherit color by default (Calendly style) - only explicit links are blue */
:where(a) {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition), opacity var(--transition);
}
/* Blue links - use .link class or wrap in .content */
a.link, .content a { color: var(--primary); }
@media (any-hover: hover) {
    a.link:hover, .content a:hover { opacity: 0.8; }
}
:where(pre) { max-inline-size: 100%; overflow-x: auto; }

:where(a, button, input, select, textarea, .btn, .card) { transition: background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition), transform var(--transition), box-shadow var(--transition-fast); touch-action: manipulation; }
:where(input, textarea) { caret-color: var(--primary); }

/* ── Site Compare Slider (shared across sites) ── */

[data-controller="hanna--slide-before-after"] {
  container-type: inline-size;
}

.site-compare__handle {
  width: clamp(36px, 10cqi, 48px);
  height: clamp(36px, 10cqi, 48px);
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid #ffffff;
  color: #ffffff;
  cursor: col-resize;
  touch-action: none;
}

.site-compare__label {
  font-size: clamp(0.55rem, 2.5cqi, 0.75rem);
  font-weight: 700;
  padding: clamp(3px, 1cqi, 6px) clamp(6px, 2cqi, 14px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 4px;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Legal Pages ── */

.site-legal {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.site-legal h1 { margin-block-end: 0.25em; }
.site-legal__updated {
  font-size: var(--text-sm, 0.875rem);
  color: var(--ink-muted, #666);
  margin-block-end: 2rem;
}
.site-legal__close {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 2.5rem;
  text-decoration: none;
  color: inherit;
  padding: 0.5rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.site-legal__close:hover { opacity: 1; }
.site-legal h2 { margin-block-start: 2rem; }
.site-legal h3 { font-size: var(--text-lg, 1.125rem); }
.site-legal ul {
  padding-inline-start: 1.5rem;
  list-style: disc;
}
.site-legal li { margin-block: 0.35em; }

/* ── Legal Footer ── */

.site-legal-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: var(--text-sm, 0.875rem);
  color: var(--ink-muted, #666);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.site-legal-footer a { text-decoration: underline; text-underline-offset: 2px; }

/* ── Cookie Consent Banner ── */

.site-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--ink, #1a1a1a);
  color: var(--page, #fff);
  font-size: var(--text-sm, 0.875rem);
}
.site-consent[hidden] { display: none; }
.site-consent a { color: inherit; text-decoration: underline; }
.site-consent button {
  padding: 0.4rem 1.25rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Platform Bar ── */

.platform-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted, rgba(255,255,255,0.5));
  text-decoration: none;
  cursor: pointer;
  padding: 4px 0;
  outline: none;
  transition: color 0.3s ease;
}
.platform-bar__brand:hover { color: var(--text, #fff); }

/* ── Accessibility Layer ── */

:root {
  --focus-ring-size: 2px;
  --focus-ring-color: var(--primary, #2563eb);
  --focus-ring-offset: 2px;
}
:focus-visible {
  outline: var(--focus-ring-size) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.site-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--ink, #1a1a1a);
  color: var(--page, #fff);
  font-weight: 600;
  text-decoration: none;
}
.site-skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .card, .btn, input, textarea, select {
    border: 1px solid CanvasText !important;
  }
  svg {
    fill: CanvasText !important;
    stroke: CanvasText !important;
  }
}
