: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: 6px;
    margin-left: auto;
    margin-right: 12px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 14px;
    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;
}

/* Burger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: auto;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 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: 1.1; /* Increased to fix text clipping */
    letter-spacing: -0.05em;
    margin-bottom: 24px;
    padding-bottom: 12px; /* Breathing room for descenders */
    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.25rem;
    line-height: 1.6;
    background: transparent;
    outline: none;
    color: #FFFFFF;
    transition: background-color 0.3s;
}

.text-input-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.text-input-container textarea:focus {
    background-color: rgba(255, 255, 255, 0.02);
}

.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 DESIGN SYSTEM
   Breakpoints: 1024px → 900px → 768px → 600px → 480px → 360px
   ========================================================================== */

/* ---------- Tablet Landscape & Small Desktop (≤ 1024px) ---------- */
@media (max-width: 1024px) {
    .how-to-grid {
        gap: 24px;
    }

    .how-to-visual {
        height: 320px;
        padding: 28px;
    }

    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ---------- Tablet Portrait (≤ 900px) ---------- */
@media (max-width: 900px) {

    /* -- Header & Nav -- */
    header {
        margin: 16px auto;
        padding: 8px 16px;
        top: 12px;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    /* -- Hero -- */
    h1 {
        font-size: 2.8rem;
    }

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

    .intro-segment p {
        font-size: 1rem;
    }

    /* -- Section Headers -- */
    .section-header h2 {
        font-size: 2rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* -- App / Upload Area -- */
    .app-container.has-result .upload-grid {
        grid-template-columns: 1fr;
    }

    .upload-card {
        height: 450px;
    }

    /* -- Bento Feature Grid -- */
    .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: 300px;
    }

    /* -- How-to Section -- */
    .how-to-section {
        padding: 48px 24px;
    }

    .how-to-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .how-to-visual {
        height: 280px;
        padding: 24px;
    }

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

    .how-to-content h3 {
        font-size: 1.15rem;
    }

    .how-to-content p {
        font-size: 0.9rem;
    }

    /* -- Testimonials -- */
    .testimonial-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* -- Footer -- */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        padding: 32px 22px;
    }

    .footer-brand {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .social-links {
        justify-content: center;
    }

    .site-footer {
        padding: 28px 14px 20px;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        align-items: center;
        gap: 16px;
        padding: 18px 22px 0;
    }

    /* -- History Drawer (cap to viewport) -- */
    .history-drawer {
        width: min(400px, 85vw);
        right: calc(-1 * min(400px, 85vw));
    }

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

    /* -- Privacy Card -- */
    .privacy-card {
        height: auto !important;
    }

    .process-flow {
        padding: 20px 0;
    }
}

/* ---------- Small Tablet / Large Phone (≤ 768px) ---------- */
@media (max-width: 768px) {

    /* -- Typography -- */
    h1 {
        font-size: 2.5rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    /* -- Mode Tabs -- */
    .mode-tabs {
        gap: 4px;
        padding: 4px;
    }

    .mode-tab {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* -- Mobile Menu -- */
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 80vw);
        height: 100dvh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        margin: 0;
        padding: 40px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -10px 0 40px rgba(0,0,0,0.1);
        z-index: 1000;
        border-left: 1px solid rgba(0,0,0,0.05);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.4rem;
        width: 100%;
        text-align: center;
        padding: 12px;
    }

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

    /* Burger to X Animation */
    .menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; transform: translateX(-20px); }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* -- Upload Card -- */
    .upload-card {
        height: 400px;
    }

    .upload-content {
        padding: 40px 28px;
        gap: 20px;
        max-width: 360px;
    }

    .upload-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    .upload-title {
        font-size: 1rem;
    }

    .upload-desc {
        font-size: 0.85rem;
    }

    .btn-primary {
        padding: 14px 28px;
        font-size: 0.95rem;
    }

    /* -- Text Mode -- */
    .text-mode-toolbar {
        padding: 12px 16px;
    }

    .text-mode-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        align-items: stretch;
    }

    .text-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .text-mode-actions {
        display: flex;
        justify-content: center;
    }

    .text-mode-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .text-input-container textarea {
        padding: 16px;
        font-size: 1.05rem;
    }

    /* -- Result / Translation Cards -- */
    .card-header {
        padding: 16px 18px;
    }

    .result-content {
        padding: 18px;
        font-size: 0.95rem;
    }

    .translation-controls {
        padding: 12px 18px;
        gap: 10px;
    }

    /* -- Bento Cards -- */
    .bento-card.large,
    .bento-card.tall,
    .bento-card.wide {
        min-height: 280px;
    }

    .bento-content {
        padding: 24px;
    }

    .bento-content h3 {
        font-size: 1.3rem;
    }

    .bento-content p {
        font-size: 0.95rem;
    }

    /* -- Process Flow (Privacy visual) -- */
    .visual-privacy {
        padding: 0 20px;
    }

    .process-flow {
        max-width: 100%;
    }

    .step-icon {
        width: 44px;
        height: 44px;
    }

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

    .flow-arrow {
        margin: 0 8px;
    }

    /* -- Showcase Grid -- */
    .card-visual {
        height: 220px;
    }

    /* -- FAQ -- */
    .faq-section {
        padding: 0 10px;
    }

    .faq-question {
        padding: 20px 16px;
        font-size: 1rem;
    }

    .faq-answer-inner {
        padding: 0 16px 20px;
    }

    /* -- Testimonials -- */
    .testimonial-card {
        padding: 24px;
    }
}

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

    /* -- Body -- */
    body {
        padding: 0 12px;
    }

    /* -- Header -- */
    header {
        margin: 10px auto;
        padding: 8px 12px;
        width: calc(100% - 24px);
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* -- App Container -- */
    main {
        padding: 24px 0 40px;
    }

    /* -- Upload Card -- */
    .upload-card {
        height: 380px;
    }

    .upload-content {
        padding: 32px 20px;
        max-width: 320px;
    }

    /* -- Showcase -- */
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .card-visual {
        height: 240px;
    }

    /* -- How-to Section -- */
    .how-to-section {
        padding: 40px 16px;
        border-radius: var(--radius-lg);
        margin: 40px 0;
    }

    .how-to-visual {
        height: 250px;
        padding: 20px;
    }

    .section-header {
        margin: 0 auto 40px;
    }

    /* -- Brand Section -- */
    .brand-grid {
        gap: 20px;
    }

    .brand-item {
        font-size: 1rem;
    }

    /* -- Features & Sections spacing -- */
    .features-section {
        margin-top: 40px;
    }

    .showcase-section {
        margin-top: 40px;
    }

    .testimonials-section {
        margin-top: 40px;
    }

    /* -- Footer -- */
    .footer-content {
        padding: 28px 16px;
        gap: 32px;
    }

    .footer-bottom {
        padding: 14px 16px 0;
        font-size: 0.8rem;
    }

    .footer-brand p {
        font-size: 0.9rem;
    }
}

