/* Fonts */
@font-face {
    font-family: 'OffBit';
    src: url('OffBit-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro';
    src: url('SF-Pro.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables */
:root {
    --bg-color: #000000;
    --card-bg: #171717;
    --card-border: #1E1E1E;
    --accent-primary: #7174FF;
    --accent-secondary: #3F42D0;
    --white: #FFFFFF;
    --white-50: rgba(255, 255, 255, 0.5);
    --gray: #8F8F8F;
    --dark-gray: #202020;
    --border-gray: #484848;
    --side-padding: 16px;
    --button-radius: 32px;
    --card-radius: 32px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    overflow: hidden;
}


body {
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 300;
    background-color: var(--bg-color);
    color: var(--white);
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    -webkit-overflow-scrolling: none;
    touch-action: manipulation;
    overscroll-behavior: none;
}

/* Canvas ASCII Background */
.ascii-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Gradient overlay for smooth fade at top of plus signs */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0.8) 70%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Main Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 402px;
    margin: 0 auto;
    padding: 0 var(--side-padding);
    padding-top: env(safe-area-inset-top);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.container::-webkit-scrollbar {
    display: none;
}

/* Hero Section */
.hero {
    padding-top: 80px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

/* 4 symbols around hero text */
.hero-symbols {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.hero-symbol {
    position: absolute;
    font-family: 'OffBit', monospace;
    font-size: 20px;
    color: var(--gray);
    opacity: 0.4;
}

.hero-text {
    font-family: 'OffBit', monospace;
    font-size: 30px;
    font-weight: normal;
    line-height: 150%;
    letter-spacing: 0;
    text-align: center;
}

.hero-text .line {
    display: block;
}

.hero-text .emoji {
    color: var(--accent-primary);
}

/* Character Placeholder */
.character-section {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12px;
    position: relative;
    z-index: 2;
}

.character-placeholder {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-gray);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

/* Bottom Card Container */
.bottom-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Spacer for in-app browsers (Telegram, etc.) */
.bottom-spacer {
    height: 40px;
    flex-shrink: 0;
}

/* Navigation Tabs */
.tabs-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.tardi-icon {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
}

.tardi-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tabs-spacer {
    flex: 1;
}

.tab {
    display: inline-block;
    padding: 8px 14px;
    background-color: var(--dark-gray);
    color: var(--white-50);
    text-decoration: none;
    font-size: 13px;
    font-weight: 300;
    border-radius: var(--button-radius);
    transition: all 0.2s ease;
}

.tab:hover {
    background-color: var(--border-gray);
    color: var(--white);
}

/* Description */
.description {
    margin-bottom: 20px;
}

.description p {
    font-size: 20px;
    line-height: 30px;
    font-weight: 300;
    color: var(--white);
}

.tardi-highlight {
    color: var(--accent-primary);
    font-weight: 500;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--button-radius);
    font-family: 'SF Pro', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    flex: 1;
    height: 52px;
}

.btn-primary {
    background-color: var(--accent-secondary);
    color: var(--white);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--white-50);
    border: 1px solid var(--border-gray);
}

.btn-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-secondary:not(:disabled):hover {
    border-color: var(--white-50);
    color: var(--white);
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.btn-small {
    font-size: 10px;
    font-weight: 300;
    opacity: 0.7;
}

.btn-large {
    font-size: 14px;
    font-weight: 500;
}

.apple-icon,
.email-icon {
    flex-shrink: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    transform: translateY(30px) scale(0.95);
    filter: blur(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
    filter: blur(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--white-50);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--white);
}

.modal-title {
    font-family: 'OffBit', monospace;
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--white);
}

.modal-text {
    color: var(--white-50);
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 300;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-input {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--button-radius);
    border: 1px solid var(--border-gray);
    background-color: var(--dark-gray);
    color: var(--white);
    font-size: 16px;
    font-weight: 300;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.modal-input::placeholder {
    color: var(--white-50);
}

.modal-input:focus {
    border-color: var(--accent-primary);
}

.btn-full {
    width: 100%;
    flex: none;
}

/* Desktop Responsive */
/* Desktop - keep same size as mobile, no scaling */
@media (min-width: 768px) {
    .container {
        max-width: 402px;
    }
}

/* ============================================ */
/* ENTRANCE ANIMATIONS */
/* ============================================ */

@keyframes fadeBlurIn {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes scaleBlurIn {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

@keyframes slideBlurUp {
    0% {
        opacity: 0;
        filter: blur(12px);
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Initial hidden state */
.animate-init {
    opacity: 0;
}

/* Canvas and gradient */
.ascii-canvas {
    animation: fadeIn 1s ease-out 0.1s forwards;
    opacity: 0;
}

.gradient-overlay {
    animation: fadeIn 0.6s ease-out 0s forwards;
    opacity: 0;
}

/* Hero symbols */
.hero-symbol {
    animation: fadeBlurIn 0.4s ease-out forwards;
    opacity: 0;
}

.hero-symbol:nth-child(1) { animation-delay: 0.5s; }
.hero-symbol:nth-child(2) { animation-delay: 0.6s; }
.hero-symbol:nth-child(3) { animation-delay: 0.7s; }
.hero-symbol:nth-child(4) { animation-delay: 0.8s; }

/* Hero text lines */
.hero-text .line {
    animation: fadeBlurIn 0.5s ease-out forwards;
    opacity: 0;
}

.hero-text .line:nth-child(1) { animation-delay: 0.15s; }
.hero-text .line:nth-child(2) { animation-delay: 0.25s; }
.hero-text .line:nth-child(3) { animation-delay: 0.35s; }
.hero-text .line:nth-child(4) { animation-delay: 0.45s; }

/* Character placeholder */
.character-placeholder {
    animation: scaleBlurIn 0.6s ease-out 0.6s forwards;
    opacity: 0;
}

/* Bottom card - appears early */
.bottom-card {
    animation: fadeIn 0.5s ease-out 0.2s forwards;
    opacity: 0;
}

/* Tabs - staggered after card */
.tabs-nav .tardi-icon {
    animation: fadeBlurIn 0.4s ease-out 0.5s forwards;
    opacity: 0;
}

.tabs-nav .tab:nth-child(3) {
    animation: fadeBlurIn 0.3s ease-out 0.6s forwards;
    opacity: 0;
}
.tabs-nav .tab:nth-child(4) {
    animation: fadeBlurIn 0.3s ease-out 0.7s forwards;
    opacity: 0;
}
.tabs-nav .tab:nth-child(5) {
    animation: fadeBlurIn 0.3s ease-out 0.8s forwards;
    opacity: 0;
}

/* Description */
.description {
    animation: fadeBlurIn 0.4s ease-out 0.9s forwards;
    opacity: 0;
}

/* CTA Buttons */
.cta-buttons .btn:nth-child(1) {
    animation: fadeBlurIn 0.4s ease-out 1.0s forwards;
    opacity: 0;
}

.cta-buttons .btn:nth-child(2) {
    animation: fadeBlurIn 0.4s ease-out 1.1s forwards;
    opacity: 0;
}
