/* ============================================
   sora.market — styles.css
   Pop-art nacre immersive scroll experience
   ============================================ */

:root {
    --void: #0a0a12;
    --abyss: #0d1b3e;
    --depth: #0a2a2a;
    --nacre: #f0ece4;
    --shell-pink: #d4a0a0;
    --pop-coral: #e85d75;
    --hud-cyan: #4aeadc;
    --marble-gray: #8b8b9e;
    --deep: #061616;
    --bg: #061616;
    --fg: #f0ece4;
}

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

html {
    scroll-behavior: auto;
}

body {
    background: var(--void);
    color: var(--nacre);
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ---- LAYER 1: THE VOID ---- */

#void {
    height: 100vh;
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.hero-title {
    font-family: 'Dela Gothic One', sans-serif;
    font-size: clamp(6rem, 20vw, 16rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--nacre);
    position: relative;
    z-index: 2;
    will-change: transform, opacity;
    transition: none;
}

/* Sonar Rings */
.sonar-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 1px;
    z-index: 1;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
    border-radius: 50%;
    border: 1px solid var(--hud-cyan);
    animation: sonar 4s ease-out infinite;
}

.ring:nth-child(2) { animation-delay: 0.8s; }
.ring:nth-child(3) { animation-delay: 1.6s; }
.ring:nth-child(4) { animation-delay: 2.4s; }
.ring:nth-child(5) { animation-delay: 3.2s; }

@keyframes sonar {
    0% {
        transform: scale(0.1);
        opacity: 0.6;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* ---- LAYER 2: THE DESCENT ---- */

#descent {
    min-height: 200vh;
    background: linear-gradient(
        to bottom,
        var(--void) 0%,
        var(--abyss) 40%,
        var(--depth) 100%
    );
    position: relative;
    padding: 10vh 0 20vh;
}

/* Market Items */
.market-item {
    position: sticky;
    max-width: 680px;
    padding: 2rem 2.5rem;
    background: rgba(10, 10, 18, 0.85);
    margin-bottom: 40vh;
    will-change: transform, opacity;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: sticky;
}

.market-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.item-left {
    margin-left: 20vw;
    margin-right: auto;
}

.item-right {
    margin-left: auto;
    margin-right: 20vw;
}

/* Ben-Day dot overlay */
.market-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--shell-pink) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.market-item:hover::before {
    opacity: 0.35;
    background: radial-gradient(circle, var(--pop-coral) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
}

/* HUD bracket corners */
.market-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-top: 1px solid var(--hud-cyan);
    border-right: 1px solid var(--hud-cyan);
    opacity: 0.3;
    pointer-events: none;
}

/* Marble-texture border */
.market-item {
    border: 1px solid rgba(139, 139, 158, 0.2);
    border-image: linear-gradient(
        135deg,
        rgba(240, 236, 228, 0.15),
        rgba(139, 139, 158, 0.1),
        rgba(212, 160, 160, 0.12),
        rgba(139, 139, 158, 0.1)
    ) 1;
    position: relative;
}

/* Bottom-left bracket */
.market-item .hud-label:first-child::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-bottom: 1px solid var(--hud-cyan);
    border-left: 1px solid var(--hud-cyan);
    opacity: 0.3;
}

.hud-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--hud-cyan);
    opacity: 0.5;
    text-transform: uppercase;
    display: block;
    position: relative;
    z-index: 1;
}

.hud-label-right {
    text-align: right;
}

.item-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nacre);
    margin: 1rem 0 0.75rem;
    position: relative;
    z-index: 1;
}

.draw-underline {
    position: relative;
    display: inline-block;
}

.draw-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--pop-coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.market-item:hover .draw-underline::after,
.market-item.visible .draw-underline::after {
    transform: scaleX(1);
}

.item-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.75;
    color: var(--nacre);
    opacity: 0.85;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

/* ---- LAYER 3: THE SHELL ---- */

#shell {
    min-height: 100vh;
    background: var(--deep);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Marble veining background */
#shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(240, 236, 228, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(139, 139, 158, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(212, 160, 160, 0.04) 0%, transparent 45%),
        conic-gradient(from 45deg at 30% 60%, rgba(240, 236, 228, 0.03) 0%, transparent 25%);
    pointer-events: none;
}

.shell-content {
    position: relative;
    z-index: 1;
}

#nautilus-svg {
    width: min(80vw, 600px);
    height: auto;
}

#nautilus-path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spiral-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.spiral-text.visible {
    opacity: 1;
}

/* ---- LAYER 4: THE RETURN ---- */

#return {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    transition: background-color 0.1s linear;
    position: relative;
}

.return-content {
    text-align: center;
}

.return-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--fg);
    transition: color 0.1s linear;
}

/* ---- Ben-Day dot field on descent ::after ---- */
#descent::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--shell-pink) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0.08;
    pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .item-left,
    .item-right {
        margin-left: 5vw;
        margin-right: 5vw;
    }

    .market-item {
        margin-bottom: 30vh;
    }
}
