/* ==========================================================================
   AnarchyMod source mirror - anarchymod.2p2t.org
   Layered on top of main.css / navigation.css design tokens.
   ========================================================================== */

.am-main {
    padding-top: 72px;
    min-height: 100vh;
}

/* Anchor targets. The nav is fixed at 72px; this clears it plus a little air,
   so a jump never parks a heading underneath the nav and the tab strip. */
:target {
    scroll-margin-top: 96px;
}

.am-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------------------------------------------------------- hero ---- */

.am-hero {
    position: relative;
    padding: 56px 0 40px;
    border-bottom: 1px solid rgba(107, 159, 212, 0.18);
    background:
        radial-gradient(1200px 380px at 50% -12%, rgba(61, 106, 158, 0.28), transparent 70%),
        linear-gradient(180deg, #121820 0%, #0c1016 100%);
    overflow: hidden;
}

.am-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(107, 159, 212, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 159, 212, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}

.am-hero .am-container {
    position: relative;
    z-index: 1;
}

.am-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid rgba(107, 159, 212, 0.35);
    border-radius: 999px;
    background: rgba(61, 106, 158, 0.14);
    color: var(--neon-blue);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.am-eyebrow .am-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e05a5a;
    box-shadow: 0 0 0 3px rgba(224, 90, 90, 0.18);
}

.am-title {
    font-size: clamp(2rem, 5vw, 3.1rem);
    line-height: 1.12;
    margin: 0 0 14px;
    color: var(--white);
}

.am-title .am-title-accent {
    color: var(--neon-blue);
}

.am-lede {
    max-width: 78ch;
    color: var(--light-gray);
    font-size: 1.02rem;
    margin: 0 0 26px;
}

.am-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* --------------------------------------------------------------- alert ---- */

.am-alert {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid rgba(224, 90, 90, 0.4);
    border-left: 4px solid #e05a5a;
    border-radius: 8px;
    background: rgba(224, 90, 90, 0.08);
    margin: 26px 0 0;
}

.am-alert-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff8f8f;
}

/* Drawn rather than typed. Monocraft has no legible codepoint for a flag:
   U+2691 is a pole with two bars, which at UI size reads as an "F" with a
   line through it. */
.am-alert-icon svg {
    display: block;
    width: 26px;
    height: 26px;
}

.am-alert-body h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #ffb3b3;
}

.am-alert-body p {
    margin: 0 0 8px;
    color: var(--light-gray);
    font-size: 0.92rem;
}

.am-alert-body p:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------ sections ---- */

.am-section {
    padding: 56px 0;
    border-bottom: 1px solid rgba(107, 159, 212, 0.1);
}

.am-section:last-of-type {
    border-bottom: none;
}

.am-section-head {
    margin-bottom: 28px;
}

.am-section-head h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    margin: 0 0 10px;
    color: var(--white);
}

.am-section-head p {
    margin: 0;
    max-width: 80ch;
    color: var(--light-gray);
}

.am-kicker {
    display: block;
    color: var(--electric-blue);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------- tabs ---- */

/* Sits directly under the fixed 72px site nav. Sticky is a nicety: if an
   ancestor establishes a scroll container it simply stops sticking, and the
   strip is still correct in flow. */
.am-tabs {
    position: sticky;
    top: 72px;
    z-index: 900;
    background: rgba(12, 16, 22, 0.96);
    border-bottom: 1px solid rgba(107, 159, 212, 0.22);
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.9);
}

.am-tabs-inner {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.am-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 15px 16px 13px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--gray);
    font-family: inherit;
    font-size: 0.86rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.am-tab:hover {
    color: var(--white);
}

.am-tab:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: -2px;
}

.am-tab.is-active {
    color: var(--white);
    border-bottom-color: var(--neon-blue);
}

.am-tab-num {
    color: var(--electric-blue);
    font-size: 0.72rem;
    opacity: 0.75;
}

.am-tab.is-active .am-tab-num {
    opacity: 1;
}

