/* ==========================================================================
   Piezza — shared design system (landing + legal)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
    --primary: #fe903b;
    --primary-deep: #f0741a;
    --secondary: #374151;
    --green: #3eb265;
    --yellow: #ffa537;
    --royal: #91a6ff;

    --tint-needs: #fe903b;
    --tint-income: #3eb265;
    --tint-expense: #de5a57;
    --tint-insights: #6b7fd7;
    --tint-transactions: #8b8b8b;
    --tint-feasibility: #de5a57;

    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-pill: 999px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --container: 1180px;
    --legal-measure: 68ch;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-low: #0a0a0a;
    --bg-mid: #1c1c1c;
    --bg-high: #2c2c2c;
    --bg-higher: #353535;
    --card: #151515;
    --card-border: rgba(255, 255, 255, 0.06);

    --txt-primary: rgba(246, 247, 235, 0.92);
    --txt-secondary: rgba(246, 247, 235, 0.7);
    --txt-light: rgba(230, 230, 230, 0.38);
    --txt-bright: rgba(248, 249, 242, 1);

    --error: #fa5c5c;
    --success: #5ac45c;

    --green-soft: rgba(62, 178, 101, 0.16);
    --red-soft: rgba(250, 92, 92, 0.16);
    --yellow-soft: rgba(255, 165, 55, 0.14);
    --orange-soft: rgba(254, 144, 59, 0.16);
    --royal-soft: rgba(145, 166, 255, 0.16);

    --shadow-lg: 0 40px 100px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(28, 28, 28, 0.55);
    --nav-border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shape-fill: rgba(255, 255, 255, 0.14);
    --phone-bezel: linear-gradient(145deg, #2a2a2a, #0b0b0b 40%, #1a1a1a);
    --progress-track: #0a0a0a;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-low: #f8f8f8;
    --bg-mid: #ececec;
    --bg-high: #dfdfdf;
    --bg-higher: #d6d6d6;
    --card: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);

    --txt-primary: #151312;
    --txt-secondary: #4e4e4e;
    --txt-light: #8b8b8b;
    --txt-bright: #121212;

    --error: #ea4f4f;
    --success: #07a675;

    --green-soft: #daefe2;
    --red-soft: #fbe1e1;
    --yellow-soft: #fff1c2;
    --orange-soft: #ffe6d2;
    --royal-soft: #e8ecff;

    --shadow-lg: 0 40px 90px rgba(40, 38, 35, 0.18), 0 6px 18px rgba(40, 38, 35, 0.08);
    --shadow-md: 0 18px 40px rgba(40, 38, 35, 0.12);
    --shadow-sm: 0 8px 20px rgba(40, 38, 35, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.62);
    --nav-border: rgba(0, 0, 0, 0.06);
    --glass: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.7);
    --shape-fill: rgba(0, 0, 0, 0.08);
    --phone-bezel: linear-gradient(145deg, #3a3a3a, #1a1a1a 40%, #2a2a2a);
    --progress-track: #1a1a1a;
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.65;
    letter-spacing: 0;
    color: var(--txt-secondary);
    background: var(--bg-low);
    overflow-x: hidden;
    transition:
        background-color 0.45s ease,
        color 0.45s ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4 {
    color: var(--txt-bright);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin: 0;
    font-optical-sizing: auto;
}

h1 {
    letter-spacing: -0.03em;
}

h2 {
    letter-spacing: -0.025em;
}

h3 {
    letter-spacing: -0.015em;
    line-height: 1.2;
}

strong,
b {
    color: var(--txt-primary);
    font-weight: 700;
}

.container {
    width: min(var(--container), 100% - 48px);
    margin-inline: auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition:
        background-color 0.45s ease,
        border-color 0.45s ease;
}

/* ---------------------------------------------------------------- tinted bands + shapes */

.tint-band {
    position: relative;
    overflow: hidden;
    background: var(--tint, var(--primary));
    color: #1a0f05;
}

.tint-band[data-tint="needs"] {
    --tint: var(--tint-needs);
}
.tint-band[data-tint="income"] {
    --tint: var(--tint-income);
}
.tint-band[data-tint="expense"],
.tint-band[data-tint="feasibility"] {
    --tint: var(--tint-expense);
}
.tint-band[data-tint="insights"] {
    --tint: var(--tint-insights);
}
.tint-band[data-tint="transactions"] {
    --tint: #a8a8a8;
}
.tint-band[data-tint="privacy"] {
    --tint: var(--tint-income);
}
.tint-band[data-tint="aup"] {
    --tint: var(--tint-insights);
}

.shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.shapes svg {
    position: absolute;
    fill: var(--shape-fill);
    opacity: 0.9;
    will-change: transform;
}

.shape-pie {
    width: 72px;
    top: 8%;
    left: 6%;
}
.shape-wallet {
    width: 56px;
    top: 12%;
    right: 10%;
}
.shape-plus {
    width: 28px;
    top: 42%;
    left: 4%;
}
.shape-squiggle {
    width: 90px;
    top: 38%;
    right: 4%;
}
.shape-dot {
    width: 14px;
    top: 55%;
    right: 18%;
}
.shape-piggy {
    width: 64px;
    bottom: 18%;
    left: 8%;
}
.shape-bars {
    width: 48px;
    bottom: 12%;
    right: 12%;
}
.shape-blob {
    width: 140px;
    bottom: -20px;
    right: -20px;
}

/* ---------------------------------------------------------------- buttons & pills */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 700;
    border: 0;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition:
        transform 100ms ease-out,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #1a0f05;
    box-shadow: 0 8px 22px rgba(254, 144, 59, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 12px 28px rgba(254, 144, 59, 0.45);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
}

.pill-green {
    color: var(--green);
    background: var(--green-soft);
}

.dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(62, 178, 101, 0.6);
    animation: live 2s ease-out infinite;
}

@keyframes live {
    70% {
        box-shadow: 0 0 0 9px rgba(62, 178, 101, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(62, 178, 101, 0);
    }
}

.status {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.status-green {
    color: var(--green);
    background: var(--green-soft);
}
.status-red {
    color: var(--error);
    background: var(--red-soft);
}
.status-yellow {
    color: #c99600;
    background: var(--yellow-soft);
}
:root[data-theme="dark"] .status-yellow {
    color: var(--yellow);
}
.status-orange {
    color: var(--primary-deep);
    background: var(--orange-soft);
}
:root[data-theme="dark"] .status-orange {
    color: var(--primary);
}

.d {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: 1px;
}
.d-green {
    background: var(--green);
}
.d-orange {
    background: var(--primary);
}
.d-red {
    background: var(--error);
}

/* ---------------------------------------------------------------- glass */

.glass {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
}

/* ---------------------------------------------------------------- store buttons */

.store-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.store-buttons.center {
    justify-content: center;
}

.appstore-badge {
    display: inline-block;
    border-radius: 12px;
    transition:
        transform 0.25s var(--ease-out),
        filter 0.25s ease;
}

.appstore-badge:active {
    transform: scale(0.97);
}

.appstore-badge img {
    height: 54px;
    width: auto;
}

.appstore-badge:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 10px 20px rgba(254, 144, 59, 0.3));
}

:root[data-theme="dark"] .badge-on-light,
:root[data-theme="light"] .badge-on-dark {
    display: none;
}

/* Colored bands are always warm/bright — prefer the white badge */
.tint-band .badge-on-dark {
    display: block !important;
}
.tint-band .badge-on-light {
    display: none !important;
}

.play-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 20px 0 16px;
    border-radius: 12px;
    border: 1.5px dashed var(--bg-higher);
    color: var(--txt-light);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.1;
    cursor: default;
    user-select: none;
}

.play-pill svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.play-pill small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- nav */

.nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    padding: 16px 0 0;
    pointer-events: none;
}

.nav-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px 10px 18px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        backdrop-filter 0.35s ease,
        padding 0.3s var(--ease-out);
}

/* Over tinted heroes the frosted white pill keeps brand/nav readable */
.nav:not(.scrolled) .brand,
.nav:not(.scrolled) .nav-links a {
    color: #121212;
}

.nav:not(.scrolled) .nav-links a:hover,
.nav:not(.scrolled) .nav-links a.current {
    color: #121212;
    background: rgba(0, 0, 0, 0.08);
}

.nav:not(.scrolled) .theme-toggle {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(0, 0, 0, 0.08);
    color: #121212;
}

.nav.scrolled .nav-inner {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-color: var(--nav-border);
    box-shadow: var(--shadow-sm);
    padding: 8px 12px 8px 16px;
}

.nav.scrolled .brand {
    color: var(--txt-bright);
}

.nav.scrolled .nav-links a {
    color: var(--txt-secondary);
}

.nav.scrolled .nav-links a:hover,
.nav.scrolled .nav-links a.current {
    color: var(--txt-bright);
    background: var(--bg-mid);
}

