/* ============================================================
   Jorvik Software — Shared Stylesheet
   ============================================================ */

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Variables */
:root {
    --bg-primary: #f7f7f5;
    --bg-secondary: #efefed;
    --bg-card: #ffffff;
    --bg-card-hover: #fafaf9;
    --border: #e2e2de;
    --border-hover: #d0d0ca;
    --text-primary: #1a1a1a;
    --text-secondary: #5c5c5c;
    --text-muted: #8a8a8a;
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.08);
    --accent-glow: rgba(79, 70, 229, 0.15);
    --green: #059669;
    --green-soft: rgba(5, 150, 105, 0.08);
    --amber: #b45309;
    --amber-soft: rgba(180, 83, 9, 0.08);
    --rose: #e11d48;
    --rose-soft: rgba(225, 29, 72, 0.08);
    --brand: #004080;
    --brand-soft: rgba(0, 64, 128, 0.08);
}

/* Base */
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Navigation
   ============================================================ */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(247, 247, 245, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
nav .nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    height: 64px; display: flex; align-items: center; justify-content: space-between;
}
nav .logo {
    font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em;
    color: var(--text-primary); text-decoration: none;
}
nav .logo span { color: var(--accent); }
nav .nav-links { display: flex; gap: 2rem; list-style: none; }
nav .nav-links a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.875rem; font-weight: 500; transition: color 0.2s;
}
nav .nav-links a:hover { color: var(--text-primary); }

/* ============================================================
   Page Header (product & content pages)
   ============================================================ */
.page-header {
    max-width: 800px; margin: 0 auto;
    padding: 7rem 2rem 3rem; text-align: center;
}
.page-header .app-icon {
    width: 128px; height: 128px; border-radius: 28px; overflow: hidden;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}
.page-header .app-icon img { width: 100%; height: 100%; object-fit: cover; }
.page-header .game-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
    letter-spacing: -0.03em; margin-bottom: 0.75rem;
}
.page-header .subtitle {
    font-size: 1.1rem; color: var(--text-secondary); font-weight: 300;
    max-width: 600px; margin: 0 auto 2rem; line-height: 1.7;
}
.page-header .tags { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   Tags
   ============================================================ */
.tag {
    font-size: 0.7rem; font-weight: 500; padding: 0.25rem 0.625rem;
    border-radius: 100px; background: var(--bg-secondary);
    color: var(--text-muted); border: 1px solid var(--border);
}
.tag.brand { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.tag.amber { color: var(--amber); background: var(--amber-soft); border-color: transparent; }

/* ============================================================
   Buttons
   ============================================================ */
.btn-row {
    display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
    margin-top: 2rem;
}
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--brand); color: #fff; border: none; border-radius: 12px;
    font-family: inherit; font-size: 1rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0, 64, 128, 0.25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0, 64, 128, 0.35); }
.btn.secondary {
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); box-shadow: none;
}
.btn.secondary:hover { border-color: var(--border-hover); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); }

/* Game play button (same as .btn but used in game pages) */
.play-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-top: 2rem; padding: 0.875rem 2rem;
    background: var(--brand); color: #fff; border: none; border-radius: 12px;
    font-family: inherit; font-size: 1rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0, 64, 128, 0.25);
}
.play-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0, 64, 128, 0.35); }
.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-top: 2rem; padding: 0.875rem 2rem;
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 12px;
    font-family: inherit; font-size: 1rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s; box-shadow: none;
}
.btn-secondary:hover { transform: translateY(-1px); border-color: var(--border-hover); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); }

/* ============================================================
   Content Sections
   ============================================================ */
.content { max-width: 800px; margin: 0 auto; padding: 0 2rem 4rem; }

.section { margin-bottom: 3rem; }
.section h2 {
    font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.section h3 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.section p { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.8; }
.section ul, .section ol { color: var(--text-secondary); margin-left: 1.25rem; margin-bottom: 1rem; }
.section li { margin-bottom: 0.375rem; }
.section strong { color: var(--text-primary); }
.section code {
    font-size: 0.85em; background: var(--bg-secondary); padding: 0.15em 0.4em;
    border-radius: 4px; font-family: 'SF Mono', Menlo, monospace;
}
.section a:not([class*="btn"]):not([class*="cta"]):not([class*="play"]) { color: var(--brand); }

/* Keyboard key indicators */
.kbd {
    display: inline-block; font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.8em; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 4px; padding: 0.1em 0.4em; box-shadow: 0 1px 0 var(--border);
}

/* ============================================================
   Tables
   ============================================================ */
table {
    width: 100%; border-collapse: collapse; margin-bottom: 1.5rem;
    font-size: 0.875rem;
}
th {
    text-align: left; font-weight: 600; padding: 0.625rem 0.75rem;
    border-bottom: 2px solid var(--border); color: var(--text-primary);
}
td {
    padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }

/* ============================================================
   History Box (game pages)
   ============================================================ */
.history-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: 2rem; margin-bottom: 2rem;
}
.history-box p { color: var(--text-secondary); margin-bottom: 0.75rem; }
.history-box p:last-child { margin-bottom: 0; }

/* Monospace diagram boxes */
.diagram, .click-tree {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
    font-family: 'SF Mono', Menlo, monospace; font-size: 0.8rem;
    color: var(--text-secondary); line-height: 1.8; white-space: pre;
}

/* Disclaimer (game pages) */
.disclaimer {
    max-width: 800px; margin: 0 auto; padding: 0 2rem 2rem;
    font-size: 0.8rem; color: var(--text-muted); line-height: 1.7;
}

/* ============================================================
   Divider & Footer
   ============================================================ */
.divider { max-width: 800px; margin: 0 auto; padding: 0 2rem; }
.divider.wide { max-width: 1200px; }
.divider hr { border: none; border-top: 1px solid var(--border); }

footer {
    max-width: 800px; margin: 0 auto; padding: 3rem 2rem 4rem;
    display: flex; justify-content: space-between; align-items: center;
    color: var(--text-muted); font-size: 0.825rem;
}
footer.wide { max-width: 1200px; }
footer .footer-brand { font-weight: 600; color: var(--text-secondary); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    nav .nav-inner { padding: 0 1rem; }
    nav .nav-links { gap: 1rem; }
    nav .nav-links a { font-size: 0.75rem; }

    .page-header { padding: 6rem 1.25rem 2rem; }
    .page-header .app-icon { width: 96px; height: 96px; border-radius: 22px; }

    .content { padding: 0 1.25rem 3rem; }

    table { font-size: 0.8rem; }
    th, td { padding: 0.375rem 0.5rem; }

    .btn-row { flex-direction: column; align-items: center; }
    .diagram, .click-tree { font-size: 0.7rem; overflow-x: auto; }

    footer {
        flex-direction: column; gap: 0.75rem; text-align: center;
    }
}
