/* ═══════════════════════════════════════════════════════════════════════════
   Yoshino Massage — Base: reset, typography, utilities, accessibility
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Content layers sit above the fixed sakura canvas. The header is NOT in
   this list — it must keep its own sticky positioning and higher z-index
   from layout.css so the nav dropdown paints above page content. */
main, footer.site-footer {
    position: relative;
    z-index: var(--z-content);
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    line-height: var(--leading-tight);
    color: var(--color-text);
}

h1 { font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 3.5vw, var(--text-4xl)); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
    max-width: 68ch;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary); }

/* WCAG 1.4.1: links inside prose carry a non-color cue. Kept subtle —
   thin line, offset below the baseline. Nav, buttons, and cards are
   exempt (they have their own affordances). */
p a,
.checklist li a,
figcaption a {
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

img { border-radius: var(--radius-sm); }

ul, ol { list-style: none; }

button {
    font: inherit;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

::selection {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

/* ── Layout primitives ─────────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-inline: auto;
    padding-inline: var(--space-6);
}

.container--narrow { max-width: var(--container-md); }
.container--wide   { max-width: var(--container-2xl); }

.section { padding-block: var(--space-24); }
.section--tight { padding-block: var(--space-16); }
.section--alt { background: var(--color-bg-alt); }
.section--ink {
    background: var(--color-ink);
    color: var(--color-text-inverse);
}
.section--ink h2, .section--ink h3 { color: var(--color-text-inverse); }
.section--ink p { color: rgba(255, 249, 245, 0.78); }

/* Sticky-header offset for in-page anchors */
section[id], [id].anchor-target {
    scroll-margin-top: calc(var(--header-height) + var(--space-6));
}

/* ── Section headings — the signature Japanese-minimal treatment ───────── */

.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-4);
}

.section-label::before {
    content: '';
    width: 2rem;
    height: 1px;
    background: var(--color-accent);
}

.section-head { margin-bottom: var(--space-12); }
.section-head--center { text-align: center; }
.section-head--center .section-label { justify-content: center; }
.section-head--center .section-label::after {
    content: '';
    width: 2rem;
    height: 1px;
    background: var(--color-accent);
}
.section-head--center p { margin-inline: auto; }

.section-head h2 + p { margin-top: var(--space-4); font-size: var(--text-lg); }

/* ── Accessibility ─────────────────────────────────────────────────────── */

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

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-modal);
    padding: var(--space-3) var(--space-5);
    background: var(--color-ink);
    color: var(--color-text-inverse);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-weight: var(--weight-medium);
}

.skip-link:focus {
    top: 0;
    color: var(--color-text-inverse);
}

:focus-visible {
    outline: 2px solid var(--color-primary-dark);
    outline-offset: 2px;
}

.section--ink :focus-visible,
.site-footer :focus-visible {
    outline-color: var(--color-blossom);
}

/* ── Scroll-reveal (JS adds .revealed; motion-gated below) ─────────────── */

.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.revealed {
    opacity: 1;
    transform: none;
}

/* ── Reduced motion: global, not just the petals ───────────────────────── */

@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;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}
