/* ==========================================================================
   MAGE'S GUILD PSYCHONAUTICS LLC — HEARTH-PRESS MASTER STYLESHEET
   Clean, High-Status Editorial Typography Infused with Holographic Phase Space
   ========================================================================== */

:root {
    --bg-dark: #0c0e12;
    --bg-surface: #14171f;
    --bg-card: #191d26;
    --border-subtle: #242936;
    --border-highlight: #3a4254;
    
    --text-primary: #f0f2f5;
    --text-secondary: #9aa1b2;
    --text-muted: #62697a;
    
    --accent-gold: #e2b35b;
    --accent-cyan: #38bdf8;
    --accent-amber: #f59e0b;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Newsreader", Georgia, Cambria, "Times New Roman", Times, serif;
    --font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
.site-header {
    background-color: rgba(12, 14, 18, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.brand-logo {
    height: 34px;
    width: auto;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.desk-link {
    background: rgba(226, 179, 91, 0.1);
    color: var(--accent-gold) !important;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(226, 179, 91, 0.25);
}

.desk-link:hover {
    background: rgba(226, 179, 91, 0.2);
}

/* Hero Section with Living Phase Space Canvas */
.hero-section {
    position: relative;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.45;
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    max-width: 840px;
    padding: 48px 24px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.telemetry-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 23, 31, 0.85);
    border: 1px solid var(--border-highlight);
    padding: 6px 16px;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-cyan);
    letter-spacing: 0.04em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

/* Interactive Demonstration Section */
.demo-section {
    padding: 64px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.section-container {
    max-width: 1100px;
    margin: 0 auto;
}

.demo-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 36px auto;
}

.demo-header .tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
    letter-spacing: 0.1em;
    display: inline-block;
    margin-bottom: 8px;
}

.demo-header h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.demo-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.demo-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.demo-canvas-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #06080b;
    border: 1px solid var(--border-subtle);
    display: flex;
    justify-content: center;
}

#landscapeCanvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.landscape-hud {
    position: absolute;
    bottom: 12px;
    left: 16px;
    background: rgba(12, 14, 18, 0.85);
    border: 1px solid var(--border-highlight);
    padding: 4px 12px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
}

.demo-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Project PRISM Demonstration Architectural Brief */
.demo-explanation {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid var(--border-subtle);
}

.explanation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 900px) {
    .explanation-grid {
        grid-template-columns: 1fr;
    }
}

.explanation-col {
    background: rgba(12, 14, 18, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.explanation-col .col-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gold);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    display: inline-block;
}

.explanation-col h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.explanation-col p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.explanation-col p:last-child {
    margin-bottom: 0;
}

.explanation-col strong {
    color: var(--text-primary);
}

.explanation-footer {
    margin-top: 28px;
    text-align: center;
}

.prism-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(226, 179, 91, 0.06);
    border: 1px solid rgba(226, 179, 91, 0.2);
    padding: 8px 18px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
}

/* Stories & Articles Section */
.stories-section {
    padding: 80px 24px;
}

.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 6px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.story-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
}

.story-card-image {
    height: 190px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-subtle);
    background-color: #101217;
}

.story-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.story-card-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.story-card-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 10px;
    color: #ffffff;
}

.story-card-summary {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

/* Story Single Page */
.story-page .story-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 64px 24px 100px 24px;
}

.story-header {
    margin-bottom: 48px;
    text-align: left;
}

.story-meta-bar {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.story-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: #ffffff;
}

.story-subtitle {
    font-size: 1.35rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
    border-left: 3px solid var(--accent-gold);
    padding-left: 16px;
    margin-top: 20px;
}

/* Markdown Editorial Content Body */
.markdown-body {
    font-family: var(--font-serif);
    font-size: 1.22rem;
    line-height: 1.8;
    color: #e2e4e9;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    font-family: var(--font-sans);
    color: #ffffff;
    margin-top: 2em;
    margin-bottom: 0.6em;
    letter-spacing: -0.01em;
}

.markdown-body h2 {
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.markdown-body h3 {
    font-size: 1.4rem;
}

.markdown-body p {
    margin-bottom: 1.5em;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.markdown-body li {
    margin-bottom: 0.5em;
}

.markdown-body pre {
    background: #0a0c10;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 18px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 2em 0;
}

.markdown-body code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 3px solid var(--accent-cyan);
    padding-left: 20px;
    margin: 2em 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    text-align: left;
}

.markdown-body th {
    background: var(--bg-surface);
    color: #ffffff;
}

/* Markdown Images, Figures & Captions */
.markdown-body img {
    max-width: 100%;
    max-height: 440px;
    width: auto;
    height: auto;
    display: block;
    margin: 2em auto;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Captions if an italicized paragraph follows an image */
.markdown-body p > em:only-child {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -1.2em;
    margin-bottom: 2.2em;
    font-style: italic;
    font-family: var(--font-sans);
}

/* Buttons */
.btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
    background: var(--accent-gold);
    color: #0c0e12;
}

.btn-primary:hover {
    background: #f0c370;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-highlight);
}

.btn-secondary:hover {
    background: #232936;
}

.btn-warning {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-warning:hover {
    background: rgba(244, 63, 94, 0.25);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.license {
    font-size: 0.8rem;
    margin-top: 8px;
}
