/* ========================================
   Filament Labs — Design System
   filamentlabs.io
   ======================================== */

/* Google Fonts loaded via <link> tags in HTML for Safari content-blocker compatibility */

/* ----------------------------------------
   Design Tokens
   ---------------------------------------- */
:root {
    --bg-primary: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #e8e8ed;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.35);
    --accent-blue: #338ef7;
    --accent-glow: rgba(51, 142, 247, 0.15);
    --accent-orange: #ff7c1e;
    --border: rgba(255, 255, 255, 0.06);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-brand: 'Zen Tokyo Zoo', cursive;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* ----------------------------------------
   Brand Title (hrv/spark)
   ---------------------------------------- */
.brand-title {
    font-family: var(--font-brand);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.project-card-text .brand-title {
    font-size: 1.6rem;
}

.hero-product .brand-title {
    font-size: 4rem;
}

/* ----------------------------------------
   Reset
   ---------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ----------------------------------------
   Base
   ---------------------------------------- */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.7;
    min-height: 100vh;
}

/* Subtle animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(51, 142, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 124, 30, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(51, 142, 247, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ----------------------------------------
   Scroll-reveal Animations
   ---------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
}

.animate-on-scroll.is-visible {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Stagger children */
.animate-on-scroll.is-visible:nth-child(2) {
    animation-delay: 0.08s;
}

.animate-on-scroll.is-visible:nth-child(3) {
    animation-delay: 0.16s;
}

.animate-on-scroll.is-visible:nth-child(4) {
    animation-delay: 0.24s;
}

/* ----------------------------------------
   Typography
   ---------------------------------------- */
h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 16px;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

strong {
    color: var(--text-primary);
}

em {
    color: var(--text-muted);
}

/* ----------------------------------------
   Layout
   ---------------------------------------- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

section {
    padding: 48px 0;
}

section h2 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

/* ----------------------------------------
   Navigation / Back Link
   ---------------------------------------- */
.nav-back {
    display: inline-block;
    font-size: 0.9rem;
    margin-bottom: 32px;
    padding-top: 40px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.nav-back:hover {
    transform: translateX(-3px);
    color: var(--text-primary);
    opacity: 1;
}

/* ----------------------------------------
   Hero — Homepage
   ---------------------------------------- */
.hero {
    text-align: center;
    padding: 100px 0 60px;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff, #a0c4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .tagline {
    font-size: 1.35rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 8px;
}

.hero .sub-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Sparkline canvas in hero */
.hero-sparkline {
    width: 100%;
    max-width: 600px;
    height: 60px;
    margin: 32px auto 0;
    opacity: 0.4;
}

/* ----------------------------------------
   Hero — Product Page
   ---------------------------------------- */
.hero-product {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 48px 0 24px;
}

.hero-logo {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(51, 142, 247, 0.15),
        0 0 80px rgba(51, 142, 247, 0.05);
    animation: logoBreath 4s ease-in-out infinite;
}

@keyframes logoBreath {

    0%,
    100% {
        box-shadow: 0 0 40px rgba(51, 142, 247, 0.15), 0 0 80px rgba(51, 142, 247, 0.05);
    }

    50% {
        box-shadow: 0 0 50px rgba(51, 142, 247, 0.25), 0 0 100px rgba(51, 142, 247, 0.1);
    }
}

.hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-text {
    text-align: left;
}

.hero-product h1 {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff, #a0c4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-product .tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 4px;
}

.hero-product .sub-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0;
}

/* ----------------------------------------
   Screenshots — 2-column layout
   ---------------------------------------- */
.screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px 0 48px;
    align-items: start;
}

