/* ==========================================================
   Landing page (index.php)
   ========================================================== */

.home {
    background: var(--surface);
    overflow-x: hidden;
}

.home h1,
.home h2,
.home h3 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    margin: 0;
}

/* ---------- Buttons ---------- */

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid transparent;
    white-space: nowrap;
}

.btn-pill:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}

.btn-solid {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    box-shadow: 0 10px 22px -8px rgba(10, 92, 64, 0.55);
}

.btn-solid:hover {
    color: #fff;
    box-shadow: 0 14px 28px -8px rgba(10, 92, 64, 0.6);
}

.btn-ghost {
    color: var(--primary);
    background: #fff;
    border-color: var(--border);
}

.btn-ghost:hover {
    color: var(--primary-dark);
    border-color: var(--primary);
}

.btn-gold {
    color: #3a2800;
    background: linear-gradient(135deg, #ffc940, #e08e00);
    box-shadow: 0 10px 22px -8px rgba(224, 142, 0, 0.6);
}

.btn-gold:hover {
    color: #3a2800;
}

.btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Nav ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(16px, 5vw, 64px);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 233, 232, 0.7);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
}

.nav-brand:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-brand img {
    width: 38px;
    height: 38px;
}

.nav-brand em {
    font-style: normal;
    font-weight: 500;
    color: var(--primary);
}

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

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.nav-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 7vw, 88px) clamp(16px, 5vw, 64px) clamp(80px, 9vw, 120px);
    background: linear-gradient(180deg, #f7faf8, #eef5f1);
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hero-bg .dots {
    color: rgba(10, 92, 64, 0.12);
}

.hero-bg .wave-1 {
    fill: rgba(10, 92, 64, 0.05);
}

.hero-bg .wave-2 {
    fill: #fff;
}

.hero-bg .orb-gold {
    fill: rgba(240, 165, 0, 0.12);
    animation: drift 14s ease-in-out infinite alternate;
}

.hero-bg .orb-green {
    fill: rgba(10, 92, 64, 0.06);
    animation: drift 18s ease-in-out infinite alternate-reverse;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
    max-width: 1200px;
    margin: 0 auto;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(240, 165, 0, 0.2);
}

.hero h1 {
    font-size: clamp(34px, 4.4vw, 54px);
    line-height: 1.08;
    text-wrap: balance;
    font-weight: 750;
    color: var(--text);
}

.hero .hl {
    position: relative;
    z-index: 0;
    color: var(--primary);
    white-space: nowrap;
}

.hero .hl::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.04em;
    height: 0.22em;
    z-index: -1;
    border-radius: 4px;
    background: rgba(240, 165, 0, 0.38);
}

.lead {
    max-width: 540px;
    margin: 22px 0 30px;
    font-size: 17px;
    color: var(--text-muted);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: 13px;
}

.hero-trust li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-trust .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.hero-art svg {
    display: block;
    width: 100%;
    max-width: 540px;
    margin-left: auto;
    overflow: visible;
}

.svg-label {
    font: 700 11px var(--font-body);
    letter-spacing: 0.14em;
}

.svg-label.gold {
    fill: #c78300;
}

.svg-mono {
    font: 700 10px var(--font-body);
    letter-spacing: 0.06em;
    fill: var(--primary);
}

.svg-chip {
    font: 600 13px var(--font-body);
    fill: var(--text);
}

.sheet-back {
    transform-origin: 280px 250px;
    transform: rotate(6deg);
    animation: float 7s ease-in-out infinite;
}

.sheet-front {
    animation: float 7s ease-in-out -3.5s infinite;
}

.typing .ln {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: type 6s ease-out infinite;
    animation-delay: var(--d);
}

.caret {
    animation: blink 1s steps(1) infinite;
}

.signature {
    stroke-dasharray: 260;
    stroke-dashoffset: 260;
    animation: sign 6s ease-in-out infinite;
}

.seal {
    animation: stamp 6s ease-out infinite;
}

.pen {
    animation: float 5s ease-in-out infinite;
}

.chip-a {
    transform: translate(-10px, 250px);
    animation: bob-a 6s ease-in-out infinite;
}

.chip-b {
    transform: translate(372px, 30px);
    animation: bob-b 7s ease-in-out infinite;
}

/* ---------- Stats strip ---------- */

.stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 1100px;
    margin: -56px auto 0;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
}

.stat + .stat {
    border-left: 1px solid var(--border);
}

