/* ════════════════════════════════════════════════════════════════
   Subscribe Link Generator — bespoke night hero + bookend + mobile fixes.
   Layout only; composes the shared night kit (components/night.css).
   Loaded after tools.css (which carries all the slg-* tool internals).
   The tool's #1 traffic page; also fixes a pre-existing 375px overflow
   (a wide .button--lg in the bottom CTA + long <code> blocks).
   ════════════════════════════════════════════════════════════════ */

/* ══ Hero — the premium do-first night surface ═════════════════════ */
.slgh-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-4);
    padding: var(--space-12) var(--space-6) var(--space-16);
    text-align: center;
}
.slgh-hero__bg,
.slgh-final__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.slgh-hero__grid {
    position: absolute;
    inset: -1px;
    background-image:
        linear-gradient(rgba(148, 163, 220, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 220, 0.055) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 78%);
    mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 78%);
}
.slgh-hero__graph {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 62%;
    opacity: 0.9;
}
.slgh-hero__graph-line {
    stroke-dasharray: 2700;
    stroke-dashoffset: 2700;
    animation: slgh-draw 1.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}
.slgh-hero__graph-fill { opacity: 0; animation: slgh-fade 1s ease 1s forwards; }
@keyframes slgh-draw { to { stroke-dashoffset: 0; } }
@keyframes slgh-fade { to { opacity: 1; } }

.slgh-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}
.slgh-hero__title {
    margin: var(--space-5) auto 0;
    max-width: 600px;
    font-size: clamp(2rem, 5vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.07;
    text-wrap: balance;
}
.slgh-hero__sub {
    max-width: 560px;
    margin: var(--space-4) auto 0;
    text-wrap: pretty;
}
/* Social-proof counter (JS-populated, hidden until then) reads on night */
.slgh-hero .slg-hero__counter {
    margin-top: var(--space-4);
    color: var(--night-text-dim, #b9c2e0);
}

.slgh-hero .night__eyebrow,
.slgh-hero .night__title,
.slgh-hero__sub {
    animation: slgh-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slgh-hero .night__title { animation-delay: 70ms; }
.slgh-hero__sub          { animation-delay: 140ms; }
@keyframes slgh-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .slgh-hero .night__eyebrow,
    .slgh-hero .night__title,
    .slgh-hero__sub { animation: none; }
    .slgh-hero__graph-line { animation: none; stroke-dashoffset: 0; }
    .slgh-hero__graph-fill { animation: none; opacity: 1; }
}

/* ══ Input action card — bridges onto the hero ═════════════════════ */
.slgh-workspace {
    position: relative;
    z-index: 2;
}
@media (min-width: 768px) {
    .slgh-workspace { margin-top: -44px; }
}
.subscribe-link-page .slg-input-label {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-gray-900);
    font-size: var(--font-size-base);
}
.subscribe-link-page .slg-input { height: 52px; }
.subscribe-link-page .slg-generate-btn { height: 52px; padding: 0 26px; font-weight: 700; }

/* Trust line + feature chips under the input */
.slgh-trust {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin: var(--space-4) 0 0;
}
.slgh-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-gray-600);
}
.slgh-trust i { color: var(--color-success); }
.slgh-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-gray-100);
}
.slgh-feature {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-gray-600);
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    padding: 6px 11px;
    border-radius: var(--radius-full);
}
.slgh-feature i { color: var(--color-primary); font-size: 0.8rem; }

/* ══ Bottom CTA — night bookend (replaces the old purple banner) ════ */
.slgh-final {
    position: relative;
    overflow: hidden;
    margin: var(--space-10) 0;
    padding: var(--space-12) var(--space-6);
    text-align: center;
    border-radius: var(--radius-2xl);
}
.slgh-final__inner {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: 0 auto;
}
.slgh-final .night__eyebrow { margin-bottom: var(--space-5); }
.slgh-final__title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 5vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--color-white);
    margin: 0;
    text-wrap: balance;
}
.slgh-final__title em { font-style: normal; color: #a5b4fc; }
.slgh-final__sub {
    max-width: 520px;
    margin: var(--space-4) auto var(--space-8);
    font-size: var(--font-size-lg);
    color: var(--night-text-dim, #b9c2e0);
    line-height: 1.6;
    text-wrap: pretty;
}
.slgh-final__hint {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin: var(--space-4) 0 0;
}

/* ══ Mobile P0 fixes — kill the 375px horizontal scroll ════════════
   The old .button--lg CTA rendered 392px wide; long <code> URLs in the
   educational content and anatomy could also poke past the viewport. */
.subscribe-link-page code {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
@media (max-width: 767px) {
    .slgh-hero {
        padding: var(--space-10) var(--space-5) var(--space-12);
        margin-bottom: 0;
    }
    .slgh-hero__sub { font-size: var(--font-size-base); }
    .subscribe-link-page .slg-input-row { flex-direction: column; }
    .subscribe-link-page .slg-generate-btn { width: 100%; }

    .slgh-final { padding: var(--space-10) var(--space-5); margin: var(--space-8) 0; }
    /* Any button inside the bookend fills the width and may wrap, never overflow */
    .slgh-final .button {
        max-width: 100%;
        white-space: normal;
    }

    /* The 6 output tabs overflow at 375px. The strip already scrolls, but the
       hidden scrollbar left no cue that UTM Tracking + Share Links exist off
       to the right. Fade the right edge so the cut-off tabs read as "scroll
       for more", and lift the tap targets to the 44px floor. Page-scoped so
       the shared .tabs component is untouched. */
    .subscribe-link-page .slg-tabs {
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent 99%);
        mask-image: linear-gradient(90deg, #000 85%, transparent 99%);
        padding-right: var(--space-6);
    }
    .subscribe-link-page .slg-tabs .tabs__item {
        min-height: 44px;
    }
    .subscribe-link-page .slg-share-actions .button--sm {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