/* ---------- Small Phone (≤ 480px) ---------- */
@media (max-width: 480px) {

    /* -- Header -- */
    header {
        margin: 8px auto;
        padding: 6px 10px;
        top: 8px;
    }

    header .logo span {
        display: none;
    }

    header .logo-icon {
        width: 38px;
        height: 38px;
    }

    .nav-links {
        gap: 2px;
        margin-right: 4px;
    }

    .nav-links a {
        padding: 6px 8px;
        font-size: 0.78rem;
    }

    /* -- Hero -- */
    h1 {
        font-size: 2rem;
        letter-spacing: -0.03em;
    }

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

    .hero {
        margin-bottom: 28px;
    }

    .intro-segment {
        margin: -12px auto 20px;
    }

    .intro-segment p {
        font-size: 0.95rem;
    }

    .badge {
        font-size: 0.72rem;
        padding: 5px 12px;
    }

    /* -- Section Headers -- */
    .section-header h2 {
        font-size: 1.5rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    /* -- Mode Tabs -- */
    .mode-tabs {
        gap: 2px;
        padding: 3px;
        border-radius: 12px;
    }

    .mode-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 6px;
        border-radius: 10px;
    }

    .mode-tab svg {
        width: 16px;
        height: 16px;
    }

    /* -- Upload Card -- */
    .upload-card {
        height: 340px;
    }

    .upload-content {
        padding: 28px 18px;
        gap: 16px;
        max-width: 290px;
        border-radius: 28px;
    }

    .upload-icon-wrapper {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
        border-radius: 12px;
    }

    .upload-title {
        font-size: 0.95rem;
    }

    .upload-desc {
        font-size: 0.8rem;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    /* -- Text Mode -- */
    .text-mode-toolbar {
        padding: 10px 14px;
    }

    .card-title {
        font-size: 0.7rem;
    }

    .toolbar-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .text-input-container textarea {
        padding: 14px;
        font-size: 1rem;
    }

    .sample-chips {
        gap: 6px;
    }

    .chip {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    /* -- Result Cards -- */
    .card-header {
        padding: 14px 16px;
    }

    .result-content {
        padding: 16px;
        font-size: 0.9rem;
    }

    .translation-controls {
        padding: 10px 16px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .lang-select {
        min-width: 0;
        font-size: 0.85rem;
    }

    /* -- Bento Cards -- */
    .bento-card.large,
    .bento-card.tall,
    .bento-card.wide {
        min-height: 240px;
        border-radius: var(--radius-lg);
    }

    .bento-content {
        padding: 20px;
    }

    .bento-content h3 {
        font-size: 1.2rem;
    }

    .bento-content p {
        font-size: 0.9rem;
    }

    .mock-browser {
        width: 200px;
        height: 150px;
    }

    /* -- How-to Section -- */
    .how-to-section {
        padding: 32px 14px;
        border-radius: 20px;
        margin: 32px 0;
    }

    .how-to-visual {
        height: 220px;
        padding: 16px;
    }

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

    .how-to-content h3 {
        font-size: 1.05rem;
        margin-bottom: 10px;
    }

    .how-to-content p {
        font-size: 0.85rem;
    }

    .mock-upload-box {
        padding: 20px;
        max-width: 200px;
        gap: 12px;
    }

    .mock-translate-box {
        padding: 20px 16px;
        max-width: 220px;
    }

    .mock-result-showcase {
        max-width: 200px;
        padding: 12px;
    }

    .mock-result-img {
        height: 80px;
    }

    .mock-label {
        font-size: 0.75rem;
    }

    .mock-btn-action {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    .mock-upload-icon-circle {
        width: 40px;
        height: 40px;
    }

    .mock-upload-icon-circle svg {
        width: 20px;
        height: 20px;
    }

    .mock-select-box {
        font-size: 0.7rem;
        height: 32px;
        padding: 0 8px;
    }

    .mock-btn-translate {
        font-size: 0.72rem;
        padding: 6px 14px;
    }

    /* -- Process Flow (Privacy visual) -- */
    .visual-privacy {
        padding: 0 12px;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .step-icon svg {
        width: 16px;
        height: 16px;
    }

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

    .flow-arrow {
        margin: 0 6px;
    }

    /* -- Showcase Cards -- */
    .card-visual {
        height: 200px;
        border-radius: 12px;
    }

    .meta-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .meta-text h4 {
        font-size: 0.9rem;
    }

    .meta-text p {
        font-size: 0.8rem;
    }

    /* -- Testimonials -- */
    .testimonial-card {
        padding: 20px;
        border-radius: 18px;
    }

    .testimonial-card p {
        font-size: 0.9rem;
    }

    .avatar {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .user-info h4 {
        font-size: 0.9rem;
    }

    .user-info span {
        font-size: 0.75rem;
    }

    /* -- FAQ -- */
    .faq-section {
        padding: 0 4px;
        margin: 40px auto 30px;
    }

    .faq-question {
        padding: 18px 14px;
        font-size: 0.95rem;
        gap: 8px;
    }

    .faq-question span {
        flex: 1;
        min-width: 0;
    }

    .faq-icon-wrapper {
        flex-shrink: 0;
    }

    .faq-answer-inner {
        padding: 0 14px 18px;
        font-size: 0.9rem;
    }

    /* -- Footer -- */
    .footer-content {
        padding: 24px 14px;
        gap: 28px;
    }

    .footer-links-col h4 {
        font-size: 0.95rem;
        margin-bottom: 14px;
    }

    .footer-links-col a {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .footer-bottom {
        font-size: 0.78rem;
        padding: 12px 14px 0;
    }

    .legal-links {
        gap: 16px;
    }

    /* -- History Drawer -- */
    .history-drawer {
        width: 100vw;
        right: -100vw;
    }

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

/* ---------- Extra-Small Phone (≤ 360px) ---------- */
@media (max-width: 360px) {
    body {
        padding: 0 8px;
    }

    header {
        padding: 6px 8px;
    }

    .nav-links a {
        font-size: 0.72rem;
        padding: 5px 6px;
    }

    h1 {
        font-size: 1.7rem;
    }

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

    .intro-segment p {
        font-size: 0.88rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    .section-header p {
        font-size: 0.85rem;
    }

    .mode-tab {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .upload-card {
        height: 300px;
    }

    .upload-content {
        padding: 24px 14px;
        max-width: 260px;
        gap: 14px;
        border-radius: 22px;
    }

    .upload-icon-wrapper {
        width: 44px;
        height: 44px;
    }

    .upload-title {
        font-size: 0.88rem;
    }

    .upload-desc {
        font-size: 0.75rem;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .text-input-container textarea {
        padding: 12px;
        font-size: 0.95rem;
    }

    .text-mode-footer {
        padding: 10px 12px;
        gap: 10px;
    }

    .chip {
        font-size: 0.65rem;
    }

    .how-to-section {
        padding: 24px 10px;
        border-radius: 16px;
    }

    .how-to-visual {
        height: 190px;
        padding: 12px;
    }

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

    .how-to-content h3 {
        font-size: 0.95rem;
    }

    .how-to-content p {
        font-size: 0.8rem;
    }

    .bento-content {
        padding: 16px;
    }

    .bento-content h3 {
        font-size: 1.05rem;
    }

    .faq-question {
        padding: 14px 12px;
        font-size: 0.88rem;
    }

    .faq-answer-inner {
        padding: 0 12px 14px;
        font-size: 0.85rem;
    }

    .testimonial-card {
        padding: 16px;
    }

    .testimonial-card p {
        font-size: 0.85rem;
    }

    .footer-content {
        padding: 20px 10px;
    }

    .footer-bottom {
        padding: 10px 10px 0;
        font-size: 0.72rem;
    }
}

/* ==========================================================================
   ABOUT PAGE 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: left;
    word-wrap: break-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: 36px 22px;
    }

    .about-card p {
        font-size: 1.02rem;
        line-height: 1.7;
    }

    .about-content {
        padding: 0 12px 60px;
    }
}

@media (max-width: 480px) {
    .about-page main {
        padding-top: 60px;
    }

    .about-card {
        padding: 28px 16px;
        border-radius: 20px;
    }

    .about-card p {
        font-size: 0.95rem;
        line-height: 1.65;
        text-align: left;
        margin-bottom: 18px;
    }

    .about-content {
        padding: 0 8px 40px;
    }
}

@media (max-width: 360px) {
    .about-page main {
        padding-top: 50px;
    }

    .about-card {
        padding: 22px 14px;
    }

    .about-card p {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   CONTACT FORM STYLES
   ========================================================================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 40px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-left: 4px;
}

.form-input, .form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.btn-submit {
    margin-top: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 480px) {
    .contact-form {
        gap: 18px;
    }
    
    .form-input, .form-textarea {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   LEGAL PAGES (Privacy & Terms)
   ========================================================================== */
.policy-section {
    margin-bottom: 40px;
    text-align: left;
}

.policy-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 700;
}

.policy-section p {
    text-align: left;
    margin-bottom: 20px;
}

.policy-section ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.policy-section li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
}

.policy-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.policy-section a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.policy-section a:hover {
    text-decoration: underline;
}

.effective-date {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 32px;
    display: block;
}

.about-page.privacy-page .about-card,
.about-page.terms-page .about-card {
    text-align: left;
}

.toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 48px;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    word-break: normal !important;
}

.toc-list a:hover {
    color: var(--accent);
}