:root {
    --bg: #090909;
    --bg-soft: #151515;
    --panel: rgba(19, 19, 19, 0.92);
    --panel-edge: #3a312a;
    --metal: #62564c;
    --brass: #bf8243;
    --copper: #d29a56;
    --ash: #bfb5a8;
    --text: #efe5d8;
    --muted: #b2a79a;
    --danger: #ff8c66;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(191, 130, 67, 0.12), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(210, 154, 86, 0.1), transparent 24%),
        linear-gradient(180deg, #080808 0%, #0d0d0d 45%, #090909 100%);
    color: var(--text);
    font-family: "Instrument Sans", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

code,
input,
textarea,
button {
    font-family: "IBM Plex Mono", "Cascadia Code", monospace;
}

.page-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.ambient {
    position: fixed;
    width: 26rem;
    height: 26rem;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(20px);
    opacity: 0.4;
}

.ambient-left {
    top: 6rem;
    left: -10rem;
    background: radial-gradient(circle, rgba(191, 130, 67, 0.22), transparent 64%);
}

.ambient-right {
    right: -12rem;
    bottom: 8rem;
    background: radial-gradient(circle, rgba(98, 86, 76, 0.34), transparent 62%);
}

.gear-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.gear {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(191, 130, 67, 0.15);
    background:
        radial-gradient(circle at center, transparent 0 28%, rgba(191, 130, 67, 0.28) 29% 31%, transparent 32%),
        repeating-conic-gradient(from 0deg, rgba(191, 130, 67, 0.18) 0deg 12deg, rgba(191, 130, 67, 0.04) 12deg 20deg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.35), inset 0 0 24px rgba(191, 130, 67, 0.08);
    opacity: 0.7;
}

.gear::after {
    content: "";
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    border: 1px solid rgba(191, 130, 67, 0.18);
    background: rgba(9, 9, 9, 0.85);
}

.gear-lg {
    width: 18rem;
    height: 18rem;
    top: 9rem;
    right: 5%;
    animation: spin-slow 26s linear infinite;
}

.gear-md {
    width: 10rem;
    height: 10rem;
    top: 22rem;
    right: 18%;
    animation: spin-reverse 18s linear infinite;
}

.gear-sm {
    width: 8rem;
    height: 8rem;
    left: 6%;
    top: 30rem;
    animation: spin-slow 16s linear infinite;
}

.gear-xs {
    width: 5rem;
    height: 5rem;
    left: 18%;
    top: 14rem;
    animation: spin-reverse 10s linear infinite;
}

.site-header,
.site-footer,
main {
    position: relative;
    z-index: 1;
}

.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background: rgba(12, 12, 12, 0.76);
    border-bottom: 1px solid rgba(98, 86, 76, 0.55);
}

.header-row,
.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand strong,
.site-footer strong {
    display: block;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: 2rem;
    letter-spacing: 0.08em;
    color: var(--brass);
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(210, 154, 86, 0.45);
    background:
        radial-gradient(circle at center, rgba(210, 154, 86, 0.3) 0 22%, transparent 23%),
        repeating-conic-gradient(from 0deg, rgba(191, 130, 67, 0.26) 0deg 14deg, rgba(98, 86, 76, 0.18) 14deg 26deg),
        linear-gradient(145deg, #1a1713, #0c0b0a);
    box-shadow: inset 0 0 14px rgba(191, 130, 67, 0.12), 0 0 18px rgba(191, 130, 67, 0.08);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 0.8rem;
    background: rgba(18, 18, 18, 0.82);
    border: 1px solid rgba(98, 86, 76, 0.58);
}

.language-switch a {
    padding: 0.55rem 0.8rem;
    border-radius: 0.55rem;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    transition: 180ms ease;
}

.language-switch a.is-active {
    color: #140f09;
    background: linear-gradient(135deg, var(--copper), var(--brass));
}

.language-switch a:hover {
    color: var(--text);
}

.site-nav a,
.button {
    border: 1px solid rgba(191, 130, 67, 0.32);
    padding: 0.75rem 1rem;
    border-radius: 0.7rem;
    transition: 180ms ease;
}

.site-nav a {
    font-size: 0.9rem;
    color: var(--muted);
    background: rgba(22, 22, 22, 0.72);
}

.site-nav a.is-active {
    color: #140f09;
    background: linear-gradient(135deg, var(--copper), var(--brass));
    border-color: rgba(210, 154, 86, 0.8);
}

.site-nav a:hover,
.button:hover,
.text-link:hover {
    transform: translateY(-1px);
    border-color: rgba(210, 154, 86, 0.75);
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 18px rgba(191, 130, 67, 0.12);
}

.hero {
    padding: 6.5rem 0 4rem;
    text-align: center;
}

.page-hero {
    padding: 5.5rem 0 2.5rem;
}

.page-title {
    margin: 0.4rem 0 1rem;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(3.5rem, 8vw, 5.4rem);
    letter-spacing: 0.06em;
    color: var(--brass);
}

.page-copy {
    width: min(760px, 100%);
    margin: 0;
    color: var(--ash);
    font-size: 1.05rem;
    line-height: 1.8;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1rem;
    color: var(--ash);
    font-size: 0.92rem;
}

.eyebrow,
.card-eyebrow,
.stat-label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--copper);
    font-size: 0.76rem;
}

