/* =============================================================
   aiice.quest — Crystalline Observatory
   Horizontal-scroll Art Deco gallery
   Bebas Neue + Cormorant Garamond + IBM Plex Mono (Google Fonts)

   Palette (Muted Vintage with Crystalline Accents):
     #1e1c1f  Antiqued Charcoal (deep bg)
     #2a2630  Warm Obsidian     (chamber bg)
     #e8dfd1  Parchment Cream   (primary text)
     #b09a6f  Oxidized Brass    (accent / structural)
     #a08080  Dusty Rose Quartz (facet wash)
     #c4b8d6  Pale Amethyst     (crystalline highlight)
     #7a7680  Tarnished Silver  (muted neutral)

   Motion: elastic / spring-physics only. Never linear.
   ============================================================= */

:root {
    --ink-deep:   #1e1c1f;
    --ink-chamber:#2a2630;
    --cream:      #e8dfd1;
    --brass:      #b09a6f;
    --quartz:     #a08080;
    --amethyst:   #c4b8d6;
    --silver:     #7a7680;

    /* Spring easings (elastic / overshoot) */
    --spring:        cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-soft:   cubic-bezier(0.25, 0.46, 0.45, 1.2);
    --spring-strong: cubic-bezier(0.28, 1.8,  0.52, 1);

    --chamber-count: 5;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ink-deep);
    color: var(--cream);
    font-family: "Cormorant Garamond", "Lora", Georgia, serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    /* never pure black: faint violet/brown undertone */
    background:
        radial-gradient(ellipse at 50% 50%, rgba(176,154,111,0.07), transparent 55%),
        radial-gradient(ellipse at 15% 85%, rgba(196,184,214,0.055), transparent 42%),
        radial-gradient(ellipse at 85% 20%, rgba(160,128,128,0.045), transparent 40%),
        var(--ink-deep);
    position: relative;
}

/* Selection — brass on obsidian */
::selection { background: rgba(176,154,111,0.45); color: var(--cream); }

/* ------ Ambient vignette + grain patina ------ */
.ambient-vignette {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background:
        radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.58) 100%),
        repeating-linear-gradient(
            0deg,
            rgba(232,223,209,0.012) 0px,
            rgba(232,223,209,0.012) 1px,
            transparent 1px,
            transparent 3px
        );
}

.ambient-sheen {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 41;
    background:
        linear-gradient(110deg,
            transparent 0%,
            rgba(196,184,214,0.025) 40%,
            rgba(196,184,214,0.04) 50%,
            rgba(196,184,214,0.025) 60%,
            transparent 100%);
    mix-blend-mode: screen;
    animation: sheen-drift 18s var(--spring-soft) infinite;
}
@keyframes sheen-drift {
    0%, 100% { transform: translateX(-6%); opacity: 0.55; }
    50%      { transform: translateX(6%);  opacity: 0.9;  }
}

/* ------ Chevron edge rails ------ */
.edge-rail {
    position: fixed;
    left: 0;
    right: 0;
    height: 16px;
    z-index: 30;
    pointer-events: none;
}
.edge-rail svg { width: 100%; height: 100%; display: block; }
.edge-rail-top    { top: 0; }
.edge-rail-bottom { bottom: 0; }

/* ------ Brand mark (fixed, upper-left) ------ */
.brand-mark {
    position: fixed;
    top: 22px;
    left: 28px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brass);
    font-family: "IBM Plex Mono", "Space Mono", monospace;
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.brand-mark .brand-sep { color: var(--silver); opacity: 0.7; }
.brand-mark .faint     { color: var(--silver); opacity: 0.78; }

/* ------ Catalog cartouche (fixed, upper-right) ------ */
.catalog-mark {
    position: fixed;
    top: 22px;
    right: 28px;
    z-index: 50;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 14px;
    border: 1px solid rgba(176,154,111,0.4);
    color: var(--brass);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.catalog-mark .faint { color: var(--silver); opacity: 0.82; }
.catalog-mark sup { font-size: 0.55rem; vertical-align: super; }

/* ------ Typographic atoms ------ */
.mono {
    font-family: "IBM Plex Mono", "Space Mono", monospace;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(0.65rem, 0.85vw, 0.82rem);
}
.mono sup { font-size: 0.55em; vertical-align: super; letter-spacing: 0; }
.faint    { color: var(--silver); opacity: 0.82; }

/* ------ Horizontal track ------ */
.track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: calc(100vw * var(--chamber-count));
    height: 100vh;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* ------ Chamber shell ------ */
.chamber {
    position: relative;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--ink-chamber);
    display: flex;
    flex-direction: column;
    padding: 72px 96px;
}

