/* ==========================================================================
   Scroll the Dice - brand palette and public website
   --------------------------------------------------------------------------
   The main palette is defined in inc/config.php and injected into every page
   by inc/brand_vars.php. Values here are fallbacks for standalone stylesheet
   loading, plus supporting pastel surfaces used by the landing page.
   ========================================================================== */
:root {
    --brand-primary: #176B57;
    --brand-accent:  #E7B94E;
    --brand-dark:    #123F35;
    --brand-ink:     #24352E;
    --brand-cream:   #FBFAF5;
    --brand-sand:    #F2EEE4;
    --brand-mint:    #E3EFE7;
    --brand-yellow:  #FBF0D3;
    --brand-peach:   #F8E4D9;
    --brand-sky:     #E3EEF0;
    --brand-lilac:   #ECE7F2;
    --brand-muted:   #647068;
    --brand-line:    #E6E3D9;
    --font-display:  "Lora", Georgia, serif;
}

html {
    scroll-behavior: smooth;
}

body {
    padding-top: 80px;
    font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
}

.site-nav {
    background: rgba(251, 250, 245, 0.94);
    border-bottom: 1px solid var(--brand-line);
}

.font-display {
    font-family: var(--font-display);
}

.site-footer {
    color: #fff;
    background: var(--brand-dark);
}

.footer-muted {
    color: #C6D5CD;
}

.footer-link {
    width: fit-content;
    color: #C6D5CD;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #fff;
}

/* Shared brand gradients now stay within the green / gold palette. */
.funky-gradient {
    background-image: linear-gradient(144deg, #23806A, var(--brand-primary) 60%);
}

.funky-gradient-muted {
    background-image: linear-gradient(144deg, var(--brand-mint), var(--brand-yellow));
}

/* Landing-page dice overlay + roll button */
.dice-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.dice-roll-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    background: var(--brand-primary);
    padding: 0.65rem 1.35rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 12px 24px rgba(18, 63, 53, 0.18);
    transition: transform 0.2s ease, background 0.2s ease;
}

.dice-roll-btn:hover:not(:disabled) {
    background: var(--brand-dark);
    transform: translateY(-2px);
}

.dice-roll-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dice-roll-result {
    min-height: 1.25rem;
}

/* Landing page foundations */
#index {
    color: var(--brand-ink);
    background: var(--brand-cream);
}

#index h1,
#index h2,
#index h3 {
    font-family: var(--font-display);
    letter-spacing: -0.035em;
}

#index a:focus-visible,
#index button:focus-visible {
    outline: 3px solid rgba(23, 107, 87, 0.28);
    outline-offset: 4px;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--brand-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
}

.section-kicker::before {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: var(--brand-accent);
    content: "";
}

.section-title {
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.13;
}

.accent-italic {
    color: var(--brand-primary);
    font-style: italic;
    font-weight: 500;
}

.btn-primary,
.btn-secondary,
.btn-sun,
.btn-outline-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    border: 1px solid var(--brand-primary);
    color: #fff;
    background: var(--brand-primary);
    box-shadow: 0 12px 24px rgba(18, 63, 53, 0.14);
}

.btn-primary:hover {
    background: var(--brand-dark);
    box-shadow: 0 16px 30px rgba(18, 63, 53, 0.2);
    transform: translateY(-2px);
}

.btn-secondary {
    border: 1px solid #DCD9CE;
    color: var(--brand-ink);
    background: rgba(255, 255, 255, 0.72);
}

.btn-secondary:hover {
    border-color: #C7C2B5;
    background: #fff;
    transform: translateY(-2px);
}

.btn-sun {
    border: 1px solid var(--brand-accent);
    color: var(--brand-dark);
    background: var(--brand-accent);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.btn-sun:hover {
    background: #F0C865;
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.42);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-2px);
}

/* Hero */
.landing-hero {
    background:
        radial-gradient(circle at 7% 9%, rgba(251, 240, 211, 0.72), transparent 27rem),
        var(--brand-cream);
}

.hero-orb {
    position: absolute;
    border-radius: 9999px;
    pointer-events: none;
}

.hero-orb-one {
    top: 8rem;
    right: -6rem;
    width: 16rem;
    height: 16rem;
    background: rgba(227, 238, 240, 0.72);
}

.hero-orb-two {
    bottom: 9rem;
    left: -4rem;
    width: 9rem;
    height: 9rem;
    background: rgba(248, 228, 217, 0.58);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid #D7E6DC;
    border-radius: 9999px;
    padding: 0.45rem 0.85rem;
    color: var(--brand-primary);
    background: #EDF4EE;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.hero-highlight {
    position: relative;
    display: inline-block;
    color: var(--brand-primary);
    font-style: italic;
    font-weight: 500;
}

.hero-highlight::after {
    position: absolute;
    right: 1%;
    bottom: -0.06em;
    left: 3%;
    height: 0.13em;
    border-bottom: 0.055em solid var(--brand-accent);
    border-radius: 50%;
    content: "";
    transform: rotate(-1.2deg);
}

