/* ==========================================================
   Darcy Flynn Romance — Global Styles & Design Tokens
   Light, classic, storybook. Pink accents, bookish serifs.
   ========================================================== */

/* --- Lenis smooth scroll (required by lenis.js) --- */
html.lenis,
html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: clip;
}

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

html {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

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

/* Suppress Android's gray tap-flash */
a,
button {
    -webkit-tap-highlight-color: transparent;
}

/* --- Design Tokens --- */
:root {
    /* Grounds */
    --bg: #FFFFFF;
    --bg-blush: #FDF3F7;          /* soft pink band */
    --bg-cream: #F9F3EE;          /* warm cream band (site secondary) */
    --bg-surface: #FFFFFF;        /* cards */
    --bg-surface-hover: #FFF8FB;
    --bg-elevated: #FBF7F2;       /* raised panels (blog cards, code blocks) */
    --glass-surface: rgba(255, 255, 255, 0.7);

    /* Ink */
    --text-primary: #2F1718;      /* warm brown-plum — headings */
    --text-body: #3D3335;         /* body copy */
    --text-secondary: #7A6A6E;    /* meta, captions */
    --text-muted: #A9989D;
    --text-faint: #C7BBBF;

    /* Brand */
    --brand: #DE0056;             /* Darcy pink */
    --brand-deep: #B00346;        /* hover / active */
    --brand-soft: #F9D9E6;        /* tints, chips */
    --gold: #C9A227;              /* award accents, stars */

    /* Lines */
    --border-subtle: rgba(47, 23, 24, 0.08);
    --border-medium: rgba(47, 23, 24, 0.16);
    --border-strong: rgba(47, 23, 24, 0.32);
    --border-brand: rgba(222, 0, 86, 0.35);

    /* Shadow — soft and warm */
    --shadow-sm: 0 2px 10px rgba(47, 23, 24, 0.07);
    --shadow-md: 0 10px 34px rgba(47, 23, 24, 0.12);
    --shadow-lg: 0 24px 70px rgba(47, 23, 24, 0.18);
    --shadow-cover: 0 14px 34px rgba(47, 23, 24, 0.22);  /* book covers */

    /* Buttons */
    --btn-bg: var(--brand);
    --btn-text: #FFFFFF;
    --btn-hover-bg: var(--brand-deep);
    --btn-radius: 999px;

    /* Footer */
    --footer-bg: #AF0044;         /* deep raspberry — from the live site */
    --footer-text: #F9F3EE;
    --footer-text-soft: rgba(255, 255, 255, 0.62);

    /* Type */
    --font-heading: 'Playfair Display', 'Georgia', serif;
    --font-body: 'Lora', 'Georgia', serif;
    --font-label: 'Josefin Sans', 'Helvetica Neue', sans-serif;
    --font-script: 'Yellowtail', cursive;

    /* Selection */
    --selection-bg: #DE0056;
    --selection-text: #FFFFFF;

    /* Rhythm */
    --section-pad: clamp(64px, 9vw, 120px);
    --container: 1200px;
    --container-narrow: 780px;

    color-scheme: light;
}

/* --- Base --- */
body {
    background-color: var(--bg);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.18;
    letter-spacing: 0.005em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }

p {
    margin: 0;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.25s ease;
}
a:hover {
    color: var(--brand-deep);
}

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

ul,
ol {
    list-style: none;
}

/* --- Shared utilities --- */

/* Label: small-caps sans eyebrow with dash — used above section headings */
.t-label {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-label);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand);
}
.t-label::before {
    content: '';
    width: 34px;
    height: 1px;
    background: var(--border-brand);
}
.t-label--center::after {
    content: '';
    width: 34px;
    height: 1px;
    background: var(--border-brand);
}

/* Script flourish — Yellowtail accent line (matches the logo script) */
.t-script {
    font-family: var(--font-script);
    font-weight: 400;
    color: var(--brand);
    line-height: 1.1;
}

/* Pill button — matches the site's "View on Amazon" buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 34px 13px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border-radius: var(--btn-radius);
    font-family: var(--font-label);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn:active {
    transform: translateY(0);
}

/* Ghost variant — thin outline, used for secondary store links */
.btn--ghost {
    background: transparent;
    color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--border-brand);
}
.btn--ghost:hover {
    background: var(--brand-soft);
    color: var(--brand-deep);
    box-shadow: inset 0 0 0 1px var(--border-brand);
}

/* Skip link — parked off-screen, slides in on keyboard focus */
.skip-link {
    position: fixed;
    top: -100%;
    left: 24px;
    z-index: 10001;
    padding: 12px 22px;
    background: var(--text-primary);
    color: #FFFFFF;
    border-radius: 999px;
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 24px;
    color: #FFFFFF;
}

/* Quiet "read more" text link — the standard path into detail pages,
   visually subordinate to the pill buttons */
.t-more {
    display: inline-block;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border-medium);
    text-underline-offset: 4px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.t-more:hover {
    color: var(--brand);
    text-decoration-color: var(--border-brand);
}

/* Screen-reader-only */
.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;
}

/* --- Selection --- */
::selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

/* --- Scrollbar (subtle, warm) --- */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-cream);
}
::-webkit-scrollbar-thumb {
    background: #D9C9CE;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

/* --- Focus visibility (ADA) --- */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 2px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline-offset: -2px;
}
section:focus-visible {
    outline: none;
}

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

/* Brand icons inside pill buttons (e.g. "Listen on Audible").
   Negative block margins keep the icon from inflating the line box,
   so icon buttons stay exactly the same height as text-only ones. */
.btn svg {
    width: 15px;
    height: 15px;
    margin-block: -5px;
    flex: 0 0 auto;
}
