/* ──────────────────────────────────────────────
   FlowTouch – Premium Monochrome Landing Page
   ────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens ────────────────────────── */
:root {
    --bg-deep: #000000;
    --bg-card: rgba(26, 26, 26, 0.4);
    --bg-card-hover: rgba(38, 38, 38, 0.6);
    --surface: rgba(255, 255, 255, 0.03);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-secondary: #a1a1aa; /* Zinc-400 */
    --text-muted: #71717a;     /* Zinc-500 */
    --accent: #ffffff;         /* Pure white accent instead of blue/purple */
    
    /* Subtle silver/white glows replacing colorful ones */
    --glow-subtle: rgba(255, 255, 255, 0.03);
    --glow-medium: rgba(255, 255, 255, 0.08);
    --glow-strong: rgba(255, 255, 255, 0.15);
    
    --shadow-lg: 0 40px 100px rgba(0, 0, 0, 0.8);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    
    --content-width: min(1180px, calc(100vw - 48px));
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-width: 320px;
    font-family: var(--font-main);
    color: var(--text);
    background: var(--bg-deep);
    overflow-x: hidden;
}

/* Minimal ambient lighting - extremely subtle, colorless */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    width: 60vw;
    height: 40vw;
    border-radius: 50%;
    background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; border-radius: inherit; }

/* ── Layout ───────────────────────────────── */
.page {
    position: relative;
    z-index: 1;
    width: var(--content-width);
    margin: 0 auto;
    padding: 0 0 100px;
}

/* ── Navigation ───────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center; /* Centered brand */
    padding: 16px 24px;
    margin: 0 -24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-size: 1.15rem; /* Slightly smaller, more refined */
    font-weight: 600;
    letter-spacing: -0.01em;
    opacity: 0.9;
    transition: opacity 200ms ease;
}

.brand:hover {
    opacity: 1;
}

.topbar-github {
    position: absolute;
    right: 24px;
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 200ms ease, color 200ms ease;
}

.topbar-github:hover {
    opacity: 1;
    color: var(--text);
}

/* Removed .topbar-cta styling as it's no longer used */

/* ── Buttons ──────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 32px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Advanced Animated Button (Codepilot style) ── */
@property --btn-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.button-primary {
    position: relative;
    color: var(--text);
    background: #050505; /* Deep dark background */
    border: none;
    z-index: 1; /* Ensure text is above pseudo elements */
    overflow: visible; /* Let the glow spread */
}

/* Base border inner ring to separate gradient from content slightly */
.button-primary::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(999px - 1px);
    background: #0a0a0a; /* Slightly lighter inner background */
    z-index: -1;
    transition: background 0.3s ease;
}

/* The Animated Gradient Border */
.button-primary::after {
    content: '';
    position: absolute;
    inset: -1.5px;
    z-index: -2;
    border-radius: inherit;
    background: conic-gradient(from var(--btn-angle), 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.1) 40%, 
        #007aff 50%,    /* Blue accent */
        #ff2d55 70%,    /* Pink accent */
        rgba(255, 255, 255, 0.1) 80%, 
        rgba(255, 255, 255, 0.1) 100%
    );
    animation: btn-rotate 4s linear infinite;
    /* Mask out the inside so it's just a border */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    padding: 1.5px; /* Border thickness */
}

/* Hover Glow (Separate element needed because pseudo is masked) */
.button-primary .btn-text {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

/* Drop a blurred shadow of the animated gradient */
.button-primary:hover::before {
    background: #000000;
}

.button-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3), 0 5px 15px rgba(255, 45, 85, 0.2);
}

.button-primary:hover .btn-text {
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

@keyframes btn-rotate {
    0% { --btn-angle: 0deg; }
    100% { --btn-angle: 360deg; }
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ── Typography & Tags ────────────────────── */
/* Removed .eyebrow */

/* ── Tech Animation: Text Reveal ──────────── */
.gradient-text {
    background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Hero ──────────────────────────────────── */
.hero {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 100px 0 80px; /* Adjusted padding to accommodate the icon */
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Hero App Icon Styling ── */
.hero-icon-wrapper {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 0 auto 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(20px);
}

.hero-app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Approximation of Apple's squircle */
    border-radius: 28.5px; 
    box-shadow: 
        0 20px 40px -10px rgba(0,0,0,0.8),
        0 0 0 1px rgba(255,255,255,0.1) inset, /* Inner glass border */
        0 2px 20px rgba(255,255,255,0.15); /* Soft outer glow */
    /* Subtle 3D lift */
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.hero-app-icon:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 30px 50px -15px rgba(0,0,0,1),
        0 0 0 1px rgba(255,255,255,0.12) inset,
        0 4px 30px rgba(255,255,255,0.25);
}

.hero h1 {
    margin: 0 0 24px 0;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 700;
    white-space: nowrap;
}

.hero-summary {
    max-width: 540px;
    margin: 0 auto 48px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-meta {
    margin-top: 32px;
    font-size: 0.9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--text-muted);
}

/* ── Advanced Tech Animation: 3D Perspective Hero Visual ── */
.hero-visual {
    position: relative;
    perspective: 2000px; /* Enable 3D space */
    padding: 0 40px 100px; /* Increased bottom padding */
    display: flex;
    justify-content: center;
    z-index: 1;
}

.hero-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.hero-screenshot-wrapper {
    position: relative;
    max-width: 960px;
    width: 100%;
    /* 3D Transform to look like it's laying slightly flat, then rotates up */
    transform: rotateX(15deg) translateY(20px) scale(0.95);
    transform-style: preserve-3d;
    box-shadow: 
        0 40px 100px -20px rgba(0,0,0,1),
        0 20px 40px -10px rgba(255,255,255,0.05); /* Soft ambient reflection under */
    border-radius: var(--radius-xl);
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Reveal state: when it scrolls into view, it levels out */
.hero-screenshot-wrapper.reveal-3d-active {
    transform: rotateX(0deg) translateY(0) scale(1);
}

.hero-screenshot {
    border-radius: inherit;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.15); /* Ultra-thin Apple-style border */
    background: rgba(20,20,20,0.8);
    backdrop-filter: blur(20px);
}

/* Glass edge highlight */
.hero-screenshot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.3);
    pointer-events: none;
}

/* ── Feature Pills Strip (Ultra Minimal) ── */
.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 60px 0 100px;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text);
}

