/* ==========================================================================
   Syntax State RP
   Design tokens, then base, layout, components, pages.
   ========================================================================== */

:root {
    color-scheme: dark;

    --bg: #13100e;
    --bg-alt: #181410;
    --surface: #1d1814;
    --surface-2: #26201b;
    --border: #322a24;
    --border-strong: #463b32;

    --text: #f4eee7;
    --text-muted: #a89d92;

    --accent: #f26b1d;
    --accent-hover: #ff8540;
    --on-accent: #1c0d04;

    --c-cop: #a9b4be;
    --c-gold: #e9b44c;
    --c-red: #ec5b55;
    --c-green: #5cbf8c;
    --c-ember: #f26b1d;
    --c-sand: #c9b8a6;

    --header-bg: rgba(19, 16, 14, 0.9);
    --overlay: rgba(8, 5, 3, 0.74);
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
    --ease: cubic-bezier(.22, .61, .36, 1);

    --radius: 8px;
    --radius-lg: 12px;
    --header-h: 68px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

[data-theme="light"] {
    color-scheme: light;

    --bg: #faf7f3;
    --bg-alt: #f3ede6;
    --surface: #ffffff;
    --surface-2: #f4eee7;
    --border: #e6ddd3;
    --border-strong: #cfc3b6;

    --text: #1d1713;
    --text-muted: #5d5249;

    --accent: #c2410c;
    --accent-hover: #a63608;
    --on-accent: #ffffff;

    --c-cop: #4e5b67;
    --c-gold: #8f5f00;
    --c-red: #b93a35;
    --c-green: #17794a;
    --c-ember: #c2410c;
    --c-sand: #6e5d4c;

    --header-bg: rgba(250, 247, 243, 0.92);
    --overlay: rgba(29, 23, 19, 0.5);
    --shadow: 0 14px 36px rgba(60, 40, 20, 0.14);
}

/* --- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; font-weight: 650; color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

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

.skip-link {
    position: absolute; left: 16px; top: -48px; z-index: 3000;
    background: var(--accent); color: var(--on-accent);
    padding: 8px 14px; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.icon { width: 1em; height: 1em; flex: none; }

/* --- Header and navigation --------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header { transition: box-shadow .3s var(--ease), background-color .3s var(--ease); }
.site-header.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.scroll-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }

.nav-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 36px; height: 36px; object-fit: contain; }
.brand-name span { color: var(--accent); }

.primary-nav { display: flex; align-items: center; flex: 1; justify-content: space-between; gap: 16px; }

.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list > li { position: relative; }

.nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 6px;
    background: none; border: 0; cursor: pointer;
    color: var(--text-muted); font-size: 0.9375rem; font-weight: 500;
    position: relative;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav-link::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link:hover::after { transform: scaleX(.5); }
.nav-link.active, .has-sub.active > .nav-link { color: var(--text); }
.nav-link.active::after, .has-sub.active > .nav-link::after { transform: scaleX(1); }
.nav-link .chev { width: 14px; height: 14px; transition: transform .15s; }
.has-sub.open > .nav-link .chev { transform: rotate(180deg); }

.sub-menu {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.has-sub::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
.has-sub:hover > .sub-menu,
.has-sub.open > .sub-menu,
.has-sub:has(:focus-visible) > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.sub-menu a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--text); }
.sub-menu a:hover { background: var(--surface-2); color: var(--text); }
.sub-menu a strong { display: block; font-size: 0.9375rem; font-weight: 600; }
.sub-menu a span { display: block; font-size: 0.8125rem; color: var(--text-muted); margin-top: 1px; }
.sub-menu a[aria-current="page"] strong { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 6px; cursor: pointer;
    background: transparent; border: 1px solid var(--border); color: var(--text-muted);
    transition: color .15s, border-color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }

.nav-toggle { display: none; margin-left: auto; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 6px; cursor: pointer;
    font-size: 0.9375rem; font-weight: 600; line-height: 1.2; text-decoration: none;
    border: 1px solid transparent;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface); border-color: var(--text-muted); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.875rem; }
.btn-block { width: 100%; }

.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9375rem; }
.text-link .icon { width: 16px; height: 16px; transition: transform .15s; }
a:hover > .text-link .icon, .text-link:hover .icon { transform: translateX(2px); }

/* --- Hero --------------------------------------------------------------- */
.hero {
    padding: 96px 0 88px;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(90deg, var(--bg) 0%, var(--bg) 40%, color-mix(in srgb, var(--bg) 62%, transparent) 68%, color-mix(in srgb, var(--bg) 30%, transparent) 100%),
        url('images/web/city-night.webp') center / cover no-repeat,
        var(--bg);
    position: relative;
}
.hero > .container { position: relative; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 56px; align-items: center; }

.eyebrow { display: inline-block; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }

.hero h1 { font-size: clamp(2.125rem, 4.6vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 20px; }
.hero-desc { font-size: 1.125rem; color: var(--text-muted); max-width: 56ch; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-side { display: grid; gap: 16px; }
.hero-banner { border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; aspect-ratio: 16 / 9; background: #000; box-shadow: var(--shadow); }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; }

/* Images fade in once loaded (only when JavaScript is running) */
.media { background: var(--surface-2); overflow: hidden; }
.js .fade-img { opacity: 0; transition: opacity .5s ease; }
.js .fade-img.loaded { opacity: 1; }
.js .fade-img.img-failed { opacity: 0; }

.info-panel { background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.info-panel h2 { font-size: 1rem; margin-bottom: 16px; }
.info-list { display: grid; gap: 0; margin: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 0.9375rem; }
.info-list > div:first-child { border-top: 0; padding-top: 0; }
.info-list dt { color: var(--text-muted); }
.info-list dd { margin: 0; font-weight: 600; text-align: right; }
.info-list dd a { font-weight: 600; }

/* --- Sections ----------------------------------------------------------- */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); margin-bottom: 12px; letter-spacing: -0.02em; }
.section-head p { color: var(--text-muted); font-size: 1.0625rem; }

/* --- Tags --------------------------------------------------------------- */
.tag, .citizen-badge, .role-tag, .card-badge {
    --c: var(--accent);
    display: inline-block; width: fit-content;
    padding: 3px 9px; border-radius: 4px;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.4;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.citizen-badge.gang { --c: var(--c-red); }
.citizen-badge.cop  { --c: var(--c-cop); }
.citizen-badge.biz  { --c: var(--c-gold); }
.citizen-badge.ems  { --c: var(--c-green); }
.role-tag.dev     { --c: var(--c-ember); }
.role-tag.admin   { --c: var(--c-gold); }
.role-tag.support { --c: var(--c-sand); }

/* --- Cards -------------------------------------------------------------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 28px; display: flex; flex-direction: column;
    transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.feature-card { cursor: pointer; }
.feature-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }

.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-num { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.card h3 { font-size: 1.1875rem; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: 0.9688rem; }
.card .text-link { margin-top: 20px; }
.card-badge { --c: var(--accent); }

/* --- Gallery ------------------------------------------------------------ */
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.gallery-item {
    margin: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; cursor: pointer; transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.gallery-item:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery-media { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.gallery-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .5s ease; }
.gallery-item:hover .gallery-media img { transform: scale(1.03); }
.img-missing > img { visibility: hidden; }
.gallery-caption { padding: 16px 18px 18px; }
.gallery-caption h3 { font-size: 1rem; margin-bottom: 4px; }
.gallery-caption p { font-size: 0.875rem; color: var(--text-muted); }

/* --- Tabs --------------------------------------------------------------- */
.tabs-container { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.tab-btn {
    background: none; border: 0; cursor: pointer;
    padding: 12px 16px; margin-bottom: -1px;
    font-size: 0.9375rem; font-weight: 600; color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: paneIn .4s var(--ease) both; }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Filter bar on the roster page: wrapping chips with square corners */
.filter-container { border-bottom: 0; gap: 8px; margin-bottom: 32px; }
.filter-container .tab-btn {
    margin: 0; padding: 7px 12px; font-size: 0.8125rem;
    border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
}
.filter-container .tab-btn:hover { border-color: var(--border-strong); }
.filter-container .tab-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* --- Citizens, organisations, gangs ------------------------------------ */
.citizens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

.citizen-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px; cursor: pointer; text-align: left;
    transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.citizen-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.citizen-avatar-wrap { order: 0; width: 88px; height: 88px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.citizen-img { width: 100%; height: 100%; object-fit: cover; }
.citizen-card .citizen-badge { order: 1; }
.citizen-info { order: 2; }
.citizen-info h3 { font-size: 1.125rem; margin-bottom: 4px; }
.citizen-rank { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.citizen-org { font-size: 0.9063rem; color: var(--text-muted); }

/* Departments cards on the home page */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; max-width: 920px; }
.dept-card { color: inherit; overflow: hidden; padding: 0; }
.dept-card:hover { color: inherit; border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.dept-media { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.dept-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .5s ease; }
.dept-card:hover .dept-media img { transform: scale(1.03); }
.dept-body { padding: 24px 28px 28px; display: flex; flex-direction: column; flex: 1; }
.dept-body .text-link { margin-top: auto; padding-top: 20px; color: var(--accent); }

/* --- Team --------------------------------------------------------------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.team-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 16px 16px 22px; cursor: pointer; text-align: left;
    transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.team-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.team-card.hiding { display: none; }
.avatar-container.square {
    width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden;
    background: var(--surface-2); margin-bottom: 16px;
}
.team-img { width: 100%; height: 100%; object-fit: cover; }
.team-card h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.role-tag { margin-bottom: 12px; }
.team-work { color: var(--text-muted); font-size: 0.9063rem; line-height: 1.5; }
.section-actions { margin-top: 40px; }

/* --- How to join -------------------------------------------------------- */
.steps-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; counter-reset: step; }
.step { transition: border-color .25s var(--ease), transform .25s var(--ease); }
.step:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.step { display: flex; flex-direction: column; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); color: var(--accent); font-weight: 700; font-size: 0.9375rem; margin-bottom: 18px; }
.step h3 { font-size: 1.1875rem; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 0.9688rem; margin-bottom: 20px; }
.step .btn, .step .address-box { margin-top: auto; }

.address-box { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 8px 8px 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); }
.address-box code { font-family: var(--mono); font-size: 0.9063rem; flex: 1; overflow-wrap: anywhere; }

/* --- Contact ------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.contact-card h3 { font-size: 1.1875rem; margin-bottom: 10px; }
.contact-card > p { color: var(--text-muted); font-size: 0.9688rem; margin-bottom: 20px; }
.link-list { display: grid; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); color: var(--text); font-weight: 500; }
.link-list a:first-child { border-top: 0; padding-top: 4px; }
.link-list a:hover { color: var(--accent); }
.link-list .icon { width: 16px; height: 16px; color: var(--text-muted); }

/* --- Sub page header ---------------------------------------------------- */
.page-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; color: var(--border-strong); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 500; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.page-hero-media { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow); }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero h1 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); letter-spacing: -0.02em; margin-bottom: 10px; }
.page-hero p { color: var(--text-muted); font-size: 1.0625rem; max-width: 62ch; }
.page-body { padding: 48px 0 88px; min-height: 60vh; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 56px 0 28px; font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; padding-bottom: 40px; }
.footer-brand p { color: var(--text-muted); margin-top: 14px; max-width: 38ch; font-size: 0.9063rem; }
.site-footer h2 { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; font-weight: 600; }
.site-footer ul { display: grid; gap: 10px; }
.site-footer ul a { color: var(--text); }
.site-footer ul a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; color: var(--text-muted); font-size: 0.8438rem; }

/* --- Modals ------------------------------------------------------------- */
body.modal-open { overflow: hidden; }

.modal {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: var(--overlay);
    opacity: 0; transition: opacity .22s var(--ease); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal.show { opacity: 1; }

.modal-panel {
    position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 48px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 32px;
    transform: translateY(10px) scale(.985); transition: transform .28s var(--ease);
}
.modal.show .modal-panel { transform: none; }
.modal-panel.wide { max-width: 920px; padding: 0; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); overflow: hidden; }
.modal-panel.image { max-width: 1000px; padding: 12px; background: var(--surface); }

.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }

