/* ============================================================
   Keys — marketing site
   Dark-mode premium aesthetic matching the iOS app.
   ============================================================ */

:root {
    /* Surface palette — pulled from KeysColor in the iOS app. */
    --bg:           #0B1220;
    --bg-deep:      #060912;
    --surface:      #111827;
    --surface-hi:   #1F2937;
    --border:       rgba(255, 255, 255, 0.08);
    --border-hi:    rgba(255, 255, 255, 0.14);

    /* Text */
    --text:         #F9FAFB;
    --text-soft:    #C7CDD8;
    --text-mute:    #8B93A4;
    --text-faint:   #5B6478;

    /* Accents — keyed on vivid blue with a cyan highlight. */
    --accent:       #3B82F6;   /* blue-500, primary */
    --accent-hi:    #06B6D4;   /* cyan-500, for gradient pop */
    --accent-blue:  #2563EB;   /* blue-600, deeper backdrop blob */
    --accent-mint:  #2DD4BF;
    --accent-glow:  rgba(59, 130, 246, 0.45);

    --max-w:        1080px;
    --radius:       18px;
    --radius-sm:    12px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ------------------------------------------------------------
   Backdrop — three blurred gradient blobs + faint grid.
   Pure CSS, sits behind everything and never reflows.
   ------------------------------------------------------------ */
body::before,
body::after,
.bg-glow {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: -2;
    filter: blur(110px);
    opacity: 0.55;
    border-radius: 50%;
}

body::before {
    width: 520px;
    height: 520px;
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
}

body::after {
    width: 620px;
    height: 620px;
    top: 40%;
    right: -200px;
    background: radial-gradient(circle, var(--accent-hi) 0%, transparent 65%);
    opacity: 0.4;
}

.bg-glow {
    width: 480px;
    height: 480px;
    bottom: -180px;
    left: 30%;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 65%);
    opacity: 0.32;
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at center, black 25%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 70%);
}

a {
    color: var(--text);
    text-decoration: none;
    transition: opacity .2s ease, color .2s ease;
}
a:hover { opacity: .85; }

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

main.landing {
    padding-top: 96px;
    padding-bottom: 96px;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
    text-align: center;
    margin-bottom: 120px;
}

.hero-icon-wrap {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto 32px;
}

.hero-icon-wrap::before {
    content: "";
    position: absolute;
    inset: -28px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
    filter: blur(20px);
    z-index: -1;
}

.app-icon {
    width: 132px;
    height: 132px;
    border-radius: 29px;
    display: block;
    box-shadow:
        0 22px 60px rgba(59, 130, 246, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 999px;
}

h1.headline {
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 22px;
    max-width: 18ch;
    margin-left: auto;
    margin-right: auto;
}

.headline .grad {
    background: linear-gradient(120deg, #ffffff 30%, var(--accent-hi) 70%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-soft);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.55;
}

.cta-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 54px;
    padding: 0 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hi) 100%);
    color: #fff;
    box-shadow: 0 10px 30px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px var(--accent-glow); opacity: 1; }

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hi);
    color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); opacity: 1; }

/* ------------------------------------------------------------
   Section scaffolding
   ------------------------------------------------------------ */
.section {
    margin-bottom: 120px;
}

.section-heading {
    text-align: center;
    margin-bottom: 56px;
}

.section-heading h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 12px;
}

.section-heading p {
    color: var(--text-soft);
    max-width: 540px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* ------------------------------------------------------------
   How it works — 3 steps
   ------------------------------------------------------------ */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step {
    padding: 32px 28px;
    background: linear-gradient(160deg,
                rgba(255, 255, 255, 0.04) 0%,
                rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    transition: border-color .25s ease, transform .25s ease;
}

.step:hover {
    border-color: var(--border-hi);
    transform: translateY(-3px);
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hi));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.step h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ------------------------------------------------------------
   Feature grid
   ------------------------------------------------------------ */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature {
    padding: 28px;
    background: linear-gradient(160deg,
                rgba(255, 255, 255, 0.045) 0%,
                rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .25s ease, transform .25s ease, background .25s ease;
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-hi), transparent);
    opacity: 0;
    transition: opacity .3s ease;
}

.feature:hover {
    transform: translateY(-3px);
    border-color: var(--border-hi);
}
.feature:hover::before { opacity: 0.9; }

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--accent);
    font-size: 1.25rem;
}

.feature h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature p {
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ------------------------------------------------------------
   Closing CTA
   ------------------------------------------------------------ */
.closing {
    text-align: center;
    padding: 64px 32px;
    background: linear-gradient(160deg,
                rgba(59, 130, 246, 0.10) 0%,
                rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 26px;
    position: relative;
    overflow: hidden;
}

.closing h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.closing p {
    color: var(--text-soft);
    margin-bottom: 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
footer.site-footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px 64px;
    text-align: center;
    color: var(--text-mute);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.footer-links a { color: var(--text-soft); }
.footer-links a:hover { color: var(--accent); opacity: 1; }

/* ------------------------------------------------------------
   Legal pages
   ------------------------------------------------------------ */
.legal {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 24px 96px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-mute);
    font-size: 0.9rem;
    margin-bottom: 36px;
    transition: color .2s ease;
}
.back-link:hover { color: var(--accent); opacity: 1; }

.legal h1 {
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    text-align: center;
}

.legal .effective-date {
    display: block;
    text-align: center;
    color: var(--text-mute);
    font-size: 0.9rem;
    margin-bottom: 52px;
    letter-spacing: 0.01em;
}

.legal h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 14px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.legal p,
.legal ul {
    color: var(--text-soft);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }

.legal a {
    color: var(--accent);
    border-bottom: 1px solid rgba(59, 130, 246, 0.35);
}
.legal a:hover { opacity: 1; border-bottom-color: var(--accent); }

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */
.fade-in {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeIn .8s ease-out forwards;
}
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }
.delay-5 { animation-delay: .5s; }

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Subtle breathing on the icon glow */
@keyframes breathe {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50%      { opacity: 0.65; transform: scale(1.06); }
}
.hero-icon-wrap::before { animation: breathe 5s ease-in-out infinite; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 880px) {
    .steps, .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
    main.landing { padding-top: 64px; padding-bottom: 64px; }
    .hero { margin-bottom: 80px; }
    .section { margin-bottom: 80px; }
    .steps, .features { grid-template-columns: 1fr; }
    .hero-icon-wrap, .app-icon { width: 108px; height: 108px; }
    .hero-icon-wrap { margin-bottom: 24px; }
    h1.headline { font-size: 2.5rem; }
    .closing { padding: 44px 22px; }
}