.screenshot-device {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Phone frame */
.screenshot-phone {
    width: 100%;
    max-width: 330px;
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(51, 142, 247, 0.1);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease;
}

.screenshot-phone:hover {
    transform: translateY(-4px);
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(51, 142, 247, 0.15);
}

.screenshot-device figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

/* Watch column — three stacked */
.watch-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Apple Watch Series 11 frame */
.watch-frame {
    position: relative;
    width: 135px;
    padding: 8px;
    background: linear-gradient(145deg, #2a2a2e, #1a1a1e);
    border-radius: 36px;
    overflow: hidden;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(51, 142, 247, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease;
}

.watch-frame:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(51, 142, 247, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.watch-frame img {
    width: 100%;
    display: block;
    border-radius: 28px;
}

/* ----------------------------------------
   Project Cards (Homepage)
   ---------------------------------------- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 40px 0;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    text-decoration: none;
    transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(51, 142, 247, 0.06);
    opacity: 1;
}

.project-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(51, 142, 247, 0.1);
}

.project-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-text h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.project-card-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.project-card-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s;
}

.project-card:hover .project-card-arrow {
    color: var(--accent-blue);
}

/* ----------------------------------------
   Feature Grid
   ---------------------------------------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 32px 0 64px;
}

.feature-trust {
    grid-column: 2;
    transform: translateY(24px);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.feature-card .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.feature-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ----------------------------------------
   Comparison Table
   ---------------------------------------- */
.comparison {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.comparison th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.comparison td {
    padding: 14px 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.comparison tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.comparison td:first-child {
    color: var(--text-muted);
}

.comparison td:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ----------------------------------------
   Quote Block
   ---------------------------------------- */
.quote-block {
    border-left: 2px solid var(--accent-blue);
    padding: 20px 24px;
    margin: 32px 0;
    background: var(--bg-card);
    border-radius: 0 12px 12px 0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.quote-block:hover {
    border-left-color: #5aa4ff;
    box-shadow: -2px 0 20px rgba(51, 142, 247, 0.1);
}

.quote-block p {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 8px;
}

.quote-block .attribution {
    font-style: normal;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ----------------------------------------
   Persona Cards
   ---------------------------------------- */
.persona {
    margin-bottom: 20px;
}

.persona p {
    margin-top: 4px;
    font-size: 0.95rem;
}

/* ----------------------------------------
   CTA / App Store Block
   ---------------------------------------- */
.cta-block {
    text-align: center;
    padding: 60px 0;
}

.cta-block h2 {
    margin-bottom: 8px;
}

.cta-block p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--accent-blue);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.25s, box-shadow 0.25s;
    box-shadow: 0 4px 20px rgba(51, 142, 247, 0.25);
}

.btn-primary:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(51, 142, 247, 0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    margin-left: 12px;
    transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    opacity: 1;
}

/* ----------------------------------------
   About Section (Homepage)
   ---------------------------------------- */
.about-section {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.about-section p {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */
footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--text-primary);
}

/* ----------------------------------------
   Privacy Page
   ---------------------------------------- */
.privacy-page {
    max-width: 700px;
    padding-top: 60px;
    line-height: 1.8;
}

.privacy-page h2 {
    font-size: 1.2rem;
    margin-top: 32px;
    margin-bottom: 12px;
}

.privacy-page p {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.privacy-page .updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
/* Tablet */
@media (max-width: 768px) {

    .hero-product {
        gap: 24px;
    }

    .hero-product h1 {
        font-size: 2.5rem;
    }

    .screenshots {
        gap: 16px;
    }

    .screenshot-phone {
        max-width: 260px;
    }

    .watch-frame {
        width: 110px;
    }
}

/* Phone */
@media (max-width: 600px) {

    .hero h1,
    .hero-product h1 {
        font-size: 2.2rem;
    }

    .hero-product {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .hero-text {
        text-align: center;
    }

    .hero-product .brand-title {
        font-size: 2.8rem;
    }

    .hero .tagline,
    .hero-product .tagline {
        font-size: 1.1rem;
    }

    .screenshots {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .screenshot-phone {
        max-width: 240px;
    }

    .watch-frame {
        width: 140px;
    }

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

    .feature-trust {
        grid-column: auto;
        transform: none;
    }

    .project-card {
        padding: 20px 24px;
    }

    .project-card-icon {
        width: 48px;
        height: 48px;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 12px;
    }

    .cta-block {
        padding: 40px 0;
    }
}

/* ----------------------------------------
   Reduced Motion
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .animate-on-scroll.is-visible {
        animation: none;
    }

    .hero-logo {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}