.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-panel h2 { font-size: 1.625rem; margin-bottom: 12px; padding-right: 40px; }
.modal-panel p { color: var(--text-muted); }
.modal-actions { margin-top: 28px; }

.profile-media { background: var(--surface-2); min-height: 280px; }
.profile-media img { width: 100%; height: 100%; object-fit: cover; }
.profile-body { padding: 32px; overflow-y: auto; max-height: calc(100vh - 48px); }
.profile-body .citizen-badge, .profile-body .role-tag { margin-bottom: 14px; }
.profile-alias { color: var(--text-muted); margin: -4px 0 20px; font-size: 1rem; }
.profile-alias[hidden] { display: none; }
.meta-box { border: 1px solid var(--border); border-radius: var(--radius); margin: 20px 0 24px; }
.meta-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 0.9375rem; }
.meta-row:first-child { border-top: 0; }
.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 600; text-align: right; }
.profile-body h3 { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.lightbox-img { width: 100%; max-height: calc(100vh - 160px); object-fit: contain; border-radius: var(--radius); background: var(--surface-2); }
.lightbox-caption { padding: 14px 6px 4px; font-weight: 600; }

/* --- Motion: restrained reveal on scroll and hero entrance ------------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .65s var(--ease), transform .65s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; }

.hero-grid > div > *, .hero-side > * { animation: heroIn .8s var(--ease) both; }
.hero-grid > div > :nth-child(1) { animation-delay: .05s; }
.hero-grid > div > :nth-child(2) { animation-delay: .15s; }
.hero-grid > div > :nth-child(3) { animation-delay: .25s; }
.hero-grid > div > :nth-child(4) { animation-delay: .35s; }
.hero-side > :nth-child(1) { animation-delay: .25s; }
.hero-side > :nth-child(2) { animation-delay: .4s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.page-hero-grid > * { animation: heroIn .7s var(--ease) both; }
.page-hero-grid > :nth-child(2) { animation-delay: .12s; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1100px) {
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    :root { --header-h: 64px; }

    .nav-toggle { display: inline-flex; }
    .primary-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        display: none; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        padding: 8px 24px 20px; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    }
    .primary-nav.open { display: flex; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-list > li { border-top: 1px solid var(--border); }
    .nav-list > li:first-child { border-top: 0; }
    .nav-link { width: 100%; justify-content: space-between; padding: 14px 4px; font-size: 1rem; border-radius: 0; }
    .nav-link.active, .has-sub.active > .nav-link { color: var(--accent); }
    .nav-link::after { display: none; }
    .has-sub::after { display: none; }
    .sub-menu {
        position: static; min-width: 0; border: 0; box-shadow: none; background: transparent; padding: 0 0 8px 12px;
        opacity: 1; visibility: visible; transform: none; display: none;
    }
    .has-sub:hover > .sub-menu { display: none; }
    .has-sub.open > .sub-menu { display: block; }
    .nav-actions { padding-top: 16px; border-top: 1px solid var(--border); }
    .nav-actions .btn { flex: 1; }

    .hero { padding: 56px 0 56px; background:
        linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 70%, transparent)),
        url('images/web/city-night.webp') center / cover no-repeat, var(--bg); }
    .page-hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .section { padding: 64px 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .modal-panel.wide { grid-template-columns: 1fr; }
    .profile-media { min-height: 0; max-height: 240px; }
}

@media (max-width: 560px) {
    .container { padding: 0 18px; }
    .gallery-grid { grid-template-columns: 1fr; }
    .hero-cta .btn { flex: 1 1 100%; }
    .tabs-container { flex-direction: column; border-bottom: 0; gap: 0; }
    .tab-btn { text-align: left; border-bottom: 1px solid var(--border); margin: 0; border-left: 2px solid transparent; }
    .tab-btn.active { border-bottom-color: var(--border); border-left-color: var(--accent); }
    .filter-container { flex-direction: row; }
    .filter-container .tab-btn { border: 1px solid var(--border); border-left-width: 1px; }
    .filter-container .tab-btn.active { border-color: var(--accent); }
    .modal { padding: 12px; }
    .modal-panel, .profile-body { padding: 24px 20px; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0ms !important; animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}


/* ==========================================================================
   Home layout refresh: bold hero, connect card, gallery slider, steps,
   feature showcase, promo band and social cards.
   ========================================================================== */

/* --- Header: slimmer, uppercase, more game-site --------------------------- */
:root { --header-h: 72px; }
.site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.brand-name { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 1.0625rem; }
.nav-link { font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.btn { text-transform: none; }
.btn-lg { padding: 15px 28px; font-size: 1.0625rem; font-weight: 700; border-radius: 10px; }
.gx-play { text-transform: uppercase; letter-spacing: .06em; font-weight: 800; font-size: .8125rem; padding: 11px 20px; }
.gx-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.28); }
.gx-ghost:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); color: #fff; }