.nav.scrolled .theme-toggle {
    background: var(--bg-mid);
    border-color: var(--card-border);
    color: var(--txt-primary);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--txt-bright);
}

.brand img {
    height: 28px;
    width: auto;
    transition: transform 0.4s var(--ease-out);
}

.brand:hover img {
    transform: rotate(-8deg) scale(1.08);
}

.brand:active img {
    transform: scale(0.95);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 600;
    color: var(--txt-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 100ms ease-out;
}

.nav-links a:hover,
.nav-links a.current {
    color: var(--txt-bright);
    background: var(--bg-mid);
}

.nav-links a:active {
    transform: scale(0.96);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--bg-mid);
    color: var(--txt-primary);
    cursor: pointer;
    overflow: hidden;
    transition: transform 100ms ease-out;
}

.theme-toggle:hover {
    transform: scale(1.06);
}

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-toggle svg {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition:
        transform 0.5s var(--ease-out),
        opacity 0.3s ease;
}

:root[data-theme="dark"] .icon-moon,
:root[data-theme="light"] .icon-sun {
    transform: translateY(24px) rotate(90deg);
    opacity: 0;
}

.reading-progress {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: transparent;
    pointer-events: none;
    overflow: hidden;
}

.nav .reading-progress {
    position: fixed;
    top: 0;
    bottom: auto;
    z-index: 51;
}

.reading-progress > i {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    transform-origin: left;
}

/* ---------------------------------------------------------------- phone frame */

.phone {
    --pw: 300px;
    position: relative;
    width: var(--pw);
    padding: calc(var(--pw) * 0.034);
    border-radius: calc(var(--pw) * 0.165);
    background: var(--phone-bezel);
    box-shadow:
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.12),
        inset 0 0 0 5px #050505,
        var(--shadow-lg);
}

.phone::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: calc(var(--pw) * 0.058);
    left: 50%;
    width: calc(var(--pw) * 0.3);
    height: calc(var(--pw) * 0.085);
    transform: translateX(-50%);
    border-radius: var(--radius-pill);
    background: #000;
}

.phone::after {
    content: "";
    position: absolute;
    right: -3px;
    top: 26%;
    width: 3px;
    height: 13%;
    border-radius: 0 3px 3px 0;
    background: #1c1c1c;
}

.phone img {
    width: 100%;
    height: auto;
    border-radius: calc(var(--pw) * 0.135);
    background: var(--bg-mid);
    transition: opacity 0.4s ease;
}

.phone img.shot-fade {
    opacity: 0;
}

.phone-lg {
    --pw: min(330px, 72vw);
}

.phone-md {
    --pw: 290px;
}

/* ---------------------------------------------------------------- footer */

.footer {
    padding: 40px 0 48px;
    border-top: 1px solid var(--card-border);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer .brand {
    font-size: 18px;
}

.footer .brand img {
    height: 26px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 15px;
    font-weight: 600;
}

.footer-links a {
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer small {
    color: var(--txt-light);
    font-size: 14px;
}

/* ---------------------------------------------------------------- scroll reveal */

.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
    transition:
        opacity 0.7s ease,
        transform 0.85s var(--ease-out),
        filter 0.7s ease;
    transition-delay: calc(var(--i, 0) * 80ms);
}

.js .reveal.in {
    opacity: 1;
    transform: none;
    filter: none;
}

/* ---------------------------------------------------------------- section chrome (shared) */

.section {
    position: relative;
    padding: 120px 0;
}

.section-head {
    max-width: 760px;
    margin: 0 auto 56px;
    text-align: center;
}

.section-head.left {
    margin-left: 0;
    text-align: left;
}

.section-head h2 {
    font-size: clamp(32px, 4.2vw, 52px);
    margin: 14px 0 18px;
}

.section-head p {
    margin: 0;
    font-size: 18px;
}

.eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
}

/* ---------------------------------------------------------------- responsive shared */

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .container {
        width: calc(100% - 36px);
    }

    .section {
        padding: 84px 0;
    }

    .nav .btn-sm {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* ---------------------------------------------------------------- a11y */

@media (prefers-reduced-transparency: reduce) {
    .nav.scrolled .nav-inner,
    .glass {
        background: var(--card);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (prefers-contrast: more) {
    .nav.scrolled .nav-inner,
    .glass,
    .card {
        background: var(--card);
        border-color: var(--txt-light);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        transition-delay: 0s !important;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .dot-live {
        animation: none !important;
    }
}
