/* Theme Variables */
:root {
    --primary: #00f0ff;
    --primary-fixed-dim: #00dbe9;
    --on-primary: #00363a;
    --primary-container: rgba(0, 240, 255, 0.1);
    
    --background: #050608;
    --surface: #111318;
    --surface-container: #1e2024;
    --surface-container-high: #282a2e;
    --surface-container-highest: #333539;
    --surface-container-lowest: #0c0e12;
    
    --on-surface: #e2e2e8;
    --on-surface-variant: #b9cacb;
    --outline: #849495;
    --outline-variant: #3b494b;
    
    --error: #ffb4ab;
    --secondary: #ffb59a;
    
    --font-headline: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--background);
    color: var(--on-surface);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

.grid-bg {
    background-image: radial-gradient(circle at 2px 2px, rgba(219, 252, 255, 0.05) 1px, transparent 0);
    background-size: 40px 40px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-headline);
    color: #fff;
    line-height: 1.1;
}

.glow-text {
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 60px 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 100px 0;
    }
}

/* Components */
.glass-panel {
    background: rgba(26, 28, 32, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(219, 252, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-panel:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(0, 240, 255, 0.1);
}

.store-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.store-badge-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.store-badge-button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.store-badge-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.store-badge-button img {
    display: block;
    width: auto;
    height: 48px;
    object-fit: contain;
}

.store-badge-button img.google-play-badge {
    height: 70px;
}

/* Header */
header {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(17, 19, 24, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    z-index: 1000;
}

nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-headline);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-headline);
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .nav-center {
        display: none;
    }
    nav {
        display: flex;
        justify-content: space-between;
    }
}

.nav-right {
    display: flex;
    justify-content: flex-end;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

@media (min-width: 768px) {
    .hero {
        grid-template-columns: 1fr 1fr;
        gap: 80px;
    }
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .hero-content h1 {
        font-size: 64px;
    }
}

.hero-content p {
    font-size: 18px;
    color: var(--on-surface-variant);
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-visual::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary);
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
}

.hero-visual img {
    width: 100%;
    max-width: 450px;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.5));
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 240, 255, 0.1);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* Terminal Section */
.terminal-container {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 16px;
    overflow: hidden;
}

.terminal-header {
    background: var(--surface-container-high);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--outline-variant);
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: var(--error); opacity: 0.5; }
.dot-yellow { background: var(--secondary); opacity: 0.5; }
.dot-green { background: var(--primary); opacity: 0.5; }

.terminal-tabs {
    display: flex;
    border-bottom: 1px solid var(--outline-variant);
}

.tab-btn {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--on-surface-variant);
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(0, 240, 255, 0.05);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
    padding: 32px;
}

.tab-content.active {
    display: block;
}

/* Terminal Content Styles */
.history-item, .news-item {
    border-left: 2px solid var(--outline-variant);
    padding-left: 20px;
    margin-bottom: 24px;
}

.history-item:last-child, .news-item:last-child {
    margin-bottom: 0;
}

.history-item.current {
    border-left-color: var(--primary);
}

.item-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--primary-fixed-dim);
    margin-bottom: 4px;
}

.item-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.ios-download-panel {
    align-items: center;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.14);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 18px 20px;
}

.icon-link-button,
.release-download-button {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 8px;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    min-width: 36px;
    padding: 0 8px;
    transition: var(--transition);
}

.icon-link-button:hover,
.release-download-button:hover {
    background: rgba(0, 240, 255, 0.1);
}

.release-history-item {
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    text-align: left;
    width: 100%;
}

.release-history-main {
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
    text-align: left;
}

.release-history-item:hover .item-title {
    color: var(--primary);
}

.release-history-text {
    display: block;
}

.release-history-text .item-meta,
.release-history-text .item-title {
    display: block;
}

.release-download-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.release-empty {
    color: var(--on-surface-variant);
}

/* Animations */
.ping-slow {
    animation: ping 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}

.terminal-cursor::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--primary);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--on-surface-variant);
    cursor: pointer;
    font-size: 24px;
}

/* Footer */
footer {
    background: var(--surface-container-lowest);
    border-top: 1px solid var(--outline-variant);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.footer-logo-area p {
    margin-top: 12px;
    font-size: 14px;
    color: var(--on-surface-variant);
}

.footer-links h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: #fff;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--on-surface-variant);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

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

.footer-link-button {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--on-surface-variant);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    padding: 0;
    text-align: left;
    transition: var(--transition);
}

.footer-link-button:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    font-size: 12px;
    color: var(--on-surface-variant);
    opacity: 0.5;
}

.icon-button {
    align-items: center;
    background: transparent;
    border: none;
    color: var(--on-surface-variant);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    padding: 0;
    transition: var(--transition);
}

.icon-button:hover {
    color: var(--primary);
}

.legal-page {
    min-height: calc(100vh - 216px);
    padding: 72px 0 96px;
}

.legal-page-container {
    max-width: 920px;
}

.legal-page-eyebrow {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.legal-page h1 {
    font-size: clamp(34px, 5vw, 52px);
    margin-bottom: 32px;
}

.legal-document {
    background: rgba(26, 28, 32, 0.72);
    border: 1px solid rgba(219, 252, 255, 0.12);
    border-radius: 8px;
    padding: 32px;
}

.legal-document pre {
    color: var(--on-surface-variant);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.release-detail-modal,
.desktop-modal-content {
    max-width: 640px;
    text-align: left;
}

.release-detail-modal h2,
.desktop-modal-content h2,
.message-modal-content h2 {
    margin-bottom: 12px;
}

.release-detail-modal h3 {
    color: #fff;
    font-size: 20px;
    margin: 12px 0 18px;
}

.release-notes {
    color: var(--on-surface-variant);
    margin: 0 0 28px 20px;
}

.release-notes li {
    margin-bottom: 10px;
}

.release-detail-actions,
.desktop-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.desktop-options {
    flex-direction: column;
}

.desktop-option-button {
    justify-content: center;
}

.message-modal-content {
    max-width: 420px;
}

.message-modal-content p {
    color: var(--on-surface-variant);
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .store-badge-row {
        gap: 10px;
    }

    .store-badge-button {
        min-height: 48px;
    }

    .store-badge-button img {
        height: 44px;
    }

    .store-badge-button img.google-play-badge {
        height: 64px;
    }

    .legal-page {
        padding: 48px 0 64px;
    }

    .legal-document {
        padding: 22px;
    }

    .legal-document pre {
        font-size: 14px;
    }

    .release-history-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .release-download-actions,
    .release-detail-actions {
        width: 100%;
    }
}
