/* ============================================================
   AMAMIYA HOMPO — styles.css
   Colors: #5C1A2E #8B2A4A #F5EEE8 #C8A96E #2B1B24 #D6C9E8 #A3D4C8 #F0E6D3
   Fonts: EB Garamond, Noto Sans JP, Cinzel Decorative
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --burgundy:       #5C1A2E;
    --crimson:        #8B2A4A;
    --cream:          #F5EEE8;
    --gold:           #C8A96E;
    --midnight:       #2B1B24;
    --lavender:       #D6C9E8;
    --celadon:        #A3D4C8;
    --washi:          #F0E6D3;
    --holo-gradient:  linear-gradient(135deg, #C8A96E 0%, #D6C9E8 35%, #A3D4C8 65%, #C8A96E 100%);
    --cell-gap:       24px;
    --cell-radius:    4px;
    --hairline:       2px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--cream);
    color: var(--midnight);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* ---------- Spectral Overlay (hue-rotate breathing) ---------- */
.spectral-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(139,42,74,0.04) 0%, rgba(214,201,232,0.04) 50%, rgba(163,212,200,0.04) 100%);
    pointer-events: none;
    z-index: 0;
    animation: spectralBreath 20s ease-in-out infinite;
}

@keyframes spectralBreath {
    0%   { filter: hue-rotate(0deg);   opacity: 0.04; }
    33%  { filter: hue-rotate(30deg);  opacity: 0.06; }
    66%  { filter: hue-rotate(-20deg); opacity: 0.04; }
    100% { filter: hue-rotate(0deg);   opacity: 0.04; }
}

/* ---------- Background Spiral ---------- */
.bg-spiral-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bg-spiral {
    width: 100%;
    height: auto;
    max-width: 1200px;
    animation: spiralDrift 40s linear infinite;
}

@keyframes spiralDrift {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ---------- Typography ---------- */
.garamond-italic {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
}

.garamond-upright {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: normal;
    font-weight: 400;
}

.cinzel {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- Marble Texture (CSS generated) ---------- */
.marble-bg {
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-color: var(--washi);
    background-image:
        repeating-linear-gradient(
            42deg,
            transparent,
            transparent 40px,
            rgba(139,42,74,0.12) 40px,
            rgba(139,42,74,0.12) 41px
        ),
        repeating-linear-gradient(
            -30deg,
            transparent,
            transparent 60px,
            rgba(139,42,74,0.06) 60px,
            rgba(139,42,74,0.06) 61px
        ),
        repeating-linear-gradient(
            70deg,
            transparent,
            transparent 80px,
            rgba(200,169,110,0.08) 80px,
            rgba(200,169,110,0.08) 82px
        );
    pointer-events: none;
    z-index: 1;
}

.marble-thin {
    opacity: 0.1;
}

/* ---------- Holographic Edge (::after on cells) ---------- */
.holo-edge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--holo-gradient);
    background-size: 200% 100%;
    opacity: 0.6;
    transition: height 0.3s ease, opacity 0.3s ease, background-position 0.8s ease;
    z-index: 5;
    pointer-events: none;
}

.bento-cell:hover .holo-edge {
    height: 8px;
    opacity: 1;
    background-position: 100% 0;
}

/* ---------- Acts / Sections ---------- */
.act {
    position: relative;
    z-index: 1;
    padding: 40px var(--cell-gap);
    max-width: 1400px;
    margin: 0 auto;
}

.act-two {
    padding-top: 60px;
    padding-bottom: 60px;
}

.act-three {
    max-width: 100%;
    padding: 0;
}

/* ---------- Bento Grid ---------- */
.bento-grid {
    display: grid;
    gap: var(--cell-gap);
    position: relative;
}

/* Hero grid: 3 columns, 2 rows */
.hero-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "hero brand"
        "seasonal flavor"
        "provenance flavor";
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

/* Product grids */
.product-grid {
    grid-template-columns: 3fr 2fr;
    max-width: 1200px;
    margin: 0 auto var(--cell-gap);
    align-items: stretch;
}