.stat svg {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.1;
}

.stat span {
    color: var(--text-muted);
    font-size: 13px;
}

/* ---------- Sections ---------- */

.section {
    padding: clamp(64px, 9vw, 110px) clamp(16px, 5vw, 64px);
}

#features {
    padding-bottom: clamp(48px, 6vw, 72px);
}

.section-tint {
    background: linear-gradient(180deg, #fff, #f2f7f4);
}

.section-head {
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-head.left {
    margin: 0;
    text-align: left;
}

.section-head h2 {
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.12;
    font-weight: 700;
}

.section-head > p:not(.kicker) {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 16px;
}

/* ---------- Features ---------- */

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    max-width: 1140px;
    margin: 0 auto;
}

.feature {
    position: relative;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-4px);
    border-color: rgba(10, 92, 64, 0.25);
    box-shadow: var(--shadow-lg);
}

.feature-art {
    display: block;
    width: 120px;
    height: 90px;
    margin-bottom: 18px;
    padding: 6px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f2f8f5, #fbf6e9);
    overflow: visible;
}

.feature h3 {
    font-size: 19px;
    font-weight: 650;
}

.feature p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

.feature .fly {
    transition: transform 0.5s ease;
}

.feature:hover .fly {
    transform: translate(6px, -6px);
}

.feature .sparkle {
    transform-origin: 92px 40px;
    animation: twinkle 3s ease-in-out infinite;
}

.feature .tick {
    transform-origin: 96px 72px;
    transition: transform 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.feature:hover .tick {
    transform: scale(1.18);
}

/* ---------- Workflow ---------- */

.workflow {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.workflow-line {
    position: absolute;
    top: 14px;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
}

.workflow-run {
    stroke-dasharray: 60 1200;
    animation: run 5s linear infinite;
}

.step {
    position: relative;
    text-align: center;
}

.step-badge {
    position: relative;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.step:hover .step-badge {
    transform: translateY(-4px) rotate(-3deg);
    box-shadow: var(--shadow-lg);
}

.step-badge svg {
    width: 44px;
    height: 44px;
}

.step-no {
    position: absolute;
    top: -8px;
    right: -8px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #3a2800;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffc940, #e08e00);
    box-shadow: 0 0 0 3px #fff;
}

.step h3 {
    font-size: 18px;
    font-weight: 650;
}

.step p {
    max-width: 230px;
    margin: 6px auto 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* ---------- Portals ---------- */

.portals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.portal {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    color: var(--text);
    font-weight: 400;
    background: #fff;
    transition: var(--transition);
}

.portal:hover {
    color: var(--text);
    text-decoration: none;
    transform: translateY(-5px);
    border-color: rgba(10, 92, 64, 0.3);
    box-shadow: var(--shadow-lg);
}

.portal-art {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 220 / 140;
    max-height: 220px;
    padding: 16px 16px 0;
}

.portal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 26px 26px;
}

.portal h3 {
    font-size: 22px;
    font-weight: 700;
}

.portal p {
    margin: 8px 0 16px;
    color: var(--text-muted);
}

.portal ul {
    display: grid;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.portal li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal li .icon {
    width: 30px;
    height: 30px;
    padding: 6px;
    border-radius: 9px;
    color: var(--primary);
    background: var(--primary-glow);
}

.portal-go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    color: var(--primary);
    font-weight: 700;
}

.portal-go .icon {
    transition: transform 0.3s ease;
}

.portal:hover .portal-go .icon {
    transform: translateX(5px);
}

.portal-admin .portal-go {
    color: #b87800;
}

/* ---------- Branch network ---------- */

.section-dark {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 90% 0%, rgba(240, 165, 0, 0.22), transparent 40%),
        linear-gradient(160deg, var(--primary-dark), var(--primary) 70%);
}

.section-dark .kicker {
    color: #ffd166;
}

.section-dark .section-head > p:not(.kicker) {
    color: rgba(255, 255, 255, 0.75);
}

.network-wrap {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
    max-width: 1180px;
    margin: 0 auto;
}

.contact {
    display: grid;
    gap: 4px;
    margin-top: 26px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    font-style: normal;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.contact span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact span:first-child {
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #ffd166;
}

.contact .icon {
    width: 15px;
    height: 15px;
}

.network {
    width: 100%;
    height: auto;
    overflow: visible;
}

.network .link {
    stroke: rgba(255, 209, 102, 0.55);
    stroke-width: 1.5;
    stroke-dasharray: 4 6;
    animation: flow 1.6s linear infinite;
    animation-delay: calc(var(--i) * -0.18s);
}

.network .node-halo {
    fill: rgba(255, 255, 255, 0.1);
    transform-origin: center;
    transform-box: fill-box;
    animation: pulse 3s ease-out infinite;
    animation-delay: calc(var(--i) * 0.33s);
}

.network .node-dot {
    fill: #ffc940;
    stroke: #06452e;
    stroke-width: 2;
}

.network text {
    font: 600 13px var(--font-body);
    fill: #fff;
}

.hub-pulse {
    fill: rgba(255, 255, 255, 0.12);
    transform-origin: center;
    transform-box: fill-box;
    animation: pulse 2.6s ease-out infinite;
}

.network .hub-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    fill: #ffd166;
}

/* ---------- Closing CTA ---------- */

.cta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 32px;
    max-width: 1100px;
    margin: clamp(56px, 8vw, 96px) auto;
    padding: 30px 40px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(240, 165, 0, 0.25), transparent 45%),
        linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 24px 50px -20px rgba(6, 69, 46, 0.6);
}

