/* ============================================================
   lordly.dev — Art-Deco Ornate Luxury
   Palette: #0a0a0f #c9a84c #1a1a25 #e8e0d0 #d4b866 #3a3a4a #12121e
   Fonts: Poiret One (display), Raleway (body), Fira Code (code)
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0a0f;
    color: #e8e0d0;
    font-family: 'Raleway', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================================
   THE THRONE ROOM (HERO)
   ============================================================ */
.throne-room {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 640px;
    background: #0a0a0f;
    overflow: hidden;
}

.sunburst-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(120vh, 120vw);
    height: min(120vh, 120vw);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.sunburst-ring {
    transition: opacity 1.2s ease;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: min(90vw, 720px);
}

.hero-eyebrow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    color: #c9a84c;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fade-rise 1.4s ease 0.2s forwards;
}

.eyebrow-mark {
    color: #c9a84c;
    font-size: 0.55rem;
}

.eyebrow-text {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
}

.hero-domain {
    font-family: 'Poiret One', 'Inter', sans-serif;
    font-weight: 400;
    color: #c9a84c;
    font-size: clamp(2.4rem, 7vw, 5.2rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.25);
    opacity: 0;
    animation: fade-rise 1.4s ease 0.5s forwards;
}

.hero-subtitle {
    margin-top: 1.5rem;
    color: #e8e0d0;
    font-family: 'Raleway', sans-serif;
    font-weight: 200;
    font-size: clamp(0.78rem, 1.2vw, 0.92rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0;
    animation: fade-rise 1.4s ease 0.8s forwards;
}

.hero-rule {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fade-rise 1.4s ease 1.1s forwards;
}

.endcap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.endcap.left { flex-direction: row; }
.endcap.right { flex-direction: row; }

.step {
    display: inline-block;
    background: #c9a84c;
    width: 8px;
    height: 8px;
}
.step.s1 { width: 4px; height: 4px; }
.step.s2 { width: 8px; height: 8px; }
.step.s3 { width: 12px; height: 12px; }

.rule-line {
    flex: 0 0 auto;
    width: clamp(40px, 12vw, 130px);
    height: 1px;
    background: #c9a84c;
}

.endcap-center {
    color: #c9a84c;
    font-size: 0.7rem;
    letter-spacing: 0;
}

.scroll-cue {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: #c9a84c;
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    z-index: 3;
    opacity: 0;
    animation: fade-rise 1.4s ease 1.4s forwards;
}

.cue-arrow {
    width: 18px;
    height: 24px;
    animation: cue-bob 2.4s ease-in-out infinite;
}

@keyframes cue-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

@keyframes fade-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   DECO DIVIDERS BETWEEN SECTIONS
   ============================================================ */
.deco-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    background: #0a0a0f;
}

.divider-step {
    display: inline-block;
    background: #c9a84c;
    width: 6px;
    height: 6px;
}

.divider-line {
    width: clamp(80px, 18vw, 240px);
    height: 1px;
    background: #c9a84c;
}

.divider-diamond {
    color: #c9a84c;
    font-size: 0.7rem;
    margin: 0 0.4rem;
}

/* ============================================================
   SECTION HEADERS (FAN MOTIF)
   ============================================================ */
.section-header {
    text-align: center;
    margin: 0 auto 3rem;
    padding: 0 2rem;
    max-width: 720px;
}

.fan-motif {
    width: 200px;
    height: 110px;
    display: block;
    margin: 0 auto 1.5rem;
}

.section-title {
    font-family: 'Poiret One', 'Inter', sans-serif;
    font-weight: 400;
    color: #c9a84c;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.2;
}

.section-kicker {
    margin-top: 0.75rem;
    color: #e8e0d0;
    font-weight: 200;
    font-size: 0.85rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.75;
}

/* ============================================================
   ORNATE FRAME (SHARED) — stepped corner ornaments
   ============================================================ */
.frame {
    background: #1a1a25;
    border: 1px solid #c9a84c;
    padding: 2rem 2.25rem;
    margin: 0;
    position: relative;
    transition: background 0.5s ease, border-color 0.5s ease, transform 0.5s ease;
}

/* Inner deco line */
.frame::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(201, 168, 76, 0.28);
    pointer-events: none;
}