.product-grid-alt {
    grid-template-columns: 2fr 3fr;
}

/* Footer grid */
.footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 40px var(--cell-gap);
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

/* ---------- Bento Cell Base ---------- */
.bento-cell {
    position: relative;
    border-radius: var(--cell-radius);
    padding: 32px 28px;
    overflow: hidden;
    border: var(--hairline) solid transparent;
    background-clip: padding-box;
    /* Hairline in iridescent gold */
    box-shadow:
        0 0 0 1px rgba(200,169,110,0.3),
        0 4px 24px rgba(43,27,36,0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.bento-cell:hover {
    box-shadow:
        0 0 0 1px rgba(200,169,110,0.6),
        0 8px 32px rgba(43,27,36,0.12);
}

/* ---------- Cell Color Variants ---------- */
.cell-marble {
    background-color: var(--washi);
    grid-area: hero;
}

.cell-burgundy {
    background-color: var(--burgundy);
    color: var(--washi);
    grid-area: brand;
}

.cell-cream {
    background-color: var(--cream);
}

.cell-holo {
    background-color: var(--cream);
    background-image: linear-gradient(135deg, rgba(200,169,110,0.05) 0%, rgba(214,201,232,0.08) 50%, rgba(163,212,200,0.05) 100%);
}

.cell-midnight {
    background-color: var(--midnight);
    color: var(--washi);
}

.cell-product-dark {
    background-color: var(--burgundy);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-marble-full {
    background-color: var(--washi);
    background-image:
        repeating-linear-gradient(
            42deg,
            transparent,
            transparent 40px,
            rgba(139,42,74,0.07) 40px,
            rgba(139,42,74,0.07) 41px
        ),
        repeating-linear-gradient(
            -30deg,
            transparent,
            transparent 60px,
            rgba(139,42,74,0.04) 60px,
            rgba(139,42,74,0.04) 61px
        );
}

/* ---------- Grid Area Placements ---------- */
#seasonal-cell  { grid-area: seasonal; }
#flavor-cell    { grid-area: flavor; grid-row: 2 / 4; }
#provenance-cell { grid-area: provenance; }

/* ---------- Offset Cells (8px vertical shift) ---------- */
.offset-cell {
    margin-top: 8px;
}

/* ---------- Hero Cell ---------- */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 16px 0;
}

.brand-logo {
    margin-bottom: 16px;
}

.brand-logo .cinzel {
    font-size: 11px;
    color: var(--gold);
    letter-spacing: 0.2em;
}

.hero-title {
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: var(--holo-gradient);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holoTextShimmer 8s ease-in-out infinite;
}

@keyframes holoTextShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-tagline {
    margin-bottom: 32px;
    line-height: 1.8;
}

.tagline-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 17px;
    color: var(--midnight);
    display: block;
}

.tagline-en {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: var(--crimson);
    opacity: 0.8;
}

/* ---------- CTA Button (Pulse) ---------- */
.cta-button {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    padding: 14px 28px;
    background: var(--burgundy);
    color: var(--washi);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
    cursor: pointer;
}

.cta-button span {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    font-size: 14px;
    display: block;
    position: relative;
    z-index: 1;
}

.cta-button .cta-en {
    font-weight: 300;
    font-size: 11px;
    opacity: 0.7;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--holo-gradient);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.4s ease, background-position 0.8s ease;
}

.cta-button:hover::before {
    opacity: 0.2;
    background-position: 100% 0;
}

.cta-button:hover {
    background: var(--crimson);
}

/* Pulse attention animation */
.pulse-btn {
    animation: pulseGlow 2s ease-out infinite;
}

@keyframes pulseGlow {
    0%   { box-shadow: 0 0 0 0 rgba(92,26,46,0.4); }
    70%  { box-shadow: 0 0 0 14px rgba(92,26,46,0); }
    100% { box-shadow: 0 0 0 0 rgba(92,26,46,0); }
}

.cta-small {
    padding: 10px 20px;
    margin-top: 20px;
}

/* ---------- Hero Ribbon SVG ---------- */
.hero-ribbon-wrap {
    margin-top: 24px;
}

