/* ==========================================================================
   Blessing Your Scalp — content pages (About, Return & Shipping Policies)
   --------------------------------------------------------------------------
   Self-contained and namespaced under `.bys-page`. These two pages sit on
   different layouts (About on layouts.web, the policy on layouts.shop-layout),
   so the tokens are redeclared here rather than inherited — that is what makes
   the pair look like one design system from either shell.

   No Alpine or jQuery: the mobile contents menu is a native <details>, and the
   only script is an optional scroll-spy.
   ========================================================================== */

/* The shop layout's stylesheet sets `main { overflow: hidden }`, which makes
   <main> a scroll container and silently cancels `position: sticky` on the
   contents sidebar. Scoped with :has() so only these pages are affected —
   every other shop page keeps the original rule. `overflow-x: clip` preserves
   the horizontal clipping that rule exists for. Browsers without :has() simply
   don't get a sticky sidebar, which degrades cleanly. */
main:has(> .bys-page) {
    overflow: visible;
    overflow-x: clip;
}

.bys-page {
    --rose: #be6d76;
    --rose-deep: #a85961;
    --rose-rgb: 190, 109, 118;
    --cream: #fbf4f0;
    --blush: #f5e6e0;
    --white: #ffffff;
    --charcoal: #35312f;
    --espresso: #302c2a;
    /* Body copy: one step darker than the system's --bys-stone (#8a8582),
       which only reaches 3.36:1 on cream. This holds 4.8:1. */
    --body: #6f6a67;
    --muted: #8a8582;
    --divider: #e3e3e3;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    background: var(--white);
    color: var(--body);
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: clip;
}

.bys-page *,
.bys-page *::before,
.bys-page *::after {
    box-sizing: border-box;
}

/* :where() keeps these at zero added specificity so component classes win. */
.bys-page :where(h1, h2, h3, h4, p, ul, ol, figure, dl, dd) {
    margin: 0;
}

.bys-page :where(h1, h2, h3, h4) {
    color: var(--charcoal);
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.01em;
}

.bys-page :where(ul, ol) {
    padding: 0;
    list-style: none;
}

.bys-page :where(img) {
    max-width: 100%;
}

.bys-page :where(a) {
    text-decoration: none;
}

.bys-page a:focus-visible,
.bys-page button:focus-visible,
.bys-page summary:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.bys-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .bys-shell {
        padding: 0 32px;
    }
}

@media (min-width: 1200px) {
    .bys-shell {
        padding: 0 40px;
    }
}

.bys-sec {
    padding: clamp(64px, 8vw, 112px) 0;
}

.bys-sec--cream {
    background: var(--cream);
}

.bys-sec--tight {
    padding: clamp(48px, 6vw, 80px) 0;
}

.bys-eyebrow {
    display: block;
    margin-bottom: 14px;
    color: var(--rose-deep);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.bys-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 15px 32px;
    border: 1px solid transparent;
    border-radius: 30px;
    font-family: 'Jost', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 300ms var(--ease), color 300ms var(--ease),
        border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}

.bys-btn--primary {
    background: var(--rose);
    /* The rose glow is a brand signal — do not remove. */
    box-shadow: 0 4px 15px rgba(var(--rose-rgb), 0.3);
    color: #fff;
}

.bys-btn--primary:hover,
.bys-btn--primary:focus-visible {
    background: var(--charcoal);
    box-shadow: 0 6px 20px rgba(53, 49, 47, 0.3);
    color: #fff;
}

.bys-btn--outline {
    border-color: var(--charcoal);
    background: transparent;
    color: var(--charcoal);
}

.bys-btn--outline:hover,
.bys-btn--outline:focus-visible {
    background: var(--charcoal);
    color: #fff;
}

.bys-btn--ghost-light {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.bys-btn--ghost-light:hover,
.bys-btn--ghost-light:focus-visible {
    border-color: #fff;
    background: #fff;
    color: var(--charcoal);
}

.bys-inline-link {
    color: var(--rose-deep);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 200ms var(--ease);
    /* Long email addresses must not widen the layout on a 320px screen. */
    overflow-wrap: anywhere;
}

.bys-inline-link:hover,
.bys-inline-link:focus-visible {
    color: var(--charcoal);
}

/* ==========================================================================
   ABOUT
   ========================================================================== */

/* Split hero: copy on cream, portrait alongside. Deliberately different from
   the homepage's full-bleed photographic hero so the two do not read as the
   same page twice. */
.bys-hero {
    background: var(--cream);
}

.bys-hero__grid {
    display: grid;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
    padding: clamp(48px, 6vw, 96px) 0;
}

@media (min-width: 900px) {
    .bys-hero__grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    }
}

.bys-hero__script {
    display: block;
    margin-bottom: 4px;
    color: var(--rose-deep);
    font-family: 'Parisienne', 'Mrs Saint Delafield', cursive;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 400;
    line-height: 1.2;
}

.bys-hero__title {
    font-size: clamp(2.125rem, 6vw, 3.5rem);
    line-height: 1.08;
}

.bys-hero__lede {
    max-width: 46ch;
    margin-top: 18px;
    font-size: 1.0625rem;
}

