/* ============================================================
   BASE — reset, typography, shared components & animations
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: var(--fs-400);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--speed) ease, color var(--speed) ease;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
address { font-style: normal; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--text);
    text-wrap: balance;
}
h1 { font-size: var(--fs-900); }
h2 { font-size: var(--fs-800); }
h3 { font-size: var(--fs-600); }

::selection { background: var(--c-primary); color: #fff; }

:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- layout ---------- */
.container {
    width: min(100% - 2.5rem, 1180px);
    margin-inline: auto;
}
.container.narrow { max-width: 760px; }

main { display: block; }
section { position: relative; }

/* ---------- utilities ---------- */
.mono {
    font-family: var(--font-mono);
    font-size: var(--fs-200);
    letter-spacing: 0.08em;
}

.eyebrow {
    text-transform: uppercase;
    color: var(--c-primary);
    font-weight: 600;
    margin-bottom: var(--sp-3);
}

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

.skip-link {
    position: absolute;
    top: -100%; left: 1rem;
    z-index: 200;
    background: var(--c-secondary);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

.section-head { max-width: 640px; margin-bottom: var(--sp-7); }
.section-intro {
    color: var(--text-muted);
    font-size: var(--fs-500);
    margin-top: var(--sp-4);
    max-width: 56ch;
}

/* ---------- glassmorphism ---------- */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: var(--shadow-md);
}

/* ---------- buttons ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: var(--fs-300);
    padding: 0.7rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    overflow: hidden;
    text-decoration: none !important;
    transition: transform var(--speed) var(--ease-out), box-shadow var(--speed) var(--ease-out), background-color var(--speed) ease;
}
.btn:active { transform: scale(0.97); }
.btn-lg { padding: 0.95rem 2rem; font-size: var(--fs-400); }
.btn-sm { padding: 0.45rem 1.1rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 6px 22px color-mix(in srgb, var(--c-primary) 38%, transparent);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--c-primary) 48%, transparent);
}

.btn-ghost {
    color: var(--text);
    border-color: var(--line);
    background: transparent;
}
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); transform: translateY(-2px); }

.btn-light {
    background: #fff;
    color: var(--c-secondary);
    box-shadow: var(--shadow-sm);
}
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* button ripple (span injected by main.js) */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: ripple 0.55s var(--ease-out) forwards;
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ---------- avatars ---------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 55%, var(--c-accent)));
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
}
.avatar-lg { width: 58px; height: 58px; flex-basis: 58px; font-size: 1.5rem; }

/* ---------- star ratings ---------- */
.stars {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.stars svg { width: 21px; height: 21px; display: inline-block; }
.stars-base { color: var(--line); }
.stars-base svg { fill: currentColor; }
.stars-fill {
    position: absolute;
    inset: 0 auto 0 0;
    overflow: hidden;
    white-space: nowrap;
    color: var(--c-star);
    transition: width 1.1s var(--ease-out) 0.15s;
}
.stars-fill svg { fill: currentColor; }

/* ---------- status dots ---------- */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-accent);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-accent) 55%, transparent);
}
.status-dot.pulse, .status-ok .status-dot, .status-ok i {
    animation: pulse 2.4s ease-out infinite;
}
i.status-dot { margin-right: 0.4rem; }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-accent) 55%, transparent); }
    70%  { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- section wave divider ---------- */
.section-wave {
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    line-height: 0;
    pointer-events: none;
}
.section-wave svg { width: 100%; height: clamp(40px, 7vw, 110px); display: block; }
.section-wave path { fill: var(--bg); }

/* ---------- CTA band ---------- */
.cta-band {
    margin-top: var(--sp-8);
    padding-block: var(--sp-8);
    background:
        radial-gradient(900px 380px at 85% 15%, color-mix(in srgb, var(--c-accent) 22%, transparent), transparent 60%),
        linear-gradient(120deg, var(--c-secondary), color-mix(in srgb, var(--c-secondary) 70%, var(--c-primary)));
    clip-path: polygon(0 clamp(0px, 3.5vw, 52px), 100% 0, 100% 100%, 0 100%);
}
.cta-inner {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    align-items: flex-start;
}
.cta-band h2 { color: #fff; max-width: 18ch; }
.cta-band p { color: rgba(255, 255, 255, 0.78); max-width: 52ch; margin-top: var(--sp-3); }

@media (min-width: 768px) {
    .cta-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- scroll-reveal & page-load animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease-out) var(--reveal-delay, 0s),
                transform 0.7s var(--ease-out) var(--reveal-delay, 0s);
}
.reveal.in-view { opacity: 1; transform: none; }

.load-fade {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s var(--ease-out) var(--load-delay, 0s),
                transform 0.8s var(--ease-out) var(--load-delay, 0s);
}
body.loaded .load-fade { opacity: 1; transform: none; }

/* headline word stagger (spans added by main.js) */
.split-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.6em) rotate(2deg);
    animation: word-in 0.7s var(--ease-out) forwards;
    animation-delay: calc(0.2s + var(--word-i, 0) * 0.07s);
}
@keyframes word-in { to { opacity: 1; transform: none; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .load-fade, .split-word { opacity: 1 !important; transform: none !important; }
    .stars-fill { transition: none; }
}
