:root {
    color-scheme: light;
    --bg: #faf9f6;
    --bg-alt: #f7f6f3;
    --text: #37352f;
    --muted: #787774;
    --secondary-text: #4a4843;
    --border: #e9e9e7;
    --input-border: rgba(55, 53, 47, 0.16);
    --accent: #2e2d29;
    --accent-hover: #1a1917;
    --success: #0b7d4e;
    --error: #e16259;
    --glow: rgba(55, 53, 47, 0.04);
    --panel-surface: #f1f0ed;
    --panel-text: #37352f;
    --panel-muted: rgba(55, 53, 47, 0.6);
    --panel-border: rgba(55, 53, 47, 0.09);
    --paper-shadow: rgba(15, 15, 15, 0.03);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #1e1e1e;
        --bg-alt: #191919;
        --text: #e9e9e7;
        --muted: #9b9a97;
        --secondary-text: #c9c9c7;
        --border: #2e2e2e;
        --input-border: rgba(233, 233, 231, 0.2);
        --accent: #ffffff;
        --accent-hover: #e9e9e7;
        --success: #4ec9b0;
        --error: #ff6b6b;
        --glow: rgba(233, 233, 231, 0.04);
        --panel-surface: #252525;
        --panel-text: #e9e9e7;
        --panel-muted: rgba(233, 233, 231, 0.65);
        --panel-border: rgba(233, 233, 231, 0.12);
        --paper-shadow: rgba(0, 0, 0, 0.2);
    }
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(55, 53, 47, 0.03) 2px,
            rgba(55, 53, 47, 0.03) 4px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 2px,
            rgba(55, 53, 47, 0.02) 2px,
            rgba(55, 53, 47, 0.02) 4px);
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(55, 53, 47, 0.08) 1px, transparent 0);
    background-size: 6px 6px;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
}

@media (prefers-color-scheme: dark) {
    body::after {
        background-image:
            radial-gradient(circle at 1px 1px, rgba(233, 233, 231, 0.05) 1px, transparent 0);
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background-image:
            repeating-linear-gradient(0deg,
                transparent,
                transparent 2px,
                rgba(233, 233, 231, 0.02) 2px,
                rgba(233, 233, 231, 0.02) 4px),
            repeating-linear-gradient(90deg,
                transparent,
                transparent 2px,
                rgba(233, 233, 231, 0.015) 2px,
                rgba(233, 233, 231, 0.015) 4px);
    }
}

body::before,
body::after {
    content: '';
    position: fixed;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle at center, var(--glow), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

body::before {
    top: 60px;
    left: -80px;
}

body::after {
    bottom: -40px;
    right: -60px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 12px,
            rgba(55, 53, 47, 0.005) 12px,
            rgba(55, 53, 47, 0.005) 24px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

@media (prefers-color-scheme: dark) {
    .container::before {
        background-image:
            repeating-linear-gradient(45deg,
                transparent,
                transparent 12px,
                rgba(233, 233, 231, 0.003) 12px,
                rgba(233, 233, 231, 0.003) 24px);
    }
}

header {
    margin-bottom: 60px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.2;
    color: var(--text);
}

main {
    margin-bottom: 80px;
}

section {
    margin-bottom: 50px;
}

.definition {
    border-radius: 6px;
    padding: 0;
    margin-bottom: 48px;
}

.definition-merged {
    margin-bottom: 70px;
}

.definition-bubble {
    margin-bottom: 70px;
}

.bubble-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    position: relative;
    overflow: visible;
    cursor: pointer;
    min-height: 1.2em;
}

.bubble-title .title-text {
    font-size: 3.25rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.bubble-title .title-text.latin {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-10px);
    opacity: 0;
    z-index: 2;
}

.bubble-title .title-text.devanagari {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    font-family: 'Noto Sans Devanagari', 'DM Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
    z-index: 1;
}

.bubble-title .title-text.latin .accent-dot {
    color: #0099ff;
}

.bubble-title.active .title-text.latin {
    opacity: 1;
    transform: translateY(0);
}

.bubble-title.active .title-text.devanagari {
    opacity: 0;
    transform: translateY(10px);
}

@media (hover: hover) and (pointer: fine) {

    .bubble-title:hover .title-text.latin,
    .bubble-title.active .title-text.latin {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.4s cubic-bezier(0, 0, 0.2, 1), transform 0.4s cubic-bezier(0, 0, 0.2, 1);
    }

    .bubble-title:hover .title-text.devanagari,
    .bubble-title.active .title-text.devanagari {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.4s cubic-bezier(0, 0, 0.2, 1), transform 0.4s cubic-bezier(0, 0, 0.2, 1);
    }
}

.speech-panel {
    margin-top: 12px;
    position: relative;
}

.panel {
    background-color: var(--panel-surface);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    box-shadow: 0 1px 3px var(--paper-shadow);
    color: var(--panel-text);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 3px,
            rgba(55, 53, 47, 0.02) 3px,
            rgba(55, 53, 47, 0.02) 6px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 3px,
            rgba(55, 53, 47, 0.015) 3px,
            rgba(55, 53, 47, 0.015) 6px);
    pointer-events: none;
    opacity: 0.5;
    z-index: 0;
}

