/* ==============================================
   saram.quest - Hand-Drawn Human Quest Map
   Ma-Negative-Space Layout | Retro-Futuristic
   ============================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #F5ECD7;
    color: #6A5A40;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* --- Organic Blob Decorations --- */
.blob {
    position: fixed;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
}

.blob-1 {
    width: 320px;
    height: 280px;
    background: #E87A3A;
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    top: 8vh;
    left: -60px;
    animation: blobDrift1 18s ease-in-out infinite;
}

.blob-2 {
    width: 200px;
    height: 240px;
    background: #2AC5A0;
    border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
    top: 35vh;
    right: -40px;
    animation: blobDrift2 22s ease-in-out infinite;
}

.blob-3 {
    width: 160px;
    height: 180px;
    background: #6A5A40;
    border-radius: 55% 45% 60% 40% / 40% 55% 45% 60%;
    bottom: 20vh;
    left: 5vw;
    animation: blobDrift3 20s ease-in-out infinite;
}

.blob-4 {
    width: 240px;
    height: 200px;
    background: #E87A3A;
    border-radius: 40% 60% 45% 55% / 60% 40% 55% 45%;
    bottom: 10vh;
    right: 3vw;
    animation: blobDrift1 25s ease-in-out infinite reverse;
}

.blob-5 {
    width: 140px;
    height: 140px;
    background: #2AC5A0;
    border-radius: 50% 50% 40% 60% / 45% 55% 50% 50%;
    top: 60vh;
    left: 50%;
    transform: translateX(-50%);
    animation: blobDrift2 16s ease-in-out infinite;
}

@keyframes blobDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -20px) scale(1.05); }
    66% { transform: translate(-10px, 15px) scale(0.95); }
}

@keyframes blobDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-20px, 10px) scale(0.97); }
    66% { transform: translate(12px, -18px) scale(1.03); }
}

@keyframes blobDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(18px, 12px) scale(1.04); }
}

