/* ============================================================================
   HOMEPAGE — Direction C ("The Counter") · Warm-palette pass (Phase 2)
   ============================================================================
   Phase 293c rebuild. Adapts redesign-c.jsx structure (Don second, formulary
   shelf, paragraph closer) but on a fully warm/cream ground so the homepage
   reads as part of the same ecosystem as pricing.html, about.html, shop.html.
   No dark full-bleed sections. The accent is teal italic emphasis on serif
   moments; coral is reserved for ambient eyebrows + the sparing structural
   rule on the closing paragraph.

   Tokens consumed: --ps-bg, --ps-ink, --ps-ink-muted, --ps-teal, --ps-teal-deep,
   --ps-teal-light, --ps-mint, --ps-cream, --ps-sand, --ps-accent, --ps-line,
   --ps-card, --ps-shadow-lift, --ps-font-display, --ps-font-body.
   ============================================================================ */

/* ─────────────────────────────────────────────────────────────────────────
   1. HERO (warm bone — the homepage is part of the ecosystem)
   ───────────────────────────────────────────────────────────────────────── */

.ps-home-hero {
    background: var(--ps-bg);
    color: var(--ps-ink);
    padding: 96px 48px 96px;
    position: relative;
    overflow: hidden;
}

.ps-home-hero-inner {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.ps-home-hero-eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ps-green-deep);
    margin: 0 0 28px;
    line-height: 1.4;
}

.ps-home-hero-title {
    font-family: var(--ps-font-display);
    font-size: clamp(56px, 11vw, 132px);
    line-height: 0.96;
    font-weight: 400;
    letter-spacing: -0.03em;
    margin: 0 0 36px;
    color: var(--ps-ink);
}

.ps-home-hero-title em {
    font-style: italic;
    color: var(--ps-green-deep);
}

.ps-home-hero-lede {
    font-family: var(--ps-font-body);
    font-size: 19px;
    line-height: 1.55;
    color: var(--ps-ink-muted);
    max-width: 620px;
    margin: 0 auto 48px;
}

/* ── Search bar ── */

.ps-home-search {
    max-width: 720px;
    margin: 0 auto;
}

.ps-home-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ps-card);
    color: var(--ps-ink);
    padding: 8px 8px 8px 24px;
    border-radius: 999px;
    border: 1px solid var(--ps-line);
    box-shadow: var(--ps-shadow-lift);
    transition: box-shadow 200ms ease, border-color 200ms ease;
    cursor: text;
}

.ps-home-search-bar:focus-within {
    border-color: var(--ps-green-deep);
    box-shadow: 0 24px 56px rgba(6, 135, 73, 0.18);
}

.ps-home-search-icon {
    color: var(--ps-ink-muted);
    flex-shrink: 0;
    pointer-events: none;
}

.ps-home-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--ps-font-display);
    font-size: 22px;
    color: var(--ps-ink);
    padding: 16px 8px;
    min-height: 44px;
    min-width: 0;
}

.ps-home-search-input::placeholder { color: var(--ps-ink-muted); }

.ps-home-search-cta {
    background: var(--ps-ink);
    color: #FBF8F1;
    padding: 16px 26px;
    border-radius: 999px;
    font-family: var(--ps-font-body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: background-color 150ms ease;
}

.ps-home-search-cta:hover { background: var(--ps-green-press); }

.ps-home-search-cta:focus-visible {
    outline: 2px solid var(--ps-green);
    outline-offset: 2px;
}

/* ── Autocomplete ── */

.ps-home-autocomplete {
    position: relative;
    margin: 12px auto 0;
    background: var(--ps-card);
    color: var(--ps-ink);
    border-radius: 16px;
    border: 1px solid var(--ps-line);
    box-shadow: 0 20px 50px rgba(15, 30, 28, 0.12);
    overflow: hidden;
    text-align: left;
}

.ps-home-autocomplete[hidden] { display: none; }

.ps-home-autocomplete-item {
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--ps-ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ps-line);
    font-family: var(--ps-font-body);
    min-height: 56px;
}

.ps-home-autocomplete-item:last-child { border-bottom: none; }

.ps-home-autocomplete-item:hover,
.ps-home-autocomplete-item:focus-visible {
    background: var(--ps-cream);
    outline: none;
}

.ps-home-autocomplete-name {
    font-family: var(--ps-font-display);
    font-size: 18px;
    color: var(--ps-ink);
}

.ps-home-autocomplete-class {
    font-size: 12px;
    color: var(--ps-ink-muted);
}

.ps-home-autocomplete-price {
    font-size: 13px;
    color: var(--ps-green-deep);
    font-weight: 600;
}

/* ── Popular chip rail ── */

.ps-home-popular-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.ps-home-popular-chips-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ps-ink-muted);
    margin-right: 4px;
}

