:root {
    /* Color Palette - Refined & Professional */
    --bg-page: #f8fafc; /* Softer slate gray */
    --bg-surface: #ffffff;
    --text-primary: #0f172a; /* Deep slate */
    --text-secondary: #475569; /* Medium slate */
    --text-tertiary: #94a3b8;
    --brand-color: #000000;
    --brand-hover: #1e293b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --border-light: #e2e8f0;
    --border-premium: rgba(226, 232, 240, 0.8);
    
    /* Metrics */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 40px;
    --max-width: 1100px;
    
    /* Layered Shadows (Industry Standard) */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px var(--border-light), 0 2px 4px -2px var(--border-light);
    --shadow-premium: 
        0 0 0 1px rgba(0,0,0,0.03),
        0 2px 4px rgba(0,0,0,0.05),
        0 12px 24px rgba(0,0,0,0.05);
    --shadow-float: 
        0 0 0 1px rgba(0,0,0,0.03),
        0 20px 40px -12px rgba(0,0,0,0.1);
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    background-image: radial-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 32px 32px; /* Very subtle technical grid */
}

/* Navigation - Floating Pill Style */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 32px auto;
    padding: 10px 32px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-premium);
    border-radius: 999px;
    width: calc(100% - 40px);
    position: sticky;
    top: 24px;
    z-index: 1000;
    box-shadow: var(--shadow-premium);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

header:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--text-tertiary);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-history-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-history-toggle:hover {
    background: #E5E7EB;
    color: var(--text-primary);
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    box-sizing: border-box;
}