/* --- Ma-Negative-Space Content Layout --- */
.quest-content {
    position: relative;
    z-index: 1;
    max-width: 580px;
    margin: 12vh auto;
    padding: 0 1.5rem;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    color: #2A2520;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2rem, 4.5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #2A2520;
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* --- Glitch Text Effect --- */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text::before {
    color: #E87A3A;
    z-index: -1;
    animation: glitchFlicker 4s ease-in-out infinite;
}

.glitch-text::after {
    color: #2AC5A0;
    z-index: -1;
    animation: glitchFlicker 4s ease-in-out infinite 0.15s;
}

@keyframes glitchFlicker {
    0%, 90%, 100% {
        opacity: 0;
        transform: translate(0, 0);
    }
    92% {
        opacity: 0.8;
        transform: translate(2px, -1px);
    }
    94% {
        opacity: 0;
        transform: translate(-1px, 1px);
    }
    96% {
        opacity: 0.6;
        transform: translate(-2px, 0);
    }
    98% {
        opacity: 0;
        transform: translate(1px, 1px);
    }
}

/* --- Hero Section --- */
.quest-hero {
    text-align: center;
    margin-bottom: 16vh;
    padding-top: 4vh;
}

.quest-subtitle {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    color: #6A5A40;
    letter-spacing: 0.08em;
    margin-top: 0.75rem;
}

/* --- Narrative Section --- */
.quest-narrative {
    margin-bottom: 14vh;
}

/* --- Waypoints Section --- */
.quest-waypoints {
    margin-bottom: 14vh;
}

.waypoint-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.waypoint-card {
    background: #FFF8EC;
    padding: 2rem 2rem 1.5rem;
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(106, 90, 64, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.waypoint-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(42, 37, 32, 0.08);
}

.waypoint-card h3 {
    color: #E87A3A;
}

/* --- Isometric Icons --- */
.isometric-icon {
    width: 48px;
    height: 48px;
    position: relative;
    transform: rotateX(45deg) rotateZ(45deg);
    transform-style: preserve-3d;
    margin-bottom: 1rem;
    transition: transform 0.4s ease;
    display: inline-block;
}

.quest-hero .isometric-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
}

.iso-face {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Compass icon */
.isometric-compass .iso-top {
    background: #E87A3A;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0.9;
}

.isometric-compass .iso-left {
    background: #2AC5A0;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-radius: 50%;
    opacity: 0.7;
}

.isometric-compass .iso-right {
    background: #2A2520;
    width: 20%;
    height: 20%;
    top: 40%;
    left: 40%;
    border-radius: 50%;
}

/* Scroll icon */
.isometric-scroll .iso-top {
    background: #2AC5A0;
    width: 100%;
    height: 70%;
    top: 15%;
    border-radius: 4px;
    opacity: 0.9;
}

.isometric-scroll .iso-left {
    background: #E87A3A;
    width: 80%;
    height: 3px;
    top: 35%;
    left: 10%;
}

.isometric-scroll .iso-right {
    background: #E87A3A;
    width: 60%;
    height: 3px;
    top: 50%;
    left: 10%;
}

/* Gem icon */
.isometric-gem .iso-top {
    background: #E87A3A;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.isometric-gem .iso-left {
    background: #2AC5A0;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    opacity: 0.7;
}

.isometric-gem .iso-right {
    display: none;
}

/* Flame icon */
.isometric-flame .iso-top {
    background: #E87A3A;
    width: 60%;
    height: 80%;
    top: 10%;
    left: 20%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.9;
}

.isometric-flame .iso-left {
    background: #FFF8EC;
    width: 30%;
    height: 40%;
    top: 35%;
    left: 35%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.8;
}

.isometric-flame .iso-right {
    display: none;
}

/* Star icon */
.isometric-star .iso-top {
    background: #2AC5A0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.9;
}

.isometric-star .iso-left,
.isometric-star .iso-right {
    display: none;
}

/* Book icon */
.isometric-book .iso-top {
    background: #6A5A40;
    width: 100%;
    height: 75%;
    top: 12%;
    border-radius: 3px;
    opacity: 0.85;
}

.isometric-book .iso-left {
    background: #E87A3A;
    width: 4px;
    height: 75%;
    top: 12%;
    left: 0;
    border-radius: 2px 0 0 2px;
}

.isometric-book .iso-right {
    background: #FFF8EC;
    width: 70%;
    height: 2px;
    top: 40%;
    left: 18%;
}

.isometric-icon:hover {
    transform: rotateX(45deg) rotateZ(45deg) scale(1.15) translateY(-4px);
}

/* --- Reflection / Blockquote --- */
.quest-reflection {
    margin-bottom: 14vh;
}

.quest-reflection blockquote {
    border-left: 3px solid #E87A3A;
    padding: 1rem 0 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #2A2520;
    font-size: 1.05rem;
    background: #FFF8EC;
    border-radius: 0 8px 8px 0;
    padding-right: 1.5rem;
}

/* --- Footer --- */
.quest-footer {
    text-align: center;
    padding-bottom: 6vh;
    color: #6A5A40;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    opacity: 0.7;
}

.footer-line {
    width: 60px;
    height: 2px;
    background: #E87A3A;
    margin: 0 auto 1.5rem;
    border-radius: 1px;
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .quest-content {
        margin: 8vh auto;
        padding: 0 1.25rem;
    }

    .quest-hero {
        margin-bottom: 10vh;
    }

    .quest-narrative,
    .quest-waypoints,
    .quest-reflection {
        margin-bottom: 10vh;
    }

    .blob-1 { width: 200px; height: 180px; }
    .blob-2 { width: 140px; height: 160px; }
    .blob-3 { width: 100px; height: 120px; }
    .blob-4 { width: 160px; height: 140px; }
    .blob-5 { display: none; }

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

/* --- Selection styling --- */
::selection {
    background: #E87A3A;
    color: #FFF8EC;
}
