/* ethica.dev — Ethereal Art Deco */
/* Colors: #c9a84c (gold), #a78bfa (lavender), #0f0a1a (deep void), #12102a (dark navy),
   #9a94a8 (muted lavender), #0a0a14 (near-black), #e8e2d6 (warm cream), #1e1833 (dark purple),
   #67e8f9 (cyan accent) */

:root {
    --gold: #c9a84c;
    --lavender: #a78bfa;
    --void: #0f0a1a;
    --navy: #12102a;
    --muted: #9a94a8;
    --black: #0a0a14;
    --cream: #e8e2d6;
    --purple: #1e1833;
    --cyan: #67e8f9;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant', Georgia, serif;
    background-color: var(--black);
    color: var(--cream);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.vestibule-title,
.section-title {
    font-family: 'Poiret One', sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.prop-number,
.axiom-label,
.archive-card-label,
.code-panel-title,
.colophon-year {
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vestibule-subtitle,
.archive-intro,
.demonstratio-body {
    font-family: 'Cormorant', Georgia, serif;
    font-style: italic;
}

/* ========================================
   SECTION TITLES
   ======================================== */

.section-title {
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--cream);
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-rule {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), var(--lavender));
    margin: 0 auto 3rem;
}

/* ========================================
   THE VESTIBULE (Hero — 100vh)
   ======================================== */

.vestibule {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--navy) 0%, var(--void) 40%, var(--black) 100%);
    overflow: hidden;
}

.vestibule-hex-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hex-ring {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-ring-outer {
    width: min(80vw, 600px);
    height: min(92vh, 692px);
    animation: hexPulseOuter 6s ease-in-out infinite;
}

.hex-ring-mid {
    width: min(55vw, 420px);
    height: min(63vh, 485px);
    animation: hexPulseMid 6s ease-in-out infinite 1s;
}

.hex-ring-inner {
    width: min(30vw, 240px);
    height: min(35vh, 277px);
    animation: hexPulseInner 6s ease-in-out infinite 2s;
}

.hex-svg {
    width: 100%;
    height: 100%;
}

.hex-outline {
    fill: none;
    stroke: url(#hex-gradient);
    stroke-width: 0.8;
}

.hex-ring-outer .hex-outline {
    stroke: var(--gold);
    opacity: 0.25;
    filter: drop-shadow(0 0 15px rgba(201, 168, 76, 0.15));
}

.hex-ring-mid .hex-outline {
    stroke: var(--lavender);
    opacity: 0.35;
    filter: drop-shadow(0 0 15px rgba(167, 139, 250, 0.2));
}

.hex-ring-inner .hex-outline {
    stroke: var(--gold);
    opacity: 0.5;
    filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.25));
}

@keyframes hexPulseOuter {
    0%, 100% { opacity: 0.3; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.6; transform: scale(1.02) rotate(1deg); }
}

@keyframes hexPulseMid {
    0%, 100% { opacity: 0.4; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.7; transform: scale(1.03) rotate(-1deg); }
}

@keyframes hexPulseInner {
    0%, 100% { opacity: 0.5; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.8; transform: scale(1.04) rotate(1.5deg); }
}

.vestibule-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.vestibule-title {
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--cream);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--cream) 40%, var(--lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.3)); }
    100% { filter: drop-shadow(0 0 40px rgba(167, 139, 250, 0.4)); }
}

.vestibule-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--muted);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.vestibule-axiom {
    max-width: 500px;
    margin: 0 auto;
}

.axiom-label {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.3);
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
}

.axiom-text {
    font-family: 'Cormorant', Georgia, serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--muted);
    font-style: italic;
    line-height: 1.7;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--muted);
    opacity: 0.5;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ========================================
   THE NAVE — Propositions Hexagonal Grid
   ======================================== */

.nave {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--black) 0%, var(--void) 50%, var(--black) 100%);
    position: relative;
}

.nave-header {
    margin-bottom: 2rem;
}

.hex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hex-cell {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hex-cell.visible {
    opacity: 1;
    transform: translateY(0);
}

.hex-cell-inner {
    position: relative;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, rgba(18, 16, 42, 0.8), rgba(15, 10, 26, 0.9));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.4s ease;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-cell:hover .hex-cell-inner {
    transform: scale(1.03);
}

.hex-border-glow {
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, var(--gold), var(--lavender));
    opacity: 0.3;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.hex-cell:hover .hex-border-glow {
    opacity: 0.7;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3), 0 0 45px rgba(201, 168, 76, 0.15);
}

.hex-content {
    text-align: center;
    padding: 1rem;
}

.prop-number {
    display: block;
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.prop-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--cream);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.prop-text {
    font-family: 'Cormorant', Georgia, serif;
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    color: var(--muted);
    line-height: 1.6;
    font-style: italic;
}

/* Stagger the grid rows */
.hex-cell-2,
.hex-cell-5 {
    transition-delay: 0.15s;
}

.hex-cell-3,
.hex-cell-6 {
    transition-delay: 0.3s;
}

/* ========================================
   THE ARCHIVE — Ethical Frameworks
   ======================================== */

.archive {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--black) 0%, var(--navy) 50%, var(--black) 100%);
}

.archive-header {
    margin-bottom: 3rem;
}

