:root {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --secondary: #2dd4bf;
    --accent: #c084fc;
    --bg: #020617;
    --surface: rgba(15, 23, 42, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(15, 23, 42, 0.6);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius: 16px;
    --radius-lg: 24px;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Animation */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Bottom layer */
    filter: blur(80px);
    opacity: 0.4;
}

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    overflow: hidden;
    pointer-events: none;
    display: flex;
    justify-content: space-around;
    opacity: 0.20; /* Boosted for better word visibility */
    user-select: none;
}


.ambient-stream {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: var(--size, 1.2rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.2em;
    color: var(--primary);
    white-space: nowrap;
    opacity: var(--opacity, 1);
    text-shadow: 0 0 8px var(--primary);
    animation: stream-scroll var(--duration, 20s) linear infinite;
}

@keyframes stream-scroll {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}


.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
}

.blob-1 {
    background: var(--primary);
    top: -10%;
    right: -10%;
    opacity: 0.25; /* Increased glow */
    animation: move 20s infinite alternate;
}

.blob-2 {
    background: var(--secondary);
    bottom: -10%;
    left: -10%;
    opacity: 0.2; /* Increased glow */
    animation: move 25s infinite alternate-reverse;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 100px); }
}

header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

#lang-reel-container {
    display: inline-block;
    height: 1.1em;
    vertical-align: bottom;
    overflow: hidden;
    position: relative;
    padding-bottom: 5px;
}

#lang-reel {
    display: inline-block;
    color: var(--primary);
    position: relative;
}

@keyframes spin-out {
    from { transform: translateY(0); opacity: 1; filter: blur(0); }
    to { transform: translateY(-100%); opacity: 0; filter: blur(10px); }
}

@keyframes spin-in {
    from { transform: translateY(100%); opacity: 0; filter: blur(10px); }
    to { transform: translateY(0); opacity: 1; filter: blur(0); }
}

main {

    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-sub {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.demo-container {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
}

@media (max-width: 768px) {
    header { padding: 1.5rem; }
    main { padding: 2rem 1.5rem; }
    h1 { font-size: 2.5rem; }
    .demo-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}


.input-group, .output-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text);
    resize: none;
    height: 200px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.output-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    height: 200px;
    overflow-y: auto;
    font-size: 1.2rem;
    line-height: 1.8;
}

ruby rt {
    color: var(--primary);
    font-size: 0.6em;
    font-weight: 600;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Store Buttons */
.store-grid {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    min-width: 200px;
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.chrome-btn:hover { border-color: #4285F4; box-shadow: 0 0 20px rgba(66, 133, 244, 0.2); }
.firefox-btn:hover { border-color: #FF7139; box-shadow: 0 0 20px rgba(255, 113, 57, 0.2); }
.safari-btn:hover { border-color: #A2AAAD; box-shadow: 0 0 20px rgba(162, 170, 173, 0.2); }

.store-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.store-btn .btn-text {
    text-align: left;
}

.store-btn .small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
}

.store-btn .large {
    font-size: 1rem;
    font-weight: 700;
}

/* Mobile specific info */
.mobile-info {
    margin-top: 4rem;
    background: var(--glass);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.mobile-info h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.mobile-info ul {
    list-style: none;
    color: var(--text-muted);
}

.mobile-info li {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.mobile-info li::before {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
}

/* How it Works Section */
.how-to {
    margin-top: 6rem;
    text-align: center;
}

.how-to h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    background: var(--glass);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.step-num {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    margin: 0 auto 1.5rem;
}

.step h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

footer {
    padding: 3rem 2rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.footer-seal {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 400px;
    opacity: 0.05;
    filter: invert(1);
    pointer-events: none;
    z-index: -1;
    transform: rotate(-15deg);
}

/* 🎨 Premium Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* 💠 Smooth Annotation Scale-up */
.annotated-text ruby {
    display: inline-block;
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8) translateY(5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 🎞️ Hero Reel Animation */
#lang-reel-container {
    height: 1.2em;
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    padding: 0 0.2em;
}

#lang-reel {
    display: block;
    color: var(--primary);
}

@keyframes spin-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-100%); }
}

@keyframes spin-in {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tooltip for Deep Analysis */
#yomu-tooltip {
    position: absolute;
    z-index: 9999999;
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    animation: yomu-tooltip-in 0.2s ease-out;
    pointer-events: none; /* So it doesn't block clicks */
}

@keyframes yomu-tooltip-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.output-box ruby {
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    border-radius: 4px;
    padding: 2px;
}

.output-box ruby:hover {
    background: rgba(96, 165, 250, 0.15);
    opacity: 0.9;
}

@keyframes yomu-spin {
    to { transform: rotate(360deg); }
}