/* alternating vertical gradient between chambers for depth */
.chamber:nth-child(even) {
    background:
        linear-gradient(180deg, rgba(30,28,31,0.45), rgba(42,38,48,0.88)),
        var(--ink-chamber);
}
.chamber:nth-child(odd) {
    background:
        linear-gradient(180deg, rgba(42,38,48,0.82), rgba(30,28,31,0.55)),
        var(--ink-chamber);
}

/* Corner sunburst fans — quarter-circle Art Deco ornaments */
.corner-fan {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
    opacity: 0.55;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
.corner-fan-tl {
    top: 0; left: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23b09a6f' stroke-width='1' stroke-opacity='0.55'><path d='M0 0 L200 0'/><path d='M0 0 L195 32'/><path d='M0 0 L180 66'/><path d='M0 0 L160 96'/><path d='M0 0 L132 126'/><path d='M0 0 L104 152'/><path d='M0 0 L68 170'/><path d='M0 0 L36 188'/><path d='M0 0 L0 200'/></g><circle cx='0' cy='0' r='3' fill='%23b09a6f'/><circle cx='0' cy='0' r='18' fill='none' stroke='%23b09a6f' stroke-width='0.6' stroke-opacity='0.7'/><circle cx='0' cy='0' r='36' fill='none' stroke='%23b09a6f' stroke-width='0.4' stroke-opacity='0.4'/></svg>");
}
.corner-fan-br {
    bottom: 0; right: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23b09a6f' stroke-width='1' stroke-opacity='0.55'><path d='M200 200 L0 200'/><path d='M200 200 L5 168'/><path d='M200 200 L20 134'/><path d='M200 200 L40 104'/><path d='M200 200 L68 74'/><path d='M200 200 L96 48'/><path d='M200 200 L132 26'/><path d='M200 200 L164 10'/><path d='M200 200 L200 0'/></g><circle cx='200' cy='200' r='3' fill='%23b09a6f'/><circle cx='200' cy='200' r='18' fill='none' stroke='%23b09a6f' stroke-width='0.6' stroke-opacity='0.7'/><circle cx='200' cy='200' r='36' fill='none' stroke='%23b09a6f' stroke-width='0.4' stroke-opacity='0.4'/></svg>");
}

/* ------ Pilaster (diamond-ornamented vertical divider) ------ */
.pilaster {
    position: absolute;
    top: 10%;
    right: 0;
    width: 4px;
    height: 80%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(176,154,111,0.15) 8%,
        rgba(176,154,111,0.6)  30%,
        rgba(176,154,111,0.6)  70%,
        rgba(176,154,111,0.15) 92%,
        transparent 100%
    );
    transform: translateX(2px);
}
.pilaster::before,
.pilaster::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 2px;
    height: 22%;
    background: var(--brass);
    opacity: 0.7;
    transform: translateX(-50%);
}
.pilaster::before { top: 6%; }
.pilaster::after  { bottom: 6%; }

.pilaster-diamond {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--brass);
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow:
        0 0 0 2px var(--ink-chamber),
        0 0 0 3px rgba(176,154,111,0.6),
        0 0 16px rgba(196,184,214,0.45);
    animation: diamond-pulse 4.2s var(--spring) infinite;
}
.pilaster-terminal { display: none; }

@keyframes diamond-pulse {
    0%, 100% { width: 8px;  height: 8px;  opacity: 0.75; box-shadow: 0 0 0 2px var(--ink-chamber), 0 0 0 3px rgba(176,154,111,0.4), 0 0 8px rgba(196,184,214,0.3); }
    50%      { width: 16px; height: 16px; opacity: 1;    box-shadow: 0 0 0 2px var(--ink-chamber), 0 0 0 3px rgba(176,154,111,0.75), 0 0 20px rgba(196,184,214,0.7); }
}