.ribbon-svg {
    width: 100%;
    height: auto;
}

/* ---------- Brand Statement Cell ---------- */
.brand-statement-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-mark {
    font-size: 28px;
    color: var(--gold);
    opacity: 0.7;
}

.brand-quote {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 18px;
    line-height: 1.6;
    color: var(--washi);
    border-left: 2px solid var(--gold);
    padding-left: 16px;
    opacity: 0.9;
}

.brand-body {
    font-size: 13px;
    color: var(--washi);
    opacity: 0.75;
    line-height: 1.9;
}

.watermark-icon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 80%;
    pointer-events: none;
    z-index: 0;
}

/* ---------- Seasonal Cell ---------- */
.cell-badge {
    display: inline-block;
    font-family: 'Cinzel Decorative', serif;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 3px 8px;
    margin-bottom: 14px;
    opacity: 0.8;
}

.cell-title {
    font-size: 28px;
    letter-spacing: -0.02em;
    color: var(--burgundy);
    margin-bottom: 4px;
}

.cell-body {
    font-size: 13px;
    color: var(--midnight);
    opacity: 0.75;
    line-height: 1.8;
    margin-bottom: 10px;
}

.jp-body {
    font-size: 12px;
    opacity: 0.6;
}

.seasonal-list {
    list-style: none;
    margin: 12px 0;
}

.seasonal-list li {
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    padding: 4px 0;
    color: var(--midnight);
}

.seasonal-list em {
    font-style: italic;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 12px;
    opacity: 0.7;
}

.gold-dot {
    color: var(--gold);
    font-size: 9px;
    margin-right: 8px;
}

/* ---------- Flavor Cell ---------- */
.flavor-feature {
    margin-top: 16px;
    padding: 16px;
    background: rgba(200,169,110,0.08);
    border-left: 2px solid var(--gold);
}

.flavor-name {
    font-size: 32px;
    color: var(--burgundy);
    letter-spacing: -0.02em;
    display: block;
}

.flavor-sub {
    font-size: 12px;
    color: var(--midnight);
    opacity: 0.6;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
}

/* ---------- Provenance Cell ---------- */
.provenance-text {
    font-size: 16px;
    color: var(--burgundy);
    margin: 12px 0;
    line-height: 1.6;
}

/* ---------- Cell Wave Border ---------- */
.cell-wave-border {
    margin-top: 16px;
}

.cell-wave-border svg {
    width: 100%;
    height: 20px;
}

.wave-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.9s ease-in-out;
}

.wave-visible .wave-path {
    stroke-dashoffset: 0;
}

/* ---------- Marble Band Divider ---------- */
.marble-band {
    width: 100%;
    height: 60px;
    margin: 0;
    background-color: var(--washi);
    background-image:
        repeating-linear-gradient(
            42deg,
            transparent,
            transparent 40px,
            rgba(139,42,74,0.08) 40px,
            rgba(139,42,74,0.08) 41px
        ),
        repeating-linear-gradient(
            -20deg,
            transparent,
            transparent 55px,
            rgba(139,42,74,0.05) 55px,
            rgba(139,42,74,0.05) 56px
        );
    filter: blur(2px);
    position: relative;
    z-index: 1;
    opacity: 0.8;
}

/* ---------- Section Header ---------- */
.section-header {
    text-align: center;
    padding: 20px 0 36px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-label {
    font-size: 10px;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-bottom: 10px;
}

.section-title {
    font-size: 42px;
    letter-spacing: -0.02em;
    color: var(--burgundy);
    margin-bottom: 6px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--midnight);
    opacity: 0.6;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
}

/* ---------- Product Cells ---------- */
.product-img-cell {
    position: relative;
    overflow: hidden;
}

.product-image-placeholder {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.product-image-placeholder svg {
    width: 280px;
    height: 220px;
}

.product-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    width: 80%;
    left: 10%;
}

.product-name {
    font-size: 36px;
    letter-spacing: -0.02em;
    color: var(--burgundy);
    margin-bottom: 4px;
}

.product-name-light {
    color: var(--washi);
}

