:root {
    /* Flutter brand palette: https://flutter.dev/brand */
    --ink: #042b59;
    --ink-soft: #0a3d73;
    --mist: #e3f2fd;
    --paper: #f3f9fd;
    --accent: #0175c2;
    --accent-deep: #02569b;
    --gold: #13b9fd;
    --muted: #5a6b7d;
    --line: rgba(2, 86, 155, 0.14);
    --white: #ffffff;
    --font-display: "Syne", sans-serif;
    --font-body: "Figtree", sans-serif;
    --max: 1120px;
    --header-h: 4.5rem;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(1, 117, 194, 0.14), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(19, 185, 253, 0.12), transparent 50%),
        linear-gradient(180deg, #f7fbfe 0%, var(--paper) 40%, #e8f3fb 100%);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

p { margin: 0 0 1rem; color: var(--muted); }

.lede {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 36rem;
    color: var(--ink-soft);
}

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin-bottom: 0.75rem;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1.25rem, 4vw, 3rem);
    height: var(--header-h);
    transition: background 0.35s var(--ease), backdrop-filter 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.is-scrolled {
    background: rgba(243, 249, 253, 0.9);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    z-index: 2;
}

.brand-mark {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.4rem;
    background:
        linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    position: relative;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 28% 28% 18% 18%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 2px 2px 40% 2px;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    color: var(--ink);
    transition: color 0.3s var(--ease);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.site-nav a {
    font-size: 0.95rem;
    font-weight: 550;
    color: var(--ink-soft);
    position: relative;
    transition: color 0.3s var(--ease);
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
    transform: scaleX(1);
}

.nav-cta {
    padding: 0.55rem 1.1rem !important;
    background: var(--ink);
    color: var(--white) !important;
    border-radius: 999px;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
    background: var(--accent-deep);
}

/* Home hero: light menu over dark background until scrolled */
.page-home .site-header:not(.is-scrolled) .brand-name {
    color: var(--white);
}

.page-home .site-header:not(.is-scrolled) .site-nav:not(.is-open) a:not(.nav-cta) {
    color: rgba(255, 255, 255, 0.92);
}

.page-home .site-header:not(.is-scrolled) .site-nav:not(.is-open) a::after {
    background: var(--gold);
}

.page-home .site-header:not(.is-scrolled) .nav-cta {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white) !important;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.page-home .site-header:not(.is-scrolled) .nav-cta:hover {
    background: rgba(255, 255, 255, 0.22);
}

.page-home .site-header:not(.is-scrolled) .nav-toggle span {
    background: var(--white);
}

.nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 1.4rem;
    background: var(--ink);
    transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 0;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--ink);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-deep);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1.5px var(--line);
}

.btn-ghost:hover {
    box-shadow: inset 0 0 0 1.5px var(--accent);
    color: var(--accent-deep);
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    align-items: end;
    padding: calc(var(--header-h) + 2rem) clamp(1.25rem, 4vw, 3rem) 4rem;
    overflow: hidden;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(180deg, rgba(2, 86, 155, 0.15) 0%, rgba(2, 86, 155, 0.72) 100%),
        linear-gradient(120deg, #02569b 0%, #041e3a 45%, #0a3d73 100%);
}

.hero-glow {
    position: absolute;
    width: 55vw;
    height: 55vw;
    max-width: 640px;
    max-height: 640px;
    right: -8%;
    top: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(1, 117, 194, 0.55) 0%, transparent 70%);
    animation: float-glow 8s ease-in-out infinite;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
    animation: grid-drift 20s linear infinite;
}

.hero-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42%;
    background:
        linear-gradient(90deg, transparent 0%, rgba(227, 242, 253, 0.1) 20%, transparent 40%),
        repeating-linear-gradient(
            90deg,
            transparent 0 18px,
            rgba(243, 249, 253, 0.14) 18px 19px,
            transparent 19px 52px,
            rgba(243, 249, 253, 0.2) 52px 54px,
            transparent 54px 90px
        );
    clip-path: polygon(
        0% 100%, 0% 62%, 4% 62%, 4% 48%, 9% 48%, 9% 55%, 14% 55%, 14% 35%,
        22% 35%, 22% 50%, 28% 50%, 28% 28%, 36% 28%, 36% 45%, 42% 45%, 42% 20%,
        50% 20%, 50% 40%, 58% 40%, 58% 30%, 66% 30%, 66% 52%, 74% 52%, 74% 25%,
        82% 25%, 82% 48%, 90% 48%, 90% 38%, 100% 38%, 100% 100%
    );
    opacity: 0.85;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    color: var(--white);
}

.brand-lockup {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin: 0 0 1rem;
    color: var(--white);
    text-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.hero-content h1 {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 650;
    max-width: 22ch;
    margin-bottom: 1rem;
}

.hero-content .lede {
    color: rgba(227, 242, 253, 0.9);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.75rem;
}

.hero .btn-primary {
    background: var(--gold);
    color: #042b59;
}

.hero .btn-primary:hover {
    background: #5ecfff;
}

.hero .btn-ghost {
    color: var(--white);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.hero .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.8);
}

/* Page hero */
.page-hero {
    padding: calc(var(--header-h) + 3.5rem) clamp(1.25rem, 4vw, 3rem) 3rem;
}

.page-hero-inner {
    max-width: var(--max);
    margin: 0 auto;
}

.page-hero-app {
    background:
        linear-gradient(135deg, rgba(1, 117, 194, 0.12), transparent 55%),
        linear-gradient(180deg, rgba(2, 86, 155, 0.04), transparent);
}

/* Sections */
.section {
    padding: 4.5rem clamp(1.25rem, 4vw, 3rem);
}

.section-inner {
    max-width: var(--max);
    margin: 0 auto;
}