.feature h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ── Feature Showcase (Apple Style) ───────── */
.feature-showcase {
    display: grid;
    gap: 160px;
    padding: 40px 0 100px;
}

.showcase-item {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: center;
}

.showcase-item.reverse {
    grid-template-columns: 1.2fr 1fr;
}

.showcase-copy {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.showcase-copy h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.showcase-copy p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.6;
}

.showcase-visual {
    position: relative;
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 2px; /* Small padding creates a nested bezel effect */
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.showcase-visual img {
    border-radius: calc(var(--radius-xl) - 3px);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Inner glow ring for high-end tech feel */
.showcase-visual::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* ── Custom Glowing Border Animation ── */
/* ── Custom Glowing Border Animation ── */
/* A subtle moving metallic sheen sweeping the border of a showcase component */
@property --glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.glow-edge {
    position: relative;
    /* Do not use overflow hidden to let the border effect apply cleanly */
}

.glow-edge::after {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--glow-angle) at 50% 50%, transparent 50%, rgba(255,255,255,0.05) 75%, rgba(255,255,255,0.8) 95%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    animation: rotate-glow 6s linear infinite;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.glow-edge:hover::after {
    opacity: 1;
}

@keyframes rotate-glow {
    0% { --glow-angle: 0deg; }
    100% { --glow-angle: 360deg; }
}

/* ── Command Grid Marquee Simulation (Massive) ── */
.command-grid-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    background: rgba(4, 4, 4, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 30px 0; /* Removing horizontal padding for flush scrolling */
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    overflow: hidden; /* Hide overflow for the scrolling marquee */
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Linear gradient fade out effect on left and right edges */
.command-grid-wrapper::before,
.command-grid-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}
.command-grid-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(4,4,4,1) 0%, transparent 100%);
}
.command-grid-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(4,4,4,1) 0%, transparent 100%);
}

.marquee-track {
    display: flex;
    width: fit-content;
}

.marquee-content {
    display: flex;
    gap: 16px;
    padding-right: 16px; /* Offset gap for seamless loop */
    width: fit-content;
    will-change: transform;
}

.track-left .marquee-content {
    animation: scroll-left 15s linear infinite;
}

.track-right .marquee-content {
    animation: scroll-right 12s linear infinite;
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); } /* Scrolls precisely half its length since we duped the items */
}

@keyframes scroll-right {
    from { transform: translateX(-50%); } /* Scrolls the other way */
    to { transform: translateX(0); }
}

.cmd-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px; /* Unified fixed size */
    height: 90px; /* Unified fixed size */
    gap: 12px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: default;
    position: relative;
    flex-shrink: 0; /* Essential for flex horizontal scrolling */
}

.cmd-cell svg {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.cmd-cell span {
    font-size: 0.8rem; /* Scaled down slightly */
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
    text-align: center;
    line-height: 1;
    white-space: nowrap; /* Prevent line breaks */
    overflow: hidden;    /* In case long text spills */
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 4px;
}

.cmd-cell:hover, .cmd-cell.active {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.cmd-cell:hover svg, .cmd-cell.active svg,
.cmd-cell:hover span, .cmd-cell.active span {
    color: var(--text);
}

/* Specific pulse for icons within animation */
@keyframes cell-pulse {
    0%, 100% { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.03); transform: translateY(0); box-shadow: none; }
    50% { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
}

@keyframes cell-pulse-content {
    0%, 100% { color: var(--text-muted); }
    50% { color: var(--text); }
}

.marquee-track:hover .marquee-content {
    animation-play-state: paused; /* Pause scrolling on hover for readability */
}

/* ── Download ─────────────── */
.download {
    padding: 60px 0;
}

.download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 40px;
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.download-copy {
    max-width: 500px;
    margin-bottom: 40px;
}

.download-copy h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 16px 0;
}

.spec-list {
    list-style: none;
    display: flex;
    gap: 32px;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 40px;
}

.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-link {
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 200ms ease, color 200ms ease;
}

.footer-link:hover {
    opacity: 1;
    color: var(--text);
}

/* ── Animation Classes ── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }

/* Slow levitation for images */
@keyframes levitate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.levitate { animation: levitate 8s ease-in-out infinite; }

/* ── Responsive ── */
@media (max-width: 980px) {
    .showcase-item,
    .showcase-item.reverse {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
    }
    .showcase-item.reverse .showcase-copy {
        order: -1; /* Keep text above image on mobile */
    }
}

@media (max-width: 760px) {
    .hero { padding: 100px 0 40px; }
    .hero h1 { font-size: 2.5rem; }
    .feature-strip { grid-template-columns: 1fr; gap: 40px; }
    .hero-visual { padding: 0 20px 40px; }
    .spec-list { flex-direction: column; gap: 16px; }
    .statement { padding: 80px 20px; }
}
