/* ronri.xyz — McBling × Formal Logic
   Palette: Velvet Midnight #0F172A, Chrome Silver #C0C8D0, Diamond White #F0F0FF,
            Sapphire #3B82F6, Amethyst #8B5CF6, Gold Bling #D4A843, Deep Void #050A1A,
            Light Chrome #E8E8F0
   Fonts: Josefin Sans (headlines), Outfit (body), Space Mono (logic)
   Layout: z-pattern, full-bleed sections, particle canvas overlay
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    background: #0F172A;
    color: #E8E8F0;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    /* Subtle velvet-stitch texture using radial gradients */
    background-image:
        radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(212, 168, 67, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
}

/* Particle canvas overlay */
#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Sections sit above particles; cards reach above particles */
section,
footer {
    position: relative;
    z-index: 2;
}

/* =====================================================
   Diamond Entrance
   ===================================================== */
.diamond-entrance {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at center, rgba(59, 130, 246, 0.18) 0%, rgba(15, 23, 42, 0) 60%),
        linear-gradient(180deg, #0F172A 0%, #050A1A 100%);
    display: grid;
    grid-template-columns: 1fr minmax(320px, 720px) 1fr;
    align-items: center;
    justify-items: center;
    padding: 80px 40px 100px;
    position: relative;
    overflow: hidden;
}

/* Decorative corner glints */
.diamond-entrance::before,
.diamond-entrance::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.18) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}
.diamond-entrance::before { top: -60px; left: -60px; }
.diamond-entrance::after  { bottom: -60px; right: -60px; }

.entrance-flank {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flank-left {
    animation: elastic-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both, gem-float 6s ease-in-out infinite 1.1s;
}

.flank-right {
    animation: elastic-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.65s both, gem-float 6s ease-in-out infinite 1.25s reverse;
}

.iso-icon {
    width: clamp(140px, 16vw, 220px);
    height: auto;
    filter: drop-shadow(0 8px 22px rgba(59, 130, 246, 0.45)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.entrance-core {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

/* 論理 kanji glyph above wordmark */
.wordmark-logic {
    font-family: 'Josefin Sans', 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 7vw, 96px);
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #C0C8D0 0%, #F0F0FF 35%, #E8E8F0 55%, #C0C8D0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 0 28px rgba(192, 200, 208, 0.15);
    line-height: 1;
    animation: elastic-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

/* Main wordmark — chrome sweep */
.wordmark {
    font-family: 'Josefin Sans', 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 7.5vw, 92px);
    text-transform: lowercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #C0C8D0 0%, #E8E8F0 25%, #F0F0FF 50%, #E8E8F0 75%, #C0C8D0 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1;
    animation: elastic-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both,
               chrome-sweep 6s ease-in-out infinite 1s;
    position: relative;
}

.entrance-tagline {
    font-family: 'Space Mono', monospace;
    font-size: clamp(13px, 1.4vw, 16px);
    color: #C0C8D0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.85;
    animation: elastic-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s both;
}

.entrance-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 10px 22px;
    border: 1px solid rgba(192, 200, 208, 0.25);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: elastic-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

.meta-symbol {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    color: #D4A843;
    text-shadow: 0 0 8px rgba(212, 168, 67, 0.6);
}

.meta-divider {
    color: rgba(192, 200, 208, 0.4);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
}

.scroll-cue {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(192, 200, 208, 0.65);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: elastic-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s both;
}

.scroll-cue-glyph {
    font-size: 14px;
    color: #D4A843;
    animation: scroll-bounce 1.8s ease-in-out infinite;
}

/* =====================================================
   Z-Sections
   ===================================================== */
.z-section {
    min-height: 90vh;
    padding: clamp(60px, 9vw, 130px) clamp(28px, 7vw, 100px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px 60px;
    align-items: center;
    position: relative;
}

.z-section-1 {
    background: linear-gradient(180deg, #0F172A 0%, #131c33 100%);
}

.z-section-2 {
    background: linear-gradient(180deg, #131c33 0%, #0F172A 100%);
}

/* Alternate: swap column order for visual rhythm */
.z-section-2 .z-tag,
.z-section-2 .z-headline { grid-column: 2; }
.z-section-2 .z-icon-cell { grid-column: 1; grid-row: 1 / span 2; }
.z-section-2 .z-body { grid-column: 2; grid-row: 2; }

.z-section-1 .z-tag,
.z-section-1 .z-headline { grid-column: 1; }
.z-section-1 .z-icon-cell { grid-column: 2; grid-row: 1 / span 2; }
.z-section-1 .z-body { grid-column: 1; grid-row: 2; }

.z-tag {
    grid-row: 1;
    align-self: end;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #D4A843;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 168, 67, 0.35);
    width: max-content;
}

.z-headline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 68px);
    line-height: 1.1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #C0C8D0 0%, #F0F0FF 50%, #C0C8D0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-top: 6px;
    align-self: start;
}

.z-icon-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    position: relative;
}

.z-icon-cell::before {
    content: "";
    position: absolute;
    inset: 12%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, transparent 65%);
    filter: blur(24px);
    pointer-events: none;
}

.z-section-2 .z-icon-cell::before {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, transparent 65%);
}

.iso-large {
    width: clamp(180px, 28vw, 320px);
    height: auto;
    filter: drop-shadow(0 18px 40px rgba(59, 130, 246, 0.45)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
    animation: gem-float 7s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.z-section-2 .iso-large {
    filter: drop-shadow(0 18px 40px rgba(139, 92, 246, 0.5)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
    animation-delay: -2s;
}

.z-body {
    align-self: start;
    max-width: 560px;
}

.z-paragraph {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.4vw, 18px);
    line-height: 1.75;
    color: #E8E8F0;
}

.z-paragraph em {
    font-family: 'Space Mono', monospace;
    font-style: normal;
    color: #D4A843;
    background: rgba(212, 168, 67, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.95em;
    letter-spacing: 0.02em;
}

.z-formula {
    margin-top: 28px;
    padding: 18px 22px;
    background: rgba(5, 10, 26, 0.65);
    border: 1px solid rgba(192, 200, 208, 0.18);
    border-left: 2px solid #D4A843;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: #C0C8D0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.formula-line {
    display: flex;
    gap: 10px;
    align-items: center;
}

.formula-token {
    color: #F0F0FF;
}

.formula-op {
    color: #8B5CF6;
    font-weight: 700;
}

.formula-arrow {
    color: #D4A843;
    font-weight: 700;
}

/* =====================================================
   The Vault
   ===================================================== */
.vault {
    background:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, #0F172A 0%, #050A1A 100%);
    padding: clamp(80px, 12vw, 160px) clamp(28px, 7vw, 100px);
    position: relative;
}

.vault-header {
    text-align: center;
    margin-bottom: 70px;
}

.vault-tag {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #D4A843;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.vault-headline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 6vw, 80px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #C0C8D0, #F0F0FF, #C0C8D0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1;
}

.vault-sub {
    font-family: 'Outfit', sans-serif;
    color: rgba(232, 232, 240, 0.7);
    margin-top: 14px;
    font-size: clamp(14px, 1.3vw, 16px);
}

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
    max-width: 1200px;
    margin: 0 auto;
}

.vault-card {
    position: relative;
    padding: 28px 22px 26px;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.85) 0%, rgba(5, 10, 26, 0.92) 100%);
    border: 1px solid rgba(192, 200, 208, 0.18);
    border-radius: 6px;
    text-align: center;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease,
                box-shadow 0.4s ease;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Chrome filigree corner accents */
.vault-card::before,
.vault-card::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(212, 168, 67, 0.5);
    transition: border-color 0.3s ease;
}
.vault-card::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}
.vault-card::after {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
}