/* ==============================================================
   Chamber I — The Atrium
   ============================================================== */
.chamber-atrium .atrium-inner {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 28px;
    align-items: center;
    justify-items: center;
    text-align: center;
    padding-top: 24px;
}

.atrium-caption {
    display: flex;
    gap: 18px;
    color: var(--brass);
}

.atrium-title {
    font-family: "Bebas Neue", "Oswald", "Impact", sans-serif;
    font-weight: 400;
    font-size: clamp(5rem, 12vw, 14rem);
    line-height: 0.9;
    letter-spacing: 0.08em;
    color: var(--cream);
    text-transform: uppercase;
    position: relative;
    margin: 0;
    text-shadow:
        0 0 24px rgba(196,184,214,0.1),
        0 0 1px  rgba(176,154,111,0.5);
}
.atrium-title .atrium-dot {
    color: var(--brass);
    display: inline-block;
    transform: translateY(-0.08em);
    animation: dot-breathe 3.6s var(--spring) infinite;
}
.atrium-title .word {
    display: inline-block;
    animation: word-rise 1.6s var(--spring) both;
}
.atrium-title .word:nth-of-type(2) { animation-delay: 0.18s; }

@keyframes dot-breathe {
    0%, 100% { opacity: 0.65; transform: translateY(-0.08em) scale(1); }
    50%      { opacity: 1;    transform: translateY(-0.08em) scale(1.2); color: var(--amethyst); }
}
@keyframes word-rise {
    0%   { opacity: 0; transform: translateY(32px) scale(0.96); letter-spacing: 0.22em; }
    60%  { opacity: 1; transform: translateY(-6px) scale(1.01); letter-spacing: 0.06em; }
    100% { opacity: 1; transform: translateY(0)    scale(1);    letter-spacing: 0.08em; }
}

.atrium-wireframe {
    width: clamp(220px, 28vw, 360px);
    height: clamp(220px, 28vw, 360px);
    position: relative;
    filter: drop-shadow(0 0 14px rgba(196,184,214,0.22));
}
.icosahedron {
    width: 100%;
    height: 100%;
    animation: icos-tumble 30s linear infinite;
    transform-origin: 50% 50%;
}
@keyframes icos-tumble {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.04); }
    100% { transform: rotate(360deg) scale(1); }
}
.icos-edge {
    stroke: var(--brass);
    stroke-width: 0.012;
    stroke-linecap: round;
    fill: none;
}
.icos-vertex {
    fill: var(--amethyst);
    opacity: 0.4;
    animation: vert-breathe 4s ease-in-out infinite;
}
@keyframes vert-breathe {
    0%, 100% { opacity: 0.3; r: 0.030; }
    50%      { opacity: 1;   r: 0.055; }
}

.atrium-subtitle {
    font-family: "Cormorant Garamond", "Lora", serif;
    font-weight: 300;
    font-style: normal;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.75;
    color: var(--cream);
    max-width: 640px;
    opacity: 0.92;
}
.atrium-subtitle em {
    color: var(--amethyst);
    font-style: italic;
    font-weight: 400;
}

.atrium-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--brass);
    animation: arrow-pulse 2.6s var(--spring) infinite;
}
.atrium-arrow svg { width: 110px; height: 16px; display: block; }
@keyframes arrow-pulse {
    0%, 100% { transform: translateX(0);    opacity: 0.75; }
    50%      { transform: translateX(14px); opacity: 1;    }
}

/* ==============================================================
   Chamber II — Gallery of Facets
   ============================================================== */
.chamber-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    max-width: 680px;
}
.chamber-title {
    font-family: "Bebas Neue", sans-serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 4.5vw, 4.2rem);
    letter-spacing: 0.08em;
    color: var(--cream);
    line-height: 0.95;
    text-transform: uppercase;
}

.facets-stage {
    position: relative;
    flex: 1;
    display: block;
}