.hero h1 {
    margin: 0.4rem 0 1rem;
    font-family: "Bebas Neue", Impact, sans-serif;
    font-size: clamp(5rem, 14vw, 8.5rem);
    line-height: 0.88;
    letter-spacing: 0.06em;
}

.hero h1 span {
    color: var(--brass);
    text-shadow: 0 0 24px rgba(191, 130, 67, 0.22);
}

.hero h1 em {
    font-style: normal;
    color: var(--copper);
    font-size: 0.56em;
    vertical-align: top;
}

.hero-copy {
    width: min(820px, 100%);
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--ash);
}

.hero-copy a,
.text-link,
.site-footer a {
    color: var(--copper);
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.button-primary {
    color: #140f09;
    background: linear-gradient(135deg, var(--copper), var(--brass));
}

.button-secondary {
    background: rgba(22, 22, 22, 0.72);
    color: var(--text);
}

.hero-panel,
.card-grid,
.resource-layout,
.tools-layout,
.split-layout {
    display: grid;
    gap: 1.2rem;
}

.hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2.8rem;
}

.hero-panel > div,
.panel {
    background:
        linear-gradient(180deg, rgba(29, 27, 24, 0.94), rgba(15, 15, 15, 0.96)),
        linear-gradient(145deg, rgba(210, 154, 86, 0.05), rgba(0, 0, 0, 0));
    border: 1px solid rgba(98, 86, 76, 0.68);
    border-radius: 1rem;
    padding: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 38px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(191, 130, 67, 0.04);
}

.hero-panel strong {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
}

.section {
    padding: 1rem 0 3rem;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.section-heading span {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, rgba(191, 130, 67, 0.42), transparent);
}

.section-heading h2,
.panel-heading h2,
.card h3,
.doctrine-panel h3 {
    margin: 0;
    font-family: "Bebas Neue", Impact, sans-serif;
    letter-spacing: 0.05em;
}

.section-heading h2 {
    font-size: 2.4rem;
    color: var(--copper);
    white-space: nowrap;
}

.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-up,
.split-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.card h3,
.panel h3 {
    font-size: 1.75rem;
    color: var(--text);
}

.card-cover,
.article-cover,
.cover-preview {
    width: 100%;
    border-radius: 0.9rem;
    object-fit: cover;
    border: 1px solid rgba(98, 86, 76, 0.65);
    background: rgba(8, 8, 8, 0.88);
}

.card-cover {
    aspect-ratio: 16 / 9;
    margin-bottom: 0.2rem;
}

.article-cover {
    aspect-ratio: 16 / 8;
    margin-bottom: 0.5rem;
}

.cover-preview {
    max-width: 30rem;
}

.card p,
.doctrine-copy p,
.panel p {
    margin: 0;
    line-height: 1.75;
    color: var(--muted);
}

