/*
 * Site chrome — the shared header and promo-banner styles.
 *
 * These are the "single elements" that span both halves of the site: the
 * marketing landing (public/landing.html) and the React app must render the
 * top brand row (DAILYN + Account) and the promo announcement bar
 * identically. Both pages link this file:
 *   - public/landing.html: <link href="/chrome.css">
 *   - index.html (React app): <link href="/chrome.css">
 *
 * Never restyle these elements inline on either surface — change the rule
 * here and both pages follow. Palette values come from /tokens.css.
 * The contract is enforced by src/__tests__/constants/chrome.test.ts.
 */

/* ---------------------------------------------------------------- header */

/* Layout row shared by every page header: brand left, nav link right.
   72rem/1rem match the app's former max-w-6xl px-4 py-5 container. */
.site-header {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
}

/* The DAILYN wordmark. Size and weight follow the app's brand row
   (text-2xl, regular Playfair) — the landing must not render it bolder,
   larger, or with a badge. */
.site-brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a.site-brand:hover {
    opacity: 0.8;
}

/* The Account / Sign In link. 15px keeps the visual size it had before
   the token audit switched the app's sans to Source Sans 3 (which renders
   smaller than the old system stack at 14px). */
.site-nav-link {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.4;
    font-weight: 400;
    color: #262626; /* neutral-800 from the app's tailwind scale */
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
    color: #030303; /* neutral-950 */
    text-decoration: underline;
}

/* ------------------------------------------------------------ promo bar */

@keyframes promoIn {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* An in-flow block at the very top of the page (it pushes the content down
   rather than floating over it) on both surfaces. */
.promo-bar {
    position: relative;
    z-index: 102;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 56px;
    background: var(--dark-bg);
    color: #f5f2ec;
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-align: center;
}

/* Entrance animation for the static landing; the React bar animates the
   same slide via framer-motion instead, so it omits this class. */
.promo-bar--animate {
    animation: promoIn 0.5s ease;
}

/* `display: flex` above would otherwise override the UA [hidden] rule
   (equal specificity), so the bar could never be hidden. Make the
   `hidden` attribute win so dismissing it actually removes it. */
.promo-bar[hidden] {
    display: none;
}

.promo-bar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.promo-main {
    font-size: 15px;
    letter-spacing: 0.01em;
}

.promo-main strong {
    font-weight: 700;
}

.promo-secondary {
    font-size: 12.5px;
    color: rgba(245, 242, 236, 0.62);
}

/* Offer-off fallback (landing): the founding line is hidden and the
   LAUNCH line is promoted to the only, full-size line. */
.promo-secondary--solo {
    font-size: 15px;
    letter-spacing: 0.01em;
    color: #f5f2ec;
}

.promo-code {
    position: relative;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(245, 242, 236, 0.92);
    border-bottom: 1px dashed rgba(245, 242, 236, 0.5);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.promo-code:hover {
    border-bottom-color: rgba(245, 242, 236, 0.9);
}

.promo-copied {
    position: absolute;
    top: calc(100% + 0.7rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.6rem;
    background: #ffffff;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.promo-bar.copied .promo-copied {
    opacity: 1;
}

.promo-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 1.4rem;
    height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.promo-close:hover,
.promo-close:focus-visible {
    color: #ffffff;
}

@media (max-width: 640px) {
    .promo-bar {
        padding: 8px 44px;
    }

    .promo-main {
        font-size: 13.5px;
    }

    .promo-secondary {
        display: none;
    }

    /* …but when it's the only line (offer off), keep it visible. */
    .promo-secondary--solo {
        display: inline;
        font-size: 13.5px;
    }
}