.hero-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--brand-muted);
    transition: color 0.2s ease;
}

.hero-text-link::before {
    color: var(--brand-primary);
    content: "✓";
    font-weight: 700;
}

.hero-text-link:hover {
    color: var(--brand-primary);
}

.hero-visual {
    isolation: isolate;
}

.hero-visual::before {
    position: absolute;
    z-index: -2;
    inset: -2.5rem -1.5rem 2rem 2rem;
    border-radius: 48% 48% 2.5rem 2.5rem;
    background: var(--brand-mint);
    content: "";
    transform: rotate(1.5deg);
}

.hero-visual::after {
    position: absolute;
    z-index: -1;
    top: -3.25rem;
    right: 12%;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 9999px;
    background: #F2C35C;
    box-shadow: -23rem 5rem 0 -1.25rem #F4B8A0;
    content: "";
}

.hero-screenshot {
    border: 6px solid rgba(255, 255, 255, 0.94);
    border-radius: 1.5rem;
    box-shadow: 0 28px 70px -28px rgba(31, 57, 47, 0.35);
}

.hero-dice-screenshot {
    border: 5px solid #fff;
    border-radius: 1.15rem;
    box-shadow: 0 20px 45px -18px rgba(31, 57, 47, 0.35);
}

.hero-stats {
    border-top: 1px solid var(--brand-line);
    background: rgba(242, 238, 228, 0.62);
}

.hero-stat-value {
    color: var(--brand-primary);
    font-family: var(--font-display);
    font-weight: 600;
}

/* Showcase */
.story-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #E4DFCF;
    border-radius: 9999px;
    padding: 0.4rem 0.8rem;
    color: #625632;
    background: var(--brand-yellow);
    font-size: 0.75rem;
    font-weight: 600;
}

.story-card {
    overflow: hidden;
    border: 1px solid var(--brand-line);
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 18px 45px -32px rgba(31, 57, 47, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.story-card:hover {
    box-shadow: 0 24px 55px -30px rgba(31, 57, 47, 0.34);
    transform: translateY(-4px);
}

.story-card > img,
.story-card > div > img {
    padding: 0.6rem;
    border-radius: 1.35rem;
}

.story-card figcaption {
    padding: 1.25rem 1.5rem 1.5rem;
}

.story-card figcaption > p:first-child {
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Access */
.access-section {
    background: var(--brand-sand);
}

.access-panel {
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 24px 60px -42px rgba(49, 61, 51, 0.4);
}

.access-code {
    border: 1px dashed #D4A83E;
    border-radius: 0.9rem;
    color: var(--brand-dark);
    background: var(--brand-yellow);
    transition: background 0.2s ease;
}

.access-code:hover {
    background: #F8E6B8;
}

.access-step {
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 1.25rem;
    padding: 1.25rem;
}

.access-step-mint { background: var(--brand-mint); }
.access-step-yellow { background: var(--brand-yellow); }
.access-step-peach { background: var(--brand-peach); }

/* Editor */
.editor-section {
    color: var(--brand-ink);
    background: var(--brand-mint);
}

.editor-feature {
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 40px -34px rgba(31, 57, 47, 0.45);
}

.feature-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
}

.feature-number {
    color: #87958D;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-style: italic;
}

.feature-title {
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
}

#editor .text-white { color: var(--brand-ink); }
#editor .text-gray-400 { color: #5D6B64; }
#editor .text-gray-200 { color: var(--brand-primary); }

.editor-figure {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 45px -34px rgba(31, 57, 47, 0.4);
}

.editor-figure > img {
    padding: 0.6rem;
    border-radius: 1.35rem;
}

.editor-figure figcaption > p:first-child {
    font-family: var(--font-display);
    font-size: 1.25rem;
}

/* Written responses */
.question-section {
    background: var(--brand-cream);
}

.question-panel {
    border: 1px solid #F1DCD1;
    border-radius: 2rem;
    background: var(--brand-peach);
    box-shadow: 0 24px 60px -44px rgba(91, 57, 43, 0.38);
}

.question-card {
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 1.25rem;
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.78);
}

.question-card > p:first-child {
    font-family: var(--font-display);
    font-size: 1.1rem;
}

/* Mechanics */
.mechanic-card {
    display: flex;
    height: 100%;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 1.5rem;
    padding: 1.6rem;
}

.mechanic-mint { background: var(--brand-mint); }
.mechanic-yellow { background: var(--brand-yellow); }
.mechanic-peach { background: var(--brand-peach); }

.mechanic-card pre {
    border-radius: 1rem;
    background: var(--brand-dark);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.mechanic-inset {
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.64);
}

.mechanics-table {
    overflow-x: auto;
    border: 1px solid var(--brand-line);
    border-radius: 1.25rem;
    background: #fff;
}

.mechanics-table thead {
    color: var(--brand-ink);
    background: var(--brand-sand);
}

/* Closing CTA */
.closing-cta {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: var(--brand-dark);
}

.closing-cta::before,
.closing-cta::after {
    position: absolute;
    border-radius: 9999px;
    content: "";
    pointer-events: none;
}

.closing-cta::before {
    top: -8rem;
    left: -5rem;
    width: 22rem;
    height: 22rem;
    background: rgba(227, 239, 231, 0.08);
}

.closing-cta::after {
    right: -4rem;
    bottom: -9rem;
    width: 20rem;
    height: 20rem;
    background: rgba(231, 185, 78, 0.1);
}

#index .closing-cta .text-gray-400,
#about .closing-cta .text-gray-400 {
    color: #CBD9D2;
}

