/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0b1117;
    --bg-secondary: #111c26;
    --bg-card: #162029;
    --accent: #4a7c8f;
    --accent-hover: #6a9bac;
    --accent-glow: rgba(74, 124, 143, 0.25);
    --orange: #c9a24e;
    --orange-light: #dbb563;
    --text-primary: #e2ddd3;
    --text-muted: #8a94a0;
    --border-color: rgba(74, 124, 143, 0.15);
}

/* ===== Base ===== */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    overscroll-behavior: none;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(74, 124, 143, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(201, 162, 78, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(74, 124, 143, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
}

a {
    color: var(--accent-hover);
    text-decoration: none;
}

a:hover {
    color: var(--orange-light);
}

.text-muted {
    color: var(--text-muted) !important;
}

hr {
    border: 0;
    height: 40px;
    background: url('/images/vine-divider.png') center / contain no-repeat;
    opacity: 0.5;
    margin: 1.5rem 0;
}

/* ===== Site nav ===== */
.site-nav {
    background: rgba(17, 28, 38, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-nav .container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
}

.site-brand {
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.site-logo {
    height: 56px;
    width: auto;
}

.site-brand:hover {
    opacity: 0.9;
}

.site-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
    flex-wrap: wrap;
}

.site-links a {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-block;
}

.site-links a:hover {
    color: var(--text-primary);
    background: rgba(74, 124, 143, 0.1);
}

/* ===== Cards ===== */
.card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 90px;
    height: 90px;
    background: url('/images/spiderweb-corner.png') bottom right / contain no-repeat;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
}

.card:hover {
    border-color: rgba(74, 124, 143, 0.4);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== Buttons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--orange)) !important;
    border: none !important;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    color: #fff !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(74, 124, 143, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(74, 124, 143, 0.5);
    opacity: 0.95;
}

/* ===== Utility ===== */
.container {
    position: relative;
    z-index: 1;
}

.page-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 124, 143, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 124, 143, 0.5);
}

/* ===== Splash page ===== */
.splash-page {
    max-width: 960px;
    margin: 0 auto;
}

.splash-hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.splash-logo {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 0 16px rgba(201, 162, 78, 0.25));
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .splash-logo {
        width: 240px;
    }
}

.splash-headline {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .splash-headline {
        font-size: 2.75rem;
    }
}

.splash-subhead {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

.splash-moth {
    display: block;
    width: 80px;
    height: auto;
    opacity: 0.3;
    margin: 1.5rem auto 0;
    filter: drop-shadow(0 0 8px rgba(201, 162, 78, 0.2));
}

.splash-section {
    padding: 3rem 1rem 1rem;
}

.splash-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.splash-apps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .splash-apps {
        grid-template-columns: repeat(2, 1fr);
    }
}

.splash-app-card {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.splash-app-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 90px;
    height: 90px;
    background: url('/images/spiderweb-corner.png') bottom right / contain no-repeat;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
}

.splash-app-card:hover {
    border-color: rgba(74, 124, 143, 0.4);
    box-shadow: 0 0 20px var(--accent-glow);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.splash-app-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.splash-app-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.splash-app-link {
    color: var(--accent-hover);
    font-weight: 600;
    font-size: 0.9rem;
}

.splash-values {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .splash-values {
        grid-template-columns: repeat(2, 1fr);
    }
}

.splash-value {
    background: rgba(17, 28, 38, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.splash-value h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--orange-light);
}

.splash-value p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

.splash-final {
    text-align: center;
    padding-bottom: 3rem;
}

.splash-final p {
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--accent-hover);
}

.footer-moth {
    width: 80px;
    height: auto;
    opacity: 0.15;
    margin: 1rem auto;
    display: block;
}

.footer-fine {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-bottom: 2rem;
}

/* ===== Touch targets ===== */
@media (pointer: coarse) {
    .btn,
    .site-links a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
