/* ============================================================
   senggack.net — z-pattern playful thinking surface
   palette:
     #1A1A2E deep charcoal     #3D9BE9 bright sky
     #D4D0CB marble light      #BFBAB3 marble vein
     #0F0F1A midnight          #FAFAFA pure white
     #E8A87C warm blush
   fonts:
     Albert Sans (display), Inter (body), DM Mono (counters)
   ============================================================ */

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

:root {
    --charcoal: #1A1A2E;
    --midnight: #0F0F1A;
    --sky: #3D9BE9;
    --marble-light: #D4D0CB;
    --marble-vein: #BFBAB3;
    --white: #FAFAFA;
    --blush: #E8A87C;

    --font-display: "Albert Sans", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "DM Mono", ui-monospace, monospace;

    --row-max: 1240px;
    --side-pad: clamp(1.25rem, 4vw, 3.5rem);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.08rem);
    line-height: 1.72;
    color: var(--white);
    background: var(--midnight);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ---------- ambient background ---------- */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(61, 155, 233, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(232, 168, 124, 0.06) 0%, transparent 55%),
        linear-gradient(180deg, var(--midnight) 0%, var(--charcoal) 50%, var(--midnight) 100%);
    overflow: hidden;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
    pointer-events: none;
}
.blob-1 {
    width: 520px; height: 520px;
    top: -120px; left: -120px;
    background: radial-gradient(circle, var(--sky) 0%, transparent 70%);
    animation: drift 22s ease-in-out infinite alternate;
}
.blob-2 {
    width: 640px; height: 640px;
    bottom: -180px; right: -200px;
    background: radial-gradient(circle, var(--blush) 0%, transparent 70%);
    animation: drift 28s ease-in-out infinite alternate-reverse;
}
.blob-3 {
    width: 380px; height: 380px;
    top: 45%; left: 55%;
    background: radial-gradient(circle, var(--sky) 0%, transparent 70%);
    opacity: 0.12;
    animation: drift 32s ease-in-out infinite alternate;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.12); }
}

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem var(--side-pad);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(15, 15, 26, 0.55);
    border-bottom: 1px solid rgba(61, 155, 233, 0.18);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    background: var(--sky);
    color: var(--midnight);
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.15rem;
    transform: rotate(-6deg);
    box-shadow: 0 6px 20px rgba(61, 155, 233, 0.35);
}

.brand-name {
    color: var(--white);
}

.site-nav {
    display: flex;
    gap: clamp(1rem, 2.5vw, 2rem);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.site-nav a {
    color: var(--marble-light);
    text-decoration: none;
    padding: 0.4rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.site-nav a:hover {
    color: var(--blush);
    border-bottom-color: var(--blush);
    transform: translateY(-1px);
}

/* ---------- z-stage ---------- */
.z-stage {
    max-width: var(--row-max);
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 6rem) var(--side-pad) clamp(3rem, 8vw, 8rem);
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 8vw, 7rem);
}

/* ---------- z-row base ---------- */
.z-row {
    position: relative;
    display: grid;
    gap: clamp(1.5rem, 3vw, 3rem);
    min-height: 55vh;
    align-items: center;
    padding: clamp(1rem, 2vw, 2rem) 0;
}

.row-left {
    grid-template-columns: 1.2fr 0.8fr;
}
.row-right {
    grid-template-columns: 0.8fr 1.2fr;
}
.row-center {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 70vh;
}

.row-side {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.z-row.is-visible .row-side {
    opacity: 1;
    transform: translateY(0);
}
.z-row.is-visible .row-side.side-secondary {
    transition-delay: 0.18s;
}

/* ---------- connectors ---------- */
.connector {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3.5rem;
    width: 100%;
    height: 80px;
    pointer-events: none;
    overflow: visible;
}
.connector path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.8s ease-out;
}
.z-row.is-visible .connector path {
    stroke-dashoffset: 0;
}

.row-center ~ .connector,
.row-center .connector {
    display: none;
}