.archive-intro {
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.archive-card {
    position: relative;
    background: rgba(18, 16, 42, 0.6);
    border: 1px solid rgba(201, 168, 76, 0.15);
    padding: 2.5rem 2rem;
    transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.archive-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.archive-card:hover {
    border-color: rgba(167, 139, 250, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.15), 0 0 40px rgba(201, 168, 76, 0.08);
}

.archive-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--lavender));
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.archive-card:hover .archive-card-accent {
    opacity: 1;
}

.archive-card-label {
    font-size: 0.65rem;
    color: var(--lavender);
    opacity: 0.7;
    margin-bottom: 0.75rem;
    display: block;
}

.archive-card-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--cream);
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.archive-card-body {
    font-family: 'Cormorant', Georgia, serif;
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.archive-card-source {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--gold);
    opacity: 0.6;
}

/* ========================================
   DEMONSTRATIO — Code Ethics
   ======================================== */

.demonstratio {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--black) 0%, var(--void) 100%);
}

.demonstratio-header {
    margin-bottom: 3rem;
}

.demonstratio-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.code-panel {
    background: rgba(10, 10, 20, 0.9);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.code-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(18, 16, 42, 0.6);
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.code-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.code-dot-red { background: #e05252; }
.code-dot-gold { background: var(--gold); }
.code-dot-lavender { background: var(--lavender); }

.code-panel-title {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.5;
}

.code-block {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.75rem, 1.1vw, 0.88rem);
    line-height: 1.8;
    color: var(--cream);
}

.code-keyword { color: var(--lavender); }
.code-function { color: var(--gold); }
.code-type { color: var(--cyan); }
.code-prop { color: var(--cream); opacity: 0.9; }
.code-value { color: #4ade80; }
.code-comment { color: var(--muted); opacity: 0.5; font-style: italic; }

.demonstratio-text {
    padding: 1rem 0;
}

.demonstratio-body {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.demonstratio-body em {
    color: var(--cream);
    font-style: italic;
}

.demonstratio-qed {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
}

.qed-symbol {
    font-size: 1.5rem;
    color: var(--gold);
}

.qed-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ========================================
   THE COLOPHON — Dissolving Hexagons
   ======================================== */

.colophon {
    position: relative;
    padding: 8rem 2rem;
    background: var(--black);
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.colophon-hex-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dissolving-hex {
    position: absolute;
    width: 60px;
    height: 69px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(201, 168, 76, 0.1);
    background: rgba(167, 139, 250, 0.03);
    animation: dissolve 8s ease-in-out infinite;
}

.dh-1 { top: 10%; left: 5%; animation-delay: 0s; width: 50px; height: 58px; }
.dh-2 { top: 20%; right: 10%; animation-delay: 1s; width: 70px; height: 81px; }
.dh-3 { top: 60%; left: 15%; animation-delay: 2s; width: 45px; height: 52px; }
.dh-4 { top: 40%; right: 20%; animation-delay: 3s; width: 55px; height: 63px; }
.dh-5 { bottom: 20%; left: 25%; animation-delay: 4s; width: 65px; height: 75px; }
.dh-6 { top: 15%; left: 40%; animation-delay: 5s; width: 40px; height: 46px; }
.dh-7 { bottom: 30%; right: 8%; animation-delay: 6s; width: 55px; height: 63px; }
.dh-8 { top: 70%; left: 60%; animation-delay: 7s; width: 48px; height: 55px; }

@keyframes dissolve {
    0%, 100% { opacity: 0; transform: scale(0.8) rotate(0deg); }
    20% { opacity: 0.3; transform: scale(1) rotate(5deg); }
    50% { opacity: 0.15; transform: scale(1.05) rotate(-3deg); }
    80% { opacity: 0.05; transform: scale(0.95) rotate(2deg); }
}

.colophon-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
}

.colophon-quote {
    font-family: 'Cormorant', Georgia, serif;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--cream);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.colophon-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.colophon-attribution {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.08em;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
}

.colophon-attribution.visible {
    opacity: 0.7;
}

.colophon-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.colophon-mark.visible {
    opacity: 1;
}

.colophon-domain {
    font-family: 'Poiret One', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    color: var(--cream);
    text-transform: lowercase;
}

.colophon-year {
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.4;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hex-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hex-cell-inner {
        clip-path: polygon(50% 0%, 100% 15%, 100% 85%, 50% 100%, 0% 85%, 0% 15%);
        min-height: 200px;
        padding: 2rem 1.5rem;
    }

    .hex-border-glow {
        clip-path: polygon(50% 0%, 100% 15%, 100% 85%, 50% 100%, 0% 85%, 0% 15%);
    }

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

    .demonstratio-content {
        grid-template-columns: 1fr;
    }

    .vestibule-title {
        font-size: clamp(3rem, 15vw, 6rem);
    }
}

@media (max-width: 480px) {
    .nave, .archive, .demonstratio {
        padding: 4rem 1rem;
    }

    .archive-card {
        padding: 1.5rem;
    }
}

/* ========================================
   ANIMATIONS — Scroll reveal base
   ======================================== */

.hex-cell,
.archive-card {
    transition-property: opacity, transform;
    transition-duration: 0.6s;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Neon line accent */
.nave::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, transparent, var(--gold), transparent);
    opacity: 0.3;
}
