/* ==========================================================================
   nfth.ing - Y2K Futurism x Terracotta Warmth
   Palette: Terracotta-Warm
   Fonts: Cormorant Garamond, DM Sans, Space Mono
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --fired-terracotta: #C4693D;
    --sun-bleached-clay: #E8B896;
    --kiln-cream: #F5EAD9;
    --charred-earth: #2A1F16;
    --linen-dust: #EDE3D5;
    --warm-silver: #C9BFB3;
    --warm-charcoal: #3D3229;
    --amber-ember: #D4883A;
    --burnished-clay: #9E6B55;

    --bg-color: #F5EAD9;
    --text-color: #3D3229;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
    --font-accent: 'Space Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 800ms cubic-bezier(0.4, 0, 0.2, 1),
                color 800ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    line-height: 1.72;
    letter-spacing: 0.005em;
    cursor: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    animation: grain-shift 400ms steps(4) infinite;
}

@keyframes grain-shift {
    0% { background-position: 0 0; }
    25% { background-position: -40px 20px; }
    50% { background-position: 20px -30px; }
    75% { background-position: -20px 40px; }
    100% { background-position: 0 0; }
}

body.dark-section .grain-overlay {
    opacity: 0.06;
}

/* --- Cursor Follower --- */
.cursor-follower {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--fired-terracotta);
    opacity: 0;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 9998;
    transition: width 200ms ease, height 200ms ease, background 200ms ease, opacity 200ms ease, border-radius 200ms ease;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}

.cursor-follower.active {
    opacity: 0.5;
}

.cursor-follower.on-text {
    width: 24px;
    height: 24px;
    background: var(--warm-silver);
}

/* --- Floating Nav --- */
.floating-nav {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9000;
    cursor: none;
}

.nav-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fired-terracotta);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    transition: border-radius 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
                width 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
                height 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
                background 300ms ease;
    position: relative;
}

.nav-dot-label {
    font-family: var(--font-accent);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--kiln-cream);
    opacity: 0.8;
}

.floating-nav:hover .nav-dot {
    width: 200px;
    height: 180px;
    border-radius: 62% 38% 55% 45% / 40% 60% 40% 60%;
    background: var(--fired-terracotta);
}

.floating-nav:hover .nav-dot-label {
    display: none;
}

.nav-expanded {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms ease 200ms;
}

.floating-nav:hover .nav-expanded {
    pointer-events: auto;
    opacity: 1;
}

.nav-link {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 1rem;
    color: var(--kiln-cream);
    letter-spacing: 0.02em;
    transition: color 200ms ease;
    cursor: none;
}

.nav-link:hover {
    color: var(--amber-ember);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(4rem, 14vw, 10rem);
    letter-spacing: -0.03em;
    color: var(--fired-terracotta);
    line-height: 1;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Chrome Orb --- */
.orb-container {
    position: relative;
    width: clamp(200px, 35vw, 450px);
    height: clamp(200px, 35vw, 450px);
    margin: 40px 0;
}

.orb {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #F5EAD9, #C4693D 40%, #2A1F16 80%);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
    animation: orb-rotate 30s linear infinite;
    animation-play-state: paused;
    filter: contrast(1.05) saturate(1.1);
}

.orb.visible {
    opacity: 1;
    transform: scale(1);
    animation-play-state: running;
}

.orb-highlight {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 25% 20%, rgba(255,255,255,0.6) 0%, transparent 30%);
}

.orb-environment {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 180deg, #E8B896, #C9BFB3, #D4883A, #C4693D, #E8B896);
    opacity: 0.25;
    mix-blend-mode: overlay;
}

@keyframes orb-rotate {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.02) rotate(90deg);
    }
    50% {
        transform: scale(1) rotate(180deg);
    }
    75% {
        transform: scale(0.98) rotate(270deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

/* --- Hero Subtitle (Typewriter) --- */
.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: var(--warm-charcoal);
    letter-spacing: 0.005em;
    overflow: hidden;
    white-space: nowrap;
    max-width: 0;
    opacity: 0;
    transition: opacity 200ms ease;
}

.hero-subtitle.typing {
    opacity: 1;
    animation: typewriter-reveal 1.6s steps(42, end) forwards;
}

@keyframes typewriter-reveal {
    from { max-width: 0; }
    to { max-width: 600px; }
}

/* --- Retro Decorative Elements --- */
.retro-deco {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.retro-starburst {
    width: 20px;
    height: 20px;
    opacity: 0.2;
}

.retro-starburst::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--warm-silver);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.retro-circles {
    width: 28px;
    height: 28px;
    opacity: 0.15;
}

.retro-circles::before,
.retro-circles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid var(--fired-terracotta);
}

