/* ============================================
   hwaglyul.com - Watercolor Glass Design System
   ============================================ */

/* Reset and Baseline */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1C1826;
    background: #F0EBF5;
    overflow-x: hidden;
}

/* ============================================
   Color Palette
   ============================================ */
:root {
    --deep-ink: #2B2054;
    --warm-light: #E8A838;
    --wash-base: #F0EBF5;
    --glass-white: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.35);
    --white-pure: #FFFFFF;
    --ink-bleed: #6B5B8A;
    --highlight-glow: #FFD6A8;
    --text-primary: #1C1826;
    --text-secondary: #6E6479;
    --code-bg: #EDEAFF;
    --accent-pulse: #E85D75;
}

/* ============================================
   Navigation Bar
   ============================================ */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 48px;
    background: rgba(240, 235, 245, 0.95);
    backdrop-filter: blur(24px) saturate(160%);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-wordmark {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--deep-ink);
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--warm-light);
}

/* ============================================
   Page Container and Zones
   ============================================ */
.page-container {
    padding-top: 56px;
}

.zone {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.zone-content {
    position: relative;
    height: 100%;
    padding: 60px 48px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   Watercolor Wash Backgrounds
   ============================================ */
.watercolor-wash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    z-index: 1;
}

.zone.active .watercolor-wash {
    opacity: 1;
}

.wash-origin {
    background: radial-gradient(ellipse 400px 300px at 20% 30%, rgba(107, 91, 138, 0.25) 0%, transparent 70%),
                radial-gradient(ellipse 500px 400px at 80% 70%, rgba(179, 157, 219, 0.15) 0%, transparent 70%);
}

.wash-dissolve {
    background: radial-gradient(ellipse 450px 350px at 60% 40%, rgba(232, 168, 56, 0.20) 0%, transparent 65%),
                radial-gradient(ellipse 500px 400px at 30% 80%, rgba(255, 214, 168, 0.18) 0%, transparent 70%);
}

.wash-resolve {
    background: radial-gradient(ellipse 400px 350px at 50% 50%, rgba(107, 91, 138, 0.22) 0%, transparent 65%),
                radial-gradient(ellipse 450px 380px at 20% 20%, rgba(232, 173, 119, 0.12) 0%, transparent 70%);
}

.wash-synthesize {
    background: radial-gradient(ellipse 500px 400px at 70% 30%, rgba(232, 168, 56, 0.18) 0%, transparent 65%),
                radial-gradient(ellipse 450px 350px at 15% 70%, rgba(43, 32, 84, 0.15) 0%, transparent 70%);
}

.wash-complete {
    background: radial-gradient(ellipse 400px 300px at 50% 50%, rgba(240, 235, 245, 0.5) 0%, transparent 70%);
}

/* ============================================
   Glassmorphic Cards
   ============================================ */
.glass-card {
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(20px) saturate(140%);
    box-shadow: 0 8px 32px rgba(43, 32, 84, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeInCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card h1, .glass-card h2, .glass-card h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--deep-ink);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.glass-card h1 {
    font-size: 64px;
    line-height: 1.15;
    color: var(--deep-ink);
}

.glass-card h2 {
    font-size: 36px;
    line-height: 1.15;
}

.glass-card h3 {
    font-size: 28px;
    line-height: 1.15;
}

.glass-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.glass-card p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Bento Grid Layouts
   ============================================ */
.bento-grid {
    display: grid;
    gap: 16px;
    position: relative;
    z-index: 10;
}

/* Origin Grid - Sparse 3-cell layout */
.origin-grid {
    grid-template-columns: 1fr 2fr 1fr;
    min-height: 400px;
}

.origin-grid .accent-left,
.origin-grid .accent-right {
    grid-column: span 1;
}

.origin-grid .feature-main {
    grid-column: span 1;
}

/* Dissolve Grid - Dense 4x2 mosaic */
.dissolve-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    min-height: 600px;
}

.dissolve-grid .cell-1 { grid-column: span 1; }
.dissolve-grid .cell-2 { grid-column: span 1; }
.dissolve-grid .cell-3 { grid-column: span 1; }
.dissolve-grid .cell-4 { grid-column: span 1; }
.dissolve-grid .cell-5 { grid-column: span 1; }
.dissolve-grid .cell-6 { grid-column: span 1; }
.dissolve-grid .cell-7 { grid-column: span 1; }
.dissolve-grid .cell-8 { grid-column: span 1; }

/* Stagger animations for dissolve cells */
.dissolve-grid .cell-1 .glass-card { animation-delay: 0ms; }
.dissolve-grid .cell-2 .glass-card { animation-delay: 120ms; }
.dissolve-grid .cell-3 .glass-card { animation-delay: 240ms; }
.dissolve-grid .cell-4 .glass-card { animation-delay: 360ms; }
.dissolve-grid .cell-5 .glass-card { animation-delay: 120ms; }
.dissolve-grid .cell-6 .glass-card { animation-delay: 240ms; }
.dissolve-grid .cell-7 .glass-card { animation-delay: 360ms; }
.dissolve-grid .cell-8 .glass-card { animation-delay: 480ms; }

/* Resolve Grid - 3-step code tutorial */
.resolve-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 10;
}

