:root {
    --bg: #0c0b09;
    --card: #17150f;
    --gold: #c9a227;
    --gold-dim: #8a7018;
    --text: #e8e0d5;
    --muted: #9a8f7f;
    --line: #2c2922;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Georgia, "Times New Roman", serif;
    background: var(--bg) url('../images/background1.jpg') center top / cover fixed;
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(12,11,9,0.82);
    z-index: -1;
}

.topnav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(12,11,9,0.94);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
    padding: 0.65rem 1.2rem;
}

.topnav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.topnav a:hover, .topnav a.active { color: var(--gold); }

.topnav .brand {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.12em;
    margin-right: 0.6rem;
    text-transform: uppercase;
}

header {
    position: relative;
    height: 420px;
    background: url('../images/hero-banner.jpg') center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

header.short { height: 260px; }
header.ember { background-image: url('../images/bodega.jpg'); }
header.palace { background-image: url('../images/mansion.jpg'); }
header.ships { background-image: url('../images/bookstore.jpg'); }
header.world { background-image: url('../images/map-bg.jpg'); }

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12,11,9,0.94) 0%, rgba(12,11,9,0.25) 55%, rgba(12,11,9,0.45) 100%);
}

.header-content {
    position: relative;
    z-index: 2;
    padding: 0 1.5rem 2.2rem;
}

h1 {
    font-size: 3.2rem;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8);
    margin-bottom: 0.3rem;
}

.subtitle {
    color: #d4c4a8;
    font-style: italic;
    font-size: 1.15rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.2rem 1.5rem;
}

.status {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    padding: 1.3rem 1.6rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.status h2 {
    color: var(--gold);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.nav-grid, .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.3rem;
}

.nav-card, .note-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
}

.nav-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

.nav-card img, .bleed {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.nav-card .card-body, .note-card {
    padding: 1.15rem 1.25rem 1.3rem;
}

.nav-card h3, .note-card h3 {
    color: var(--gold);
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}

.muted { color: var(--muted); font-size: 0.95rem; }

.prose h2 {
    color: var(--gold);
    font-size: 1.4rem;
    margin: 1.8rem 0 0.55rem;
    clear: both;
}

.prose h3 {
    color: var(--gold);
    font-size: 1.12rem;
    margin: 1.15rem 0 0.35rem;
}

.prose p { margin-bottom: 0.8rem; }

.prose ul, .prose ol {
    margin: 0 0 1rem 1.25rem;
}

.prose li { margin-bottom: 0.3rem; }

.portrait {
    float: right;
    width: 220px;
    max-width: 42%;
    margin: 0 0 1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.crumb {
    margin-bottom: 1.2rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.crumb a { color: var(--gold); text-decoration: none; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.6rem 0 1.3rem;
    font-size: 0.95rem;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 0.45rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

th { color: var(--gold); font-weight: normal; }

td.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag {
    display: inline-block;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    margin-right: 0.3rem;
}

.map {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #cfc4b4;
    white-space: pre;
    margin-bottom: 1.2rem;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
}

footer {
    text-align: center;
    padding: 2.6rem 1rem 2.2rem;
    color: var(--muted);
    font-size: 0.88rem;
    border-top: 1px solid var(--line);
    margin-top: 2rem;
    clear: both;
    background: rgba(12,11,9,0.6);
}

@media (max-width: 720px) {
    header { height: 280px; }
    header.short { height: 200px; }
    h1 { font-size: 2.2rem; }
    .two-col { grid-template-columns: 1fr; }
    .portrait { float: none; width: 100%; max-width: 260px; display: block; margin: 0 auto 1rem; }
}