.shard {
    position: absolute;
    top: 50%;
    width: clamp(260px, 30vw, 460px);
    height: clamp(320px, 46vh, 520px);
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 14px 22px rgba(122,118,128,0.38));
    transition: clip-path 0.8s var(--spring), filter 0.4s var(--spring);
    will-change: transform;
}
.shard::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 0.5;
    mix-blend-mode: screen;
    pointer-events: none;
}
.shard-inner {
    width: 100%;
    height: 100%;
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.shard-inner .mono   { color: var(--brass); }
.shard-text {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
    line-height: 1.55;
    color: var(--cream);
    max-width: 92%;
}

/* three distinct tinted shards, each with a distinct polygon cut */
.shard-1 {
    left: 30%;
    background: rgba(160,128,128,0.24);
    clip-path: polygon(14% 0%, 92% 6%, 100% 58%, 78% 100%, 6% 94%, 0% 34%);
    border: 1px solid rgba(196,184,214,0.2);
}
.shard-2 {
    left: 50%;
    background: rgba(196,184,214,0.2);
    clip-path: polygon(0% 14%, 84% 0%, 100% 44%, 88% 96%, 18% 100%, 4% 58%);
    border: 1px solid rgba(176,154,111,0.24);
}
.shard-3 {
    left: 70%;
    background: rgba(176,154,111,0.2);
    clip-path: polygon(10% 4%, 100% 10%, 96% 70%, 70% 100%, 0% 88%, 6% 38%);
    border: 1px solid rgba(232,223,209,0.14);
}

.shard:hover {
    filter: drop-shadow(0 20px 28px rgba(196,184,214,0.45));
}

.facets-foot {
    margin-top: auto;
    padding-top: 24px;
    color: var(--silver);
    opacity: 0.72;
}

/* ==============================================================
   Chamber III — The Threshold
   ============================================================== */
.chamber-threshold {
    flex-direction: row;
    align-items: stretch;
    padding: 72px 96px;
    gap: 48px;
}
.threshold-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    max-width: 600px;
}
.threshold-quote {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 2.4vw, 2.4rem);
    line-height: 1.5;
    color: var(--cream);
    border-left: 1px solid rgba(176,154,111,0.5);
    padding-left: 28px;
    position: relative;
}
.threshold-quote em          { color: var(--amethyst); font-style: italic; }
.threshold-quote .quote-accent { color: var(--brass); font-style: normal; letter-spacing: 0.02em; }

.threshold-meta {
    display: flex;
    gap: 12px;
    color: var(--silver);
    opacity: 0.8;
    margin-top: 8px;
}

.threshold-divider {
    width: 40px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
}
.threshold-divider svg { width: 100%; height: 100%; }

.threshold-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 14px;
}
.hex-lattice {
    width: clamp(280px, 34vw, 460px);
    height: clamp(280px, 34vw, 460px);
}
.hex-lattice g { transform-origin: center; transform-box: fill-box; }
#hex-group-outer { animation: hex-rotate-slow 42s linear infinite; }
#hex-group-inner { animation: hex-rotate-rev  30s linear infinite; }
#hex-core        { animation: hex-pulse        6s var(--spring) infinite; }

@keyframes hex-rotate-slow { to { transform: rotate(360deg); } }
@keyframes hex-rotate-rev  { to { transform: rotate(-360deg); } }
@keyframes hex-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1;    }
}

.hex-caption {
    color: var(--brass);
    opacity: 0.8;
}

/* ==============================================================
   Chamber IV — The Archive
   ============================================================== */
.chamber-archive { padding: 72px 96px; }

