/* ────────────────────────────────────────────────────────────────
   Heila Studio — Custom CSS
   Refinements on top of Tailwind: typography polish, animations,
   things Tailwind can't do cleanly.
   ──────────────────────────────────────────────────────────────── */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Fraunces refinements ─────────────────────────────────────── */
.font-serif {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

.font-serif em {
    font-style: italic;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
}

/* ─── Selection ─────────────────────────────────────────────────── */
::selection {
    background-color: #E8927C;
    color: #FAF6F0;
}
::-moz-selection {
    background-color: #E8927C;
    color: #FAF6F0;
}

/* ─── Fade-in animation for hero ───────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* ─── Scroll-triggered reveal for sections ─────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Details (FAQ) chevron polish ─────────────────────────────── */
details > summary {
    list-style: none;
    transition: background-color 0.2s ease;
}

details > summary::-webkit-details-marker {
    display: none;
}

details[open] > summary h3 {
    color: #3D2C1F;
}

details > summary:hover {
    background-color: rgba(232, 146, 124, 0.04);
}

/* ─── Form refinements ─────────────────────────────────────────── */
input,
textarea {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus {
    box-shadow: 0 0 0 4px rgba(232, 146, 124, 0.12);
}

/* Remove iOS input shadows */
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

/* ─── Subtle texture on cream background ───────────────────────── */
body {
    background-image:
        radial-gradient(ellipse at top, rgba(232, 146, 124, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(201, 168, 124, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

/* ─── Image lazy-load fade-in ──────────────────────────────────── */
img {
    transition: opacity 0.4s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded,
img[loading="eager"] {
    opacity: 1;
}

/* ─── Link underline polish ────────────────────────────────────── */
a {
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* ─── Mobile improvements ──────────────────────────────────────── */
@media (max-width: 640px) {
    .font-serif {
        letter-spacing: -0.01em;
    }
}

/* ─── Print: keep it clean ─────────────────────────────────────── */
@media print {
    nav, footer, form, .no-print { display: none !important; }
    body { background: white; color: black; }
}

/* ─── Reduced motion respect ───────────────────────────────────── */
@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;
    }
}

/* ─── Focus visible for keyboard navigation ────────────────────── */
:focus-visible {
    outline: 2px solid #E8927C;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 4px;
}