.section-head {
    max-width: 36rem;
    margin-bottom: 2.5rem;
}

.section-muted {
    background: rgba(2, 86, 155, 0.04);
}

.section-split .section-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

.product-stack {
    display: grid;
    gap: 1rem;
}

.stack-panel {
    padding: 1.5rem 1.6rem;
    border-radius: 1.1rem;
    border: 1px solid var(--line);
    background: var(--white);
    transform: translateX(0);
    transition: transform 0.35s var(--ease);
}

.stack-panel:hover {
    transform: translateX(6px);
}

.stack-web {
    background: linear-gradient(145deg, #ffffff, #e3f2fd);
}

.stack-app {
    margin-left: 1.5rem;
    background: linear-gradient(145deg, var(--ink), var(--ink-soft));
    color: var(--white);
    border-color: transparent;
}

.stack-app p {
    color: rgba(227, 242, 253, 0.75);
}

.stack-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    color: var(--accent);
}

.stack-app .stack-label {
    color: var(--gold);
}

/* Flow */
.flow-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.flow-list li {
    padding-top: 1rem;
    border-top: 2px solid var(--accent);
}

.flow-num {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* Features */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.feature-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.feature {
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
}

.feature p {
    margin-bottom: 0;
}

.roles .role-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.roles h2 {
    max-width: 20ch;
}

/* Phone mock */
.phone-stage {
    display: flex;
    justify-content: center;
}

.phone {
    width: min(100%, 280px);
    aspect-ratio: 9 / 18.5;
    border-radius: 2rem;
    background: var(--ink);
    padding: 0.7rem;
    box-shadow:
        0 30px 60px rgba(2, 86, 155, 0.28),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: phone-float 5.5s ease-in-out infinite;
}

.phone-notch {
    width: 38%;
    height: 0.7rem;
    margin: 0.2rem auto 0.8rem;
    background: #021526;
    border-radius: 999px;
}

.phone-screen {
    height: calc(100% - 1.5rem);
    border-radius: 1.4rem;
    background:
        radial-gradient(circle at 80% 0%, rgba(1, 117, 194, 0.35), transparent 45%),
        linear-gradient(180deg, #0a3d73, #041e3a);
    padding: 1.25rem 1rem;
    color: var(--white);
}

.phone-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    margin: 0 0 1.25rem;
    color: var(--white);
}

.phone-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
}

.phone-card span {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.phone-card strong {
    font-size: 0.95rem;
}

.phone-card.muted {
    background: rgba(255, 255, 255, 0.05);
}

.check-list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
}

.check-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.65rem;
    color: var(--ink-soft);
    font-weight: 500;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--accent);
}

.tech-strip {
    max-width: 40rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.tech-tags span {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(1, 117, 194, 0.12);
    color: var(--accent-deep);
    font-size: 0.85rem;
    font-weight: 600;
}

/* CTA */
.section-cta {
    padding-bottom: 5rem;
}

.cta-band {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3rem clamp(1.5rem, 4vw, 3rem);
    border-radius: 1.5rem;
    background:
        linear-gradient(135deg, var(--ink) 0%, #0a3d73 55%, #0175c2 100%);
    color: var(--white);
}

.cta-band h2,
.cta-band p {
    color: var(--white);
}

.cta-band p {
    opacity: 0.85;
    max-width: 32rem;
}

.cta-band .btn-primary {
    background: var(--gold);
    color: #042b59;
    margin-top: 0.5rem;
}

/* Contact */
.contact-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: start;
}

.contact-form {
    display: grid;
    gap: 1rem;
}

.contact-form label {
    display: grid;
    gap: 0.4rem;
}

.contact-form label span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--white);
    font: inherit;
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(1, 117, 194, 0.15);
}

.form-note {
    color: var(--accent-deep);
    font-weight: 600;
    margin: 0;
}

.form-note-success {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: rgba(1, 117, 194, 0.12);
    border: 1px solid rgba(1, 117, 194, 0.3);
}

.form-note-warn {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid rgba(201, 162, 39, 0.45);
    color: #6b5508;
}

.field-error {
    display: block;
    margin-top: 0.1rem;
    color: #b3261e;
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 600;
}

.contact-form input:invalid:not(:placeholder-shown),
.contact-form .field-error + input {
    border-color: #b3261e;
}

.contact-aside {
    padding-top: 0.5rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 2rem;
    background: rgba(255, 255, 255, 0.45);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

.footer-brand p {
    margin: 0.4rem 0 0;
    max-width: 28rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-weight: 600;
    color: var(--ink-soft);
}

.footer-links a:hover {
    color: var(--accent-deep);
}

.footer-copy {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.reveal-delay { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.22s; }
.reveal-delay-3 { transition-delay: 0.32s; }

@keyframes float-glow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-4%, 3%) scale(1.06); }
}

@keyframes grid-drift {
    from { background-position: 0 0; }
    to { background-position: 64px 64px; }
}

@keyframes phone-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 960px) {
    .section-split .section-inner,
    .contact-layout,
    .flow-list,
    .feature-grid,
    .feature-grid-3,
    .roles .role-row {
        grid-template-columns: 1fr;
    }

    .stack-app {
        margin-left: 0;
    }

    .flow-list {
        gap: 1.75rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: fixed;
        inset: 0;
        background: rgba(243, 249, 253, 0.97);
        flex-direction: column;
        justify-content: center;
        gap: 1.75rem;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s var(--ease);
    }

    .site-nav.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav a {
        font-size: 1.35rem;
        font-family: var(--font-display);
        font-weight: 700;
    }

    .hero {
        align-items: center;
        padding-bottom: 3rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .cta-band .btn {
        width: auto;
    }
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