.bys-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: clamp(28px, 4vw, 36px);
}

@media (max-width: 379px) {
    .bys-hero__actions .bys-btn {
        flex: 1 1 100%;
    }
}

.bys-hero__media {
    /* Portrait leads on mobile — this is the brand story page, and the 4:3
       crop below is short enough that the headline still lands above the fold. */
    order: -1;
}

@media (min-width: 900px) {
    .bys-hero__media {
        order: 0;
    }
}

.bys-hero__frame {
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.bys-hero__frame img {
    display: block;
    width: 100%;
    /* A tall portrait would eat a whole phone screen before any words. */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 22%;
}

@media (min-width: 900px) {
    .bys-hero__frame img {
        aspect-ratio: 4 / 5;
        object-position: 50% 30%;
    }
}

/* Story */
.bys-story {
    display: grid;
    gap: clamp(32px, 5vw, 64px);
}

@media (min-width: 992px) {
    .bys-story {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        align-items: start;
    }
}

.bys-story__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
}

@media (min-width: 992px) {
    .bys-story__aside {
        position: sticky;
        top: 120px;
    }
}

.bys-prose > p {
    /* 65-75ch is the comfortable reading range. */
    max-width: 68ch;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.bys-prose > p + p {
    margin-top: 20px;
}

/* Pull quote — one highlighted statement, not a decorated box. */
.bys-quote {
    max-width: 60ch;
    margin: 32px 0;
    padding-left: 22px;
    border-left: 3px solid var(--rose);
    color: var(--charcoal);
    font-size: clamp(1.125rem, 2.4vw, 1.375rem);
    font-weight: 400;
    line-height: 1.55;
}

.bys-signature {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--divider);
}

.bys-signature__name {
    color: var(--charcoal);
    font-family: 'Mrs Saint Delafield', 'Parisienne', cursive;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.1;
}