.vault-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(212, 168, 67, 0.6);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.45),
        0 6px 18px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(240, 240, 255, 0.08);
}

.vault-card:hover::before,
.vault-card:hover::after {
    border-color: #D4A843;
}

.vault-card-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vault-card-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 6px 14px rgba(59, 130, 246, 0.4));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.4s ease;
}

.vault-card:hover .vault-card-icon svg {
    transform: rotate(8deg) scale(1.08);
    filter: drop-shadow(0 10px 20px rgba(212, 168, 67, 0.55));
}

.vault-card-name {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    background: linear-gradient(135deg, #C0C8D0, #F0F0FF, #C0C8D0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 6px;
}

.vault-card-symbol {
    font-family: 'Space Mono', monospace;
    font-size: 28px;
    color: #D4A843;
    margin-bottom: 10px;
    text-shadow: 0 0 14px rgba(212, 168, 67, 0.45);
}

.vault-card-desc {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(232, 232, 240, 0.72);
}

/* =====================================================
   Velvet Footer
   ===================================================== */
.velvet-footer {
    background: linear-gradient(180deg, #050A1A 0%, #020512 100%);
    padding: clamp(70px, 10vw, 120px) 40px clamp(40px, 6vw, 60px);
    text-align: center;
    border-top: 1px solid rgba(192, 200, 208, 0.12);
}

.footer-wordmark {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(34px, 5vw, 60px);
    text-transform: lowercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #C0C8D0, #E8E8F0, #F0F0FF, #E8E8F0, #C0C8D0);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1;
    margin-bottom: 22px;
    animation: chrome-sweep 8s ease-in-out infinite;
}

.footer-meta {
    display: flex;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.footer-meta-item {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #C0C8D0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.7;
}

.footer-credo {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(14px, 1.3vw, 16px);
    color: rgba(232, 232, 240, 0.55);
    max-width: 480px;
    margin: 0 auto 30px;
    font-style: italic;
}

.footer-symbols {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px dashed rgba(192, 200, 208, 0.15);
}

.footer-symbols span {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    color: #D4A843;
    text-shadow: 0 0 10px rgba(212, 168, 67, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.3s ease;
    cursor: default;
}

.footer-symbols span:hover {
    transform: scale(1.4) rotate(-8deg);
    color: #F0F0FF;
}

/* =====================================================
   Animations
   ===================================================== */
@keyframes elastic-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes gem-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-12px) rotate(2deg); }
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50%      { transform: translateY(6px); opacity: 1; }
}

/* Reveal hooks for IntersectionObserver */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.40s; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 0.47s; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 0.54s; }

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 860px) {
    .diamond-entrance {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 80px 24px 100px;
        gap: 30px;
    }
    .entrance-flank { display: none; }

    .z-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 80px 24px;
        gap: 24px;
    }
    .z-section-1 .z-tag,
    .z-section-2 .z-tag,
    .z-section-1 .z-headline,
    .z-section-2 .z-headline,
    .z-section-1 .z-icon-cell,
    .z-section-2 .z-icon-cell,
    .z-section-1 .z-body,
    .z-section-2 .z-body {
        grid-column: 1;
        grid-row: auto;
    }
    .z-icon-cell { order: 2; }
    .z-body { order: 3; }

    .vault-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 480px) {
    .entrance-meta {
        gap: 8px;
        padding: 8px 14px;
    }
    .meta-symbol { font-size: 14px; }
    .footer-meta { gap: 14px; }
    .footer-symbols { gap: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
