/* xity.quest - Fairycore Anti-Design Experimental Aesthetic */
/* Palette: #2D1B4E #A67BA6 #4A7C59 #E8D9D1 #C8B8D8 #A63E39 #6BA87E */
/* Fonts: Caveat, Indie Flower, Crimson Text */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #2D1B4E;
    color: #E8D9D1;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: clamp(1rem, 1vw + 0.6rem, 1.2rem);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* === Typography === */
.chaotic-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: #E8D9D1;
    /* Rotation applied by JS */
}

.indie-text {
    font-family: 'Indie Flower', cursive;
}

h1.chaotic-heading {
    font-size: clamp(3.2rem, 5vw + 1rem, 6rem);
    letter-spacing: -0.04em;
    text-shadow: 0 0 40px rgba(200, 184, 216, 0.3), 0 0 80px rgba(166, 123, 166, 0.15);
}

h2.chaotic-heading {
    font-size: clamp(2.4rem, 3vw + 0.8rem, 4rem);
    letter-spacing: 0.02em;
    color: #C8B8D8;
    margin-bottom: 1.5rem;
}

h3.chaotic-heading {
    font-size: clamp(1.8rem, 2vw + 0.5rem, 2.4rem);
    color: #A67BA6;
    margin-bottom: 0.8rem;
}

/* === Hidden Navigation === */
#hidden-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

#nav-moon {
    font-size: 2rem;
    cursor: pointer;
    color: #C8B8D8;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.5s ease;
    display: inline-block;
}

#nav-moon:hover {
    opacity: 1;
    transform: rotate(15deg) scale(1.1);
}

#nav-links {
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(45, 27, 78, 0.92);
    border: 1px dashed #4A7C59;
    border-radius: 4px;
}

#hidden-nav:hover #nav-links,
#hidden-nav.nav-open #nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#nav-links li {
    margin: 8px 0;
}

#nav-links a {
    font-family: 'Indie Flower', cursive;
    font-size: 1.1rem;
    color: #A67BA6;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
    padding-bottom: 2px;
}

#nav-links a:hover {
    border-bottom-color: #A67BA6;
    color: #C8B8D8;
}

/* === Floating Decorations === */
#floating-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.float-icon {
    position: absolute;
    font-size: 1.4rem;
    color: #C8B8D8;
    opacity: 0;
    animation: gentleDrift 4s ease-in-out infinite;
}