.retro-circles::before {
    inset: 0;
}

.retro-circles::after {
    inset: 6px;
    border-color: var(--sun-bleached-clay);
}

.retro-pill {
    width: 32px;
    height: 12px;
    border-radius: 6px;
    background: var(--warm-silver);
    opacity: 0.2;
}

.retro-deco-light .retro-starburst::before,
.retro-deco-light.retro-starburst::before {
    background: var(--sun-bleached-clay);
}

.retro-deco-light .retro-circles::before,
.retro-deco-light.retro-circles::before,
.retro-deco-light .retro-circles::after,
.retro-deco-light.retro-circles::after {
    border-color: var(--sun-bleached-clay);
}

.retro-deco-light.retro-pill {
    background: var(--sun-bleached-clay);
}

/* --- Terracotta Texture Strips --- */
.terracotta-strip {
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #C4693D 0px,
        #C4693D 4px,
        #E8B896 4px,
        #E8B896 7px,
        transparent 7px,
        transparent 9px
    );
    opacity: 0.6;
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    padding: clamp(120px, 18vh, 240px) clamp(20px, 5vw, 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(60px, 10vh, 120px);
    overflow: hidden;
}

/* --- Organic Containers --- */
.organic-container {
    border-radius: var(--br, 50% 50% 50% 50% / 50% 50% 50% 50%);
    background: var(--sun-bleached-clay);
    padding: clamp(32px, 6vw, 80px);
    position: relative;
    z-index: 1;
    transition: border-radius 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 600ms ease;
}

.organic-container:hover {
    box-shadow: 0 8px 40px rgba(196, 105, 61, 0.08);
}

.organic-container-wide {
    max-width: 900px;
    width: 100%;
}

.organic-container-narrow {
    max-width: 520px;
    width: 100%;
}

.organic-container-dark {
    background: rgba(196, 105, 61, 0.08);
}

.organic-container-footer {
    background: rgba(245, 234, 217, 0.1);
    text-align: center;
}

/* Hover border-radius shifts for organic feel */
.organic-container-wide:hover {
    --br: 35% 65% 50% 50% / 55% 45% 50% 50%;
}

.organic-container-narrow:hover {
    --br: 50% 50% 35% 65% / 45% 55% 60% 40%;
}

/* --- Typography --- */
.section-label {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--burnished-clay);
    display: block;
    margin-bottom: 16px;
}

.section-label-light {
    color: var(--sun-bleached-clay);
}

.section-label-footer {
    color: var(--kiln-cream);
    margin-top: 16px;
    opacity: 0.7;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--fired-terracotta);
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.section-heading-light {
    color: var(--kiln-cream);
}

.section-heading-footer {
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--kiln-cream);
    letter-spacing: -0.03em;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--warm-charcoal);
    line-height: 1.72;
    letter-spacing: 0.005em;
}

.body-text-light {
    color: var(--kiln-cream);
}

.body-text-footer {
    color: var(--kiln-cream);
    opacity: 0.85;
}

.pull-quote {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--fired-terracotta);
    line-height: 1.35;
    letter-spacing: -0.01em;
    text-align: center;
}

.pull-quote-light {
    color: var(--sun-bleached-clay);
}

/* --- Section-specific backgrounds --- */
.section-philosophy {
    background: transparent;
}

.section-craft {
    background: transparent;
}

.section-deep {
    background: transparent;
}

.section-return {
    background: transparent;
}

.section-closing {
    background: transparent;
    min-height: 60vh;
    justify-content: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    .cursor-follower {
        display: none;
    }

    .organic-container {
        border-radius: 24px;
    }

    .organic-container:hover {
        --br: unset;
        border-radius: 24px;
    }

    .floating-nav {
        bottom: 20px;
        right: 20px;
    }

    .floating-nav:hover .nav-dot {
        width: 180px;
        height: 160px;
        border-radius: 52% 48% 55% 45% / 40% 60% 40% 60%;
    }

    .nav-expanded {
        width: 180px;
        height: 160px;
    }

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

    .orb-container {
        width: clamp(150px, 50vw, 280px);
        height: clamp(150px, 50vw, 280px);
    }

    .content-section {
        padding: clamp(80px, 14vh, 160px) clamp(16px, 5vw, 40px);
        gap: clamp(40px, 8vh, 80px);
    }
}

@media (max-width: 480px) {
    .floating-nav:hover .nav-dot {
        width: 160px;
        height: 150px;
    }

    .nav-expanded {
        width: 160px;
        height: 150px;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }
}