.text-link {
    margin-top: auto;
    font-size: 0.92rem;
}

.tools-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.tool-panel {
    min-height: 100%;
}

.side-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-heading {
    margin-bottom: 1rem;
}

.panel-heading h2 {
    font-size: 2rem;
}

.tool-form {
    display: grid;
    gap: 1rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.field {
    display: grid;
    gap: 0.55rem;
}

.field span {
    color: var(--ash);
    font-size: 0.92rem;
}

input[type="text"],
input[type="password"],
textarea,
input[type="range"] {
    width: 100%;
}

input[type="text"],
input[type="password"],
textarea {
    border: 1px solid rgba(98, 86, 76, 0.75);
    border-radius: 0.75rem;
    padding: 0.95rem 1rem;
    background: rgba(10, 10, 10, 0.8);
    color: var(--text);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 8rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: rgba(210, 154, 86, 0.72);
    box-shadow: 0 0 0 3px rgba(210, 154, 86, 0.08);
}

input[type="range"] {
    accent-color: var(--copper);
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.option-grid label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.75rem;
    background: rgba(12, 12, 12, 0.7);
    border: 1px solid rgba(98, 86, 76, 0.55);
    color: var(--ash);
    font-size: 0.92rem;
}

.wide-option {
    grid-column: 1 / -1;
}

.result-panel {
    margin-top: 1.2rem;
    padding: 1rem;
    border-radius: 0.9rem;
    background:
        linear-gradient(180deg, rgba(17, 17, 17, 0.86), rgba(10, 10, 10, 0.94)),
        linear-gradient(145deg, rgba(210, 154, 86, 0.06), rgba(0, 0, 0, 0));
    border: 1px solid rgba(98, 86, 76, 0.65);
}

.result-panel code {
    display: block;
    margin: 0.7rem 0 0.5rem;
    padding: 1rem;
    border-radius: 0.7rem;
    overflow-wrap: anywhere;
    background: rgba(8, 8, 8, 0.88);
    color: #f6dfb5;
    font-size: 1.02rem;
}

.muted-copy {
    color: var(--muted);
    line-height: 1.7;
}

.meta-line,
.status-line {
    color: var(--ash);
    font-size: 0.9rem;
    line-height: 1.6;
}

.status-line {
    margin-top: 0.9rem;
    opacity: 0.82;
}

.error-copy {
    color: var(--danger);
    line-height: 1.7;
}

.success-copy {
    color: #9ad28c;
    line-height: 1.7;
}

.audit-head,
.audit-meta,
.doctrine-panel {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.audit-head strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.2rem;
}

.audit-meta {
    margin: 1rem 0;
    flex-wrap: wrap;
    color: var(--ash);
    font-size: 0.9rem;
}

.meter {
    margin-top: 1rem;
    height: 0.85rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(40, 36, 32, 0.85);
    border: 1px solid rgba(98, 86, 76, 0.65);
}

.meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7f4d2b, var(--brass), #f4be7f);
    box-shadow: 0 0 16px rgba(210, 154, 86, 0.28);
}

.feedback-list {
    margin: 1rem 0 0;
    padding-left: 1.15rem;
    color: var(--ash);
    line-height: 1.8;
}

.resource-layout {
    grid-template-columns: 1.25fr 1fr;
}

.threat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.threat-tags span {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(191, 130, 67, 0.32);
    background: rgba(17, 17, 17, 0.78);
    color: var(--ash);
    font-size: 0.88rem;
}

.site-footer {
    border-top: 1px solid rgba(98, 86, 76, 0.52);
    background: rgba(10, 10, 10, 0.7);
}

.site-footer p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    line-height: 1.7;
}

button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.7rem;
}

.chip-button {
    padding: 0.55rem 0.8rem;
    font-size: 0.88rem;
}

.chip-button.is-selected {
    background: linear-gradient(135deg, var(--copper), var(--brass));
    color: #140f09;
}

.filter-panel,
.filter-group,
.admin-stack,
.admin-form,
.inline-form {
    display: grid;
    gap: 1rem;
}