.float-icon.moon { color: #E8D9D1; font-size: 1.8rem; }
.float-icon.star { color: #C8B8D8; }
.float-icon.glyph { color: #A67BA6; font-size: 1.2rem; }

.float-icon:nth-child(1) { top: 8%; left: 12%; animation-delay: 0s; opacity: 0.35; }
.float-icon:nth-child(2) { top: 15%; right: 18%; animation-delay: 0.7s; opacity: 0.25; }
.float-icon:nth-child(3) { top: 35%; left: 8%; animation-delay: 1.2s; opacity: 0.3; }
.float-icon:nth-child(4) { top: 50%; right: 10%; animation-delay: 0.3s; opacity: 0.2; }
.float-icon:nth-child(5) { top: 65%; left: 15%; animation-delay: 1.8s; opacity: 0.28; }
.float-icon:nth-child(6) { top: 78%; right: 22%; animation-delay: 0.5s; opacity: 0.22; }
.float-icon:nth-child(7) { top: 88%; left: 25%; animation-delay: 1.0s; opacity: 0.18; }
.float-icon:nth-child(8) { top: 22%; left: 80%; animation-delay: 2.1s; opacity: 0.32; }

@keyframes gentleDrift {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.float-icon[data-drift="2"] {
    animation-duration: 5s;
}
.float-icon[data-drift="3"] {
    animation-duration: 3.5s;
}

/* === Botanical SVG Layer === */
#botanical-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.botanical {
    position: absolute;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.botanical.visible {
    opacity: 1;
}

.fern-left {
    width: 80px;
    top: 10%;
    left: 3%;
    transform: rotate(-5deg);
}

.mush-right {
    width: 60px;
    top: 30%;
    right: 5%;
    transform: rotate(3deg);
}

.fern-right {
    width: 70px;
    top: 55%;
    right: 4%;
    transform: rotate(8deg);
}

.mush-left {
    width: 55px;
    top: 70%;
    left: 4%;
    transform: rotate(-3deg);
}

.toad-center {
    width: 50px;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
}

.sprout-1 {
    width: 40px;
    top: 42%;
    left: 7%;
    transform: rotate(-8deg);
}

.sprout-2 {
    width: 40px;
    bottom: 30%;
    right: 7%;
    transform: rotate(6deg);
}

/* SVG Draw Animation */
.draw-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s ease;
}

.botanical.visible .draw-path {
    stroke-dashoffset: 0;
}

/* === Sections === */
.section {
    position: relative;
    z-index: 2;
    padding: 5rem 1.5rem;
}

.section-inner {
    max-width: 900px;
    margin: 0 auto;
}

/* === Hero Section === */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 8rem;
    padding-bottom: 6rem;
}

.hero-title {
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero-intro {
    max-width: 65ch;
    margin: 0 auto 2rem;
    font-size: clamp(1rem, 1.2vw + 0.4rem, 1.2rem);
    color: #E8D9D1;
    opacity: 0.92;
}

.hero-sub {
    font-size: clamp(1.2rem, 1.5vw + 0.3rem, 1.6rem);
    color: #C8B8D8;
    max-width: 55ch;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInSlow 2s ease 0.8s forwards;
}

@keyframes fadeInSlow {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 0.9; transform: translateY(0); }
}

/* === ASCII Dividers === */
.ascii-divider {
    margin: 1.5rem 0 2rem;
    text-align: center;
}

.ascii-divider pre {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #4A7C59;
    opacity: 0.7;
    line-height: 1.3;
    display: inline-block;
}

/* === Hand-Drawn Borders === */
.hand-drawn-border {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.hand-drawn-border svg {
    width: 100%;
    height: 20px;
}

.border-leaf {
    display: inline-block;
    color: #4A7C59;
    font-size: 1.2rem;
    margin-top: -12px;
    position: relative;
    opacity: 0.6;
}

/* === Garden Section === */
.garden-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.garden-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.garden-card {
    background: rgba(45, 27, 78, 0.5);
    border: 1px dashed #4A7C59;
    padding: 2rem 2.2rem;
    position: relative;
    transition: border-color 0.3s ease, transform 0.3s ease;
    max-width: 65ch;
}

.garden-card:hover {
    border-color: #A67BA6;
    transform: rotate(0.5deg);
}

.garden-card:hover .card-glyph {
    opacity: 1;
}

.card-1 {
    margin-left: 0;
    transform: rotate(-1.5deg);
}

.card-2 {
    margin-left: auto;
    transform: rotate(2deg);
}

.card-3 {
    margin-left: 3rem;
    transform: rotate(-0.8deg);
}

.card-glyph {
    position: absolute;
    top: -12px;
    right: 15px;
    font-size: 1.5rem;
    color: #C8B8D8;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.garden-card p {
    color: #E8D9D1;
    opacity: 0.88;
}

/* === Archives Section === */
.archives-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.archive-entries {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.archive-entry {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 65ch;
    padding: 1.5rem;
    border-left: 2px dashed #4A7C59;
    transition: border-color 0.3s ease;
}

.archive-entry:hover {
    border-left-color: #A67BA6;
}

.archive-entry:nth-child(1) { margin-left: 2rem; transform: rotate(-0.5deg); }
.archive-entry:nth-child(2) { margin-left: auto; margin-right: 1rem; transform: rotate(1deg); }
.archive-entry:nth-child(3) { margin-left: 4rem; transform: rotate(-1.2deg); }

.entry-symbol {
    font-size: 2rem;
    color: #C8B8D8;
    flex-shrink: 0;
    opacity: 0.7;
    line-height: 1;
}

.entry-content p {
    color: #E8D9D1;
    opacity: 0.88;
}

.prose-link {
    color: #A63E39;
    cursor: pointer;
    border-bottom: 1px dashed #A63E39;
    transition: color 0.3s ease, border-color 0.3s ease;
    font-style: italic;
}

.prose-link:hover {
    color: #C8B8D8;
    border-bottom-color: #C8B8D8;
}

/* === Whispers Section === */
.whispers-section {
    padding-top: 4rem;
    padding-bottom: 6rem;
    text-align: center;
}

.whisper-fragments {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
    align-items: center;
}

.whisper {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.4rem, 2vw + 0.4rem, 2rem);
    color: #C8B8D8;
    max-width: 50ch;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    border: none;
    padding: 0;
    margin: 0 auto;
    quotes: none;
}

.whisper.visible {
    opacity: 0.85;
    transform: translateY(0);
}

.whisper:nth-child(1) { color: #E8D9D1; }
.whisper:nth-child(2) { color: #A67BA6; }
.whisper:nth-child(3) { color: #6BA87E; }
.whisper:nth-child(4) { color: #C8B8D8; }
.whisper:nth-child(5) { color: #E8D9D1; opacity: 0; }

/* === Footer === */
#footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 1.5rem 4rem;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-text {
    font-size: 1.3rem;
    color: #A67BA6;
    margin: 1rem 0;
    opacity: 0.8;
}

.footer-symbols {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-symbols span {
    font-size: 1.2rem;
    color: #C8B8D8;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.footer-symbols span:hover {
    opacity: 1;
}

/* === Gradient Background Overlay === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        #2D1B4E 0%,
        rgba(74, 124, 89, 0.08) 40%,
        rgba(45, 27, 78, 0.95) 60%,
        rgba(232, 217, 209, 0.03) 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* === Parallax Sway (hero title) === */
.hero-title {
    transition: transform 0.15s ease-out;
}

/* === Responsive Adjustments (fluid, no breakpoints) === */
.garden-card {
    padding: clamp(1.2rem, 3vw, 2.2rem);
}

.archive-entry {
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .card-1, .card-2, .card-3 {
        margin-left: 0;
        margin-right: 0;
    }
    .archive-entry:nth-child(1),
    .archive-entry:nth-child(2),
    .archive-entry:nth-child(3) {
        margin-left: 0;
        margin-right: 0;
    }
    .fern-left, .fern-right, .mush-left, .mush-right, .toad-center, .sprout-1, .sprout-2 {
        opacity: 0.5;
    }
}

/* === Selection === */
::selection {
    background: #A67BA6;
    color: #2D1B4E;
}