/* Stepped corner ornaments — top-left & bottom-right via ::after */
.frame::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background: #c9a84c;
    top: -3px;
    left: -3px;
    box-shadow:
        /* mirror to top-right */
        calc(100% + 0px) 0 0 0 #c9a84c,
        /* The four "outer" stepped corner squares */
        -3px -3px 0 0 #0a0a0f,
        /* bottom-left */
        0 calc(100vh) 0 0 transparent;
    pointer-events: none;
}

/* Use four explicit corner squares via background-image for crispness */
.frame {
    background-image:
        linear-gradient(#c9a84c, #c9a84c),
        linear-gradient(#c9a84c, #c9a84c),
        linear-gradient(#c9a84c, #c9a84c),
        linear-gradient(#c9a84c, #c9a84c),
        linear-gradient(#1a1a25, #1a1a25);
    background-size:
        6px 6px,
        6px 6px,
        6px 6px,
        6px 6px,
        100% 100%;
    background-position:
        -3px -3px,
        calc(100% + 3px) -3px,
        -3px calc(100% + 3px),
        calc(100% + 3px) calc(100% + 3px),
        0 0;
    background-repeat: no-repeat;
    /* Cancel the sweeping ::after; we used background-image for corners */
}

.frame::after { content: none; }

/* Stepped outer ornament via box-shadow stack — ziggurat profile */
.frame {
    box-shadow:
        -4px -4px 0 0 #0a0a0f,
        -4px -4px 0 1px #c9a84c,
        -8px -8px 0 1px #0a0a0f,
        -8px -8px 0 2px #c9a84c,
        4px 4px 0 0 #0a0a0f,
        4px 4px 0 1px #c9a84c,
        8px 8px 0 1px #0a0a0f,
        8px 8px 0 2px #c9a84c;
}

.frame:hover {
    border-color: #d4b866;
}

/* ============================================================
   THE ARMORY (CONTENT) — diagonal grid of tool frames
   ============================================================ */
.armory {
    padding: 4rem 0 5rem;
    background: #0a0a0f;
}

.armory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3.5rem 3rem;
    padding: 1rem clamp(2rem, 6vw, 5rem);
    max-width: 1280px;
    margin: 0 auto;
}

.tool {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Diagonal-sections feel: stagger every other tool downward */
.armory-grid .tool:nth-child(even) {
    transform: translateY(28px);
}

.frame-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.3);
    padding-bottom: 0.85rem;
    margin-bottom: 0.5rem;
}

.frame-numeral {
    color: #c9a84c;
    font-family: 'Poiret One', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
}

.tool-name {
    font-family: 'Poiret One', 'Inter', sans-serif;
    font-weight: 400;
    color: #c9a84c;
    font-size: 1.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tool-desc {
    color: #e8e0d0;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
}

.code-block {
    background: #12121e;
    border: 1px solid rgba(201, 168, 76, 0.35);
    padding: 1rem 1.1rem;
    margin-top: 0.5rem;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px dashed rgba(201, 168, 76, 0.18);
    pointer-events: none;
}

.code-block code {
    font-family: 'Fira Code', 'Space Mono', monospace;
    font-size: 0.82rem;
    font-weight: 400;
    color: #d4b866;
    line-height: 1.65;
    white-space: pre;
}

.frame-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(201, 168, 76, 0.3);
}

.frame-tag {
    color: #c9a84c;
    border: 1px solid rgba(201, 168, 76, 0.6);
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 400;
}

/* ============================================================
   THE GREAT HALL (TENETS)
   ============================================================ */
.great-hall {
    padding: 4rem 0 5rem;
}

.hall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 3rem;
    padding: 1rem clamp(2rem, 6vw, 5rem);
    max-width: 1280px;
    margin: 0 auto;
}

.tenet {
    text-align: center;
    padding: 2.25rem 1.6rem;
}

.tenet-numeral {
    display: block;
    color: #c9a84c;
    font-family: 'Poiret One', sans-serif;
    font-size: 2.2rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.tenet-title {
    font-family: 'Poiret One', 'Inter', sans-serif;
    font-weight: 400;
    color: #c9a84c;
    font-size: 1.35rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.tenet-text {
    color: #e8e0d0;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ============================================================
   THE CHANCERY (CHRONICLE)
   ============================================================ */
.chancery {
    padding: 4rem 0 5rem;
}

.chronicle {
    list-style: none;
    max-width: 920px;
    margin: 0 auto;
    padding: 1rem clamp(2rem, 6vw, 4rem);
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.chronicle-entry {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1.75rem;
    align-items: start;
    padding: 1.6rem 1.85rem;
}

.chronicle-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid rgba(201, 168, 76, 0.4);
    padding-right: 1rem;
    color: #c9a84c;
    font-family: 'Poiret One', sans-serif;
    line-height: 1.1;
}

.date-day {
    font-size: 2.6rem;
    letter-spacing: 0.04em;
}

.date-month {
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    margin-top: 0.4rem;
}

.date-year {
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    margin-top: 0.35rem;
    color: rgba(201, 168, 76, 0.7);
}

.chronicle-title {
    font-family: 'Poiret One', 'Inter', sans-serif;
    font-weight: 400;
    color: #c9a84c;
    font-size: 1.25rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.chronicle-text {
    color: #e8e0d0;
    font-weight: 300;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ============================================================
   THE ROYAL DECREE (FOOTER)
   ============================================================ */
.royal-decree {
    background: #0a0a0f;
    padding: 5rem 2rem 5rem;
}

.decree-frame {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 2rem;
    border: 1px solid #c9a84c;
    background: #12121e;
    position: relative;
    box-shadow:
        -4px -4px 0 0 #0a0a0f,
        -4px -4px 0 1px #c9a84c,
        -8px -8px 0 1px #0a0a0f,
        -8px -8px 0 2px #c9a84c,
        4px 4px 0 0 #0a0a0f,
        4px 4px 0 1px #c9a84c,
        8px 8px 0 1px #0a0a0f,
        8px 8px 0 2px #c9a84c;
}

.decree-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    pointer-events: none;
}

.decree-top-rule,
.decree-bottom-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto;
}

.decree-top-rule { margin-bottom: 1.75rem; }
.decree-bottom-rule { margin-top: 1.75rem; }

.decree-body {
    color: #e8e0d0;
    font-family: 'Poiret One', 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    letter-spacing: 0.06em;
    line-height: 1.8;
    max-width: 640px;
    margin: 0 auto;
}

.decree-meta {
    margin-top: 1.5rem;
    color: #c9a84c;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.meta-divider {
    color: #c9a84c;
    font-size: 0.55rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
    .armory-grid .tool:nth-child(even) {
        transform: none;
    }
    .chronicle-entry {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .chronicle-date {
        flex-direction: row;
        gap: 0.75rem;
        align-items: baseline;
        border-right: none;
        border-bottom: 1px solid rgba(201, 168, 76, 0.4);
        padding: 0 0 0.6rem;
    }
    .date-day { font-size: 1.8rem; }
    .date-month, .date-year { margin-top: 0; }

    .frame {
        box-shadow:
            -3px -3px 0 0 #0a0a0f,
            -3px -3px 0 1px #c9a84c,
            -6px -6px 0 1px #0a0a0f,
            -6px -6px 0 2px #c9a84c,
            3px 3px 0 0 #0a0a0f,
            3px 3px 0 1px #c9a84c,
            6px 6px 0 1px #0a0a0f,
            6px 6px 0 2px #c9a84c;
    }
}

@media (max-width: 460px) {
    .hero-eyebrow { gap: 0.6rem; font-size: 0.6rem; }
    .rule-line { width: 36px; }
    .deco-divider { padding: 2rem 1rem; }
    .armory-grid, .hall-grid, .chronicle {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* ============================================================
   IN-VIEW REVEAL (driven by JS toggling .is-visible)
   ============================================================ */
.frame {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s ease, transform 0.9s ease, border-color 0.5s ease;
}

.frame.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.armory-grid .tool.is-visible:nth-child(even) {
    transform: translateY(28px);
}

@media (max-width: 720px) {
    .armory-grid .tool.is-visible:nth-child(even) {
        transform: translateY(0);
    }
}

.section-header .fan-motif,
.section-header .section-title,
.section-header .section-kicker {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.section-header.is-visible .fan-motif,
.section-header.is-visible .section-title,
.section-header.is-visible .section-kicker {
    opacity: 1;
    transform: translateY(0);
}

.section-header.is-visible .section-title { transition-delay: 0.15s; }
.section-header.is-visible .section-kicker { transition-delay: 0.3s; }
