/* ============================================================
   SafeCast — Aurora Design System
   Cinematic dark interface with aurora gradients, glass morphism,
   and scroll-driven storytelling.
   ============================================================ */

/* —— Design tokens —— */
:root {
    --bg:          #030306;
    --surface:     #0a0a12;
    --surface-2:   #10101c;
    --surface-3:   #161628;
    --border:      rgba(255, 255, 255, 0.06);
    --border-bright: rgba(255, 255, 255, 0.12);
    --text:        #f0f0f5;
    --muted:       #8b8fa4;
    --cast:        #3b82f6;
    --cast-glow:   rgba(59, 130, 246, 0.25);
    --send:        #a78bfa;
    --send-glow:   rgba(167, 139, 250, 0.2);
    --teal:        #2dd4bf;
    --teal-glow:  rgba(45, 212, 191, 0.2);
    --ease:        cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out:    cubic-bezier(0.33, 1, 0.68, 1);
    --font:        'Inter', system-ui, -apple-system, sans-serif;
    --nav-h:       68px;
}

/* —— Reset —— */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* —— Noise overlay —— */
.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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");
}

/* —— Ambient aurora background —— */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.aurora::before {
    content: '';
    position: absolute;
    width: 140%;
    height: 100%;
    top: -30%;
    left: -20%;
    background:
        radial-gradient(ellipse 50% 45% at 20% 50%, rgba(59, 130, 246, 0.14) 0%, transparent 70%),
        radial-gradient(ellipse 40% 35% at 75% 40%, rgba(139, 92, 246, 0.1) 0%, transparent 65%),
        radial-gradient(ellipse 35% 30% at 50% 80%, rgba(45, 212, 191, 0.06) 0%, transparent 60%);
    animation: aurora-shift 25s ease-in-out infinite alternate;
}
.aurora::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 80%;
    bottom: -20%;
    right: -10%;
    background:
        radial-gradient(ellipse 45% 40% at 60% 60%, rgba(59, 130, 246, 0.08) 0%, transparent 65%),
        radial-gradient(ellipse 35% 30% at 30% 70%, rgba(167, 139, 250, 0.06) 0%, transparent 60%);
    animation: aurora-shift 30s ease-in-out infinite alternate-reverse;
}
@keyframes aurora-shift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(3%, -2%) scale(1.05); }
    100% { transform: translate(-2%, 1%) scale(1); }
}

/* —— Container —— */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
}

/* —— Scroll-reveal system —— */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* —— Navigation —— */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: rgba(3, 3, 6, 0.6);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.3s;
}
nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}
.logo-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.nav-links {
    display: flex;
    gap: 2.25rem;
    list-style: none;
}
.nav-links a {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--text);
}
.nav-links a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 1px;
    background: var(--cast);
}
.nav-right { display: flex; align-items: center; gap: 1rem; }
.top-right-mark {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s var(--ease), filter 0.25s;
}
.top-right-mark img { width: 100%; height: 100%; object-fit: contain; }
.top-right-mark:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px var(--cast-glow));
}

/* —— Hero —— */
.hero {
    padding: calc(var(--nav-h) + 5rem) 0 3rem;
    text-align: center;
    position: relative;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(167, 139, 250, 0.1), rgba(45, 212, 191, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #b8c9ff;
    margin-bottom: 2rem;
}
.hero h1 {
    font-size: clamp(2.75rem, 7vw, 4.75rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.05em;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #ffffff 20%, #6b7fa0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-lead {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 34rem;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    font-weight: 400;
}
.hero-cta-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    border: none;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.btn-primary {
    background: linear-gradient(135deg, var(--cast), #6366f1);
    color: #fff;
    box-shadow: 0 4px 24px var(--cast-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.35);
}
.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border-bright);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.btn svg { flex-shrink: 0; }

/* —— Product mockup hero (landing) —— */
.product-hero {
    position: relative;
    padding: 2rem 0 6rem;
}
.product-hero::before {
    content: '';
    position: absolute;
    left: -10%;
    right: -10%;
    top: 0;
    height: 100%;
    background:
        radial-gradient(ellipse 70% 50% at 50% 60%, rgba(59, 130, 246, 0.15) 0%, transparent 65%),
        radial-gradient(ellipse 40% 35% at 70% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}
.product-hero-wrap {
    position: relative;
    z-index: 1;
    max-width: min(1100px, 92vw);
    margin: 0 auto;
}
.product-hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    filter:
        drop-shadow(0 60px 120px rgba(0, 0, 0, 0.7))
        drop-shadow(0 0 80px rgba(59, 130, 246, 0.1));
}
.product-hero-glow {
    position: absolute;
    inset: 10% 15%;
    background: radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.12), transparent 70%);
    z-index: -1;
    filter: blur(40px);
}

/* —— Section headers —— */
.section-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cast);
    margin-bottom: 0.85rem;
    text-align: center;
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 0.85rem;
}
.section-sub {
    text-align: center;
    color: var(--muted);
    font-size: 1rem;
    max-width: 36rem;
    margin: 0 auto 3rem;
    line-height: 1.65;
}

