/* dommajs.org - the site's own look (see site.js). */

/* ---- The opening hero, lifted out of the body column by site.js ---------- */
.site-main > .site-hero {
    grid-column: 1 / -1;
    margin: 0;
    border-radius: 0;
}
/* Flush with the top of the page: no gap above it. */
.site-main:has(> .site-hero) { padding-top: 0; }

/* Page heroes at half the height they come with: less padding, no gap above the title. */
.hero.hero-responsive { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.hero.hero-responsive .hero-title { margin-top: 0; }
.hero.hero-responsive .hero-subtitle { margin-bottom: 0; }

/* Content above the ambient blobs. */
.hero.bg-ambient-float-blobs > *,
.djs-hero > *,
.djs-cms-band > * { position: relative; z-index: 1; }

/* ---- Home: the hero ---------------------------------------------------------- */
.djs-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem 3rem;
    background-color: var(--dm-background);
    color: var(--dm-text);
    overflow: hidden;
}

.djs-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* minmax: a long word must not widen the column past the screen */
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .djs-hero { padding: 3rem 2rem 3rem; }
    .djs-hero-grid { grid-template-columns: auto 1fr; gap: 3rem; align-items: center; }
}

.djs-hero-brand { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1rem; }

.djs-hero-logo {
    color: var(--dm-text);
    flex-shrink: 0;
    animation: djs-glow 3s ease-in-out infinite alternate;
}

@keyframes djs-glow {
    from { filter: drop-shadow(0 0 20px var(--dm-white-t30, rgba(255, 255, 255, .3))); }
    to   { filter: drop-shadow(0 0 40px var(--dm-white-t50, rgba(255, 255, 255, .5))); }
}

.djs-hero .djs-hero-name {
    margin: 0;
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
    color: var(--dm-text);
}

.djs-backronym {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    opacity: 0.9;
    color: var(--dm-text-secondary);
}
.djs-backronym strong { font-weight: 600; color: var(--dm-text); }

.djs-tagline {
    margin: 0 0 1.5rem;
    max-width: 600px;
    min-height: 3.2em;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--dm-text-secondary);
}

.djs-hero-cta { text-align: right; }

.djs-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    background: var(--dm-primary);
    color: var(--dm-text-inverse);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--dm-shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.djs-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(0, 0, 0, .3); color: var(--dm-text-inverse); }

/* The module tiles, grouped */
.djs-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1300px;
}

.djs-feature-group { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.djs-feature-group-label {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--dm-border);
    border-radius: 20px;
    background: var(--dm-surface-raised);
    color: var(--dm-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.djs-feature-group-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

.djs-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--dm-border);
    border-radius: 12px;
    background: var(--dm-surface-raised);
    color: var(--dm-text);
    text-align: center;
    text-decoration: none;
}
.djs-feature:hover { background: var(--dm-hover-bg, var(--dm-surface)); color: var(--dm-text); animation: djs-heartbeat 1.5s ease-in-out infinite; }

@keyframes djs-heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.djs-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-bottom: 0.5rem;
    color: var(--dm-primary);
}
.djs-feature-icon svg { width: 40px; height: 40px; }

.djs-feature-label { font-size: 0.875rem; opacity: 0.9; color: var(--dm-text-secondary); }

/* ---- Showcase index: the module cards ----------------------------------------- */
.djs-modules-group { margin: 0 0 3rem; }
.djs-modules-group > h2 { margin: 0 0 1.25rem; }
.djs-modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.djs-module-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.djs-module-card:hover { color: inherit; }
.djs-module-card .card-body { flex: 1; }
.djs-module-icon { display: inline-flex; margin-bottom: 0.75rem; color: var(--dm-primary); }
.djs-module-card .card-title { margin: 0 0 0.5rem; }
.djs-module-card .card-text { color: var(--dm-text-secondary); }
.djs-module-features { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.djs-module-features li { padding: 0.2rem 0; font-size: 0.875rem; color: var(--dm-text-muted); }
.djs-module-features li::before { content: '\2713'; margin-right: 0.5rem; color: var(--dm-primary); }
.djs-module-card .card-footer code { font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; }

/* ---- Home: the Domma CMS band ------------------------------------------------- */
/* Lifted out of the body column by site.js, like the hero: full width. */
.site-main > .djs-cms-band { grid-column: 1 / -1; margin-bottom: 0; }

.djs-cms-band {
    position: relative;
    margin: 4rem 0;
    padding: 5rem 0;
    overflow: hidden;
    background: linear-gradient(180deg,
        color-mix(in oklab, var(--dm-surface), var(--dm-primary) 6%) 0%,
        color-mix(in oklab, var(--dm-surface), var(--dm-primary) 2%) 100%);
    border-top: 1px solid var(--dm-border);
    border-bottom: 1px solid var(--dm-border);
}

.djs-cms-band-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.djs-cms-band .djs-cms-band-headline {
    margin: 0 0 1rem;
    min-height: 1.05em;
    font-size: clamp(2rem, 5.5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--dm-text);
    text-shadow: 0 2px 24px color-mix(in oklab, var(--dm-primary), transparent 65%);
}

.djs-cms-band-subhead {
    margin: 0 auto 1rem;
    max-width: 720px;
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 500;
    color: var(--dm-text);
}
.djs-cms-band-subhead strong { color: var(--dm-primary); font-weight: 700; }

.djs-cms-band-lead {
    margin: 0 auto 2.5rem;
    max-width: 640px;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--dm-text-secondary);
}