.panel>* {
    position: relative;
    z-index: 1;
}

@media (prefers-color-scheme: dark) {
    .panel::after {
        background-image:
            repeating-linear-gradient(0deg,
                transparent,
                transparent 3px,
                rgba(233, 233, 231, 0.015) 3px,
                rgba(233, 233, 231, 0.015) 6px),
            repeating-linear-gradient(90deg,
                transparent,
                transparent 3px,
                rgba(233, 233, 231, 0.01) 3px,
                rgba(233, 233, 231, 0.01) 6px);
    }
}

.panel p,
.panel li,
.panel .translation,
.panel .usage,
.panel .subtitle,
.panel .hero-copy,
.panel strong {
    color: var(--panel-text);
}

.panel .pronunciations,
.panel .pronunciation,
.panel .term-line .pronunciation {
    color: var(--panel-muted);
}

.panel .pos {
    color: var(--panel-text);
    opacity: 1;
}

.panel .translation {
    color: var(--panel-text);
    opacity: 1;
}

.panel .translation strong {
    color: var(--panel-text);
    opacity: 1;
    font-weight: 600;
}

.panel .usage {
    color: var(--panel-text);
    opacity: 0.9;
    font-style: italic;
    font-size: 0.95rem;
}

.definition .definition-label {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.definition .term-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 15px;
}

.definition .translation {
    margin-bottom: 12px;
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.definition .term {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text);
}

.definition .pronunciation {
    font-size: 1rem;
    color: var(--muted);
    font-style: italic;
}

.definition .pos {
    font-size: 0.95rem;
    color: var(--muted);
    text-transform: lowercase;
}

.definition ol {
    margin-left: 20px;
    color: var(--secondary-text);
    margin-bottom: 15px;
}

.definition ol li {
    margin-bottom: 10px;
}

.definition .usage {
    font-size: 0.95rem;
    color: var(--muted);
    font-style: italic;
    font-weight: 400;
}

h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text);
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 36px;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--text);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--muted);
    margin-bottom: 30px;
}

.hero-copy {
    color: var(--secondary-text);
    font-size: 1rem;
    max-width: 420px;
}

.definition-primary .term-line.primary {
    margin-bottom: 12px;
}

.definition-primary .term-line.primary.stacked {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-title {
    font-size: inherit;
}

.term-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.panel .term-title {
    color: var(--panel-text);
}

.pronunciations {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
}

.term-line.primary .pronunciation {
    font-size: 1rem;
}

.term-line.primary .pronunciation.dot {
    color: inherit;
}

.term-line.primary .pos {
    font-size: 0.95rem;
    text-transform: lowercase;
    color: var(--muted);
}

.def-subtitle {
    font-size: 1.05rem;
    margin-bottom: 20px;
}

p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--secondary-text);
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    color: var(--secondary-text);
}