.card-fan {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1400px;
}
.index-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(220px, 22vw, 300px);
    height: clamp(300px, 38vh, 400px);
    padding: 28px 24px;
    background:
        linear-gradient(180deg, #efe6d6 0%, #e8dfd1 100%);
    color: #1e1c1f;
    border: 1px solid rgba(176,154,111,0.6);
    box-shadow:
        0 18px 32px rgba(0,0,0,0.42),
        0 0 0 1px rgba(30,28,31,0.22) inset,
        0 2px 0 rgba(255,255,255,0.4) inset;
    transform: translate(-50%, -50%) translateX(0) rotate(0deg);
    transition:
        transform 0.9s var(--spring),
        box-shadow 0.4s var(--spring);
    will-change: transform;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.index-card::before {
    /* paper grain */
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(176,154,111,0.03) 0 2px,
            transparent 2px 5px);
    pointer-events: none;
}
.index-card::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    height: 1px;
    background: rgba(176,154,111,0.55);
}
.index-card header {
    display: flex;
    justify-content: space-between;
    color: var(--brass);
    font-family: "IBM Plex Mono", monospace;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 4px;
}
.index-card h3 {
    font-family: "Bebas Neue", sans-serif;
    font-weight: 400;
    font-size: 1.8rem;
    letter-spacing: 0.06em;
    color: #1e1c1f;
    margin-top: 14px;
}
.index-card p {
    font-family: "Cormorant Garamond", serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #2a2630;
    font-style: italic;
}
.index-card em { color: #b09a6f; font-style: italic; }
.card-foot {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    color: var(--silver);
    opacity: 0.8;
    font-size: 0.7rem;
}

.index-card:hover {
    transform: translate(-50%, -50%)
               var(--card-transform, translateX(0) rotate(0deg))
               translateY(-20px) scale(1.05);
    box-shadow:
        0 30px 55px rgba(0,0,0,0.58),
        0 0 0 1px rgba(176,154,111,0.8) inset,
        0 2px 0 rgba(255,255,255,0.55) inset;
    z-index: 20;
}
.card-fan.fanned .index-card {
    transform: translate(-50%, -50%) var(--card-transform);
}

.archive-foot {
    margin-top: 24px;
    text-align: right;
    color: var(--silver);
    opacity: 0.72;
}

/* ==============================================================
   Chamber V — The Vanishing Point
   ============================================================== */
.chamber-vanishing {
    padding: 0;
    align-items: center;
    justify-content: center;
}
.vanishing-stage {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 800px;
    perspective-origin: 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.converging-line {
    position: absolute;
    background: linear-gradient(
        to right,
        rgba(176,154,111,0) 0%,
        rgba(176,154,111,0.75) 50%,
        rgba(176,154,111,0) 100%
    );
}
.converging-line-top {
    top: 30%; left: 0; right: 0; height: 1px;
    transform: perspective(800px) rotateX(-15deg) translateY(-80px);
    opacity: 0.7;
}
.converging-line-bot {
    bottom: 30%; left: 0; right: 0; height: 1px;
    transform: perspective(800px) rotateX(15deg) translateY(80px);
    opacity: 0.7;
}
.converging-line-left {
    top: 10%; bottom: 10%; left: 30%; width: 1px;
    background: linear-gradient(
        to bottom,
        rgba(176,154,111,0) 0%,
        rgba(176,154,111,0.75) 50%,
        rgba(176,154,111,0) 100%
    );
    transform: rotate(-5deg);
}
.converging-line-right {
    top: 10%; bottom: 10%; right: 30%; width: 1px;
    background: linear-gradient(
        to bottom,
        rgba(176,154,111,0) 0%,
        rgba(176,154,111,0.75) 50%,
        rgba(176,154,111,0) 100%
    );
    transform: rotate(5deg);
}

.vanishing-deepframe,
.vanishing-midframe,
.vanishing-nearframe {
    position: absolute;
    top: 50%; left: 50%;
    transform-origin: center;
    border: 1px solid rgba(176,154,111,0.35);
}
.vanishing-deepframe {
    width: 66vw;
    height: 62vh;
    transform: translate(-50%, -50%) translateZ(-380px);
    opacity: 0.32;
}
.vanishing-midframe {
    width: 44vw;
    height: 44vh;
    transform: translate(-50%, -50%) translateZ(-220px);
    opacity: 0.55;
    border-color: rgba(176,154,111,0.5);
}
.vanishing-nearframe {
    width: 28vw;
    height: 30vh;
    transform: translate(-50%, -50%) translateZ(-80px);
    opacity: 0.7;
    border-color: rgba(176,154,111,0.65);
}

.vanishing-midframe::before,
.vanishing-midframe::after,
.vanishing-deepframe::before,
.vanishing-deepframe::after,
.vanishing-nearframe::before,
.vanishing-nearframe::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--brass);
    transform: rotate(45deg);
}
.vanishing-midframe::before   { top: -5px; left: -5px; }
.vanishing-midframe::after    { bottom: -5px; right: -5px; }
.vanishing-deepframe::before  { top: -5px; right: -5px; }
.vanishing-deepframe::after   { bottom: -5px; left: -5px; }
.vanishing-nearframe::before  { top: -5px; left: -5px; background: var(--amethyst); }
.vanishing-nearframe::after   { bottom: -5px; right: -5px; background: var(--amethyst); }

