:root {
    --ag-primary: #001f3f;
    --ag-secondary: #003d7a;
    --ag-accent: #4da3ff;
    --ag-btn-bg: #005ebb;
    --ag-btn-bg-hover: #004a94;
    --ag-bg: #0a1628;
    --ag-surface: #0f1f36;
    --ag-text: #e9ecef;
    --ag-muted: #8aa0b8;
    --ag-line: rgba(0, 116, 217, 0.45);
    --ag-on-primary: #ffffff;
    --ag-header-h: 64px;
    --ag-page-w: 1120px;
    --ag-font-h: "JetBrains Mono", ui-monospace, monospace;
    --ag-font-b: "Courier Prime", "Courier New", monospace;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; margin: 0; }
html { scroll-padding-top: var(--ag-header-h); }
body {
    padding-top: var(--ag-header-h);
    background-color: var(--ag-bg);
    background-image:
        linear-gradient(rgba(0, 116, 217, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 116, 217, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--ag-text);
    font: 16px/1.65 var(--ag-font-b);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ag-accent); }
a:hover { color: #4da3ff; }
h1, h2, h3 {
    font-family: var(--ag-font-h);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.6em;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }

.ag-container {
    width: 100%;
    max-width: var(--ag-page-w);
    margin: 0 auto;
    padding-inline: 20px;
}
.ag-section { padding-block: 56px; }
.ag-section-grid {
    background:
        linear-gradient(180deg, rgba(0, 31, 63, 0.55), rgba(10, 22, 40, 0.2));
    border-block: 1px solid var(--ag-line);
}
.ag-muted { color: var(--ag-muted); }
.ag-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ag-accent);
    margin-bottom: 0.75rem;
    font-family: var(--ag-font-h);
}
.ag-lead { font-size: 1.05rem; max-width: 38rem; }
.ag-prose { max-width: 42rem; }

@media (max-width: 768px) {
    .ag-section { padding-block: 40px; }
    .ag-container { padding-inline: 16px; }
}

/* Header */
.ag-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--ag-header-h);
    background: #0a1628;
    border-bottom: 1px solid var(--ag-line);
}
.ag-header-row {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
}
.ag-logo {
    display: flex;
    align-items: center;
    color: var(--ag-text);
    text-decoration: none;
    flex-shrink: 0;
}
.ag-logo .ag-logo-full { width: 180px; height: auto; display: block; }
.ag-logo .ag-logo-compact { width: 120px; height: auto; display: none; }
.ag-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}
.ag-nav a {
    color: var(--ag-text);
    text-decoration: none;
    font-family: var(--ag-font-h);
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
}
.ag-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 100%;
    bottom: -4px;
    height: 1px;
    background: var(--ag-accent);
    transition: right 0.25s ease;
}
.ag-nav a:hover::after,
.ag-nav a.is-active::after { right: 0; }
.ag-header-cta { order: 0; margin-left: 8px; }
.ag-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 11px;
    flex-shrink: 0;
    border: 1.5px solid var(--ag-line);
    background: var(--ag-surface);
    color: var(--ag-text);
    cursor: pointer;
}
.ag-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
}

@media (max-width: 1024px) {
    :root { --ag-header-h: 56px; }
    .ag-nav, .ag-header-cta { display: none; }
    .ag-burger { display: flex; margin-left: auto; }
    .ag-logo .ag-logo-full { display: none; }
    .ag-logo .ag-logo-compact { display: block; }
}

/* Drawer L9 #3 */
.ag-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.45);
}
.ag-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 120;
    width: min(75vw, 320px);
    height: 100dvh;
    background: #0a1628;
    border-left: 1px solid var(--ag-line);
    padding: 64px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}
.ag-drawer a {
    color: var(--ag-text);
    text-decoration: none;
    font-family: var(--ag-font-h);
    font-size: 1rem;
}
.ag-drawer-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--ag-line);
    background: transparent;
    color: var(--ag-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons — corner bracket */
.ag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1.5px solid transparent;
    font-family: var(--ag-font-h);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    isolation: isolate;
    white-space: nowrap;
    background: transparent;
    color: var(--ag-text);
}
.ag-btn::before,
.ag-btn::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--ag-accent);
    pointer-events: none;
}
.ag-btn::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.ag-btn::after { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }

a.ag-btn-primary, a.ag-btn-primary:visited, button.ag-btn-primary {
    color: var(--ag-on-primary);
    background: var(--ag-btn-bg);
    border-color: var(--ag-btn-bg);
}
a.ag-btn-primary:hover, a.ag-btn-primary:focus-visible, a.ag-btn-primary:active, button.ag-btn-primary:hover, button.ag-btn-primary:focus-visible, button.ag-btn-primary:active {
    color: var(--ag-on-primary);
    background: var(--ag-btn-bg-hover);
    border-color: var(--ag-btn-bg-hover);
}
a.ag-btn-ghost, a.ag-btn-ghost:visited, button.ag-btn-ghost {
    color: var(--ag-text);
    background: transparent;
    border-color: var(--ag-text);
}
a.ag-btn-ghost:hover, a.ag-btn-ghost:focus-visible, button.ag-btn-ghost:hover {
    color: #0a1628;
    background: var(--ag-text);
    border-color: var(--ag-text);
}
.ag-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 520px) {
    .ag-actions { flex-direction: column; align-items: stretch; }
    .ag-actions .ag-btn { white-space: normal; }
}