/* A panel holds what used to be one or more full-width sections. hidden is
   restated because a later display rule on this class would otherwise beat
   the user-agent [hidden] rule and leak inactive panels onto the page. */
.am-tabpanel[hidden] {
    display: none;
}

.am-tabpanel .am-section {
    border-bottom: none;
}

/* Two former sections now share the default panel. */
.am-blocksplit {
    margin-top: 6px;
    padding-top: 44px;
    border-top: 1px solid rgba(107, 159, 212, 0.1);
}

/* Old #downloads / #code deep links have no element to land on any more.
   These empty targets absorb the scroll instead of letting the hash fail. */
.am-jump {
    display: block;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    line-height: 0;
    font-size: 0;
    overflow: hidden;
}

.am-tabpanel,
.am-jump {
    scroll-margin-top: 96px;
}

/* ------------------------------------------------------------- buttons ---- */

.am-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid var(--primary-blue);
    border-radius: 6px;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 0.9rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.am-btn:hover {
    transform: translateY(-1px);
    border-color: var(--neon-blue);
}

.am-btn:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}

.am-btn-ghost {
    background: transparent;
    border-color: rgba(107, 159, 212, 0.35);
}

.am-btn-ghost:hover {
    background: rgba(61, 106, 158, 0.14);
}

.am-btn-sm {
    padding: 7px 13px;
    font-size: 0.8rem;
}

/* ------------------------------------------------------------- credits ---- */

.am-credit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.am-credit {
    padding: 20px;
    border: 1px solid rgba(107, 159, 212, 0.2);
    border-radius: 8px;
    background: var(--gradient-secondary);
}

.am-credit-role {
    display: block;
    color: var(--electric-blue);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.am-credit h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--white);
}

.am-credit p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--light-gray);
}

.am-disclaimer {
    padding: 18px 20px;
    border: 1px dashed rgba(107, 159, 212, 0.35);
    border-radius: 8px;
    background: rgba(61, 106, 158, 0.08);
    color: var(--light-gray);
    font-size: 0.92rem;
}

.am-disclaimer strong {
    color: var(--white);
}

.am-disclaimer a {
    color: var(--neon-blue);
}

/* Static fallback links under the viewer. Kept as real anchors so the mirror
   is still browsable if the viewer script never runs. */
.am-fallback {
    margin-top: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(107, 159, 212, 0.22);
    border-radius: 8px;
    background: rgba(12, 16, 22, 0.55);
}

.am-fallback > p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--gray);
}

.am-fallback-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.am-fallback-list li {
    margin: 0;
}

.am-fallback-list a {
    display: block;
    padding: 5px 0;
    color: var(--neon-blue);
    font-size: 0.86rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(107, 159, 212, 0.12);
}

.am-fallback-list a:hover {
    color: var(--white);
    border-bottom-color: rgba(107, 159, 212, 0.45);
}

/* ------------------------------------------------------------ download ---- */

.am-dl-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 22px;
    align-items: start;
}

.am-dl-card {
    padding: 22px;
    border: 1px solid rgba(107, 159, 212, 0.2);
    border-radius: 8px;
    background: var(--gradient-secondary);
}

.am-dl-card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--white);
}

.am-dl-card p.am-dl-note {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: var(--gray);
}

.am-field {
    margin-bottom: 14px;
}

.am-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--light-blue);
    letter-spacing: 0.04em;
}

.am-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(107, 159, 212, 0.3);
    border-radius: 6px;
    background: var(--darker-blue);
    color: var(--white);
    font-family: inherit;
    font-size: 0.9rem;
}

.am-select:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 1px;
}

.am-jar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 16px;
}

.am-pill {
    padding: 4px 10px;
    border: 1px solid rgba(107, 159, 212, 0.25);
    border-radius: 999px;
    background: rgba(61, 106, 158, 0.12);
    color: var(--light-blue);
    font-size: 0.75rem;
}