.meetup-time {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 600;
}

.meetup-time strong {
    color: inherit;
    font-weight: 600;
    margin-right: 4px;
    text-transform: lowercase;
}

.meetup a:not(.luma-link) {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--border);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.meetup a:not(.luma-link):hover {
    color: var(--accent-hover);
    text-decoration-color: var(--accent);
}

.luma-link-wrapper {
    margin-top: 24px;
    margin-bottom: 0;
}

.luma-link {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    background-color: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: background-color 0.2s;
}

.luma-link:hover {
    background-color: var(--accent-hover);
}

.luma-link-inactive {
    background-color: var(--muted) !important;
    color: var(--bg) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}

.luma-link-inactive:hover {
    background-color: var(--muted) !important;
}

.gallery {
    margin-top: 48px;
}

.gallery h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--text);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
    align-items: stretch;
}

.gallery-item {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-alt);
    box-shadow: 0 2px 8px var(--paper-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:first-child {
    grid-row: 1 / 3;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--paper-shadow);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 1024px) {
    .gallery-grid {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, auto);
        gap: 20px;
    }
    
    .gallery-item {
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .gallery-item:first-child {
        grid-row: 1;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        gap: 16px;
    }
    
    .gallery-item {
        aspect-ratio: 4 / 3;
    }
}

.signup {
    padding: 32px;
    border-radius: 6px;
    margin-top: 48px;
}

.signup-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.signup-form input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-family: inherit;
    background-color: transparent;
    color: inherit;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.panel .signup-form input {
    border-color: var(--panel-border);
    background-color: rgba(255, 255, 255, 0.4);
}

@media (prefers-color-scheme: dark) {
    .panel .signup-form input {
        background-color: rgba(255, 255, 255, 0.15);
    }
}

.signup-form input::placeholder {
    color: var(--muted);
}

.panel .signup-form input::placeholder {
    color: var(--panel-muted);
    opacity: 0.8;
}

.signup-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.panel .signup-form input:focus {
    border-color: var(--panel-text);
    background-color: rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: dark) {
    .panel .signup-form input:focus {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

.signup-form button {
    padding: 12px 24px;
    font-size: 1rem;
    background-color: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: background-color 0.2s;
}

.signup-form button:hover {
    background-color: var(--accent-hover);
}

.panel .signup-form button {
    background-color: var(--panel-text);
    color: var(--panel-surface);
    border: 1px solid transparent;
}

.panel .signup-form button:hover {
    opacity: 0.9;
}

.form-message {
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 20px;
}

.form-message.success {
    color: var(--success);
}

.form-message.error {
    color: var(--error);
}

footer {
    text-align: center;
    padding-top: 40px;
    padding-bottom: 30px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

footer a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--border);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

footer a:hover {
    color: var(--accent);
    text-decoration-color: inherit;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.one2n-inline {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.one2n-inline:hover {
    opacity: 0.8;
}

.one2n-inline:hover .one2n-logo {
    transform: scale(1.05);
}

.one2n-logo {
    height: 72px;
    display: block;
    transition: transform 0.3s ease;
}

.one2n-logo-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .one2n-logo-light {
        display: none;
    }

    .one2n-logo-dark {
        display: block;
    }
}

.footer-socials {
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.6;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.footer-socials a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-socials a:hover {
    opacity: 1;
}

.footer-socials .separator {
    opacity: 0.4;
    margin: 0 2px;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

@media (max-width: 600px) {
    .container {
        padding: 40px 15px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .bubble-title {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .signup {
        padding: 30px 20px;
    }

    .signup-form {
        flex-direction: column;
    }

    .signup-form input {
        min-width: 100%;
    }

    .signup-form button {
        width: 100%;
    }
}