/* ============================================
   WHOLE — Sacred Website v2
   Design derived from Canon: Aesthetics, 
   Aesthetic Constraints, Philosophy of Language
   ============================================ */

/* === Design Tokens === */
:root {
    /* Void — deep, restful, temporally enduring */
    --void: #0a0a0f;
    --void-soft: #0f0d14;
    --void-elevated: #14121a;

    /* Ink — body-legible, metabolizable */
    --ink: #e8e4dc;
    --ink-muted: #9a958a;
    --ink-soft: rgba(232, 228, 220, 0.7);

    /* Gold — sacred, earned intensity */
    --gold: #c9a855;
    --gold-bright: #e8d4a0;
    --gold-soft: rgba(201, 168, 85, 0.12);
    --gold-glow: rgba(201, 168, 85, 0.25);

    /* Violet — celestial accent, used sparingly */
    --violet: #8b7ec8;
    --violet-soft: rgba(139, 126, 200, 0.10);

    /* Spacing scale — metabolic pace */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 48px;
    --space-xl: 96px;
    --space-2xl: 128px;

    /* Typography */
    --font-display: "Marcellus", Georgia, serif;
    --font-body: "Crimson Pro", Georgia, serif;
    --font-small: "Inter", -apple-system, sans-serif;

    /* Transitions — no sudden movements */
    --ease-gentle: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-slow: 0.6s;
    --duration-med: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    font-size: 18px;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--void);
    line-height: 1.7;
    letter-spacing: 0.01em;
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* === Background Layers === */

/* Layer 1: Void base (handled by body) */

/* Layer 2: Sacred Geometry */
.geometry {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.geometry svg {
    width: 140vmin;
    height: 140vmin;
    color: var(--gold);
    opacity: 0.06;
    animation: sacred-rotate 300s linear infinite;
}

@keyframes sacred-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Layer 3: Vignette */
.vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 50%,
            transparent 0%,
            var(--void) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Layer 4: Subtle grain texture */
.grain {
    position: fixed;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* === Typography === */

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

h1 {
    font-size: clamp(3rem, 10vw, 7rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
}

h3 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
}

h4 {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

p {
    max-width: 65ch;
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: 600;
    color: var(--gold);
}

/* === Thresholds (Sections) === */

.threshold {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
}

/* === Threshold I: Entrance === */

.threshold-entrance {
    text-align: center;
}

.entrance-content {
    opacity: 0;
    animation: entrance-reveal 1.5s var(--ease-gentle) 0.3s forwards;
}

@keyframes entrance-reveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invitation-line {
    font-family: var(--font-small);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: var(--space-md);
}

.wordmark {
    color: var(--gold);
    text-shadow: 0 0 80px var(--gold-glow);
    margin-bottom: var(--space-sm);
    animation: wordmark-breathe 12s ease-in-out infinite;
}

@keyframes wordmark-breathe {

    0%,
    100% {
        text-shadow: 0 0 60px var(--gold-glow);
        opacity: 1;
    }

    50% {
        text-shadow: 0 0 100px var(--gold-glow), 0 0 40px var(--gold-soft);
        opacity: 0.95;
    }
}

.essence {
    font-family: var(--font-small);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--ink-muted);
    margin-bottom: var(--space-lg);
}

.enter-button {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    background: transparent;
    border: 1px solid var(--gold-soft);
    padding: var(--space-sm) var(--space-lg);
    cursor: pointer;
    transition: all var(--duration-med) var(--ease-gentle);
}

.enter-button:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--gold-glow);
}

.enter-button:focus {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

/* === Threshold II: Orientation === */

.threshold-orientation {
    justify-content: flex-start;
    padding-top: var(--space-2xl);
}

.orientation-header {
    text-align: center;
    max-width: 700px;
    margin-bottom: var(--space-xl);
}

.section-title {
    color: var(--ink);
    margin-bottom: var(--space-md);
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: var(--space-md) auto 0;
}

.orientation-intro {
    color: var(--ink-soft);
    font-size: 1.1rem;
}

/* Virtue Cards - Lexicon */
.lexicon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    max-width: 1200px;
    width: 100%;
    margin-bottom: var(--space-xl);
}

.virtue-card {
    background: var(--void-elevated);
    border: 1px solid rgba(201, 168, 85, 0.12);
    border-radius: 8px;
    padding: var(--space-md);
    transition: all var(--duration-med) var(--ease-gentle);
}

.virtue-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 40px var(--gold-soft);
    transform: translateY(-2px);
}

.virtue-name {
    color: var(--gold);
    margin-bottom: var(--space-sm);
    font-size: 1.3rem;
}

.virtue-essence {
    color: var(--ink-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Meta virtue */
.orientation-meta {
    max-width: 700px;
    text-align: center;
    margin-bottom: var(--space-lg);
}

.meta-virtue {
    color: var(--ink-muted);
    font-style: italic;
}

/* Navigation to deeper threshold */
.threshold-nav {
    margin-top: var(--space-lg);
}

.nav-deeper {
    font-family: var(--font-small);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-muted);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid rgba(232, 228, 220, 0.15);
    border-radius: 4px;
    transition: all var(--duration-med) var(--ease-gentle);
}

.nav-deeper:hover {
    color: var(--gold);
    border-color: var(--gold-soft);
}

/* === Threshold III: Immersion === */

.threshold-immersion {
    justify-content: flex-start;
    padding-top: var(--space-2xl);
    min-height: auto;
    padding-bottom: var(--space-2xl);
}

.immersion-header {
    text-align: center;
    max-width: 700px;
    margin-bottom: var(--space-lg);
}

.immersion-intro {
    color: var(--ink-muted);
}

/* Canon Navigation */
.canon-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.canon-link {
    font-family: var(--font-small);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
    text-decoration: none;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid rgba(232, 228, 220, 0.1);
    border-radius: 4px;
    transition: all var(--duration-med) var(--ease-gentle);
}

.canon-link:hover {
    color: var(--gold);
    border-color: var(--gold-soft);
    background: var(--gold-soft);
}

/* Canon Documents */
.canon-document {
    max-width: 800px;
    width: 100%;
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg);
    background: var(--void-soft);
    border-left: 2px solid var(--gold-soft);
    border-radius: 0 8px 8px 0;
}

.doc-title {
    color: var(--gold);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gold-soft);
}

.doc-section {
    margin-bottom: var(--space-lg);
}

.doc-section:last-child {
    margin-bottom: 0;
}

.doc-section h4 {
    color: var(--ink);
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
}

.doc-section p {
    color: var(--ink-soft);
    font-size: 1rem;
}

/* === Footer === */

.site-footer {
    position: relative;
    z-index: 10;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    border-top: 1px solid rgba(201, 168, 85, 0.08);
}

.footer-mark {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: var(--space-sm);
}

.footer-line {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

/* === Responsive === */

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

    .threshold {
        padding: var(--space-lg) var(--space-sm);
    }

    .threshold-orientation,
    .threshold-immersion {
        padding-top: var(--space-xl);
    }

    .lexicon {
        grid-template-columns: 1fr;
    }

    .canon-document {
        padding: var(--space-md);
    }
}

/* === Accessibility === */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus states */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

/* Selection */
::selection {
    background: var(--gold-soft);
    color: var(--ink);
}