.article-admin-item {
    display: grid;
    gap: 1rem;
}

.admin-workspace {
    display: grid;
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 6.5rem;
    display: grid;
    gap: 1rem;
}

.admin-sidebar-head,
.admin-sidebar-note,
.admin-sidebar-nav,
.admin-main,
.admin-section,
.admin-list-panel,
.admin-editor-panel,
.admin-record-list {
    display: grid;
    gap: 1rem;
}

.admin-sidebar-nav {
    gap: 0.75rem;
}

.admin-sidebar-link {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(98, 86, 76, 0.6);
    background: rgba(12, 12, 12, 0.68);
    transition: 180ms ease;
}

.admin-sidebar-link strong {
    color: var(--text);
    font-size: 1rem;
}

.admin-sidebar-link span {
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-sidebar-link.is-active {
    border-color: rgba(210, 154, 86, 0.82);
    background: linear-gradient(145deg, rgba(210, 154, 86, 0.16), rgba(21, 18, 15, 0.94));
    box-shadow: inset 0 0 0 1px rgba(210, 154, 86, 0.14);
}

.admin-sidebar-link:hover {
    transform: translateY(-1px);
    border-color: rgba(210, 154, 86, 0.72);
}

.admin-flash {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.admin-section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-section-bar h2 {
    margin: 0;
}

.admin-manager-grid {
    display: grid;
    grid-template-columns: 24rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-single-grid {
    grid-template-columns: 20rem minmax(0, 1fr);
}

.admin-order-list {
    display: grid;
    gap: 0.75rem;
}

.admin-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(98, 86, 76, 0.58);
    background: rgba(10, 10, 10, 0.74);
}

.admin-order-item.is-dragging {
    opacity: 0.55;
}

.admin-order-item strong {
    display: block;
}

.admin-record-card {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(98, 86, 76, 0.55);
    background: rgba(11, 11, 11, 0.72);
}

.admin-record-card.is-active {
    border-color: rgba(210, 154, 86, 0.82);
    background: linear-gradient(145deg, rgba(210, 154, 86, 0.12), rgba(12, 12, 12, 0.9));
}

.admin-record-main {
    display: grid;
    gap: 0.35rem;
}

.admin-record-main strong {
    color: var(--text);
    font-size: 1rem;
}

.admin-record-main span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.admin-record-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.admin-record-actions .button,
.admin-order-item .button {
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
}

.article-admin-item.is-dragging {
    opacity: 0.55;
}

.admin-item-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.timeline {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: 1rem;
    align-items: start;
}

.timeline-date {
    color: var(--copper);
    font-family: "IBM Plex Mono", "Cascadia Code", monospace;
    font-size: 0.9rem;
    padding-top: 0.25rem;
}

.timeline-body {
    border-left: 1px solid rgba(191, 130, 67, 0.24);
    padding-left: 1rem;
}

.article-body {
    display: grid;
    gap: 1rem;
}

.pagination-panel {
    text-align: center;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.wide-field {
    grid-column: 1 / -1;
}

.auth-panel {
    max-width: 30rem;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    align-self: end;
    min-height: 100%;
}

.is-hidden {
    display: none !important;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@media (max-width: 980px) {
    .hero-panel,
    .three-up,
    .two-up,
    .tools-layout,
    .resource-layout,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .timeline-item,
    .admin-grid,
    .admin-workspace,
    .admin-manager-grid,
    .admin-single-grid {
        grid-template-columns: 1fr;
    }

    .doctrine-panel,
    .admin-item-toolbar,
    .admin-section-bar,
    .header-controls,
    .header-row,
    .footer-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-sidebar {
        position: static;
    }

    .site-nav {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 100%);
    }

    .hero {
        padding-top: 5rem;
    }

    .site-nav {
        display: grid;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .section-heading h2,
    .panel-heading h2 {
        font-size: 1.8rem;
    }

    .gear-lg {
        width: 12rem;
        height: 12rem;
        right: -2rem;
    }

    .gear-md {
        right: 20%;
        top: 17rem;
    }
}
