/* ============================================
   haru.club — styles.css
   Cottagecore + Glitch-Art Community
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    line-height: 1.85;
    font-size: clamp(15px, 1.05vw, 17px);
    color: #3A3430;
    background-color: #F5EDE0;
    overflow-x: hidden;
}

/* ---------- Linen Texture Background ---------- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(138, 117, 96, 0.02) 2px,
            rgba(138, 117, 96, 0.02) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(138, 117, 96, 0.02) 2px,
            rgba(138, 117, 96, 0.02) 4px
        );
}

/* ---------- Typography ---------- */
h1, h2, h3, .section-title {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-title {
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    color: #3A3430;
    text-align: center;
    margin-bottom: 0.5em;
}

/* ---------- SECTION 1: Hero ---------- */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F5EDE0;
    z-index: 1;
    overflow: hidden;
}

#hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem 1rem;
}

#logotype {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: clamp(36px, 6vw, 72px);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3A3430;
    opacity: 0;
    margin-bottom: 0.2em;
    transition: opacity 600ms ease, letter-spacing 600ms ease;
}

#logotype.visible {
    opacity: 1;
    letter-spacing: 0.08em;
}

#hero-tagline {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #8A7560;
    opacity: 0;
    transition: opacity 800ms ease 400ms;
    margin-bottom: 2rem;
}

#hero-tagline.visible {
    opacity: 1;
}

#hero-subtitle {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #8A7560;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 800ms ease 800ms;
}

#hero-subtitle.visible {
    opacity: 1;
}

/* ---------- Circle Window ---------- */
#circle-container {
    position: relative;
    width: min(60vh, 80vw);
    height: min(60vh, 80vw);
    max-width: 550px;
    max-height: 550px;
}

#wreath-svg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    z-index: 2;
    pointer-events: none;
}

#wreath-path {
    stroke-dasharray: 1760;
    stroke-dashoffset: 1760;
    transition: stroke-dashoffset 2000ms ease;
}

#wreath-path.drawn {
    stroke-dashoffset: 0;
}

.wreath-flower {
    opacity: 0;
    transition: opacity 400ms ease;
}

.wreath-flower.visible {
    opacity: 1;
}

#circle-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    border-radius: 50%;
    overflow: hidden;
    background: #EDE4D6;
}

/* ---------- Botanical Slides ---------- */
.botanical-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.botanical-slide.active {
    opacity: 1;
}

