/* reiwa.day - Wabi-sabi meets neon-electric */
/* Colors: #1a1a2e (deep base), #4a90d9 (primary blue), #f5f0e8 (warm off-white), #e8b84b (accent gold), #6c757d (muted gray) */
/* Font: Inter */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a2e;
    color: #f5f0e8;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Noise grain overlay for wabi-sabi texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ============ HEADER ============ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 2rem;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.scrolled {
    background-color: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #f5f0e8;
    position: relative;
}

.logo-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 2px;
    color: #4a90d9;
    clip-path: inset(0 100% 0 0);
    animation: logoGlitch 8s infinite;
}

@keyframes logoGlitch {
    0%, 95% { clip-path: inset(0 100% 0 0); }
    96% { clip-path: inset(20% 0 60% 0); }
    97% { clip-path: inset(60% 0 10% 0); }
    98% { clip-path: inset(40% 0 30% 0); }
    99%, 100% { clip-path: inset(0 100% 0 0); }
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #e8b84b;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #f5f0e8;
}

.nav-link:hover::after {
    width: 100%;
}

.header-date {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.1em;
}

/* ============ HERO ============ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.blob {
    position: absolute;
    border-radius: 50% 40% 60% 45% / 55% 50% 45% 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: #4a90d9;
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #e8b84b;
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #4a90d9;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); border-radius: 50% 40% 60% 45% / 55% 50% 45% 50%; }
    25% { transform: translate(30px, -40px) rotate(5deg) scale(1.05); border-radius: 45% 55% 50% 40% / 50% 45% 55% 50%; }
    50% { transform: translate(-20px, 20px) rotate(-3deg) scale(0.95); border-radius: 55% 45% 40% 60% / 45% 55% 50% 45%; }
    75% { transform: translate(10px, -10px) rotate(2deg) scale(1.02); border-radius: 40% 60% 55% 45% / 50% 40% 60% 55%; }
}

.blob-3 {
    animation-name: blobFloat3;
}

@keyframes blobFloat3 {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    25% { transform: translate(-50%, -50%) translate(30px, -40px) rotate(5deg) scale(1.05); }
    50% { transform: translate(-50%, -50%) translate(-20px, 20px) rotate(-3deg) scale(0.95); }
    75% { transform: translate(-50%, -50%) translate(10px, -10px) rotate(2deg) scale(1.02); }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
    position: relative;
    color: #f5f0e8;
}

.hero-title::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 3px;
    color: #4a90d9;
    clip-path: inset(0 100% 0 0);
    animation: heroGlitch 6s infinite;
}

.hero-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: -3px;
    color: #e8b84b;
    clip-path: inset(0 100% 0 0);
    animation: heroGlitch2 6s infinite;
}

@keyframes heroGlitch {
    0%, 90% { clip-path: inset(0 100% 0 0); }
    91% { clip-path: inset(15% 0 70% 0); }
    92% { clip-path: inset(55% 0 20% 0); }
    93% { clip-path: inset(35% 0 40% 0); }
    94% { clip-path: inset(70% 0 5% 0); }
    95%, 100% { clip-path: inset(0 100% 0 0); }
}

@keyframes heroGlitch2 {
    0%, 92% { clip-path: inset(0 100% 0 0); }
    93% { clip-path: inset(25% 0 50% 0); }
    94% { clip-path: inset(65% 0 15% 0); }
    95% { clip-path: inset(45% 0 30% 0); }
    96%, 100% { clip-path: inset(0 100% 0 0); }
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    color: #e8b84b;
    border: 1px solid #e8b84b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #e8b84b;
    transition: left 0.4s ease;
    z-index: -1;
}

.cta-button:hover {
    color: #1a1a2e;
}

.cta-button:hover::before {
    left: 0;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #e8b84b, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ============ SECTIONS COMMON ============ */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
    color: #f5f0e8;
}

.section-title::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 2px;
    color: #4a90d9;
    clip-path: inset(0 100% 0 0);
    animation: sectionGlitch 10s infinite;
}

@keyframes sectionGlitch {
    0%, 93% { clip-path: inset(0 100% 0 0); }
    94% { clip-path: inset(30% 0 50% 0); }
    95% { clip-path: inset(60% 0 20% 0); }
    96%, 100% { clip-path: inset(0 100% 0 0); }
}

.section-desc {
    font-size: 1rem;
    font-weight: 300;
    color: #6c757d;
    letter-spacing: 0.05em;
}

/* ============ SECTION BLOBS ============ */
.section-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50% 40% 60% 45% / 55% 50% 45% 50%;
    filter: blur(100px);
    opacity: 0.08;
    pointer-events: none;
}

.section-blob-left {
    background: #4a90d9;
    left: -200px;
    top: 50%;
    transform: translateY(-50%);
}

