@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    overscroll-behavior: none;
    --accent: #00cd9d;
    --accent-muted: rgba(0, 205, 157, 0.45);
    --bg-deep: #211e3b;
    --card-bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #555;
    --layout-gap: clamp(1rem, 4vw, 2rem);
    --container-padding: clamp(1rem, 4vw, 2em);
    --safe-bottom: max(1rem, env(safe-area-inset-bottom));
    --body-text: #2d2a35;
    --body-muted: #5c5666;
    --updates-orange: #d97706;
    --updates-orange-deep: #9a3412;
    --updates-bg: rgba(217, 119, 6, 0.1);
    --updates-border: rgba(217, 119, 6, 0.32);
    --rules-bg: rgba(0, 205, 157, 0.08);
    --rules-border: rgba(0, 205, 157, 0.28);
    --rules-label: #0a6b55;
    --updates-prose: #6d3810;
    --updates-prose-soft: #8a4a1a;
    --rules-prose: #0f4f42;
    --rules-prose-soft: #156b57;
    /* Preview scroll area — tall enough to show plenty of copy before fade */
    --guidelines-preview-max: min(28rem, 78vh);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.18);
}

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

html {
    height: 100%;
    background-color: #000;
}

body {
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}

.background {
    background-color: #000;
    background-image: linear-gradient(to top, #007459, #000);
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    width: 100%;
    padding-top: max(var(--layout-gap), env(safe-area-inset-top, 0px));
    padding-right: max(var(--layout-gap), env(safe-area-inset-right, 0px));
    padding-bottom: max(var(--safe-bottom), env(safe-area-inset-bottom, 0px));
    padding-left: max(var(--layout-gap), env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.page-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: var(--layout-gap);
    align-self: center;
    width: min(100%, 1200px);
    min-height: 0;
}

.site-top {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.site-links-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font: inherit;
    font-weight: 800;
    font-size: clamp(0.92rem, 2.7vw, 1.06rem);
    letter-spacing: 0.04em;
    text-transform: none;
    text-decoration: none;
    text-align: center;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: linear-gradient(
        115deg,
        #023933 0%,
        #064a43 22%,
        #0a6b5c 45%,
        #0b7565 58%,
        #0a6b5c 78%,
        #043d37 100%
    );
    background-size: 240% 100%;
    background-position: 0% 50%;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    padding: 0.7rem 1.65rem;
    min-height: 48px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 8px 28px rgba(0, 0, 0, 0.35),
        0 4px 22px rgba(0, 140, 118, 0.45);
    touch-action: manipulation;
    transition:
        transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1),
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        filter 0.22s ease;
    animation: site-links-btn-shimmer 4s ease-in-out infinite;
}

@keyframes site-links-btn-shimmer {
    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.site-links-btn:hover {
    transform: translateY(-2px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.55);
    filter: brightness(1.04);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.16) inset,
        0 10px 32px rgba(0, 0, 0, 0.38),
        0 6px 26px rgba(0, 120, 102, 0.5);
}

.site-links-btn:active {
    transform: translateY(0) scale(0.99);
    filter: brightness(0.96);
}

.site-links-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .site-links-btn {
        animation: none;
        background: linear-gradient(115deg, #043d37, #0a6b5c 52%, #0b7565);
        background-size: 100% 100%;
    }

    .site-links-btn:hover {
        transform: none;
    }
}

.layout {
    display: flex;
    flex-wrap: wrap;
    gap: var(--layout-gap);
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    min-height: 0;
}

/* Stack SpeakPipe first, guidelines below — matches “below” in the widgets CTA */
@media (max-width: 899px) {
    .layout {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: center;
    }

    .container {
        flex: 0 1 auto;
        width: min(100%, 560px);
    }
}

.container {
    box-sizing: border-box;
    background-color: var(--card-bg);
    border-radius: clamp(12px, 3vw, 20px);
    padding: var(--container-padding);
    border: 3px solid var(--accent);
    box-shadow: var(--shadow-card);
    flex: 1 1 min(100%, 360px);
    max-width: 560px;
    width: 100%;
    color: var(--text);
    min-height: 0;
}

.container--guidelines {
    color: var(--body-text);
    display: flex;
    flex-direction: column;
}

.container--widgets {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.widget-iframe {
    width: 100%;
    max-width: 100%;
    height: min(240px, 40vh);
    border: 0;
    display: block;
}

.widget-iframe--tall {
    height: min(400px, 55vh);
}

@media (min-width: 900px) {
    .layout {
        flex-wrap: nowrap;
        align-items: stretch;
    }

    /* Expanded guidelines can grow taller; don’t stretch the SpeakPipe card */
    @supports selector(:has(*)) {
        .layout:has(#guidelines-shell:not(.is-collapsed)) {
            align-items: flex-start;
        }
    }

    .container {
        flex: 1 1 0;
        max-width: none;
    }

    .widget-iframe {
        height: 240px;
    }

    .widget-iframe--tall {
        height: 400px;
    }

    .widgets-cta-dir--mobile {
        display: none;
    }

    .widgets-cta-dir--desktop {
        display: inline;
    }
}

/* Guidelines panel */
.guidelines-header {
    text-align: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.guidelines-title {
    margin: 0 0 0.85rem;
    line-height: 1.2;
    text-align: center;
}

.guidelines-title-line {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.35em 0.5em;
    max-width: 100%;
}

.guidelines-title-kicker {
    font-size: clamp(1.05rem, 3.8vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--accent);
}

.guidelines-title-main,
.guidelines-title-tag {
    font-size: clamp(1rem, 3.4vw, 1.35rem);
    font-weight: 700;
    color: var(--accent);
}

.guidelines-title-sep {
    color: var(--body-muted);
    font-weight: 600;
    font-size: clamp(1rem, 3.4vw, 1.35rem);
    opacity: 0.85;
}

.guidelines-cta,
.widgets-cta {
    margin: 0;
    font-size: clamp(0.84rem, 2.5vw, 0.95rem);
    line-height: 1.45;
    color: var(--body-text);
    text-align: center;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(0, 205, 157, 0.08);
    border: 1px solid rgba(0, 205, 157, 0.26);
    font-weight: 500;
}

.widgets-cta-dir--desktop {
    display: none;
}

.guidelines-body a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.guidelines-body a:hover {
    color: var(--accent-hover, var(--accent));
}

.guidelines-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Collapsed: grow with the stretched aside so the card matches the widgets column height */
.guidelines-shell.is-collapsed {
    flex: 1 1 auto;
    min-height: 0;
}

.guidelines-shell:not(.is-collapsed) {
    flex: 0 0 auto;
}

.guidelines-clip {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    min-height: 0;
}

.guidelines-shell.is-collapsed .guidelines-clip {
    flex: 0 0 auto;
    max-height: var(--guidelines-preview-max);
}

.guidelines-shell.is-collapsed .guidelines-clip::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    /* Taller band = longer, softer white fade into the preview */
    height: 10rem;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 32%,
        rgba(255, 255, 255, 0.18) 52%,
        rgba(255, 255, 255, 0.5) 74%,
        rgba(255, 255, 255, 0.92) 92%,
        var(--card-bg) 100%
    );
    pointer-events: none;
}

.guidelines-shell:not(.is-collapsed) .guidelines-clip::after {
    display: none;
}

.guidelines-body {
    overflow: visible;
}

.guidelines-toggle-wrap {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    padding-top: 0.65rem;
}

.guidelines-shell.is-collapsed .guidelines-toggle-wrap {
    margin-top: 0;
    padding-top: 0.65rem;
}

.guidelines-shell:not(.is-collapsed) .guidelines-toggle-wrap {
    padding-top: 0.65rem;
}

.guidelines-toggle {
    font: inherit;
    cursor: pointer;
    width: 100%;
    background: rgba(0, 205, 157, 0.12);
    color: #087a60;
    border: 1px solid rgba(0, 205, 157, 0.45);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    min-height: 44px;
    touch-action: manipulation;
    font-weight: 600;
    font-size: 0.95rem;
}

.guidelines-shell:not(.is-collapsed) .guidelines-toggle {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 999px;
}

.guidelines-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.guidelines-region {
    border-radius: clamp(10px, 2vw, 14px);
    padding: clamp(0.85rem, 3vw, 1.15rem);
    margin-bottom: 1.15rem;
}

.guidelines-region:last-child {
    margin-bottom: 0;
}

.guidelines-region-label {
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: left;
}

.guidelines-region--updates {
    background: var(--updates-bg);
    border: 1px solid var(--updates-border);
    padding: 0.5rem 0.65rem 0.55rem;
    margin-bottom: 0.85rem;
}

.guidelines-region--updates .guidelines-region-label {
    margin: 0 0 0.35rem;
    padding-bottom: 0.28rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
}

.guidelines-region--updates .guidelines-section {
    margin-bottom: 0.55rem;
}

.guidelines-region--updates .guidelines-section:last-child {
    margin-bottom: 0;
}

.guidelines-region--updates .guidelines-section h2 {
    font-size: clamp(0.78rem, 2.4vw, 0.88rem);
    margin: 0 0 0.3em;
    line-height: 1.28;
}

.guidelines-region--updates .guidelines-section p,
.guidelines-region--updates .guidelines-section li {
    font-size: clamp(0.74rem, 2.2vw, 0.82rem);
    line-height: 1.38;
    margin: 0 0 0.35em;
    color: var(--updates-prose);
}

.guidelines-region--updates .guidelines-section ul {
    margin: 0 0 0.35em;
    padding-left: 1rem;
}

.guidelines-region--updates .guidelines-section li {
    margin-bottom: 0.2em;
}

.guidelines-region--updates .guidelines-region-label {
    color: var(--updates-orange);
    border-bottom-color: var(--updates-border);
}

.guidelines-region--updates .guidelines-section h2 {
    color: var(--updates-orange-deep);
}

.guidelines-region--updates .guidelines-note {
    color: var(--updates-prose-soft) !important;
}

.guidelines-region--rules {
    background: var(--rules-bg);
    border: 1px solid var(--rules-border);
}

.guidelines-region--rules .guidelines-region-label {
    color: var(--rules-label);
    border-bottom-color: var(--rules-border);
}

.guidelines-region--rules .guidelines-section h2 {
    color: var(--accent);
}

.guidelines-region--rules .guidelines-section h3 {
    color: var(--rules-prose);
}

.guidelines-region--rules .guidelines-section p,
.guidelines-region--rules .guidelines-section li {
    color: var(--rules-prose);
}

.guidelines-region--rules .guidelines-note {
    color: var(--rules-prose-soft) !important;
}

.guidelines-region--rules .guidelines-sublist {
    margin: 0 0 0.85em;
    padding-left: 1.4rem;
    list-style-type: disc;
    list-style-position: outside;
}

.guidelines-region--rules .guidelines-sublist:last-child {
    margin-bottom: 0;
}

.guidelines-region--rules .guidelines-sublist li {
    color: var(--rules-prose);
    margin-bottom: 0.4em;
    line-height: 1.55;
    font-size: clamp(0.9rem, 2.8vw, 1rem);
    padding-left: 0.2rem;
}

.guidelines-region--rules .guidelines-sublist li:last-child {
    margin-bottom: 0;
}

.guidelines-region--rules .guidelines-sublist-note {
    list-style-type: circle;
    color: var(--rules-prose-soft);
    font-size: 0.92em;
}

.guidelines-section {
    margin-bottom: 1.5rem;
}

.guidelines-section:last-child {
    margin-bottom: 0;
}

.guidelines-section h2 {
    color: var(--accent);
    font-size: clamp(1rem, 3.2vw, 1.15rem);
    margin: 0 0 0.65em;
    line-height: 1.3;
    text-align: left;
}

.guidelines-section h3 {
    color: var(--body-text);
    font-size: clamp(0.95rem, 3vw, 1.05rem);
    margin: 1em 0 0.4em;
    line-height: 1.3;
    text-align: left;
}

.guidelines-section p,
.guidelines-section li {
    color: var(--body-text);
    text-align: left;
    line-height: 1.55;
    font-size: clamp(0.9rem, 2.8vw, 1rem);
    margin: 0 0 0.65em;
}

.guidelines-section ul {
    margin: 0 0 0.75em;
    padding-left: 1.25rem;
}

.guidelines-section li {
    margin-bottom: 0.35em;
}

.guidelines-note {
    color: var(--body-muted);
    font-size: 0.92em !important;
}

h1 {
    color: var(--accent);
    text-align: center;
}

p {
    color: inherit;
}

.roboto {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
}
