/* ============================================
   GGIGGL.com - Restrained Delight
   Japanese Minimal + Playful Warmth
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Color Palette - Muted Vintage */
    --bg-aged-washi: #f5f0e8;
    --surface-warm-parchment: #ebe4d4;
    --text-sumi-ink: #2c2c2c;
    --text-faded-brush: #6b6358;
    --accent-beni-red: #c2593a;
    --accent-aged-indigo: #4a5568;
    --accent-patina-green: #7d8a6e;
    --divider-silk-thread: #b8a99a;
    --highlight-persimmon: #e8a87c;

    /* Typography */
    --font-display: 'Righteous', cursive;
    --font-body: 'Zen Kaku Gothic New', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Sizing */
    --grid-gap: 24px;
    --beat-spacing: 120px;

    /* Animation */
    --ease-wabi: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- 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-size: 17px;
    line-height: 1.7;
    color: var(--text-sumi-ink);
    background: linear-gradient(135deg, var(--bg-aged-washi) 0%, var(--surface-warm-parchment) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Washi Texture Overlay ---------- */
.washi-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background:
        radial-gradient(circle at 20% 30%, rgba(107, 99, 88, 0.3) 0%, transparent 1%),
        radial-gradient(circle at 80% 10%, rgba(107, 99, 88, 0.25) 0%, transparent 0.8%),
        radial-gradient(circle at 40% 70%, rgba(107, 99, 88, 0.3) 0%, transparent 1.2%),
        radial-gradient(circle at 60% 50%, rgba(107, 99, 88, 0.2) 0%, transparent 0.6%),
        radial-gradient(circle at 10% 90%, rgba(107, 99, 88, 0.3) 0%, transparent 1%),
        radial-gradient(circle at 90% 80%, rgba(107, 99, 88, 0.25) 0%, transparent 0.9%),
        radial-gradient(circle at 50% 20%, rgba(107, 99, 88, 0.2) 0%, transparent 0.7%),
        radial-gradient(circle at 30% 50%, rgba(107, 99, 88, 0.3) 0%, transparent 1.1%),
        radial-gradient(circle at 70% 40%, rgba(107, 99, 88, 0.25) 0%, transparent 0.8%),
        radial-gradient(circle at 15% 60%, rgba(107, 99, 88, 0.2) 0%, transparent 0.9%);
    background-size: 200px 200px, 150px 180px, 180px 160px, 220px 200px, 170px 190px,
                     160px 170px, 190px 210px, 210px 180px, 175px 195px, 200px 185px;
}

/* ---------- Navigation ---------- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(245, 240, 232, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px var(--grid-gap);
}

.nav-wordmark {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-sumi-ink);
    letter-spacing: -0.02em;
}

.nav-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: opacity 300ms var(--ease-wabi);
}

.nav-menu-btn:hover {
    opacity: 0.6;
}

.menu-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-sumi-ink);
}

/* ---------- Beat Layout System ---------- */
.beat {
    position: relative;
    padding: 0 var(--grid-gap);
}

.beat-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- Beat 1: Hero ---------- */
.beat-hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.beat-hero .beat-grid {
    width: 100%;
    align-items: center;
}

.hero-text-area {
    grid-column: 2 / 6;
    position: relative;
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-sumi-ink);
    margin-bottom: 20px;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-faded-brush);
    line-height: 1.7;
    max-width: 360px;
}

.hero-text-area .pulse-dot {
    position: absolute;
    bottom: -30px;
    left: 0;
}

.hero-icon-cluster {
    grid-column: 8 / 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
    justify-items: center;
    padding: 40px 0;
}

.hero-icon-cluster .icon {
    width: 80px;
    height: 80px;
}

.hero-icon-cluster .icon-cloud {
    width: 90px;
    height: auto;
}

/* ---------- Kire Line ---------- */
.kire-line {
    width: 45%;
    max-width: 500px;
    height: 1px;
    background: var(--divider-silk-thread);
    margin: var(--beat-spacing) auto;
}

/* ---------- Beat 2: Discovery ---------- */
.beat-discovery .beat-grid {
    align-items: center;
}

.discovery-icons {
    grid-column: 7 / 12;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.discovery-icons .icon {
    width: 70px;
    height: 70px;
}

.discovery-icons .icon-wave {
    width: 100px;
    height: auto;
}

.discovery-icons .pulse-dot {
    position: absolute;
    bottom: -20px;
    right: 20px;
}

.discovery-text {
    grid-column: 2 / 6;
    grid-row: 1;
}

.section-headline {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text-sumi-ink);
    margin-bottom: 18px;
}

.body-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-faded-brush);
    line-height: 1.7;
    margin-bottom: 16px;
    max-width: 400px;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--divider-silk-thread);
}

/* ---------- Beat 3: Depth ---------- */
.beat-depth {
    position: relative;
    padding-top: 40px;
    padding-bottom: 40px;
}

.beat-depth .beat-grid {
    position: relative;
}

.depth-panels-container {
    grid-column: 2 / 12;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    position: relative;
}

.depth-panel {
    background: var(--surface-warm-parchment);
    border: 1px solid var(--divider-silk-thread);
    border-radius: 4px;
    padding: 40px 32px;
    position: relative;
    transition: box-shadow 300ms var(--ease-wabi);
}