.code-step {
    width: 100%;
}

.step-explanation {
    width: 100%;
}

/* Synthesize Grid - Mixed feature + accent cells */
.synthesize-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    min-height: 700px;
}

.syn-feature-1 { grid-column: span 2; grid-row: span 1; }
.syn-accent-1 { grid-column: span 1; grid-row: span 1; }
.syn-accent-2 { grid-column: span 1; grid-row: span 1; }
.syn-feature-2 { grid-column: span 2; grid-row: span 1; }
.syn-accent-3 { grid-column: span 1; grid-row: span 1; }
.syn-accent-4 { grid-column: span 1; grid-row: span 1; }
.syn-feature-3 { grid-column: span 2; grid-row: span 1; }
.syn-accent-5 { grid-column: span 1; grid-row: span 1; }

/* Stagger synthesize animations */
.syn-feature-1 .glass-card { animation-delay: 0ms; }
.syn-accent-1 .glass-card { animation-delay: 120ms; }
.syn-accent-2 .glass-card { animation-delay: 120ms; }
.syn-feature-2 .glass-card { animation-delay: 240ms; }
.syn-accent-3 .glass-card { animation-delay: 360ms; }
.syn-accent-4 .glass-card { animation-delay: 360ms; }
.syn-feature-3 .glass-card { animation-delay: 480ms; }
.syn-accent-5 .glass-card { animation-delay: 480ms; }

/* Complete Grid - Centered single card */
.complete-grid {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    min-height: 400px;
}

.complete-card {
    width: 100%;
    max-width: 600px;
}

/* ============================================
   Special Card Styles
   ============================================ */
.icon-card {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tech-icon {
    width: 80px;
    height: 80px;
}

.accent-stat {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--warm-light);
    line-height: 1;
    margin-bottom: 8px;
}

.accent-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ============================================
   Code Blocks
   ============================================ */
.code-card {
    padding: 24px !important;
}