.gx-online { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: .8125rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.gx-online[hidden] { display: none; }
.gx-online b { color: var(--text); font-variant-numeric: tabular-nums; }
.gx-online i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 0 rgba(92,191,140,.6); animation: gxPulse 2s infinite; }
@keyframes gxPulse { 70% { box-shadow: 0 0 0 8px rgba(92,191,140,0); } 100% { box-shadow: 0 0 0 0 rgba(92,191,140,0); } }

/* --- Shared section pieces ------------------------------------------------ */
.gx-section { padding: 96px 0; position: relative; }
.gx-head { max-width: 720px; margin-bottom: 44px; }
.gx-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.gx-head.row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.gx-head h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-transform: uppercase; margin-bottom: 14px; }
.gx-head h2 span { color: var(--accent); }
.gx-head p { color: var(--text-muted); font-size: 1.0625rem; }
.gx-kicker { display: inline-block; font-size: .8125rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.gx-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); }
.gx-link .icon { width: 16px; height: 16px; transition: transform .18s var(--ease); }
a:hover > .gx-link .icon, .gx-link:hover .icon { transform: translateX(3px); }

/* --- Hero ----------------------------------------------------------------- */
.gx-hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: center; padding: 72px 0 56px; overflow: hidden; color: #fff; isolation: isolate; }
.gx-hero-bg { position: absolute; inset: 0; z-index: -2; }
.gx-hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transform: scale(1.04); animation: gxDrift 28s ease-in-out infinite alternate; }
@keyframes gxDrift { to { transform: scale(1.12) translate3d(-1.2%, -1%, 0); } }
.gx-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background:
    linear-gradient(90deg, rgba(14,10,8,.92) 0%, rgba(14,10,8,.7) 42%, rgba(14,10,8,.25) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(19,16,14,0) 38%); }