.cta-art {
    width: 140px;
    height: auto;
    overflow: visible;
}

.cta-letter {
    animation: rise 4s ease-in-out infinite;
}

.cta h2 {
    font-size: clamp(22px, 2.6vw, 30px);
}

.cta p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.75);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Footer ---------- */

.foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px clamp(16px, 5vw, 64px);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

.foot-brand,
.foot-web {
    display: flex;
    align-items: center;
    gap: 10px;
}

.foot-brand img {
    width: 28px;
    height: 28px;
}

.foot .icon {
    width: 15px;
    height: 15px;
}

/* ---------- Animations ---------- */

@keyframes float {
    50% { translate: 0 -8px; }
}

@keyframes drift {
    to { translate: -40px 30px; }
}

@keyframes type {
    0%, 8%   { stroke-dashoffset: 300; }
    30%, 88% { stroke-dashoffset: 0; }
    100%     { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes sign {
    0%, 55%  { stroke-dashoffset: 260; }
    75%, 92% { stroke-dashoffset: 0; }
    100%     { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes stamp {
    0%, 70%  { opacity: 0; scale: 1.6; }
    76%      { opacity: 1; scale: 0.92; }
    80%, 94% { opacity: 1; scale: 1; }
    100%     { opacity: 0; scale: 1; }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes bob-a {
    50% { transform: translate(-10px, 238px); }
}

@keyframes bob-b {
    50% { transform: translate(372px, 42px); }
}

@keyframes twinkle {
    50% { scale: 0.85; rotate: 12deg; opacity: 0.75; }
}

@keyframes run {
    to { stroke-dashoffset: -1260; }
}

@keyframes flow {
    to { stroke-dashoffset: -20; }
}

@keyframes pulse {
    0%   { scale: 0.8; opacity: 1; }
    100% { scale: 1.9; opacity: 0; }
}

@keyframes rise {
    50% { translate: 0 -10px; }
}

.seal {
    transform-box: fill-box;
    transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
    .home *,
    .home *::before,
    .home *::after {
        animation: none !important;
        transition: none !important;
    }

    .typing .ln,
    .signature {
        stroke-dashoffset: 0;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .hero-bg .dots {
        display: none;
    }

    .hero-inner,
    .network-wrap {
        grid-template-columns: 1fr;
    }

    .hero-art svg {
        max-width: 440px;
        margin: 0 auto;
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        margin: -48px 16px 0;
    }

    .stat:nth-child(3) {
        border-left: 0;
    }

    .cta {
        grid-template-columns: 1fr;
        margin-left: 16px;
        margin-right: 16px;
        text-align: center;
        justify-items: center;
    }

    .cta-actions {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .nav-links {
        display: none;
    }

    .workflow {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 40px;
    }

    .workflow-line {
        display: none;
    }

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

@media (max-width: 560px) {
    .features,
    .stats {
        grid-template-columns: 1fr;
    }

    .stat + .stat {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

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

    .hero .hl {
        white-space: normal;
    }

    .hero-cta .btn-pill {
        flex: 1;
        justify-content: center;
    }

    .network text {
        font-size: 16px;
    }

    .cta {
        padding: 28px 20px;
    }
}