.ps-home-chip {
    background: transparent;
    border: 1px solid var(--ps-line);
    color: var(--ps-ink);
    padding: 10px 18px;
    border-radius: 999px;
    font-family: var(--ps-font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.ps-home-chip:hover,
.ps-home-chip:focus-visible {
    border-color: var(--ps-ink);
    background: var(--ps-card);
    color: var(--ps-ink);
    outline: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   2. THE PHARMACIST (warm cream — Don second on the page)
   ───────────────────────────────────────────────────────────────────────── */

.ps-home-don {
    background: var(--ps-cream);
    color: var(--ps-ink);
    padding: 112px 48px;
    border-top: 1px solid var(--ps-line);
}

.ps-home-don-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: center;
}

.ps-home-don-portrait {
    position: relative;
    margin: 0;
    max-width: 320px;
}

.ps-home-don-tape {
    position: absolute;
    top: -14px;
    left: 56px;
    width: 96px;
    height: 26px;
    background: rgba(232, 105, 60, 0.55);
    transform: rotate(-4deg);
    z-index: 2;
    box-shadow: 0 1px 2px rgba(15, 30, 28, 0.08);
}

.ps-home-don-portrait-frame {
    aspect-ratio: 4 / 5;
    background: linear-gradient(135deg, var(--ps-sand) 0%, #D4CDBC 100%);
    border: 1px solid rgba(15, 30, 28, 0.15);
    box-shadow: 0 30px 60px rgba(15, 30, 28, 0.18);
    position: relative;
    overflow: hidden;
}

.ps-home-don-portrait-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(15, 30, 28, 0.04) 0,
        rgba(15, 30, 28, 0.04) 1px,
        transparent 1px,
        transparent 14px
    );
    pointer-events: none;
}

.ps-home-don-portrait-inner {
    position: absolute;
    inset: 24px;
    border: 1px dashed rgba(15, 30, 28, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 16px;
    gap: 6px;
}

.ps-home-don-portrait-stamp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: rgba(15, 30, 28, 0.55);
}

.ps-home-don-portrait-caption {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.5;
    color: rgba(15, 30, 28, 0.45);
}

.ps-home-don-eyebrow {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ps-green-deep);
    margin-bottom: 18px;
}

.ps-home-don-headline {
    font-family: var(--ps-font-display);
    font-size: clamp(44px, 6vw, 76px);
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.025em;
    color: var(--ps-ink);
    margin: 0 0 28px;
}

.ps-home-don-headline em {
    font-style: italic;
    color: var(--ps-green-deep);
}

.ps-home-don-bio {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ps-ink-muted);
    max-width: 520px;
    margin: 0 0 28px;
}

.ps-home-don-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.ps-home-don-phone {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ps-ink);
    color: #FBF8F1;
    padding: 16px 26px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    min-height: 44px;
    transition: background-color 150ms ease;
}

.ps-home-don-phone:hover { background: var(--ps-green-press); }

.ps-home-don-phone:focus-visible {
    outline: 2px solid var(--ps-green);
    outline-offset: 2px;
}

.ps-home-don-phone-icon {
    font-size: 18px;
    line-height: 1;
}

.ps-home-don-hours {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ps-ink-muted);
    margin: 0;
}

.ps-home-don-credentials {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 0 36px;
    margin: 0;
    padding-top: 24px;
    border-top: 1px solid rgba(15, 30, 28, 0.15);
}

.ps-home-don-credentials > div { margin: 0; }

.ps-home-don-credentials dt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ps-ink-muted);
    margin: 0;
}

.ps-home-don-credentials dd {
    font-family: var(--ps-font-display);
    font-size: 22px;
    color: var(--ps-ink);
    margin: 4px 0 0;
    line-height: 1.1;
}

/* ─────────────────────────────────────────────────────────────────────────
   3. THE SHELF (warm bone — formulary teaser, cards on white surface)
   ───────────────────────────────────────────────────────────────────────── */

.ps-home-shelf {
    background: var(--ps-bg);
    color: var(--ps-ink);
    padding: 112px 48px;
}

.ps-home-shelf-head {
    max-width: 1100px;
    margin: 0 auto 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.ps-home-shelf-eyebrow {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ps-green-deep);
    margin-bottom: 12px;
}

.ps-home-shelf-title {
    font-family: var(--ps-font-display);
    font-size: clamp(36px, 5.5vw, 56px);
    line-height: 1;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ps-ink);
    margin: 0;
}

.ps-home-shelf-title em {
    font-style: italic;
    color: var(--ps-green-deep);
}

.ps-home-shelf-link {
    color: var(--ps-ink);
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--ps-ink-muted);
    padding-bottom: 4px;
    transition: color 150ms ease, border-color 150ms ease;
}

.ps-home-shelf-link:hover,
.ps-home-shelf-link:focus-visible {
    color: var(--ps-green-deep);
    border-color: var(--ps-green-deep);
    outline: none;
}

.ps-home-shelf-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ps-home-shelf-card {
    background: var(--ps-card);
    border: 1px solid var(--ps-line);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    text-decoration: none;
    color: inherit;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.ps-home-shelf-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ps-shadow-lift);
    border-color: var(--ps-green-tint);
}

.ps-home-shelf-card:focus-visible {
    outline: 2px solid var(--ps-green);
    outline-offset: 2px;
}