.vanishing-core {
    position: relative;
    transform: translateZ(-120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    text-align: center;
    max-width: 560px;
    padding: 36px 48px;
}
.vanishing-core .mono { color: var(--brass); }
.vanishing-sentence {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-style: normal;
    font-size: clamp(1.05rem, 1.35vw, 1.4rem);
    line-height: 1.8;
    color: var(--cream);
    opacity: 0.92;
}
.vanishing-sentence em {
    color: var(--amethyst);
    font-style: italic;
}
.vanishing-em {
    display: block;
    margin-top: 12px;
    color: var(--brass);
    letter-spacing: 0.03em;
    font-style: italic;
}
.vanishing-signature {
    margin-top: 8px;
    opacity: 0.75;
}
.vanishing-signature svg { width: 140px; height: 12px; }

/* ==============================================================
   Progress Rail — fixed lateral indicator
   ============================================================== */
.progress-rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 26px;
    height: 42px;
    z-index: 60;
    pointer-events: none;
}
.rail-track {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    height: 2px;
    background: rgba(176,154,111,0.28);
    transform: translateY(-50%);
}
.rail-fill {
    position: absolute;
    left: 6%;
    top: 50%;
    height: 2px;
    width: 0;
    background: var(--brass);
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(196,184,214,0.55);
    transition: width 0.25s var(--spring-soft);
}
.rail-marker {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    padding: 0;
    border: none;
    background: transparent;
    transform: translate(-50%, -50%) rotate(45deg);
    cursor: pointer;
    pointer-events: auto;
}
.rail-marker::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--ink-chamber);
    border: 1px solid var(--brass);
    transition: all 0.3s var(--spring);
}
.rail-marker.active::before {
    background: var(--brass);
    box-shadow: 0 0 14px rgba(196,184,214,0.75);
}
.rail-marker:hover::before {
    background: var(--amethyst);
    border-color: var(--amethyst);
}
.marker-label {
    position: absolute;
    left: 50%;
    top: -30px;
    transform: translate(-50%, 0) rotate(-45deg);
    white-space: nowrap;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: var(--silver);
    opacity: 0;
    transition: opacity 0.3s var(--spring);
    pointer-events: none;
}
.rail-marker.active .marker-label,
.rail-marker:hover  .marker-label {
    opacity: 1;
    color: var(--brass);
}

/* Markers evenly positioned across inner track band 6%–94% */
.rail-marker[data-jump="0"] { left: 6%;  }
.rail-marker[data-jump="1"] { left: 28%; }
.rail-marker[data-jump="2"] { left: 50%; }
.rail-marker[data-jump="3"] { left: 72%; }
.rail-marker[data-jump="4"] { left: 94%; }

/* ==============================================================
   Responsive softening (still lateral)
   ============================================================== */
@media (max-width: 1100px) {
    .chamber { padding: 56px 60px; }
    .catalog-mark { padding: 4px 10px; font-size: 0.62rem; }
}
@media (max-width: 900px) {
    .chamber { padding: 48px 44px; }
    .brand-mark    { font-size: 0.62rem; left: 14px; top: 12px; gap: 6px; }
    .catalog-mark  { font-size: 0.58rem; right: 14px; top: 12px; }
    .corner-fan { width: 140px; height: 140px; }
    .threshold-divider { width: 22px; }
    .shard-inner { padding: 32px 22px; }
    .index-card  { width: 220px; height: 300px; padding: 20px 18px; }
    .index-card h3 { font-size: 1.4rem; }
    .progress-rail { bottom: 18px; }
}
@media (max-width: 560px) {
    .atrium-title { font-size: clamp(3rem, 14vw, 6rem); }
    .shard        { width: 74vw; height: 58vh; }
    .shard-1 { left: 34%; }
    .shard-2 { left: 50%; }
    .shard-3 { left: 66%; }
    .chamber-threshold { flex-direction: column; gap: 18px; padding: 48px 28px; }
    .threshold-divider { width: 100%; height: 22px; }
    .threshold-divider svg { transform: rotate(90deg); }
}