.djs-cms-band-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 760px;
    margin: 0 auto 2.5rem;
}

.djs-cms-stat {
    padding: 1.25rem 0.75rem;
    border: 1px solid var(--dm-border);
    border-radius: 12px;
    background: color-mix(in oklab, var(--dm-surface-raised), var(--dm-primary) 4%);
    backdrop-filter: blur(4px);
}

.djs-cms-stat-number {
    display: block;
    margin-bottom: 0.35rem;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1;
    color: var(--dm-primary);
    font-variant-numeric: tabular-nums;
}

.djs-cms-stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.3;
    color: var(--dm-text-secondary);
}

.djs-cms-band-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.djs-cms-band-cta .btn { min-width: 200px; }
.djs-cms-band-cta .btn-primary { font-size: 1.0625rem; padding: 0.85rem 1.75rem; }

.djs-cms-band-tagline { margin: 0; font-size: 0.85rem; letter-spacing: 0.02em; color: var(--dm-text-muted); }
.djs-cms-band-tagline .sep { margin: 0 0.5rem; opacity: 0.7; }

@media (max-width: 768px) {
    /* As specific as the rule it overrides (.djs-hero .djs-hero-name), or it never applies. */
    .djs-hero .djs-hero-name { font-size: clamp(2.5rem, 13vw, 3.25rem); }
    .djs-hero-brand { gap: 1rem; }
    .djs-hero-logo { width: 64px; height: auto; }
    .djs-hero-cta { text-align: left; }
    .djs-cms-band { padding: 3.5rem 0; margin: 2rem 0; }
    .djs-cms-band-stats { grid-template-columns: repeat(2, 1fr); max-width: 380px; }
    .djs-cms-band-cta { flex-direction: column; align-items: stretch; padding: 0 1.5rem; }
    .djs-cms-band-cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .djs-hero-logo, .djs-feature:hover { animation: none; }
}
html.dm-reduced-motion .djs-hero-logo,
html.dm-reduced-motion .djs-feature:hover { animation: none; }

/* ---- Seasonal celebrations: the sparkle disc (site.js), above the search button ---- */
.djs-celebrate {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.5rem;
}
.djs-celebrate-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--dm-border);
    border-radius: 9999px;
    background: var(--dm-surface);
    color: var(--dm-text);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: transform .2s ease, background .2s ease;
}
.djs-celebrate-toggle:hover { transform: scale(1.06); background: var(--dm-hover-bg, var(--dm-surface-raised)); }
.djs-celebrate-toggle.active { color: var(--dm-primary); border-color: var(--dm-primary); }
.djs-celebrate-levels {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.djs-celebrate:hover .djs-celebrate-levels,
.djs-celebrate:focus-within .djs-celebrate-levels { opacity: 1; visibility: visible; transform: none; }
.djs-celebrate-levels button {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--dm-border);
    border-radius: 4px;
    background: var(--dm-surface);
    color: var(--dm-text);
    font-size: 0.75rem;
    cursor: pointer;
}
.djs-celebrate-levels button.active { background: var(--dm-primary); border-color: var(--dm-primary); color: var(--dm-text-inverse); }

/* ---- The Domma version (site.js): under the brand, and in the footer ---- */
#site-navbar .navbar-brand { flex-wrap: wrap; }
#site-navbar .navbar-brand .djs-version {
    flex-basis: 100%;
    margin: 0.1rem 0 0 2.1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dm-text-muted);
    text-decoration: none;
}
#site-navbar .navbar-brand .djs-version:hover { color: var(--dm-primary); }
body.dm-vnav-collapsed #site-navbar .navbar-brand .djs-version { display: none; }
.djs-version-footer { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--dm-text-muted); }
.cms-footer-bottom .djs-version-footer { margin: 0; }
.djs-version-footer a { color: inherit; }

/* ---- The API reference table (/showcase/reference): calls and signatures as code ---- */
.djs-api-table td:nth-child(1),
.djs-api-table td:nth-child(4) { font-family: var(--dm-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 0.85rem; }
.djs-api-table td:nth-child(1) { white-space: nowrap; color: var(--dm-primary); }
.djs-api-table td:nth-child(3) { min-width: 14rem; }
.djs-api-table td:nth-child(4) { white-space: pre-wrap; word-break: break-word; min-width: 15rem; font-size: 0.8rem; }

/* ---- Changelog (/changelog): long file paths in old release notes wrap on a phone ---- */
.dm-progression-content code { overflow-wrap: anywhere; }