.bys-signature__role {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Values */
.bys-values {
    display: grid;
    gap: 16px;
}

@media (min-width: 640px) {
    .bys-values {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

.bys-value {
    padding: 28px 26px;
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.bys-value__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--blush);
    color: var(--rose-deep);
}

.bys-value__icon svg {
    width: 21px;
    height: 21px;
}

.bys-value__title {
    margin-bottom: 8px;
    font-size: 1.125rem;
    font-weight: 600;
}

.bys-value__text {
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* Stats */
.bys-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 48px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--divider);
}

.bys-stat__num {
    display: block;
    color: var(--charcoal);
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.bys-stat__label {
    display: block;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
}

/* Reviews rail — same treatment as the homepage, for continuity. */
.bys-reviews {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(15rem, 72vw, 19rem);
    gap: 16px;
    margin: 0 -20px;
    padding: 4px 20px 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.bys-reviews::-webkit-scrollbar {
    display: none;
}

.bys-reviews > * {
    scroll-snap-align: center;
}

@media (min-width: 768px) {
    .bys-reviews {
        gap: 20px;
        margin: 0 -32px;
        padding: 4px 32px 20px;
    }

    .bys-reviews > * {
        scroll-snap-align: start;
    }
}

.bys-reviews:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 3px;
}

.bys-review {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}

@media (hover: hover) {
    .bys-review:hover {
        transform: translateY(-10px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

.bys-review__shot {
    display: block;
    width: 100%;
    /* `contain`, never `cover`: these are screenshots of messages, and cropping
       cuts words out of the middle. 1:1 matches their own ratios. */
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    background: var(--cream);
}

.bys-review__foot {
    padding: 16px 18px;
    border-top: 1px solid var(--divider);
}

.bys-review__name {
    color: var(--charcoal);
    font-size: 0.9375rem;
    font-weight: 600;
}

.bys-review__meta {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.75rem;
}

.bys-reviews__hint {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8125rem;
    text-align: center;
}

@media (min-width: 992px) {
    .bys-reviews__hint {
        display: none;
    }
}

/* Closing CTA band */
.bys-cta {
    background: var(--espresso);
    color: rgba(255, 255, 255, 0.86);
    text-align: center;
}

.bys-cta__inner {
    max-width: 42rem;
    margin: 0 auto;
    padding: clamp(56px, 7vw, 96px) 0;
}

.bys-cta__title {
    color: #fff;
    font-size: clamp(1.5rem, 3.6vw, 2.25rem);
    line-height: 1.25;
}

.bys-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

@media (max-width: 379px) {
    .bys-cta__actions .bys-btn {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   POLICY
   ========================================================================== */

.bys-policy-head {
    padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
    border-bottom: 1px solid var(--divider);
    background: var(--cream);
}

.bys-policy-head__title {
    font-size: clamp(1.875rem, 5vw, 3rem);
    line-height: 1.1;
}

.bys-policy-head__lede {
    max-width: 60ch;
    margin-top: 16px;
    font-size: 1.0625rem;
}

.bys-policy-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.8125rem;
}

.bys-policy-head__meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.bys-policy-head__meta svg {
    width: 15px;
    height: 15px;
    color: var(--rose-deep);
    flex: 0 0 auto;
}

.bys-policy-layout {
    display: grid;
    gap: clamp(28px, 4vw, 56px);
    padding: clamp(32px, 5vw, 64px) 0 clamp(64px, 8vw, 104px);
}

@media (min-width: 992px) {
    .bys-policy-layout {
        grid-template-columns: 232px minmax(0, 1fr);
        align-items: start;
    }
}

/* Contents — a native <details> on mobile (no JS), a sticky list on desktop */
.bys-toc {
    border: 1px solid var(--divider);
    border-radius: 12px;
    background: var(--cream);
}

@media (min-width: 992px) {
    .bys-toc {
        position: sticky;
        /* Clears the sticky site header. */
        top: 104px;
        border: 0;
        border-radius: 0;
        background: none;
    }
}

.bys-toc__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 14px 18px;
    color: var(--charcoal);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
}

.bys-toc__summary::-webkit-details-marker {
    display: none;
}

.bys-toc__summary svg {
    width: 11px;
    height: 7px;
    color: var(--muted);
    transition: transform 220ms var(--ease);
}

.bys-toc[open] .bys-toc__summary svg {
    transform: rotate(180deg);
}

@media (min-width: 992px) {
    .bys-toc__summary {
        min-height: 0;
        padding: 0 0 14px;
        border-bottom: 1px solid var(--divider);
        cursor: default;
        pointer-events: none;
    }

    .bys-toc__summary svg {
        display: none;
    }
}

.bys-toc__list {
    padding: 0 10px 12px;
}

@media (min-width: 992px) {
    .bys-toc__list {
        padding: 14px 0 0;
    }
}

.bys-toc__link {
    display: block;
    /* 44px of thumb room per row. */
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--body);
    font-size: 0.9375rem;
    line-height: 1.45;
    transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

.bys-toc__link:hover,
.bys-toc__link:focus-visible {
    background: var(--blush);
    color: var(--charcoal);
}

@media (min-width: 992px) {
    .bys-toc__link {
        padding: 9px 12px;
        border-left: 2px solid transparent;
        border-radius: 0 6px 6px 0;
    }
}

.bys-toc__link.is-current {
    color: var(--rose-deep);
    font-weight: 500;
}

@media (min-width: 992px) {
    .bys-toc__link.is-current {
        border-left-color: var(--rose);
        background: var(--cream);
    }
}

/* Policy body */
.bys-policy-body {
    max-width: 72ch;
}

.bys-policy-sec + .bys-policy-sec {
    margin-top: clamp(40px, 5vw, 64px);
    padding-top: clamp(40px, 5vw, 64px);
    border-top: 1px solid var(--divider);
}

/* Clears the sticky site header when jumped to from the contents. */
.bys-policy-sec {
    scroll-margin-top: 96px;
}

.bys-policy-sec__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.bys-policy-sec__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--blush);
    color: var(--rose-deep);
}

.bys-policy-sec__icon svg {
    width: 19px;
    height: 19px;
}

.bys-policy-sec__title {
    font-size: clamp(1.25rem, 2.6vw, 1.625rem);
    line-height: 1.25;
}

.bys-policy-sec__sub {
    margin: 28px 0 12px;
    color: var(--charcoal);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.bys-policy-body p {
    font-size: 1rem;
    line-height: 1.8;
}

.bys-policy-body p + p {
    margin-top: 14px;
}

/* Definition-style rows for thresholds and timings — easier to scan than a
   sentence, and they stack cleanly on a narrow screen. */
.bys-rows {
    display: grid;
    gap: 10px;
}

.bys-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    padding: 16px 18px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    background: var(--white);
}

.bys-row__label {
    color: var(--charcoal);
    font-size: 0.9375rem;
    font-weight: 600;
}

.bys-row__value {
    color: var(--body);
    font-size: 0.9375rem;
}

.bys-row__value strong {
    color: var(--charcoal);
    font-weight: 600;
    white-space: nowrap;
}

/* Callout — reserved for genuinely critical information. Uses the brand's
   documented warning treatment (blush fill, rose left rule). */
.bys-callout {
    display: flex;
    gap: 14px;
    margin: 24px 0;
    padding: 18px 20px;
    border-left: 4px solid var(--rose);
    border-radius: 4px;
    background: #f9e9eb;
}

.bys-callout svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    color: var(--rose-deep);
}

.bys-callout__title {
    margin-bottom: 4px;
    color: var(--charcoal);
    font-size: 0.9375rem;
    font-weight: 600;
}

.bys-callout__text {
    color: var(--charcoal);
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* Support card closing the policy */
.bys-support {
    margin-top: clamp(40px, 5vw, 64px);
    padding: clamp(28px, 4vw, 40px);
    border-radius: 14px;
    background: var(--cream);
    text-align: center;
}

.bys-support__title {
    font-size: 1.25rem;
    font-weight: 500;
}

.bys-support__text {
    max-width: 46ch;
    margin: 8px auto 24px;
    font-size: 0.9375rem;
}

.bys-support__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

@media (max-width: 379px) {
    .bys-support__actions .bys-btn {
        flex: 1 1 100%;
    }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .bys-page *,
    .bys-page *::before,
    .bys-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