/* —— Screenshot marquee (horizontal scroll band) —— */
.marquee-section {
    padding: 3rem 0 5rem;
    overflow: hidden;
}
.marquee-track {
    display: flex;
    gap: 1.25rem;
    animation: marquee-scroll 45s linear infinite;
    width: max-content;
}
.marquee-track:hover {
    animation-play-state: paused;
}
.marquee-track img {
    height: clamp(200px, 22vw, 340px);
    width: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}
@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* —— 2×2 screenshot gallery —— */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 1040px;
    margin: 0 auto;
}
.gallery-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.gallery-card:hover {
    transform: translateY(-6px) scale(1.005);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.12);
}
.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* —— Feature cards —— */
.feature-band {
    padding: 5rem 0;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.feature-card {
    padding: 2rem 1.75rem;
    border-radius: 20px;
    background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.feature-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
}
.feature-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
}
.feature-card-icon.blue   { background: rgba(59, 130, 246, 0.12); color: var(--cast); }
.feature-card-icon.violet { background: rgba(139, 92, 246, 0.12); color: var(--send); }
.feature-card-icon.teal   { background: rgba(45, 212, 191, 0.12); color: var(--teal); }
.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}
.feature-card p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.55;
}

/* —— Nav cards (homepage "where to go next") —— */
.nav-cards {
    padding: 0 0 6rem;
}
.nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.nav-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    border-radius: 18px;
    background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.nav-card.features:hover { border-color: rgba(59, 130, 246, 0.35); }
.nav-card.download:hover { border-color: rgba(45, 212, 191, 0.35); }
.nav-card.security:hover { border-color: rgba(167, 139, 250, 0.35); }
.nav-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}
.nav-card p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.55;
    flex: 1;
    margin-bottom: 1rem;
}
.nav-card-cta {
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-card.features .nav-card-cta { color: var(--cast); }
.nav-card.download .nav-card-cta { color: var(--teal); }
.nav-card.security .nav-card-cta { color: var(--send); }

/* —— Download cards —— */
.download-section {
    padding: 3rem 0 5rem;
}
.download-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.dl-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 2rem;
    transition: border-color 0.3s, transform 0.35s var(--ease), box-shadow 0.35s;
}
.dl-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.4);
}
.dl-card.safecast:hover { border-color: rgba(59, 130, 246, 0.35); }
.dl-card.safesend:hover { border-color: rgba(139, 92, 246, 0.35); }
.dl-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.dl-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: contain;
}
.dl-card-info h4 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.3rem;
}
.dl-card-info p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}
.dl-card-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: auto;
}
.dl-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s var(--ease);
}
.dl-btn:hover {
    transform: translateY(-1px);
}
.dl-btn--win:hover {
    border-color: rgba(0, 164, 239, 0.4);
    background: rgba(0, 164, 239, 0.08);
}
.dl-btn--android:hover {
    border-color: rgba(61, 220, 132, 0.4);
    background: rgba(61, 220, 132, 0.06);
}
.dl-btn--coming-soon {
    cursor: default;
    opacity: 0.4;
    pointer-events: none;
}
.dl-btn--coming-soon .dl-btn-meta small {
    font-style: italic;
}
.dl-btn-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dl-btn--win .dl-btn-icon  { background: rgba(0, 164, 239, 0.12); color: #4cc2ff; }
.dl-btn--android .dl-btn-icon { background: rgba(61, 220, 132, 0.11); color: #53e69b; }
.dl-btn-meta { min-width: 0; }
.dl-btn-meta strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.dl-btn-meta small {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 0.1rem;
}

/* —— Security page —— */
.security-page {
    padding: calc(var(--nav-h) + 3rem) 0 5rem;
}
.security-hero {
    background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 3.5rem 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}
.security-hero h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    margin-bottom: 1rem;
}
.security-hero > p {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 36rem;
    margin: 0 auto 2rem;
    line-height: 1.6;
}
.security-pillars {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.security-pillar {
    flex: 1;
    min-width: 240px;
    max-width: 320px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
    text-align: left;
}
.security-pillar h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.security-pillar.safecast h4 { color: var(--cast); }
.security-pillar.safesend h4 { color: var(--send); }
.security-pillar p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.55;
}

/* —— Features page —— */
.features-page {
    padding: calc(var(--nav-h) + 3rem) 0 5rem;
}

/* —— Download page showcase area —— */
.showcase-first {
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: 2rem;
}

/* —— Footer —— */
footer {
    padding: 4.5rem 0 2.5rem;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}
.footer-brand p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 22rem;
    line-height: 1.55;
}
.footer-links h5 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 1rem;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a {
    color: var(--muted);
    font-size: 0.88rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--cast); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: #52525b;
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .marquee-track { animation: none; }
    .aurora::before, .aurora::after { animation: none; }
}

/* —— Mobile —— */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .hero h1 { font-size: clamp(2rem, 8vw, 3rem); }
    .feature-grid { grid-template-columns: 1fr; }
    .nav-cards-grid { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .dl-card-actions { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .security-pillars { flex-direction: column; align-items: center; }
}
