/* Rhapsody of Genetics — light theme inspired by montone.studio */

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

:root {
    --bg-root: #f4f6fb;
    --bg-surface: #ffffff;
    --bg-elevated: #fafbfd;
    --bg-card: #ffffff;
    --accent: #5c6bff;
    --accent-hover: #4a58e8;
    --accent-dim: rgba(92, 107, 255, 0.1);
    --accent-border: rgba(92, 107, 255, 0.35);
    --accent-glow: rgba(92, 107, 255, 0.2);
    --text-primary: #111111;
    --text-secondary: #56565a;
    --text-muted: #8b8b93;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
    --shadow-hover: 0 12px 32px rgba(17, 24, 39, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --primary-color: var(--text-primary);
    --secondary-color: var(--accent);
    --accent-color: var(--accent);
    --bg-color: var(--bg-root);
    --text-color: var(--text-primary);
    --border-color: var(--border);
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background: linear-gradient(160deg, #ffffff 0%, #f4f6fb 40%, #e8edff 100%);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 24px;
}

.logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo a {
    text-decoration: none;
    color: var(--text-primary);
    display: inline-flex;
    align-items: baseline;
    gap: 0;
}

.logo-mark {
    font-weight: 700;
}

.logo-accent {
    color: var(--accent);
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.75rem;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

.main-content {
    min-height: calc(100vh - 140px);
}

/* Hero */
.hero-section {
    color: var(--text-primary);
    padding: 5rem 0 4.5rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.7);
}

.hero-badge-new {
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    letter-spacing: 0.04em;
}

.hero-title {
    font-size: clamp(2.5rem, 5.5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.08;
    margin-bottom: 1.25rem;
    letter-spacing: -0.04em;
}

.text-accent {
    color: var(--accent);
    font-style: normal;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2.25rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Search */
.search-box {
    max-width: 480px;
    margin: 0 auto 2.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Featured genes */
.featured-genes {
    margin-top: 1rem;
}

.featured-genes h3,
.featured-header h3 {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.species-label {
    margin: 2rem 0 0.75rem;
    color: var(--accent);
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    text-align: left;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.species-label::before {
    content: '/ ';
    color: var(--text-muted);
}

.gene-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto;
}

.gene-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.gene-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.gene-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
}

.gene-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    line-height: 1.5;
}

.organism {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Info section */
.info-section {
    padding: 4.5rem 0;
    background: rgba(255, 255, 255, 0.55);
    border-top: 1px solid var(--border);
}

.info-section h3 {
    text-align: center;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.info-section h3::before {
    content: '/ ';
    color: var(--text-muted);
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.info-item {
    text-align: left;
    padding: 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.step-number {
    display: inline-block;
    min-width: 2rem;
    padding: 0.15rem 0.55rem;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 1rem;
}

.info-item h4 {
    margin-bottom: 0.65rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.info-item p {
    color: var(--text-secondary);
    font-size: 0.925rem;
}

/* CTA */
.cta-section {
    padding: 4rem 0;
    text-align: center;
}

.cta-button {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: background 0.2s, transform 0.2s;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Gene browser page */
.gene-browser {
    min-height: calc(100vh - 80px);
}

.browser-header {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 24px 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.browser-header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 0.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.gene-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.gene-desc {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 70ch;
    font-size: 0.95rem;
}

.gene-meta-line {
    color: var(--text-muted);
    font-size: 0.88em;
    margin-top: 4px;
}

/* Transport */
.transport-bar {
    max-width: 1120px;
    margin: 1.25rem auto 0;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.transport-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.transport-btn:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-dim);
}

.time-display {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 5.5rem;
}

.timeline {
    flex: 1;
    min-width: 120px;
    height: 5px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
}

.timeline-progress {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    width: 0%;
}

.timeline-playhead {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.measure-display {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.measure-display .measure-total {
    opacity: 0.7;
    margin-left: 0.35rem;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.speed-control input[type="range"] {
    -webkit-appearance: none;
    width: 64px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    cursor: pointer;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
}

#speed-display {
    min-width: 2.5rem;
    color: var(--text-secondary);
}

/* Panels — white content areas blend with viewers */
.browser-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem 24px 2.5rem;
    max-width: 1120px;
    margin: 0 auto;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--shadow);
}

.panel-header {
    background: var(--bg-elevated);
    padding: 0.9rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.panel-header h3::before {
    content: '/ ';
    color: var(--text-muted);
    font-weight: 600;
}

.panel-header .panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.panel-header .download-btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.panel-header .download-btn:hover {
    border-color: var(--accent-border);
    color: var(--accent);
}

.panel-header .download-btn:first-of-type {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 600;
}

.panel-header .download-btn:first-of-type:hover {
    background: var(--accent-hover);
    color: #ffffff;
}

.panel-content {
    padding: 1.25rem;
    min-height: 280px;
    background: #ffffff;
}

#genome-viewer {
    width: 100%;
    height: 300px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: crosshair;
    background: #ffffff;
}

#osmd-score {
    max-height: 460px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.sequence-info {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.navigation-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.zoom-controls {
    display: flex;
    gap: 0.35rem;
}

.zoom-controls button {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: border-color 0.2s, color 0.2s;
}

.zoom-controls button:hover {
    border-color: var(--accent-border);
    color: var(--accent);
}

.playback-status {
    max-width: 1120px;
    margin: 0 auto 1.5rem;
    padding: 0 24px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.playback-status.error {
    color: #dc2626;
}

/* Loading / error */
.loading {
    color: var(--text-muted);
    font-style: italic;
}

.error {
    color: #dc2626;
}

/* Inner pages */
.page-content {
    padding: 3rem 0 4rem;
    max-width: 760px;
}

.page-content h2 {
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-content h3 {
    margin: 2rem 0 0.75rem;
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 600;
}

.page-content h4 {
    margin-bottom: 0.5rem;
}

.page-content p,
.page-content li {
    color: var(--text-secondary);
}

.page-content ul,
.page-content ol {
    margin-left: 1.5rem;
}

.page-content a {
    color: var(--accent);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.download-item {
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.download-links a {
    color: var(--accent);
    text-decoration: none;
}

.download-links a.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.separator {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.license-box {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Footer */
.main-footer {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.main-footer a {
    color: var(--accent);
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* Feedback */
.feedback-page {
    max-width: 560px;
}

.feedback-intro {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.feedback-success {
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    background: var(--accent-dim);
    color: var(--text-primary);
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.feedback-field .optional {
    font-weight: 400;
    color: var(--text-muted);
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
    font-family: var(--font-main);
    font-size: 0.95rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.feedback-field textarea {
    resize: vertical;
    min-height: 8rem;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
    outline: none;
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.feedback-honey {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}

.feedback-submit {
    align-self: flex-start;
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.feedback-submit:hover {
    background: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.82rem;
    }

    .hero-section {
        padding: 3rem 0 3.5rem;
    }

    .browser-header {
        margin-top: 0.75rem;
        padding: 1.25rem 16px;
    }

    .browser-content {
        padding: 1rem 16px 2rem;
    }

    .transport-bar {
        margin-left: 16px;
        margin-right: 16px;
        padding: 0.75rem;
    }

    .timeline {
        width: 100%;
        order: 10;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