.product-romanji {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 14px;
}

.product-romanji-light {
    color: var(--gold);
    opacity: 0.8;
}

.cell-body-light {
    color: var(--washi);
    opacity: 0.8;
}

/* Pulse badge variants */
.pulse-badge {
    animation: badgePulse 3s ease-out infinite;
}

@keyframes badgePulse {
    0%   { box-shadow: 0 0 0 0 rgba(200,169,110,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(200,169,110,0); }
    100% { box-shadow: 0 0 0 0 rgba(200,169,110,0); }
}

/* ---------- Footer Bento ---------- */
.act-three {
    background-color: var(--midnight);
    padding: 0;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.footer-grid {
    padding: 48px 40px;
}

/* ---------- Story Cell ---------- */
.story-label {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-bottom: 12px;
}

.story-title {
    font-size: 32px;
    color: var(--washi);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.story-body {
    font-size: 13px;
    color: var(--washi);
    opacity: 0.75;
    line-height: 1.9;
    margin-bottom: 10px;
}

.story-curve-wrap {
    margin-bottom: 20px;
}

.story-curve {
    width: 100%;
    height: 60px;
}

/* ---------- Calendar Cell ---------- */
.calendar-label {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-bottom: 12px;
}

.calendar-title {
    font-size: 28px;
    color: var(--midnight);
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cal-season {
    padding: 12px;
    background: rgba(200,169,110,0.06);
    border-radius: 2px;
}

.cal-month {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 16px;
    display: block;
    margin-bottom: 6px;
}

.cal-items {
    list-style: none;
}

.cal-items li {
    font-size: 11px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    color: var(--midnight);
    opacity: 0.7;
    line-height: 1.7;
}

/* ---------- Contact Cell ---------- */
.contact-label {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-bottom: 12px;
}

.contact-title {
    font-size: 22px;
    color: var(--burgundy);
    margin-bottom: 16px;
}

.map-container {
    margin-bottom: 16px;
    border: 1px solid rgba(200,169,110,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.map-svg {
    width: 100%;
    height: auto;
    display: block;
}

.contact-info {
    margin-bottom: 4px;
}

.contact-detail {
    font-size: 12px;
    color: var(--midnight);
    opacity: 0.65;
    line-height: 1.8;
}

/* ---------- Footer Holographic Border ---------- */
.footer-holo-border {
    height: 4px;
    width: 100%;
    background: var(--holo-gradient);
    background-size: 200% 100%;
    animation: holoBorderShimmer 6s linear infinite;
}

@keyframes holoBorderShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ---------- Scroll Reveal (initial state) ---------- */
.bento-cell.reveal-pending {
    opacity: 0;
    transform: translateY(24px);
}

.bento-cell.reveal-done {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* ---------- Ribbon Draw-on (initial state) ---------- */
.ribbon-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.ribbon-drawn .ribbon-path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.9s ease-in-out;
}

/* ---------- Diamond Icon Pulse (wagashi watermarks) ---------- */
.product-watermark svg {
    animation: watermarkPulse 4s ease-in-out infinite;
}

@keyframes watermarkPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 1.5; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "hero hero"
            "brand brand"
            "seasonal flavor"
            "provenance provenance";
    }

    #flavor-cell {
        grid-row: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        padding: 32px 24px;
    }

    .footer-grid .story-cell {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    :root {
        --cell-gap: 12px;
    }

    .hero-grid,
    .product-grid,
    .product-grid-alt,
    .footer-grid {
        grid-template-columns: 1fr;
        grid-template-areas: none;
    }

    #flavor-cell { grid-row: auto; }
    #seasonal-cell { grid-area: auto; }
    #provenance-cell { grid-area: auto; }
    .cell-marble { grid-area: auto; }
    .cell-burgundy { grid-area: auto; }

    .hero-title {
        font-size: 36px;
    }

    .section-title {
        font-size: 28px;
    }

    .act {
        padding: 24px 16px;
    }

    .footer-grid {
        padding: 24px 16px;
    }

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

    .offset-cell {
        margin-top: 0;
    }
}
