@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(17, 24, 39, 0.65);
    --border-glow: rgba(217, 119, 6, 0.15);
    --border-light: rgba(255, 255, 255, 0.08);
    --accent: #d97706; /* Gold */
    --accent-glow: rgba(217, 119, 6, 0.4);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --emerald-glow: rgba(16, 185, 129, 0.4);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

/* Background Nebula Effects */
.nebula-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.06) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}
.nebula-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Header & Navigation */
header {
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}
.logo {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logo span {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}
.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}
.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
    letter-spacing: 0.5px;
}
.nav-menu a:hover, .nav-menu a.active {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Container */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: 80vh;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}
.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    color: var(--text-primary);
}
.hero h1 span {
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
}
.hero p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    margin-bottom: 2.5rem;
    transition: border 0.3s, box-shadow 0.3s;
}
.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 8px 32px 0 rgba(217, 119, 6, 0.08);
}

/* Flex Translation Workspace */
.translator-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .translator-workspace {
        grid-template-columns: 1fr;
    }
}
.panel-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}
.panel-label span {
    color: var(--accent);
}
textarea {
    width: 100%;
    height: 180px;
    background: rgba(10, 15, 26, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    padding: 1rem;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.1);
}
.output-box {
    width: 100%;
    height: 180px;
    background: rgba(10, 15, 26, 0.85);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    font-size: 1.2rem;
    position: relative;
    word-break: break-all;
}

/* Calligraphy Styles */
.font-tengwar {
    font-family: 'Cinzel', serif; /* fallback */
    font-weight: 500;
}
.font-runic {
    font-family: monospace;
    font-size: 1.4rem;
    letter-spacing: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #000;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--accent-glow);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Canvas Preview & Exporter Panel */
.canvas-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}
.canvas-container {
    background: #000;
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 0 20px var(--border-glow);
    max-width: 100%;
}
canvas {
    max-width: 100%;
    display: block;
}
.canvas-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255,255,255,0.02);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    width: 100%;
}
.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.control-group label {
    font-weight: 600;
}
.control-group select, .control-group input[type="color"] {
    background: #0d121f;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    outline: none;
}

/* Virtual Keyboard (Navajo Accents, Sumerian) */
.virtual-keyboard {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    justify-content: flex-start;
}
.key {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--accent);
    transition: background 0.2s, border-color 0.2s;
}
.key:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent);
}

/* Dialect Selector Grid */
.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.selector-card {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.3s;
}
.selector-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: rgba(17, 24, 39, 0.6);
}
.selector-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}
.selector-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Rich Text & Articles */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.75;
}
.article-meta {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}
.article-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    margin: 2rem 0 1rem 0;
    color: var(--accent);
}
.article-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    color: var(--text-primary);
}
.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}
.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: var(--text-secondary);
}
.article-content li {
    margin-bottom: 0.5rem;
}
.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-primary);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}
.article-content th, .article-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}
.article-content th {
    background: rgba(255,255,255,0.02);
    color: var(--accent);
    font-weight: 600;
}

/* Giscus Comments Wrap */
.giscus-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

/* Footer */
footer {
    background: #05070a;
    border-top: 1px solid var(--border-light);
    padding: 3rem 0;
    margin-top: 5rem;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}
.footer-logo {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}
.footer-logo span {
    color: var(--accent);
}
.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}
.footer-links a:hover {
    color: var(--accent);
}