.gx-hero-inner { width: 100%; }
.gx-hero h1 { font-size: clamp(2.75rem, 8.5vw, 6.25rem); font-weight: 900; line-height: .95; letter-spacing: -.03em; text-transform: uppercase; margin-bottom: 22px; max-width: 12ch; }
.gx-hero h1 em { font-style: normal; color: var(--accent); display: block; }
.gx-lead { font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); color: rgba(255,255,255,.82); max-width: 52ch; margin-bottom: 34px; }
.gx-hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }

.gx-servers { max-width: 860px; }
.gx-server { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 18px 22px; border-radius: 14px; background: rgba(20,15,12,.72); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 20px 50px rgba(0,0,0,.45); transition: border-color .2s, transform .2s var(--ease); }
.gx-server:hover { border-color: var(--accent); transform: translateY(-2px); }
.gx-server-info { display: flex; align-items: center; gap: 14px; }
.gx-server-flag { width: 52px; height: 52px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; flex: none; }
.gx-server-flag img { width: 36px; height: 36px; object-fit: contain; }
.gx-server h2 { font-size: 1.125rem; font-weight: 800; color: #fff; margin: 0 0 2px; }
.gx-server p { margin: 0; font-size: .875rem; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 8px; }
.gx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-gold); flex: none; }
.gx-server-addr { display: grid; gap: 2px; }
.gx-server-addr span { font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 700; }
.gx-server-addr code { font-family: var(--mono); font-size: .9375rem; color: #fff; }
.gx-server-actions { display: flex; gap: 10px; }

/* --- Gallery slider ------------------------------------------------------- */
.gx-gallery { background: var(--bg); padding-bottom: 80px; overflow: hidden; }
.gx-arrows { display: flex; gap: 10px; flex: none; }
.gx-arrow { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.gx-arrow:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.06); }
.gx-arrow svg { width: 22px; height: 22px; }
.gx-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 6px max(24px, calc((100vw - 1180px) / 2 + 24px)) 24px; scrollbar-width: none; outline-offset: -4px; }
.gx-track::-webkit-scrollbar { display: none; }
.gx-shot { flex: 0 0 min(560px, 82vw); margin: 0; scroll-snap-align: start; cursor: pointer; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.gx-shot:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.gx-shot-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.gx-shot-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gx-shot:hover img { transform: scale(1.05); }
.gx-shot figcaption { padding: 16px 20px 18px; }
.gx-shot h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.gx-shot p { color: var(--text-muted); font-size: .9063rem; margin: 0; }

/* --- How to start --------------------------------------------------------- */
.gx-start { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.gx-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; counter-reset: none; }
.gx-step { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 32px 26px 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: border-color .25s var(--ease), transform .25s var(--ease); }
.gx-step:hover { border-color: var(--accent); transform: translateY(-4px); }
.gx-step-n { font-size: 3.75rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.5px var(--accent); margin-bottom: 22px; }
.gx-step h3 { font-size: 1.25rem; margin-bottom: 10px; }
.gx-step p { color: var(--text-muted); font-size: .9688rem; margin-bottom: 22px; }
.gx-step .gx-link, .gx-step .address-box { margin-top: auto; }
.gx-step .address-box { flex-wrap: wrap; }

/* --- Feature showcase ----------------------------------------------------- */
.gx-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 36px; }
.gx-tab { display: inline-flex; align-items: center; gap: 12px; padding: 14px 24px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); font: inherit; font-weight: 700; font-size: .9375rem; cursor: pointer; transition: all .2s var(--ease); }
.gx-tab span { font-size: .75rem; opacity: .7; font-variant-numeric: tabular-nums; }
.gx-tab:hover { color: var(--text); border-color: var(--text-muted); }
.gx-tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 35%, transparent); }
.gx-pane { display: none; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.gx-pane.active { display: grid; animation: paneIn .45s var(--ease) both; }
.gx-pane-text { padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.gx-pane-text .card-badge { align-self: flex-start; margin-bottom: 18px; }
.gx-pane-text h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; margin-bottom: 18px; }
.gx-pane-text p { color: var(--text-muted); font-size: 1.0313rem; margin-bottom: 14px; }
.gx-pane-media { min-height: 340px; background: var(--surface-2); position: relative; }
.gx-pane-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gx-pane-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--surface), transparent 30%); }