.ps-home-shelf-class {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ps-ink-muted);
    margin-bottom: 8px;
}

.ps-home-shelf-name {
    display: block;
    font-family: var(--ps-font-display);
    font-size: 26px;
    line-height: 1.1;
    color: var(--ps-ink);
    letter-spacing: -0.012em;
}

.ps-home-shelf-strength {
    display: block;
    font-size: 12px;
    color: var(--ps-ink-muted);
    margin-top: 6px;
}

.ps-home-shelf-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 18px;
}

.ps-home-shelf-price {
    font-family: var(--ps-font-display);
    font-style: italic;
    font-size: 30px;
    line-height: 1;
    color: var(--ps-green-deep);
}

.ps-home-shelf-price-unit {
    font-family: var(--ps-font-body);
    font-style: normal;
    font-size: 13px;
    color: var(--ps-ink-muted);
    margin-left: 2px;
}

.ps-home-shelf-tier {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--ps-ink-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   4. HOW IT WORKS (warm cream closer — single paragraph, two CTAs)
   ───────────────────────────────────────────────────────────────────────── */

.ps-home-how {
    background: var(--ps-cream);
    color: var(--ps-ink);
    padding: 112px 48px;
    border-top: 1px solid var(--ps-line);
}

.ps-home-how-inner {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}

.ps-home-how-eyebrow {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ps-green-deep);
    margin-bottom: 24px;
}

.ps-home-how-paragraph {
    font-family: var(--ps-font-display);
    font-size: clamp(28px, 3.6vw, 40px);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.012em;
    color: var(--ps-ink);
    margin: 0 0 48px;
}

.ps-home-how-paragraph em {
    font-style: italic;
    color: var(--ps-green-deep);
}

.ps-home-how-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7em;
    letter-spacing: 0.04em;
    background: var(--ps-card);
    padding: 2px 10px;
    border-radius: 4px;
    color: var(--ps-ink);
    font-style: normal;
    border: 1px solid var(--ps-line);
}

.ps-home-how-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.ps-home-how-cta-primary,
.ps-home-how-cta-secondary {
    padding: 16px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.ps-home-how-cta-primary {
    background: var(--ps-ink);
    color: #FBF8F1;
}

.ps-home-how-cta-primary:hover { background: var(--ps-green-press); }

.ps-home-how-cta-primary:focus-visible {
    outline: 2px solid var(--ps-green);
    outline-offset: 2px;
}

.ps-home-how-cta-secondary {
    background: transparent;
    color: var(--ps-ink);
    border: 1px solid var(--ps-ink);
}

.ps-home-how-cta-secondary:hover {
    background: var(--ps-ink);
    color: #FBF8F1;
}

.ps-home-how-cta-secondary:focus-visible {
    outline: 2px solid var(--ps-green);
    outline-offset: 2px;
}

.ps-home-how-fineprint {
    font-size: 12px;
    color: var(--ps-ink-muted);
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .ps-home-don-grid { grid-template-columns: 1fr; gap: 48px; }
    .ps-home-don-portrait { max-width: 420px; margin: 0 auto; }
    .ps-home-shelf-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .ps-home-hero,
    .ps-home-don,
    .ps-home-shelf,
    .ps-home-how {
        padding-left: 24px;
        padding-right: 24px;
    }
    .ps-home-hero { padding-top: 64px; padding-bottom: 80px; }
    .ps-home-don,
    .ps-home-shelf,
    .ps-home-how { padding-top: 80px; padding-bottom: 80px; }

    .ps-home-search-bar {
        gap: 8px;
        padding: 6px 6px 6px 18px;
    }
    .ps-home-search-icon   { width: 18px; height: 18px; }
    .ps-home-search-input  { font-size: 18px; padding: 12px 4px; }
    .ps-home-search-cta    { padding: 12px 18px; font-size: 13px; }

    .ps-home-don-credentials {
        grid-template-columns: 1fr 1fr;
        gap: 20px 24px;
    }

    .ps-home-shelf-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .ps-home-shelf-grid { grid-template-columns: 1fr; }
    .ps-home-don-credentials { grid-template-columns: 1fr; }
    .ps-home-search-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 24px;
        padding: 16px;
        gap: 8px;
    }
    .ps-home-search-icon {
        width: 18px;
        height: 18px;
        align-self: flex-start;
        margin-bottom: 4px;
    }
    .ps-home-search-input {
        font-size: 18px;
        padding: 12px 4px;
        border-bottom: 1px solid var(--ps-line);
    }
    .ps-home-search-cta {
        justify-content: center;
        width: 100%;
    }
    .ps-home-popular-chips { justify-content: flex-start; }
    .ps-home-hero-title { font-size: clamp(44px, 13vw, 64px); }
}

/* ─────────────────────────────────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .ps-home-search-bar,
    .ps-home-chip,
    .ps-home-search-cta,
    .ps-home-don-phone,
    .ps-home-shelf-link,
    .ps-home-shelf-card,
    .ps-home-how-cta-primary,
    .ps-home-how-cta-secondary {
        transition: none;
    }
    .ps-home-shelf-card:hover { transform: none; }
}