.botanical-slide-1 {
    background:
        radial-gradient(circle at 30% 40%, #c9d4a0 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, #d4b8a0 0%, transparent 50%),
        radial-gradient(circle at 50% 30%, #a8b890 0%, transparent 40%),
        linear-gradient(160deg, #e8e0c8 0%, #d0c8a8 40%, #b8c4a0 70%, #c8b8a0 100%);
}

.botanical-slide-2 {
    background:
        radial-gradient(circle at 60% 35%, #b8c4a0 0%, transparent 45%),
        radial-gradient(circle at 35% 65%, #e0cca0 0%, transparent 50%),
        radial-gradient(circle at 55% 70%, #c0a890 0%, transparent 35%),
        linear-gradient(200deg, #d8d0b8 0%, #c4bca0 35%, #a0b8a0 65%, #d0c0a0 100%);
}

.botanical-slide-3 {
    background:
        radial-gradient(circle at 45% 50%, #d0b0a0 0%, transparent 45%),
        radial-gradient(circle at 25% 30%, #c0c8a0 0%, transparent 40%),
        radial-gradient(circle at 70% 40%, #b4c0a8 0%, transparent 50%),
        linear-gradient(140deg, #e4dcc4 0%, #c8c0a0 30%, #b0b898 60%, #d8c8a0 100%);
}

.botanical-slide-4 {
    background:
        radial-gradient(circle at 40% 60%, #c8b4a0 0%, transparent 50%),
        radial-gradient(circle at 65% 30%, #a8b890 0%, transparent 40%),
        radial-gradient(circle at 30% 35%, #d4c0a0 0%, transparent 45%),
        linear-gradient(180deg, #dcd4bc 0%, #c0b898 40%, #b8c0a0 70%, #d0c4a0 100%);
}

/* ---------- Glitch Overlay ---------- */
#glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
}

#glitch-overlay.glitching {
    opacity: 1;
    /* Glitch magenta: #D040A0 */
    background:
        linear-gradient(transparent 0%, transparent 20%,
            #D040A026 20%, #D040A026 20.5%,
            transparent 20.5%, transparent 35%,
            #D040A01A 35%, #D040A01A 35.3%,
            transparent 35.3%, transparent 52%,
            #D040A01F 52%, #D040A01F 52.8%,
            transparent 52.8%, transparent 68%,
            #D040A014 68%, #D040A014 68.4%,
            transparent 68.4%, transparent 82%,
            #D040A024 82%, #D040A024 82.6%,
            transparent 82.6%, transparent 100%
        );
    animation: glitchShift 150ms steps(3) forwards;
}

@keyframes glitchShift {
    0% { transform: translateX(3px); }
    33% { transform: translateX(-3px); }
    66% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

/* ---------- SECTION 2: Portfolio Grid ---------- */
#portfolio {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    background-color: #F5EDE0;
}

#portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* ---------- Day Cards ---------- */
.day-card {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    transform: rotate(var(--rotation, 0deg));
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transition: opacity 400ms ease, transform 400ms ease, box-shadow 300ms ease;
}

.day-card.revealed {
    opacity: 1;
}

.day-card:hover {
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.12);
}

/* Glitch on every 5th card */
.day-card:nth-child(5n) {
    animation: cardGlitch 12s infinite;
}

@keyframes cardGlitch {
    0%, 98.5%, 100% {
        transform: rotate(var(--rotation, 0deg)) translateX(0);
    }
    99% {
        transform: rotate(var(--rotation, 0deg)) translateX(3px);
    }
    99.3% {
        transform: rotate(var(--rotation, 0deg)) translateX(-3px);
    }
    99.6% {
        transform: rotate(var(--rotation, 0deg)) translateX(0);
    }
}

.day-card:nth-child(5n).revealed {
    animation: cardGlitch 12s infinite;
}

.card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.card-image-inner {
    width: 100%;
    height: 100%;
    transition: filter 400ms ease;
}

.blur-focus .card-image-inner,
.blur-focus .day-thumbnail {
    filter: blur(3px);
    transition: filter 400ms ease;
}

.blur-focus:hover .card-image-inner,
.blur-focus:hover .day-thumbnail,
.blur-focus.focused .card-image-inner,
.blur-focus.focused .day-thumbnail {
    filter: blur(0px);
}

.card-body {
    padding: 1rem 1.2rem 1.2rem;
}

.card-meta {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #8A7560;
    display: block;
    margin-bottom: 0.2em;
}

.card-member {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #3A3430;
    display: block;
    margin-bottom: 0.5em;
}

.card-desc {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    line-height: 1.7;
    color: #8A7560;
}

/* ---------- SECTION 3: Featured Story ---------- */
#featured-story {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    background-color: #EDE4D6;
}

.story-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
    gap: 2rem;
}

.story-decoration {
    flex: 0 0 60px;
    padding-top: 4rem;
}

.story-decoration svg {
    width: 60px;
    height: 200px;
}

.story-content {
    flex: 1;
    max-width: 680px;
}

.story-label {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7A8A60;
    display: block;
    margin-bottom: 0.8em;
}

.story-title {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3A3430;
    line-height: 1.1;
    margin-bottom: 0.3em;
}

.story-author {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.03em;
    color: #8A7560;
    margin-bottom: 2rem;
}

.story-text p {
    margin-bottom: 1.5em;
    color: #3A3430;
}

.pull-quote {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 30px);
    line-height: 1.4;
    color: #B07070;
    border-left: 3px solid #B07070;
    padding: 0.5em 0 0.5em 1.5em;
    margin: 2em 0;
}

/* ---------- SECTION 4: Calendar ---------- */
#calendar {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    background-color: #F5EDE0;
}

.calendar-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 16px;
    color: #8A7560;
    text-align: center;
    margin-bottom: 2.5rem;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    max-width: 900px;
    margin: 0 auto;
}

.calendar-header {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: #8A7560;
    padding: 0.5em 0;
}

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 0.4em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 400ms ease, box-shadow 300ms ease;
}

.calendar-day:hover {
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.calendar-day.today {
    border: 2px solid #B07070;
}

.calendar-day.today .day-number {
    color: #B07070;
    font-weight: 700;
}

.day-number {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #3A3430;
    position: relative;
    z-index: 1;
    margin-bottom: 0.2em;
}

.day-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: filter 400ms ease;
    z-index: 0;
    opacity: 0.6;
}

.day-ritual {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 9px;
    letter-spacing: 0.02em;
    color: #8A7560;
    text-align: center;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 400ms ease;
}

.calendar-day:hover .day-ritual {
    opacity: 1;
}

/* Calendar Overlay */
#calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(58, 52, 48, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}

#calendar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#calendar-overlay.hidden {
    display: none;
}

#calendar-overlay-content {
    background: #F5EDE0;
    border-radius: 16px;
    padding: 3rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 300ms ease;
}

#calendar-overlay.active #calendar-overlay-content {
    transform: scale(1);
}

#calendar-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 24px;
    color: #8A7560;
    cursor: pointer;
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    line-height: 1;
}

#calendar-overlay-close:hover {
    color: #3A3430;
}

#overlay-day-title {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3A3430;
    margin-bottom: 0.3em;
}

#overlay-day-ritual {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #7A8A60;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1em;
}

#overlay-day-description {
    font-family: 'Lora', Georgia, serif;
    font-size: 15px;
    line-height: 1.8;
    color: #8A7560;
}

/* ---------- SECTION 5: Footer ---------- */
#site-footer {
    position: relative;
    z-index: 1;
    background-color: #8A7560;
    color: #F5EDE0;
    padding: 0;
}

.footer-border {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.footer-border svg {
    width: 100%;
    height: 30px;
    display: block;
}

.footer-content {
    padding: 3rem 2rem 2rem;
    text-align: center;
}

.footer-logo {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #F5EDE0;
    margin-bottom: 0.3em;
}

.footer-tagline {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: #EDE4D6;
    margin-bottom: 1.5em;
}

.footer-nav {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.footer-nav a {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: #EDE4D6;
    text-decoration: none;
    transition: color 300ms ease;
}

.footer-nav a:hover {
    color: #E8D8A0;
}

.footer-copy {
    font-family: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.03em;
    color: #B8A890;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    #portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-decoration {
        display: none;
    }

    #calendar-grid {
        gap: 4px;
    }
}

@media (max-width: 600px) {
    #portfolio-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    #circle-container {
        width: min(75vh, 85vw);
        height: min(75vh, 85vw);
    }

    .calendar-day {
        padding: 0.2em;
    }

    .day-number {
        font-size: 11px;
    }

    .day-ritual {
        font-size: 7px;
    }

    .footer-nav {
        gap: 1rem;
    }
}