/* ---------- eyebrow ---------- */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: lowercase;
    letter-spacing: 0.15em;
    color: var(--sky);
}
.eyebrow.center { text-align: center; }

/* ---------- display title ---------- */
.display-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
    color: var(--white);
}
.display-title .dot {
    color: var(--sky);
}

.title-underline {
    width: clamp(80px, 15vw, 180px);
    height: 6px;
    background: linear-gradient(90deg, var(--sky), var(--blush));
    border-radius: 99px;
    transform: skewX(-18deg);
}

.sub-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--white);
}
.sub-title.center {
    text-align: center;
}
.sub-title.big {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
}
.sub-title .accent-word {
    color: var(--sky);
    position: relative;
    display: inline-block;
}
.sub-title .accent-word::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 8px;
    background: var(--blush);
    opacity: 0.35;
    border-radius: 99px;
    transform: skewX(-10deg);
}

.sub-title.dark {
    color: var(--charcoal);
}

/* ---------- body text ---------- */
.body-text {
    color: rgba(250, 250, 250, 0.82);
    max-width: 52ch;
}
.body-text.center {
    text-align: center;
    margin-inline: auto;
}
.body-text.dark {
    color: rgba(26, 26, 46, 0.82);
}

/* ---------- counter ---------- */
.counter-block {
    display: inline-flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.3rem;
    background: rgba(61, 155, 233, 0.08);
    border: 1px solid rgba(61, 155, 233, 0.25);
    border-left: 3px solid var(--sky);
    border-radius: 10px;
    width: fit-content;
    margin-top: 0.5rem;
}
.counter-block.big {
    align-items: center;
    padding: 1.6rem 2.2rem;
    margin-inline: auto;
}

.counter {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--sky);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}
.counter-block.big .counter {
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.counter-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--marble-light);
    text-transform: lowercase;
}
.counter-block.big .counter-label {
    font-size: 0.88rem;
}

/* ---------- bullet list ---------- */
.bullet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--marble-light);
    margin-top: 0.5rem;
}
.bullet-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.bullet-dot {
    width: 8px;
    height: 8px;
    background: var(--blush);
    border-radius: 2px;
    transform: rotate(45deg);
    display: inline-block;
}

/* ---------- marble panel (bounce 2) ---------- */
.marble-panel {
    position: relative;
    padding: 0;
    min-height: 420px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.6);
}

.marble-inner {
    position: relative;
    height: 100%;
    min-height: 420px;
    padding: clamp(1.5rem, 3vw, 2.8rem);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    justify-content: center;
    background:
        radial-gradient(ellipse 60% 40% at 20% 30%, var(--marble-light) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 70% 60%, var(--marble-vein) 0%, transparent 45%),
        radial-gradient(ellipse 70% 50% at 50% 80%, var(--marble-light) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 85% 20%, var(--marble-vein) 0%, transparent 45%),
        radial-gradient(ellipse 55% 45% at 15% 75%, var(--marble-vein) 0%, transparent 40%),
        var(--white);
}
.marble-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            118deg,
            transparent 0 18px,
            rgba(191, 186, 179, 0.12) 18px 19px,
            transparent 19px 42px
        );
    mix-blend-mode: multiply;
    pointer-events: none;
}

.marble-signature {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.7rem;
}
.sig-line {
    width: 40px;
    height: 1px;
    background: var(--charcoal);
    opacity: 0.4;
}
.sig-text {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--charcoal);
    opacity: 0.75;
    letter-spacing: 0.06em;
}

/* ---------- node panel (bounce 3) ---------- */
.node-panel {
    position: relative;
    padding: clamp(1.2rem, 2.5vw, 2rem);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(61, 155, 233, 0.08), rgba(232, 168, 124, 0.04)),
        rgba(15, 15, 26, 0.6);
    border: 1px solid rgba(61, 155, 233, 0.25);
    aspect-ratio: 520 / 380;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.node-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, transparent 60%, rgba(15, 15, 26, 0.4) 100%),
        repeating-linear-gradient(
            0deg,
            transparent 0 26px,
            rgba(61, 155, 233, 0.06) 26px 27px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0 26px,
            rgba(61, 155, 233, 0.06) 26px 27px
        );
    pointer-events: none;
}