.depth-panel:hover {
    box-shadow: 0 0 20px rgba(232, 168, 124, 0.2);
}

.depth-panel .icon {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
}

.panel-1 {
    z-index: 1;
    transform: translateY(0);
}

.panel-2 {
    z-index: 2;
    transform: translateY(24px);
    margin-left: -16px;
    margin-right: -16px;
    background: var(--bg-aged-washi);
}

.panel-3 {
    z-index: 3;
    transform: translateY(48px);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-sumi-ink);
    margin-bottom: 12px;
}

.panel-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-faded-brush);
    line-height: 1.7;
}

.panel-2 .pulse-dot {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* Hinge zone floating icons */
.hinge-zone {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.hinge-zone .icon {
    width: 40px;
    height: 40px;
}

/* ---------- Beat 4: Close ---------- */
.beat-close {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 60px;
    padding-bottom: 80px;
}

.close-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.brand-circle {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-circle .icon-brand-ensou {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--text-sumi-ink);
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.close-tagline {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--text-sumi-ink);
    letter-spacing: -0.02em;
}

.beat-close .meta-label {
    margin-top: 4px;
}

.beat-close .pulse-dot {
    margin-top: 8px;
}

/* ---------- Pulse Dots ---------- */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-beni-red);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.6;
    }
}

/* ---------- Icon Drift Animation ---------- */
.icon-drift {
    animation: drift 4s ease-in-out infinite;
}

.icon-drift:nth-child(2) {
    animation-delay: -1s;
}

.icon-drift:nth-child(3) {
    animation-delay: -2s;
}

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

/* ---------- Icon Kinetic - Path Drawing ---------- */
.icon-kinetic path,
.icon-kinetic circle {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.2s var(--ease-wabi);
}

.icon-kinetic.is-visible path,
.icon-kinetic.is-visible circle {
    stroke-dashoffset: 0;
}

/* ---------- Ensou Path Drawing ---------- */
.ensou-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s var(--ease-wabi);
}

.beat-close.is-visible .ensou-path {
    stroke-dashoffset: 0;
}

/* ---------- Scroll Reveal ---------- */
.beat {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-wabi), transform 0.7s var(--ease-wabi);
}

.beat.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children within beats */
.beat.is-visible .hero-text-area,
.beat.is-visible .hero-icon-cluster,
.beat.is-visible .discovery-text,
.beat.is-visible .discovery-icons,
.beat.is-visible .depth-panel,
.beat.is-visible .close-content {
    opacity: 0;
    animation: revealChild 0.6s var(--ease-wabi) forwards;
}

.beat.is-visible .hero-text-area { animation-delay: 0ms; }
.beat.is-visible .hero-icon-cluster { animation-delay: 80ms; }
.beat.is-visible .discovery-text { animation-delay: 0ms; }
.beat.is-visible .discovery-icons { animation-delay: 80ms; }
.beat.is-visible .panel-1 { animation-delay: 0ms; }
.beat.is-visible .panel-2 { animation-delay: 80ms; }
.beat.is-visible .panel-3 { animation-delay: 160ms; }
.beat.is-visible .close-content { animation-delay: 0ms; }

@keyframes revealChild {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Hover Warmth ---------- */
.depth-panel,
.nav-menu-btn,
.brand-circle {
    transition: box-shadow 300ms var(--ease-wabi);
}

.brand-circle:hover {
    box-shadow: 0 0 20px rgba(232, 168, 124, 0.2);
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 40px var(--grid-gap) 60px;
    text-align: center;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--divider-silk-thread);
}

.footer-divider {
    color: var(--divider-silk-thread);
    font-size: 11px;
}

/* ---------- Responsive: 768px breakpoint ---------- */
@media (max-width: 768px) {
    :root {
        --beat-spacing: 180px;
    }

    .beat-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-text-area,
    .hero-icon-cluster,
    .discovery-text,
    .discovery-icons,
    .depth-panels-container {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .beat-hero {
        min-height: 100svh;
        padding-top: 100px;
    }

    .hero-headline {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }

    .hero-icon-cluster {
        justify-items: start;
        padding: 20px 0;
    }

    /* Discovery: text first, then icons on mobile */
    .discovery-text {
        order: 1;
    }
    .discovery-icons {
        order: 2;
        justify-content: flex-start;
    }

    .section-headline {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }

    /* Depth panels stack vertically */
    .depth-panels-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .panel-1,
    .panel-2,
    .panel-3 {
        transform: none;
        margin: 0;
    }

    .panel-2 {
        margin-left: 16px;
    }

    .panel-3 {
        margin-left: 32px;
    }

    .hinge-zone {
        display: none;
    }

    .kire-line {
        width: 60%;
        margin: 80px auto;
    }

    .brand-circle {
        width: 120px;
        height: 120px;
    }

    .brand-mark {
        font-size: 2.2rem;
    }
}

/* ---------- Layer Shift (desktop parallax) ---------- */
.depth-panel {
    will-change: transform;
}

/* ---------- Selection color ---------- */
::selection {
    background: var(--highlight-persimmon);
    color: var(--text-sumi-ink);
}

::-moz-selection {
    background: var(--highlight-persimmon);
    color: var(--text-sumi-ink);
}