/* --- Promo band ----------------------------------------------------------- */
.gx-promo { padding: 72px 0; background: linear-gradient(115deg, #3a1706 0%, #7a2f0a 45%, var(--c-ember) 100%); color: #fff; position: relative; overflow: hidden; }
.gx-promo::after { content: ''; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.07); }
.gx-promo-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.gx-promo .gx-kicker { color: #ffd9bd; margin-bottom: 12px; }
.gx-promo h2 { font-size: clamp(1.875rem, 4.5vw, 3rem); font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; line-height: 1.05; margin-bottom: 12px; }
.gx-promo p { max-width: 52ch; color: rgba(255,255,255,.88); font-size: 1.0625rem; margin: 0; }
.gx-promo .btn-primary { background: #fff; color: #5a2308; }
.gx-promo .btn-primary:hover { background: #ffe9d8; color: #5a2308; }

/* --- Social cards --------------------------------------------------------- */
.gx-social { padding: 72px 0 24px; }
.gx-social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gx-soc { display: flex; flex-direction: column; align-items: flex-start; padding: 30px 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.gx-soc:hover { color: var(--text); border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.gx-soc > svg { width: 44px; height: 44px; color: var(--accent); margin-bottom: 20px; }
.gx-soc h3 { font-size: 1.375rem; margin-bottom: 8px; }
.gx-soc p { color: var(--text-muted); font-size: .9688rem; margin-bottom: 22px; }
.gx-soc .gx-link { margin-top: auto; }

/* --- Footer polish -------------------------------------------------------- */
.site-footer { border-top: 3px solid var(--accent); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1020px) {
    .gx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gx-pane { grid-template-columns: 1fr; }
    .gx-pane-media { min-height: 260px; order: -1; }
    .gx-pane-media::after { background: linear-gradient(0deg, var(--surface), transparent 40%); }
    .gx-online { display: none !important; }
}
@media (max-width: 760px) {
    .gx-section { padding: 68px 0; }
    .gx-hero { min-height: auto; padding: 56px 0 40px; }
    .gx-hero::before { background: linear-gradient(0deg, var(--bg) 0%, rgba(14,10,8,.82) 55%, rgba(14,10,8,.6) 100%); }
    .gx-hero-cta { margin-bottom: 36px; }
    .gx-hero-cta .btn { flex: 1 1 100%; justify-content: center; }
    .gx-server { grid-template-columns: 1fr; gap: 16px; }
    .gx-server-actions .btn { flex: 1; justify-content: center; }
    .gx-head.row { flex-direction: column; align-items: flex-start; }
    .gx-steps, .gx-social-grid { grid-template-columns: 1fr; }
    .gx-tab { padding: 12px 18px; }
    .gx-promo-inner .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .gx-hero-bg img { animation: none; }
    .gx-track { scroll-behavior: auto; }
}

/* --- Header fit fixes ----------------------------------------------------- */
.nav-inner { gap: 16px; }
.nav-link, .gx-play, .brand-name { white-space: nowrap; }
.nav-link { padding-left: 10px; padding-right: 10px; letter-spacing: .06em; }
.nav-link::after { left: 10px; right: 10px; }
.nav-actions { gap: 8px; flex: none; }
@media (max-width: 1180px) { .nav-link { padding-left: 8px; padding-right: 8px; font-size: .75rem; } }
.site-header .container { max-width: 1360px; }
.brand { flex: none; margin-right: 12px; }
.primary-nav { min-width: 0; }
@media (max-width: 1280px) { .brand-name { font-size: .9688rem; } .gx-play { padding: 10px 16px; } }

/* --- Fixes: gallery snap alignment, address box in steps ----------------- */
.gx-track { --gx-pad: max(24px, calc((100vw - 1180px) / 2 + 24px)); padding-left: var(--gx-pad); padding-right: var(--gx-pad); scroll-padding-left: var(--gx-pad); scroll-padding-right: var(--gx-pad); }
.gx-step .address-box { flex-direction: column; align-items: stretch; gap: 10px; }
.gx-step .address-box code { white-space: nowrap; font-size: .875rem; }
.gx-step .address-box .btn { justify-content: center; }
