/* ==========================================================================
   storiographer.net -- blobitecture playground
   palette (muted):
     #A8B5A0 soft sage
     #C4A0A8 dusty rose
     #B0A8C4 lavender fog
     #C8BCA8 warm sand
     #F2EDE6 off-white background
     #3A3A42 charcoal soft text
     #5C6B54 moss deep accent
   fonts: Sora (display + caption), Nunito (body)
   ========================================================================== */

:root {
    --color-bg: #F2EDE6;
    --color-text: #3A3A42;
    --color-accent: #5C6B54;
    --color-sage: #A8B5A0;
    --color-rose: #C4A0A8;
    --color-lavender: #B0A8C4;
    --color-sand: #C8BCA8;

    --font-display: "Sora", "Inter", system-ui, sans-serif;
    --font-body: "Nunito", "Lora", Georgia, serif;
    --font-caption: "Sora", "Inter", system-ui, sans-serif;

    --grain-url: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1.75;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow-x: hidden;
    position: relative;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ==========================================================================
   Grain overlay
   ========================================================================== */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: var(--grain-url);
    background-size: 300px 300px;
    opacity: 0.03;
    z-index: 60;
    mix-blend-mode: multiply;
}

.card-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: var(--grain-url);
    background-size: 300px 300px;
    opacity: 0.05;
    mix-blend-mode: multiply;
    z-index: 1;
}

/* ==========================================================================
   Background curves
   ========================================================================== */