.section-blob-right {
    background: #e8b84b;
    right: -200px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============ MOMENTS / CARD GRID ============ */
.moments-section {
    padding: 6rem 2rem;
    position: relative;
}

.card-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.card {
    background: rgba(245, 240, 232, 0.03);
    border: 1px solid rgba(245, 240, 232, 0.06);
    border-radius: 3px 8px 5px 6px;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 184, 75, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card-featured {
    grid-column: span 2;
    grid-row: span 2;
}

.card-wide {
    grid-column: span 2;
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.card-featured .card-image-wrapper {
    aspect-ratio: 4 / 3;
}

.card-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-svg {
    width: 100%;
    height: 100%;
}

.card-glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 144, 217, 0.03) 2px,
        rgba(74, 144, 217, 0.03) 4px
    );
}

.card:hover .card-glitch-overlay {
    opacity: 1;
    animation: glitchOverlay 0.3s steps(3) forwards;
}

@keyframes glitchOverlay {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, 3px); }
    80% { transform: translate(3px, -2px); }
    100% { transform: translate(0); opacity: 0.5; }
}

/* Glitch on card image hover */
.card:hover .card-image {
    animation: cardImageGlitch 0.5s steps(2) forwards;
}

@keyframes cardImageGlitch {
    0% { filter: none; }
    20% { filter: hue-rotate(90deg) saturate(2); }
    40% { filter: hue-rotate(-45deg) brightness(1.2); }
    60% { filter: hue-rotate(180deg) contrast(1.5); }
    80% { filter: hue-rotate(45deg) saturate(1.5); }
    100% { filter: none; }
}

.card-content {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.card-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #e8b84b;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(232, 184, 75, 0.3);
    border-radius: 2px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    color: #f5f0e8;
}

.card-featured .card-title {
    font-size: 1.75rem;
}

.card-text {
    font-size: 0.9rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.6;
}

/* ============ DAILY SECTION ============ */
.daily-section {
    padding: 6rem 2rem;
    position: relative;
}

.daily-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.daily-card {
    background: rgba(245, 240, 232, 0.02);
    border: 1px solid rgba(245, 240, 232, 0.05);
    border-radius: 5px 3px 7px 4px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.daily-card:hover {
    border-color: rgba(74, 144, 217, 0.3);
    transform: translateY(-2px);
}

.daily-card-large {
    grid-column: span 2;
}

.daily-number {
    font-size: 4rem;
    font-weight: 900;
    color: rgba(74, 144, 217, 0.1);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.daily-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #f5f0e8;
    letter-spacing: -0.02em;
}

.daily-text {
    font-size: 0.95rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.7;
    max-width: 500px;
}

.daily-accent {
    width: 40px;
    height: 2px;
    background: #e8b84b;
    margin-top: 1.5rem;
    transition: width 0.4s ease;
}

.daily-card:hover .daily-accent {
    width: 80px;
}

/* ============ PHILOSOPHY SECTION ============ */
.philosophy-section {
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
}

.blob-4 {
    width: 500px;
    height: 500px;
    background: #e8b84b;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
}

.philosophy-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.philosophy-title {
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    position: relative;
    color: #f5f0e8;
}

.philosophy-title::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 2px;
    color: #e8b84b;
    clip-path: inset(0 100% 0 0);
    animation: sectionGlitch 12s infinite;
}

.philosophy-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.7;
}

.philosophy-item {
    padding: 2rem;
    border-left: 1px solid rgba(232, 184, 75, 0.2);
    margin-bottom: 2rem;
    transition: border-color 0.3s ease;
}

.philosophy-item:hover {
    border-left-color: #e8b84b;
}

.philosophy-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.philosophy-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f5f0e8;
}

.philosophy-item p {
    font-size: 0.9rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.6;
}

/* ============ ABOUT SECTION ============ */
.about-section {
    padding: 8rem 2rem;
    position: relative;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.about-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    position: relative;
    color: #f5f0e8;
}

.about-title::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 2px;
    color: #4a90d9;
    clip-path: inset(0 100% 0 0);
    animation: sectionGlitch 9s infinite;
}

.about-description {
    font-size: 1rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.about-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-svg {
    width: 100%;
    max-width: 300px;
    animation: aboutRotate 60s linear infinite;
}

@keyframes aboutRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============ FOOTER ============ */
.site-footer {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(245, 240, 232, 0.05);
}

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

.footer-logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #f5f0e8;
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

.footer-logo::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 2px;
    color: #4a90d9;
    clip-path: inset(0 100% 0 0);
    animation: logoGlitch 8s infinite;
}

.footer-text {
    font-size: 0.95rem;
    font-weight: 300;
    color: #6c757d;
    margin-bottom: 2rem;
}

.footer-line {
    width: 40px;
    height: 1px;
    background: #e8b84b;
    margin: 0 auto 2rem;
}

.footer-copyright {
    font-size: 0.75rem;
    font-weight: 300;
    color: rgba(108, 117, 125, 0.5);
    letter-spacing: 0.05em;
}

/* ============ ANIMATIONS ============ */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .card-featured {
        grid-column: span 1;
        grid-row: span 1;
    }

    .card-wide {
        grid-column: span 1;
    }

    .daily-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .daily-card-large {
        grid-column: span 1;
    }

    .philosophy-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-visual {
        order: -1;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .daily-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .site-header {
        padding: 1rem 1.5rem;
    }
}