/* Layout L2 #2 sidebar right */
.ag-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 36px;
    align-items: start;
}
.ag-side-card {
    position: sticky;
    top: calc(var(--ag-header-h) + 16px);
    border: 1.5px solid var(--ag-line);
    background: transparent;
    padding: 18px;
}
.ag-side-title { font-size: 0.95rem; margin-bottom: 0.75rem; }
.ag-side-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.ag-side-list li { margin-bottom: 0.45rem; }
.ag-side-list a { color: var(--ag-text); text-decoration: none; font-family: var(--ag-font-h); font-size: 0.9rem; }
.ag-side-list a:hover { color: var(--ag-accent); }

@media (max-width: 900px) {
    .ag-layout { grid-template-columns: 1fr; }
    .ag-side-card { position: static; }
}

/* Hero L7 #1 */
.ag-hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}
.ag-hero-still {
    margin: 0;
    border: 1.5px solid var(--ag-line);
    overflow: hidden;
    background: #06101c;
    aspect-ratio: 16 / 9;
}
.ag-hero-still img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
@media (max-width: 768px) {
    .ag-hero-split { grid-template-columns: 1fr; }
}

/* Tiles — equal-height catalogue cards */
.ag-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 1.5rem;
}
@media (max-width: 720px) {
    .ag-tiles { grid-template-columns: 1fr; gap: 16px; }
}
.ag-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 1.5px solid var(--ag-line);
    background: rgba(15, 31, 54, 0.92);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.ag-tile:hover {
    border-color: var(--ag-accent);
    transform: translateY(-2px);
}
.ag-tile-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #06101c;
    flex-shrink: 0;
}
.ag-tile-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.ag-tile-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 18px 18px 16px;
    min-width: 0;
}
.ag-tile-body h3 { margin-bottom: 0.35em; }
.ag-tile-body > p { margin-bottom: 0.55em; }
.ag-tile-body .ag-muted { margin-bottom: 0.85em; }
.ag-tile-body .ag-actions {
    margin-top: auto;
    padding-top: 4px;
}
.ag-tag {
    display: inline-block;
    font-family: var(--ag-font-h);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ag-accent);
    margin-bottom: 0.45rem;
}

.ag-random { text-align: center; }
.ag-controls-card {
    border: 1.5px solid var(--ag-line);
    padding: 20px;
    max-width: 560px;
}
.ag-key-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.ag-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--ag-accent);
    font-family: var(--ag-font-h);
    font-size: 0.78rem;
    color: var(--ag-accent);
}
.ag-desk-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 1.25rem 0;
}
.ag-desk-preview .ag-tile { padding: 16px; }
.ag-cta { text-align: center; border-top: 1px solid var(--ag-line); }

/* Blur-in */
@media (prefers-reduced-motion: no-preference) {
    .ag-section {
        animation: ag-blur-in 0.55s ease both;
    }
    @keyframes ag-blur-in {
        from { opacity: 0; filter: blur(8px); }
        to { opacity: 1; filter: blur(0); }
    }
}

/* Inner pages */
.ag-page { padding-block: 40px 64px; }
.ag-page-title { margin-bottom: 0.4em; }
.ag-breadcrumb {
    font-size: 0.85rem;
    color: var(--ag-muted);
    margin-bottom: 1rem;
}
.ag-breadcrumb a { color: var(--ag-muted); }
.ag-checklist { list-style: none; padding: 0; }
.ag-checklist li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.65rem;
}
.ag-checklist li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.35em;
    width: 0.75rem; height: 0.75rem;
    border: 1.5px solid var(--ag-accent);
}
.ag-form {
    display: grid;
    gap: 14px;
    max-width: 480px;
}
.ag-form label { display: grid; gap: 6px; font-family: var(--ag-font-h); font-size: 0.88rem; }
.ag-form input, .ag-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--ag-line);
    background: var(--ag-surface);
    color: var(--ag-text);
    font: inherit;
}
.ag-form input:focus, .ag-form textarea:focus {
    outline: 2px solid var(--ag-accent);
    outline-offset: 1px;
}
.ag-thanks { border: 1.5px solid var(--ag-accent); padding: 16px; }

.ag-pinned {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 1.25rem 0 2rem;
}
.ag-pinned article, .ag-feed article {
    border: 1.5px solid var(--ag-line);
    padding: 16px;
}
.ag-feed { display: grid; gap: 12px; }

.ag-records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.ag-record {
    border: 1.5px solid var(--ag-line);
    padding: 16px;
}
.ag-record strong { display: block; font-family: var(--ag-font-h); font-size: 1.4rem; color: var(--ag-accent); }

/* Footer L4 #9 */
.ag-footer-band {
    background: var(--ag-secondary);
    padding: 22px 0;
}
.ag-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
}
.ag-footer-links a {
    color: #e9ecef;
    text-decoration: none;
    font-family: var(--ag-font-h);
    font-size: 0.88rem;
}
.ag-footer-legal {
    background: #050b14;
    padding: 28px 0 36px;
    color: #b8c4d4;
}
.ag-footer-legal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}
.ag-footer-legal a, .ag-footer-cookie {
    color: #e9ecef;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.ag-footer-note { font-size: 0.88rem; max-width: 52rem; }
.ag-footer-copy { font-size: 0.85rem; color: var(--ag-muted); }

/* Cookie L10 #4 */
.ag-cookie {
    position: fixed;
    z-index: 130;
    bottom: 16px;
    right: 16px;
    width: min(360px, calc(100% - 32px));
    border: 1.5px solid var(--ag-line);
    background: #0a1628;
    color: var(--ag-text);
    padding: 16px;
}
.ag-cookie:not([hidden]) { display: block; }
.ag-cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ag-cookie a { color: #9ec9ff; }

@media (max-width: 480px) {
    .ag-cookie { left: 12px; right: 12px; width: auto; }
}