.terminal-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.red { background-color: #E85D75; }
.dot.yellow { background-color: #FFD6A8; }
.dot.green { background-color: #6B5B8A; }

.code-block {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: var(--code-bg);
    padding: 16px;
    border-radius: 8px;
    color: var(--deep-ink);
    overflow-x: auto;
    margin: 0;
}

/* ============================================
   Watercolor Decorative Elements
   ============================================ */
.corner-bleed {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    z-index: 2;
}

.zone.active .corner-bleed {
    opacity: 1;
}

.bleed-top-left {
    width: 120px;
    height: 120px;
    top: -40px;
    left: -40px;
    background: radial-gradient(circle, rgba(43, 32, 84, 0.3) 0%, transparent 70%);
}

.bleed-top-right {
    width: 150px;
    height: 150px;
    top: -50px;
    right: -60px;
    background: radial-gradient(circle, rgba(179, 157, 219, 0.25) 0%, transparent 70%);
}

.bleed-bottom-left {
    width: 100px;
    height: 100px;
    bottom: -30px;
    left: -30px;
    background: radial-gradient(circle, rgba(232, 168, 56, 0.2) 0%, transparent 70%);
}

.bleed-bottom-right {
    width: 130px;
    height: 130px;
    bottom: -40px;
    right: -40px;
    background: radial-gradient(circle, rgba(107, 91, 138, 0.25) 0%, transparent 70%);
}

.bleed-dissolve-left {
    width: 140px;
    height: 140px;
    top: 100px;
    left: -50px;
    background: radial-gradient(circle, rgba(232, 168, 56, 0.25) 0%, transparent 70%);
}

.bleed-dissolve-right {
    width: 160px;
    height: 160px;
    bottom: 150px;
    right: -60px;
    background: radial-gradient(circle, rgba(255, 214, 168, 0.2) 0%, transparent 70%);
}

.bleed-resolve-left {
    width: 120px;
    height: 120px;
    top: 200px;
    left: -40px;
    background: radial-gradient(circle, rgba(107, 91, 138, 0.2) 0%, transparent 70%);
}

.bleed-synthesize-left {
    width: 150px;
    height: 150px;
    top: 100px;
    left: -50px;
    background: radial-gradient(circle, rgba(43, 32, 84, 0.2) 0%, transparent 70%);
}

.bleed-synthesize-right {
    width: 140px;
    height: 140px;
    bottom: 200px;
    right: -50px;
    background: radial-gradient(circle, rgba(232, 168, 56, 0.22) 0%, transparent 70%);
}

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

.motif-1 {
    background: radial-gradient(ellipse 60px 50px at center, rgba(107, 91, 138, 0.4) 0%, transparent 70%);
}

.motif-2 {
    background: radial-gradient(ellipse 50px 70px at center, rgba(232, 168, 56, 0.35) 0%, transparent 70%);
}

/* ============================================
   Watercolor Dividers
   ============================================ */
.watercolor-divider {
    height: 80px;
    position: relative;
    background: linear-gradient(to right,
        rgba(43, 32, 84, 0) 0%,
        rgba(107, 91, 138, 0.15) 25%,
        rgba(107, 91, 138, 0.15) 75%,
        rgba(43, 32, 84, 0) 100%);
}

.divider-1 {
    background: linear-gradient(to right,
        rgba(232, 168, 56, 0) 0%,
        rgba(232, 168, 56, 0.12) 25%,
        rgba(232, 168, 56, 0.12) 75%,
        rgba(232, 168, 56, 0) 100%);
}

.divider-2 {
    background: linear-gradient(to right,
        rgba(107, 91, 138, 0) 0%,
        rgba(107, 91, 138, 0.15) 25%,
        rgba(107, 91, 138, 0.15) 75%,
        rgba(107, 91, 138, 0) 100%);
}

.divider-3 {
    background: linear-gradient(to right,
        rgba(232, 168, 56, 0) 0%,
        rgba(232, 168, 56, 0.12) 25%,
        rgba(232, 168, 56, 0.12) 75%,
        rgba(232, 168, 56, 0) 100%);
}

.divider-4 {
    background: linear-gradient(to right,
        rgba(43, 32, 84, 0) 0%,
        rgba(43, 32, 84, 0.08) 25%,
        rgba(43, 32, 84, 0.08) 75%,
        rgba(43, 32, 84, 0) 100%);
}

/* ============================================
   Code Brackets
   ============================================ */
.code-bracket {
    font-family: 'Outfit', sans-serif;
    font-size: 120px;
    font-weight: 200;
    color: var(--warm-light);
    opacity: 0.15;
    position: absolute;
    line-height: 1;
    z-index: 0;
}

.bracket-open {
    top: 100px;
    left: -20px;
}

.bracket-close {
    bottom: 100px;
    right: -20px;
}

/* ============================================
   Circuit Lines
   ============================================ */
.circuit-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.circuit-lines line {
    stroke: var(--ink-bleed);
    stroke-width: 1;
    opacity: 0.2;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawTrace 0.8s ease-out forwards;
}

@keyframes drawTrace {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   Pulse Animation
   ============================================ */
.nav-link:hover {
    animation: pulse 2s ease-in-out infinite;
}

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

.title-main {
    animation: pulseTitleStart 2s ease-in-out infinite;
}

@keyframes pulseTitleStart {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(232, 168, 56, 0.06);
    }
    50% {
        transform: scale(1.01);
        text-shadow: 0 0 20px rgba(232, 168, 56, 0.12);
    }
}

/* ============================================
   Subtitle Styling
   ============================================ */
.subtitle {
    font-size: 20px !important;
    color: var(--text-secondary);
    margin-bottom: 0 !important;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .nav-bar {
        padding: 0 32px;
    }

    .zone-content {
        padding: 48px 32px;
    }

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

    .dissolve-grid {
        grid-template-columns: repeat(2, 1fr);
        min-height: auto;
    }

    .synthesize-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        min-height: auto;
    }

    .syn-feature-1 { grid-column: span 2; }
    .syn-feature-2 { grid-column: span 2; }
    .syn-feature-3 { grid-column: span 2; }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }

    .nav-bar {
        padding: 0 20px;
        height: 48px;
    }

    .nav-wordmark {
        font-size: 16px;
    }

    .nav-links {
        display: none;
    }

    .zone-content {
        padding: 40px 20px;
    }

    .bento-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 12px;
    }

    .bento-cell,
    .origin-grid > *,
    .dissolve-grid > *,
    .resolve-grid > *,
    .synthesize-grid > *,
    .code-step,
    .step-explanation,
    .syn-feature-1,
    .syn-feature-2,
    .syn-feature-3,
    .syn-accent-1,
    .syn-accent-2,
    .syn-accent-3,
    .syn-accent-4,
    .syn-accent-5 {
        grid-column: span 1 !important;
        grid-row: auto !important;
    }

    .glass-card {
        padding: 24px;
    }

    .glass-card h1 {
        font-size: 48px;
    }

    .glass-card h2 {
        font-size: 24px;
    }

    .glass-card h3 {
        font-size: 20px;
    }

    .code-bracket {
        font-size: 80px;
    }

    .tech-icon {
        width: 60px;
        height: 60px;
    }

    .corner-bleed {
        width: 80px;
        height: 80px;
    }

    .corner-bleed.bleed-top-right {
        width: 100px;
        height: 100px;
    }

    .zone {
        min-height: auto;
        padding: 80px 0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .glass-card,
    .watercolor-wash,
    .corner-bleed,
    .zone {
        animation: none !important;
        transition: none !important;
    }

    .nav-link:hover {
        animation: none;
    }

    .title-main {
        animation: none;
    }

    .circuit-lines line {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .nav-bar {
        display: none;
    }

    .watercolor-divider {
        display: none;
    }

    .corner-bleed {
        display: none;
    }

    .glass-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