/* About page */
#about {
    color: var(--brand-ink);
    background: var(--brand-cream);
}

#about h1,
#about h2,
#about h3 {
    font-family: var(--font-display);
    letter-spacing: -0.035em;
}

#about a:focus-visible,
#about button:focus-visible {
    outline: 3px solid rgba(23, 107, 87, 0.28);
    outline-offset: 4px;
}

.about-portrait {
    position: relative;
    isolation: isolate;
}

.about-portrait::before {
    position: absolute;
    z-index: -1;
    inset: -1.5rem -0.5rem 2.5rem 1.5rem;
    border-radius: 48% 48% 2.5rem 2.5rem;
    background: var(--brand-mint);
    content: "";
    transform: rotate(2deg);
}

.about-photo {
    position: relative;
    z-index: 1;
    border: 7px solid #fff;
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 28px 70px -28px rgba(31, 57, 47, 0.35);
    transform: rotate(-1.4deg);
}

.about-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1rem;
}

.about-photo-caption {
    padding: 0.85rem 0 0.3rem;
    color: var(--brand-muted);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
}

.about-name-tag {
    position: absolute;
    z-index: 2;
    border: 1px solid var(--brand-line);
    border-radius: 9999px;
    padding: 0.35rem 0.9rem;
    color: var(--brand-primary);
    background: var(--brand-cream);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-style: italic;
    box-shadow: 0 10px 22px -14px rgba(31, 57, 47, 0.5);
}

.about-name-tag-left {
    bottom: 20%;
    left: -0.75rem;
}

.about-name-tag-right {
    top: 16%;
    right: -0.9rem;
}

.about-card {
    height: 100%;
    border: 1px solid var(--brand-line);
    border-radius: 1.5rem;
    padding: 1.75rem;
    background: #fff;
    box-shadow: 0 18px 45px -32px rgba(31, 57, 47, 0.28);
}

.about-card-quote {
    color: var(--brand-primary);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.4;
}

.about-timeline {
    background: var(--brand-sand);
}

.about-timeline-list {
    position: relative;
    display: grid;
    gap: 1.75rem;
    margin-top: 3rem;
}

.about-timeline-list::before {
    position: absolute;
    top: 0.6rem;
    bottom: 0.6rem;
    left: 4.4rem;
    width: 1px;
    background: #D8D2C2;
    content: "";
}

.about-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 4.4rem 1fr;
    gap: 2.25rem;
}

.about-timeline-item::before {
    position: absolute;
    top: 0.45rem;
    left: 4.4rem;
    width: 0.65rem;
    height: 0.65rem;
    margin-left: -0.325rem;
    border-radius: 9999px;
    background: var(--brand-accent);
    box-shadow: 0 0 0 4px var(--brand-sand);
    content: "";
}

.about-timeline-year {
    padding-top: 0.1rem;
    padding-right: 0.9rem;
    color: var(--brand-primary);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.about-timeline-body {
    border: 1px solid var(--brand-line);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    box-shadow: 0 18px 45px -38px rgba(31, 57, 47, 0.4);
}

.about-timeline-title {
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
}

.about-makers {
    background: var(--brand-mint);
}

.about-maker {
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 1.5rem;
    padding: 1.75rem;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 45px -34px rgba(31, 57, 47, 0.4);
}

.about-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    color: #fff;
    background: var(--brand-primary);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
}

@media (max-width: 1023px) {
    .hero-visual {
        margin-top: 1.5rem;
    }

    .hero-visual::before {
        inset: -1.5rem 0 2rem 1rem;
    }
}

@media (max-width: 639px) {
    body {
        padding-top: 64px;
    }

    .hero-visual::after {
        right: 8%;
        width: 3rem;
        height: 3rem;
        box-shadow: none;
    }

    .hero-screenshot {
        border-width: 4px;
        border-radius: 1rem;
    }

    .access-panel,
    .question-panel {
        border-radius: 1.5rem;
    }

    .about-name-tag-left {
        bottom: 14%;
        left: 0.5rem;
    }

    .about-name-tag-right {
        top: 6%;
        right: 0.5rem;
    }

    .about-timeline-list::before {
        left: 0.4rem;
    }

    .about-timeline-item {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding-left: 1.75rem;
    }

    .about-timeline-item::before {
        top: 0.55rem;
        left: 0.4rem;
    }

    .about-timeline-year {
        padding-top: 0;
        padding-right: 0;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .story-card,
    .btn-primary,
    .btn-secondary,
    .btn-sun,
    .btn-outline-light,
    .dice-roll-btn {
        transition: none;
    }
}