.background-curves {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.bg-curve {
    fill: none;
    stroke-width: 90;
    stroke-linecap: round;
}

.bg-curve-1 { stroke: var(--color-sage); opacity: 0.1; stroke-width: 100; }
.bg-curve-2 { stroke: var(--color-lavender); opacity: 0.08; stroke-width: 120; }
.bg-curve-3 { stroke: var(--color-rose); opacity: 0.10; stroke-width: 80; }
.bg-curve-4 { stroke: var(--color-sand); opacity: 0.11; stroke-width: 70; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 640px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

.hero-blob-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-blob {
    position: relative;
    width: min(78vmin, 820px);
    height: min(78vmin, 820px);
    background: var(--color-sage);
    clip-path: url(#blob-hero);
    -webkit-clip-path: url(#blob-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: blobBreathe 9s ease-in-out infinite;
    filter: drop-shadow(0 30px 60px rgba(92, 107, 84, 0.18));
}

.hero-blob-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    padding: 10% 14%;
    text-align: center;
    color: #2C2F2A;
    max-width: 680px;
}

.hero-kicker {
    font-family: var(--font-caption);
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 0.72;
    margin: 0 0 1.25rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.02;
    margin: 0 0 1.3rem;
    letter-spacing: -0.02em;
    color: #2C2F2A;
}

.hero-title .hero-dot {
    color: var(--color-accent);
    display: inline-block;
    animation: dotPulse 3.4s ease-in-out infinite;
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    max-width: 44ch;
    margin: 0 auto 2rem;
    opacity: 0.88;
}

.hero-scroll-hint {
    font-family: var(--font-caption);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.7;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.hero-arrow {
    color: var(--color-accent);
    animation: arrowFloat 2.2s ease-in-out infinite;
}

/* ==========================================================================
   Float blobs in hero
   ========================================================================== */
.float-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(0.5px);
    opacity: 0.55;
    animation: floatBlob 10s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    z-index: -1;
}

.float-blob-a {
    width: 180px;
    height: 180px;
    background: var(--color-rose);
    clip-path: url(#blob-2);
    top: 10%;
    left: 6%;
}

.float-blob-b {
    width: 120px;
    height: 120px;
    background: var(--color-lavender);
    clip-path: url(#blob-4);
    bottom: 12%;
    right: 8%;
}

.float-blob-c {
    width: 90px;
    height: 90px;
    background: var(--color-sand);
    clip-path: url(#blob-6);
    top: 22%;
    right: 14%;
}

.float-blob-d {
    width: 140px;
    height: 140px;
    background: var(--color-sage);
    clip-path: url(#blob-8);
    bottom: 18%;
    left: 10%;
    opacity: 0.45;
}

/* ==========================================================================
   Garden body
   ========================================================================== */
.garden {
    position: relative;
    padding: 5vh 6vw 8vh;
    max-width: 1500px;
    margin: 0 auto;
    z-index: 2;
}

.section-intro {
    text-align: center;
    padding: 4rem 0 3rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin: 0 0 0.8rem;
    color: var(--color-accent);
    letter-spacing: -0.01em;
}

.section-sub {
    font-family: var(--font-body);
    font-size: 1.05rem;
    max-width: 55ch;
    margin: 0 auto;
    opacity: 0.78;
}

/* Connection layer */
.connection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
}

.connection-line {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 2;
    opacity: 0;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    stroke-linecap: round;
    transition: opacity 0.8s ease, stroke-dashoffset 2s ease-in-out;
}

.connection-line.visible {
    opacity: 0.3;
    stroke-dashoffset: 0;
}

/* ==========================================================================
   Card grid
   ========================================================================== */
.card-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 320px;
    gap: 32px;
    z-index: 4;
}

.card {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--color-sage);
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.5s ease,
                filter 0.4s ease;
    filter: drop-shadow(0 16px 30px rgba(58, 58, 66, 0.12));
    cursor: pointer;
}

.card.in-view {
    transform: scale(1);
    opacity: 1;
}

.card:hover {
    filter: drop-shadow(0 24px 42px rgba(92, 107, 84, 0.24));
}

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

@media (max-width: 640px) {
    .card-span-2 { grid-column: span 1; }
}

.surface-sage { background: var(--color-sage); }
.surface-rose { background: var(--color-rose); }
.surface-lavender { background: var(--color-lavender); }
.surface-sand { background: var(--color-sand); }

.clip-blob-1 { clip-path: url(#blob-1); -webkit-clip-path: url(#blob-1); }
.clip-blob-2 { clip-path: url(#blob-2); -webkit-clip-path: url(#blob-2); }
.clip-blob-3 { clip-path: url(#blob-3); -webkit-clip-path: url(#blob-3); }
.clip-blob-4 { clip-path: url(#blob-4); -webkit-clip-path: url(#blob-4); }
.clip-blob-5 { clip-path: url(#blob-5); -webkit-clip-path: url(#blob-5); }
.clip-blob-6 { clip-path: url(#blob-6); -webkit-clip-path: url(#blob-6); }
.clip-blob-7 { clip-path: url(#blob-7); -webkit-clip-path: url(#blob-7); }
.clip-blob-8 { clip-path: url(#blob-8); -webkit-clip-path: url(#blob-8); }
.clip-blob-9 { clip-path: url(#blob-9); -webkit-clip-path: url(#blob-9); }
.clip-blob-10 { clip-path: url(#blob-10); -webkit-clip-path: url(#blob-10); }

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18% 16%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.6s ease;
}

.card:hover .card-inner {
    transform: scale(1.03);
}

.card-tag {
    font-family: var(--font-caption);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-accent);
    opacity: 0.8;
    align-self: flex-start;
    padding: 0.3rem 0.8rem;
    border-radius: 24px;
    background: rgba(242, 237, 230, 0.55);
    z-index: 2;
    position: relative;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1.18;
    margin: 0.9rem 0 0.6rem;
    color: #2C2F2A;
    letter-spacing: -0.01em;
    z-index: 2;
    position: relative;
}

.card-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #2C2F2A;
    opacity: 0.88;
    margin: 0;
    z-index: 2;
    position: relative;
    flex: 1;
    overflow: hidden;
}

.card-meta {
    font-family: var(--font-caption);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 0.9rem;
    z-index: 2;
    position: relative;
}

/* span-2 cards need taller content area considerations */
.card-span-2 .card-inner {
    padding: 14% 10%;
}

/* ==========================================================================
   Field (secondary blobs)
   ========================================================================== */
.section-field {
    padding: 10vh 0 2vh;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
    align-items: center;
}

.field-blob {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 420px;
    margin: 0 auto;
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.5s ease;
    filter: drop-shadow(0 20px 32px rgba(58, 58, 66, 0.14));
}

.field-blob.in-view {
    transform: scale(1);
    opacity: 1;
}

.field-blob-1 { background: var(--color-lavender); clip-path: url(#blob-3); }
.field-blob-2 { background: var(--color-sand); clip-path: url(#blob-7); }
.field-blob-3 { background: var(--color-rose); clip-path: url(#blob-9); }

.field-blob-1 .field-blob-inner,
.field-blob-2 .field-blob-inner,
.field-blob-3 .field-blob-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.field-blob h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.3rem, 2.2vw, 2rem);
    margin: 0 0 0.6rem;
    color: #2C2F2A;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 2;
}

.field-blob p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: #2C2F2A;
    opacity: 0.86;
    margin: 0;
    position: relative;
    z-index: 2;
    max-width: 24ch;
    margin-inline: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    position: relative;
    padding: 8vh 6vw 10vh;
    display: flex;
    justify-content: center;
    z-index: 2;
}

.footer-blob {
    position: relative;
    width: min(72vmin, 640px);
    height: min(52vmin, 400px);
    background: #D6CEBE;
    clip-path: url(#blob-footer);
    -webkit-clip-path: url(#blob-footer);
    filter: drop-shadow(0 24px 40px rgba(58, 58, 66, 0.14));
    animation: blobBreathe 11s ease-in-out infinite;
}

.footer-blob-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10%;
    overflow: hidden;
    text-align: center;
}

.footer-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    margin: 0;
    color: #2C2F2A;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 2;
}

.footer-sub {
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin: 0.4rem 0 1rem;
    opacity: 0.75;
    position: relative;
    z-index: 2;
}

.footer-year {
    font-family: var(--font-caption);
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.6;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes blobBreathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.025) rotate(1.4deg); }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.75; }
}

@keyframes arrowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(18px, -14px) rotate(4deg); }
    66% { transform: translate(-12px, 18px) rotate(-3deg); }
}

/* ==========================================================================
   Responsive -- mobile blob degradation
   ========================================================================== */
@media (max-width: 768px) {
    .card,
    .field-blob {
        clip-path: none !important;
        -webkit-clip-path: none !important;
        border-radius: 48% 52% 46% 54% / 54% 46% 52% 48%;
    }

    .card-inner,
    .field-blob-inner {
        padding: 2rem 1.6rem;
    }

    .hero-blob {
        clip-path: none;
        -webkit-clip-path: none;
        border-radius: 50% 48% 52% 50% / 48% 52% 50% 50%;
    }

    .footer-blob {
        clip-path: none;
        -webkit-clip-path: none;
        border-radius: 48% 52% 48% 52% / 52% 48% 52% 48%;
    }

    .connection-layer {
        display: none;
    }

    .float-blob {
        clip-path: none;
        border-radius: 50%;
    }

    .card-grid {
        grid-auto-rows: 280px;
    }

    .background-curves {
        opacity: 0.7;
    }
}

@media (max-width: 420px) {
    .hero-content {
        padding: 12% 10%;
    }
}