.logo-icon img {
    width: 96%;
    height: 96%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.nav-links {
    display: flex;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 999px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.nav-links a.active {
    background: var(--text-primary);
    color: white !important;
}

/* Remove unused elements */
.btn-github, .bg-mesh { display: none; }

/* Main Content */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
@media (max-width: 480px) {
    header .logo span {
        display: none; /* Hide header brand text, keep the icon */
    }

    header .logo-icon {
        width: 38px;
        height: 38px;
        padding: 5px;
    }
}
/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 40px;
    max-width: 720px;
    position: relative;
}

.hero::before {
    /* Subtle glow behind hero */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    z-index: -1;
    animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.badge {
    display: inline-flex;
    align-items: center;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

h1 {
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.05em;
    margin-bottom: 28px;
    background: linear-gradient(180deg, var(--text-primary) 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
}

/* Intro Highlight Segment */
.intro-segment {
    text-align: center;
    max-width: 680px;
    margin: -20px auto 30px;
    padding: 0 20px;
}

.intro-segment p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 500;
    opacity: 0.85;
}

/* App Container - The Modern Card */
.app-container {
    width: 100%;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.has-result .upload-grid {
    grid-template-columns: 450px 1fr;
}

/* Cards Shared Styles */
.upload-card, .result-card, .translation-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Upload Card Specifics - Midnight Navy Overhaul */
.upload-card {
    height: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default; /* Not the whole card anymore, just the content */
    background-color: #0F172A;
    background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

.upload-card:hover { border-color: rgba(255,255,255,0.1); }

/* Mode Switching Styles */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    background: #E5E7EB;
    padding: 6px;
    border-radius: 16px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab svg {
    opacity: 0.6;
}

.mode-tab.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.mode-tab.active svg {
    opacity: 1;
}

.mode-view {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mode-view.active {
    display: flex;
}

/* Text mode specific */
.text-input-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.text-mode-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    background: #F9FAFB;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #F3F4F6;
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

.text-input-container textarea {
    flex: 1;
    width: 100%;
    padding: 24px;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 1.2rem;
    line-height: 1.6;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    transition: background-color 0.3s;
}

.text-input-container textarea:focus {
    background-color: rgba(59, 130, 246, 0.01);
}

.text-mode-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: #F9FAFB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px; /* Space between stats and actions */
    flex-wrap: wrap; /* Allow wrapping on very small screens, but we handled children wrapping */
}

.text-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    white-space: nowrap; /* Prevent character count from wrapping */
}

.dot-separator {
    opacity: 0.5;
}

.sample-chips {
    display: flex;
    gap: 8px;
}

.chip {
    padding: 4px 10px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.text-mode-actions .btn-primary {
    padding: 10px 24px;
    width: auto;
    display: flex;
    align-items: center;
    white-space: nowrap; /* Prevent 'Process Text' from wrapping */
}

.upload-card.dragover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.02);
}

.upload-content {
    background: #FFFFFF;
    padding: 60px 48px;
    border-radius: var(--radius-xl); /* 40px */
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    text-align: center;
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-content:hover {
    transform: scale(1.02);
}

.upload-icon-wrapper {
    font-size: 2.2rem;
    background: #F8FAFC;
    width: 72px;
    height: 72px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.upload-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* Primary Button - High Contrast Black Pill */
.btn-primary {
    background: #000000;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1rem;
    padding: 16px 36px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px var(--accent-glow);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* File Preview */
input[type="file"] { display: none; }

/* Preview & Scanner Animation */
.preview-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.upload-preview {
    display: none;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.scan-line {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    box-shadow: 0 0 15px var(--accent), 0 0 5px var(--accent);
    z-index: 10;
    animation: scanMove 2s linear infinite;
}

@keyframes scanMove {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.upload-card.is-scanning .scan-line {
    display: block;
}

.upload-card.is-scanning .upload-preview {
    filter: brightness(0.7) contrast(1.2);
    transition: filter 0.3s;
}

.upload-card.has-file .upload-preview { display: block; }
.upload-card.has-file .upload-content { display: none; }
.upload-card.has-file {
    padding: 0;
    background: var(--bg-surface);
    cursor: default;
}

/* Change Button Overlay — only after a file is selected (avoid flash on empty-card hover) */
.change-img-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0,0,0,0.7);
    color: white;
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.upload-card.has-file .change-img-btn {
    visibility: visible;
    pointer-events: auto;
}

.upload-card.has-file:hover .change-img-btn,
.upload-card.has-file:focus-within .change-img-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Touch / no-hover: show Change Image once a file exists (hover overlay is unavailable) */
@media (hover: none) {
    .upload-card.has-file .change-img-btn {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Results Panel */
.results-panel {
    display: none;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.app-container.has-result .results-panel { display: flex; }

.result-card, .translation-card {
    height: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: #ffffff;
}

.card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

.card-actions { display: flex; gap: 8px; }

.icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    background: white;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.icon-btn.speaking {
    color: var(--danger);
    border-color: #FEE2E2;
    background: #FEF2F2;
    animation: speakPulse 1.5s infinite;
}

@keyframes speakPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.result-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    font-size: 1rem;
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-primary);
}

.translation-controls {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    background: white;
}

.lang-select {
    flex: 1;
    padding: 0 12px;
    height: 40px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.lang-select:focus {
    border-color: var(--text-primary);
}

/* Spinner */
.progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.progress-overlay.active { opacity: 1; pointer-events: all; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: var(--brand-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.progress-text {
    font-weight: 600;
    font-size: 0.95rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Brand Section */
.brand-section {
    margin: 40px 0;
    text-align: center;
    width: 100%;
}

.brand-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.brand-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    opacity: 0.6;
}

.brand-item {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s;
}

.brand-item:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: translateY(-2px);
}

/* Feature Bento Grid */
.features-section {
    width: 100%;
    margin-top: 60px;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.feature-grid-bento {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 400px 300px;
    gap: 24px;
}

.bento-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.bento-content {
    padding: 32px;
    z-index: 2;
}

.bento-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.bento-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Specific Card Layouts */
.bento-card.large {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    justify-content: space-between;
}

.bento-card.tall {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.bento-card.wide {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
}

.bento-card.wide h3, .bento-card.wide p {
    color: white;
}

.bento-card.wide p {
    opacity: 0.8;
}

/* Visual Assets in Bento - Detailed Mockups */
.bento-visual {
    flex: 1;
    background: #F9FAFB;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mock Browser Visual */
.visual-ocr {
    background-image: radial-gradient(#E5E7EB 1px, transparent 1px);
    background-size: 20px 20px;
}

.mock-browser {
    width: 240px;
    height: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-float);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mock-header {
    height: 32px;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
}

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

.dot.red { background: #EF4444; }
.dot.yellow { background: #F59E0B; }
.dot.green { background: #10B981; }

.mock-body {
    padding: 16px;
    position: relative;
    flex: 1;
}

.text-line {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    margin-bottom: 8px;
}

.w-80 { width: 80%; }
.w-60 { width: 60%; }
.w-90 { width: 90%; }
.w-40 { width: 40%; }

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent); /* Electric Blue */
    box-shadow: 0 0 10px var(--accent);
    animation: scan 3s ease-in-out infinite;
    z-index: 10;
}

@keyframes scan {
    0%, 100% { top: 0; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Language Stack Visual */
.visual-lang-stack {
    position: relative;
    flex-direction: column;
    padding: 20px;
}

.lang-card {
    background: white;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.9rem;
    position: absolute;
    animation: floatStack 6s infinite ease-in-out;
    opacity: 0;
}

.lang-card:nth-child(1) { animation-delay: 0s; top: 30%; left: 20%; transform: rotate(-5deg); z-index: 1; }
.lang-card:nth-child(2) { animation-delay: 1.2s; top: 40%; right: 20%; transform: rotate(5deg); z-index: 2; }
.lang-card:nth-child(3) { animation-delay: 2.4s; top: 20%; left: 40%; transform: rotate(2deg); z-index: 3; }
.lang-card:nth-child(4) { animation-delay: 3.6s; top: 50%; left: 30%; transform: rotate(-3deg); z-index: 4; }
.lang-card:nth-child(5) { animation-delay: 4.8s; top: 35%; right: 30%; transform: rotate(4deg); z-index: 5; }

@keyframes floatStack {
    0% { opacity: 0; transform: translateY(20px) scale(0.9); }
    20% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

/* Privacy Visual - Process Flow */
.visual-privacy {
    background: #F9FAFB;
    border-left: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
}

.process-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}

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

.step-icon {
    width: 56px;
    height: 56px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    transition: all 0.3s;
}

.step-icon.delete-icon {
    color: var(--danger);
    background: #FEF2F2;
    border-color: #FEE2E2;
}

.flow-step span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.flow-arrow {
    flex: 1;
    height: 2px;
    background: #E5E7EB;
    margin: 0 16px;
    position: relative;
    top: -14px; /* Align with icon center */
}

.flow-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(2px);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid #E5E7EB;
}

/* Specific styling for the Privacy Card text layout */
/* Specific styling for the Privacy Card text layout */
.privacy-card {
    flex-direction: column !important; /* Force vertical stack */
    align-items: stretch;
    background: #111827;
}

.privacy-card .bento-content {
    flex: 0 0 auto;
    padding: 32px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.privacy-card .bento-content h3 {
    margin-bottom: 8px;
    color: white;
}

.privacy-card .bento-content p {
    color: #9CA3AF;
    font-size: 0.95rem;
}

.privacy-card .bento-visual {
    flex: 1;
    background: #F9FAFB;
    width: 100%;
    padding: 20px; /* Reduced padding for fit */
}

/* Ensure flow fits horizontally in the card */
.process-flow {
    gap: 8px;
    justify-content: center;
}

.step-icon {
    width: 48px; /* Slightly smaller icons */
    height: 48px;
}

.flow-step span {
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .privacy-card { height: auto !important; }
    .process-flow { padding: 20px 0; }
}

/* Use Cases Showcase (Mobbin Style) */
.showcase-section {
    margin-top: 60px;
    width: 100%;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 cards row like Mobbin apps */
    gap: 32px;
}

.showcase-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.showcase-card:hover {
    transform: translateY(-4px);
}

.card-visual {
    height: 280px; /* Tall aspect ratio like mobile screens */
    background: #F3F4F6;
    border-radius: 16px;
    border: 1px solid var(--border-light); /* Subtle border */
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.showcase-card:hover .card-visual {
    box-shadow: var(--shadow-float);
    border-color: var(--accent);
}

/* Visual mocks inside cards */
.visual-book { background: #e0e7ff; }
.floating-extract {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    width: 70%;
}
.extract-line { display: block; font-weight: 600; font-size: 0.8rem; margin-bottom: 4px; }
.dim { color: var(--text-tertiary); }

.visual-sign { background: #fae8ff; }
.sign-board {
    background: #111827;
    color: white;
    padding: 16px 24px;
    border-radius: 4px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}
.jp-text { display: block; font-size: 1.5rem; margin-bottom: 4px; }
.en-text { font-size: 0.8rem; color: #10B981; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.visual-notes { background: #fff7ed; }
.note-paper {
    background: #fff;
    width: 70%;
    height: 70%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 16px;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}
.handwriting { font-size: 0.8rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px; margin-bottom: 8px; }

.visual-receipt { background: #f0fdf4; }
.receipt-paper {
    background: white;
    width: 60%;
    padding: 16px;
    font-family: monospace;
    font-size: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-top: 4px solid var(--accent); /* Receipt strip */
}
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-secondary); }
.receipt-total { display: flex; justify-content: space-between; margin-top: 8px; font-weight: 700; border-top: 1px dashed #e5e7eb; padding-top: 8px; }

/* Metadata below card */
.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-icon {
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.meta-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.meta-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

@media (max-width: 1000px) {
    .showcase-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .showcase-grid { grid-template-columns: 1fr; }
}

/* Testimonials */
.testimonials-section {
    margin-top: 60px;
    width: 100%;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.testimonial-card {
    background: var(--bg-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-premium);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.user-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.user-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.testimonial-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* How to Use Section (Dark Mode Premium) */
.how-to-section {
    background: #0F172A; /* Deep Navy Slate from screenshot */
    margin: 60px 0;
    padding: 60px 40px;
    border-radius: var(--radius-xl);
    width: 100%;
}

.section-header.white h2 {
    color: white;
}

.section-header.white p {
    color: rgba(255,255,255,0.7);
}

.how-to-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 60px;
}

.how-to-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.how-to-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.how-to-visual {
    height: 380px;
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%); /* Light blue wash */
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mock-ui-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Step 1 Mockup: Upload */
.mock-upload-box {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 240px;
    position: relative;
}

.mock-upload-icon-circle {
    width: 48px;
    height: 48px;
    background: #F8FAFC;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
}

.mock-label {
    font-size: 0.85rem;
    color: #94A3B8;
}

.mock-btn-action {
    background: #3B82F6;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mock-cursor, .mock-cursor-2 {
    position: absolute;
    font-size: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    animation: mock-click 2s infinite ease-in-out;
}

.mock-cursor { bottom: -20px; right: 20px; }
.mock-cursor-2 { bottom: -10px; right: 40px; }

@keyframes mock-click {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9); }
}

/* Step 2 Mockup: Translation */
.mock-translate-box {
    background: white;
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.mock-lang-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mock-select-box {
    flex: 1;
    height: 36px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 0 12px;
    display: flex;
    align-items: center;
    color: #64748B;
}

.mock-select-box.active {
    border-color: #3B82F6;
    color: #3B82F6;
}

.mock-lang-arrow {
    color: #94A3B8;
    font-weight: 800;
}

.mock-btn-translate {
    background: #3B82F6;
    color: white;
    text-transform: lowercase;
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto;
    font-weight: 600;
}

/* Step 3 Mockup: Result */
.mock-result-showcase {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 240px;
}

.mock-actions-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.m-icon {
    font-size: 1.2rem;
    padding: 6px;
    background: #EFF6FF;
    border-radius: 6px;
    color: #3B82F6;
}

.mock-result-img {
    height: 160px;
    background: linear-gradient(to bottom, #BFDBFE, #DBEAFE);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.m-mountain {
    position: absolute;
    bottom: -10px;
    left: -20px;
    width: 120%;
    height: 60%;
    background: #93C5FD;
    clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
}

.m-sun {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 24px;
    height: 24px;
    background: #FBBF24;
    border-radius: 50%;
}

.how-to-content {
    padding: 32px;
}

.how-to-content h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.how-to-content p {
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* FAQ Section - Enhanced Interactivity */
.faq-section {
    margin: 60px auto 40px;
    width: 100%;
    max-width: var(--max-width);
    padding: 0 20px;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex !important;
    flex-direction: column;
    gap: 16px;
}

.faq-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: block !important;
}

.faq-row.active {
    border-color: var(--accent);
    box-shadow: var(--shadow-premium);
}

.faq-question {
    width: 100%;
    padding: 24px;
    background: transparent !important;
    border: none !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
}

.faq-icon-wrapper {
    color: var(--text-tertiary);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-row.active .faq-icon-wrapper {
    transform: rotate(45deg);
    color: var(--accent);
}

.faq-answer {
    display: grid !important;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    visibility: hidden;
}

.faq-row.active .faq-answer {
    grid-template-rows: 1fr;
    visibility: visible;
}

.faq-answer-inner {
    overflow: hidden;
    padding: 0 24px 24px;
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 0; /* Essential for grid-template-rows 0fr */
}

/* Site Footer */
.site-footer {
    background: transparent;
    padding: 20px 20px 24px;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(320px, 1.4fr) minmax(180px, 0.6fr);
    gap: 48px;
    padding: 44px 40px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 24px 24px 0 0;
    box-shadow: var(--shadow-card);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin: 16px 0 22px;
    max-width: 360px;
    line-height: 1.65;
}

.footer-contact {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.footer-contact:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    text-decoration: none;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    transition: all 0.2s;
}

.social-links a:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.footer-links-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.footer-links-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.96rem;
    margin-bottom: 12px;
    transition: color 0.2s;
}

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

.footer-bottom {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 40px 0;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.72);
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: 0 0 24px 24px;
}

.legal-links {
    display: flex;
    gap: 32px;
}

.legal-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: var(--text-secondary);
}

/* History Drawer (Phase 2) */
.history-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.history-drawer.open {
    right: 0;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.close-drawer {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.drawer-search {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}

.drawer-search input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.drawer-footer {
    padding: 20px;
    border-top: 1px solid var(--border-light);
}

.btn-text-danger {
    width: 100%;
    padding: 12px;
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FEE2E2;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-text-danger:hover {
    background: var(--danger);
    color: white;
}

/* History Item Pro Style */
.mode-indicator {
    margin-right: 8px;
    font-size: 1.1rem;
    vertical-align: middle;
}

.source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    margin-left: 10px;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.source-badge.text-mode {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.source-badge.photo-mode {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.history-item-pro {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item-pro:hover {
    background: #F9FAFB;
    border-color: var(--border-light);
}

.item-content-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.delete-history-item {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item-pro:hover .delete-history-item {
    opacity: 1;
}

.delete-history-item:hover {
    background: #FEF2F2;
    color: var(--danger);
}

.history-item-pro .item-text {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.history-item-pro .item-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 900px) {
    header {
        margin: 16px auto;
        padding: 8px 16px;
        top: 12px;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .feature-grid-bento {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .bento-card.large, .bento-card.tall, .bento-card.wide {
        grid-column: 1 / -1;
        grid-row: auto;
        min-height: 350px;
    }

    .testimonial-grid, .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-brand { align-items: center; display: flex; flex-direction: column; }
    .social-links { justify-content: center; }
    .site-footer { padding: 28px 14px 20px; }
    .footer-content { padding: 32px 22px; }
    .footer-bottom {
        flex-direction: column-reverse;
        align-items: center;
        gap: 24px;
        padding: 18px 22px 0;
    }

    .app-container.has-result .upload-grid { 
        grid-template-columns: 1fr; 
    }
    
    .upload-card { height: 450px; }
}

@media (max-width: 480px) {
    header {
        margin: 12px auto;
        padding: 8px 12px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .footer-content {
        padding: 28px 16px;
    }

    .footer-bottom {
        padding: 16px 16px 0;
    }

    .legal-links {
        gap: 18px;
    }
}

/* About Page Specific Styles */
.about-page main {
    padding-top: 100px;
}

.about-hero {
    margin-bottom: 20px !important;
}

.about-content {
    width: 100%;
    max-width: var(--max-width);
    padding: 0 20px 100px;
    margin: 0 auto;
}

.about-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 60px;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
    text-align: justify;
    text-justify: inter-word;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-card strong {
    color: var(--text-primary);
    font-weight: 700;
}

@media (max-width: 768px) {
    .about-page main {
        padding-top: 80px;
    }
    
    .about-card {
        padding: 40px 24px;
    }
    
    .about-card p {
        font-size: 1.05rem;
    }
}