.am-dl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.am-search {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(107, 159, 212, 0.25);
    border-radius: 6px;
    background: var(--darker-blue);
    color: var(--white);
    font-family: inherit;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.am-search::placeholder {
    color: var(--gray);
}

.am-version-list {
    max-height: 268px;
    overflow-y: auto;
    border: 1px solid rgba(107, 159, 212, 0.16);
    border-radius: 6px;
}

.am-version-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-bottom: 1px solid rgba(107, 159, 212, 0.1);
    background: transparent;
    color: var(--light-gray);
    font-family: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.am-version-row:last-child {
    border-bottom: none;
}

.am-version-row:hover {
    background: rgba(61, 106, 158, 0.14);
    color: var(--white);
}

.am-version-row.is-active {
    background: rgba(61, 106, 158, 0.26);
    color: var(--white);
}

.am-version-row .am-vr-mc {
    flex: 1;
}

.am-version-row .am-vr-java {
    color: var(--gray);
    font-size: 0.76rem;
}

.am-version-empty {
    padding: 16px;
    color: var(--gray);
    font-size: 0.85rem;
    text-align: center;
}

/* -------------------------------------------------------------- viewer ---- */

.am-viewer {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    border: 1px solid rgba(107, 159, 212, 0.22);
    border-radius: 8px;
    overflow: hidden;
    background: #0f1319;
}

.am-viewer-tree {
    border-right: 1px solid rgba(107, 159, 212, 0.18);
    background: #0d1116;
    display: flex;
    flex-direction: column;
    max-height: 660px;
}

.am-viewer-tree-head {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(107, 159, 212, 0.14);
    color: var(--light-blue);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.am-tree-scroll {
    overflow: auto;
    padding: 8px 0 12px;
    flex: 1;
}

.am-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.am-tree-list .am-tree-list {
    margin-left: 12px;
    border-left: 1px solid rgba(107, 159, 212, 0.12);
}

.am-tree-item {
    padding: 0;
}

.am-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--light-gray);
    font-family: inherit;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.am-tree-row:hover {
    background: rgba(61, 106, 158, 0.16);
    color: var(--white);
}

.am-tree-row.is-active {
    background: rgba(61, 106, 158, 0.3);
    color: var(--white);
}

.am-tree-row.is-dir {
    color: var(--light-blue);
}

.am-tree-icon {
    flex: 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    opacity: 0.85;
}

/* Inline SVG, not glyphs. Monocraft covers none of the symbols this tree used
   to draw with (U+25BE, U+25B8, U+2615, U+2261, U+2699, U+1F4D6, U+25A4,
   U+1F5BC, U+25A3), so the browser substituted unrelated letters. */
.am-tree-icon svg {
    display: block;
    width: 13px;
    height: 13px;
}

.am-tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.am-tree-size {
    margin-left: auto;
    padding-left: 8px;
    color: var(--gray);
    font-size: 0.7rem;
}

.am-viewer-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: 660px;
}

.am-viewer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(107, 159, 212, 0.16);
    background: #11161d;
}

.am-viewer-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--light-blue);
    font-size: 0.82rem;
}

.am-viewer-code {
    margin: 0;
    overflow: auto;
    flex: 1;
    font-size: 12.5px;
    line-height: 1.75;
    tab-size: 4;
}

.am-code-table {
    border-collapse: collapse;
    width: 100%;
    font-size: inherit;
}

.am-code-table td {
    vertical-align: top;
    padding: 0;
    border: none;
}

.am-ln {
    width: 1%;
    min-width: 52px;
    padding: 0 12px 0 14px !important;
    text-align: right;
    color: #46525f;
    user-select: none;
    background: #0d1116;
    border-right: 1px solid rgba(107, 159, 212, 0.12) !important;
    position: sticky;
    left: 0;
}

.am-code {
    padding: 0 18px !important;
    white-space: pre;
    color: #c9d4e0;
}

.am-viewer-status {
    padding: 26px 20px;
    color: var(--gray);
    font-size: 0.88rem;
    text-align: center;
}