.node-diagram {
    width: 100%;
    height: auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.node-diagram .edge {
    fill: none;
    stroke: var(--sky);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    opacity: 0.75;
    transition: stroke-dashoffset 1.6s ease-out;
}
.z-row.is-visible .node-diagram .edge {
    stroke-dashoffset: 0;
}
.z-row.is-visible .node-diagram .edge:nth-child(1) { transition-delay: 0.5s; }
.z-row.is-visible .node-diagram .edge:nth-child(2) { transition-delay: 0.65s; }
.z-row.is-visible .node-diagram .edge:nth-child(3) { transition-delay: 0.8s; }
.z-row.is-visible .node-diagram .edge:nth-child(4) { transition-delay: 0.9s; }
.z-row.is-visible .node-diagram .edge:nth-child(5) { transition-delay: 1.0s; }
.z-row.is-visible .node-diagram .edge:nth-child(6) { transition-delay: 1.1s; }
.z-row.is-visible .node-diagram .edge:nth-child(7) { transition-delay: 1.2s; }
.z-row.is-visible .node-diagram .edge:nth-child(8) { transition-delay: 1.3s; }

.node-diagram .node {
    fill: var(--sky);
    stroke: var(--white);
    stroke-width: 1.2;
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
    transform-box: fill-box;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.z-row.is-visible .node-diagram .node {
    opacity: 1;
    transform: scale(1);
    transition-delay: calc(var(--i) * 55ms);
}
.node-diagram .node:nth-child(2n) {
    fill: var(--blush);
}

.node-caption {
    position: relative;
    z-index: 1;
    margin-top: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--marble-light);
    letter-spacing: 0.08em;
    text-align: right;
}

/* ---------- converge (bounce 4) ---------- */
.converge {
    max-width: 780px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem);
    border-radius: 22px;
    background: rgba(61, 155, 233, 0.04);
    border: 1px solid rgba(61, 155, 233, 0.18);
    position: relative;
}
.converge::before,
.converge::after {
    content: "";
    position: absolute;
    width: 40px; height: 40px;
    border: 1.5px solid var(--sky);
    opacity: 0.6;
}
.converge::before {
    top: -1px; left: -1px;
    border-right: none; border-bottom: none;
    border-top-left-radius: 22px;
}
.converge::after {
    bottom: -1px; right: -1px;
    border-left: none; border-top: none;
    border-bottom-right-radius: 22px;
}

.cta {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.85rem 1.7rem;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--white);
    background: transparent;
    border: 1px solid var(--sky);
    border-radius: 99px;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.cta:hover {
    background: var(--sky);
    color: var(--midnight);
    transform: translateY(-2px);
    border-color: var(--sky);
}

/* ---------- footer ---------- */
.site-footer {
    max-width: var(--row-max);
    margin: 0 auto;
    padding: 2rem var(--side-pad) 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--marble-vein);
    border-top: 1px solid rgba(61, 155, 233, 0.15);
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
    .row-left,
    .row-right {
        grid-template-columns: 1fr;
        gap: 1.8rem;
    }
    .z-row {
        min-height: auto;
    }
    .marble-panel {
        min-height: 320px;
    }
    .marble-inner {
        min-height: 320px;
    }
    .node-panel {
        min-height: 280px;
    }
    .connector {
        display: none;
    }
    .site-nav {
        gap: 0.9rem;
        font-size: 0.75rem;
    }
    .site-header {
        padding: 1rem var(--side-pad);
    }
}

@media (max-width: 520px) {
    .site-nav a:nth-child(n+3) {
        display: none;
    }
    .z-stage {
        gap: 3rem;
    }
}