.am-binary-note {
    padding: 26px 20px;
    color: var(--light-gray);
    font-size: 0.9rem;
    text-align: center;
}

.am-binary-note a {
    color: var(--neon-blue);
}

/* --- syntax highlighting (self-contained, no external deps) --- */

.am-code .tok-key { color: #c792ea; }
.am-code .tok-str { color: #a5d6a7; }
.am-code .tok-num { color: #f0a868; }
.am-code .tok-com { color: #5f6b7a; font-style: italic; }
.am-code .tok-ann { color: #ffcb6b; }
.am-code .tok-typ { color: #82aaff; }
.am-code .tok-fn  { color: #82d2ff; }
.am-code .tok-op  { color: #89ddff; }
.am-code .tok-tag { color: #f07178; }
.am-code .tok-attr { color: #ffcb6b; }

/* JSON / YAML keys */
.am-code .tok-keyjson { color: #82aaff; }

/* --------------------------------------------------------------- facts ---- */

.am-fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.am-fact {
    padding: 18px;
    border: 1px solid rgba(107, 159, 212, 0.18);
    border-radius: 8px;
    background: rgba(61, 106, 158, 0.07);
}

.am-fact-value {
    display: block;
    font-size: 1.55rem;
    color: var(--neon-blue);
    margin-bottom: 4px;
}

.am-fact-label {
    display: block;
    font-size: 0.8rem;
    color: var(--light-gray);
    line-height: 1.5;
}

.am-legal-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
    counter-reset: am-point;
}

.am-legal-list li {
    counter-increment: am-point;
    padding: 16px 18px 16px 54px;
    position: relative;
    border: 1px solid rgba(107, 159, 212, 0.16);
    border-left: 3px solid var(--primary-blue);
    border-radius: 6px;
    background: rgba(61, 106, 158, 0.06);
    color: var(--light-gray);
    font-size: 0.92rem;
}

/* Real numbering. Every item used to be stamped with an identical section
   sign, which looked like a bullet and carried no information. The counter
   follows the list, so inserting a point renumbers the rest by itself. */
.am-legal-list li::before {
    content: counter(am-point);
    position: absolute;
    left: 15px;
    top: 15px;
    min-width: 24px;
    padding: 2px 0;
    border-radius: 5px;
    background: rgba(61, 106, 158, 0.3);
    color: var(--neon-blue);
    font-size: 0.82rem;
    text-align: center;
}

.am-legal-list strong {
    color: var(--white);
}

.am-code-inline {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(107, 159, 212, 0.14);
    color: var(--light-blue);
    font-size: 0.86em;
}

.am-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 980px) {
    .am-dl-panel {
        grid-template-columns: 1fr;
    }

    .am-viewer {
        grid-template-columns: 1fr;
    }

    .am-viewer-tree {
        border-right: none;
        border-bottom: 1px solid rgba(107, 159, 212, 0.18);
        max-height: 300px;
    }

    .am-viewer-pane {
        max-height: 520px;
    }
}

@media (max-width: 640px) {
    .am-container {
        padding: 0 16px;
    }

    .am-hero {
        padding: 40px 0 32px;
    }

    .am-section {
        padding: 40px 0;
    }

    .am-hero-actions .am-btn,
    .am-dl-actions .am-btn {
        width: 100%;
    }

    .am-alert {
        flex-direction: column;
        gap: 10px;
    }

    .am-tabs-inner {
        /* Five labels do not fit; let the strip scroll instead of wrapping. */
        padding: 0 16px;
    }

    .am-tab {
        padding: 13px 12px 11px;
        font-size: 0.8rem;
    }

    .am-tab-num {
        display: none;
    }

    .am-viewer-code {
        font-size: 11.5px;
    }

    .am-tree-row {
        font-size: 0.78rem;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .am-btn {
        transition: none;
    }

    .am-btn:hover {
        transform: none;
    }
}
