/* Beepscript Tour & Landing Page Styles
   Uses CSS variables from style.css for theming (dark default, light optional) */

/* ==========================================================================
   Landing Page
   ========================================================================== */

body.landing {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* -- Navigation bar -- */
.landing-nav {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-nav .nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

.landing-nav .nav-brand .beep {
    font-weight: 800;
    color: var(--logo-beep);
}

.landing-nav .nav-brand .script {
    font-weight: 400;
    color: var(--logo-script);
}

.landing-nav .nav-links {
    margin-left: auto;
    display: flex;
    gap: 1.5rem;
}

.landing-nav .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s;
}

.landing-nav .nav-links a:hover {
    color: var(--text-primary);
}

/* -- Hero section -- */
.landing-hero {
    text-align: center;
    padding: 5rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(50, 100, 200, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(100, 50, 200, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* CSS waveform visual */
.waveform-visual {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    margin-bottom: 2rem;
    position: relative;
}

.waveform-visual .bar {
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(to top, #3b82f6, #8b5cf6);
    opacity: 0.7;
    animation: wave-pulse 2s ease-in-out infinite;
}

@keyframes wave-pulse {
    0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 0.8; }
}

.landing-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: 0.04em;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border: none;
    padding: 0;
}

.landing-hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 0 2.5rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
}

.cta-primary,
.cta-secondary {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.cta-primary {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.cta-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cta-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.cta-secondary:hover {
    border-color: var(--text-secondary);
    text-decoration: none;
    transform: translateY(-1px);
}

/* -- Feature cards -- */
.feature-section {
    padding: 3rem 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--border-secondary);
}

.feature-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* -- Code snippet preview -- */
.code-preview {
    padding: 2rem 2rem 3rem;
    max-width: 700px;
    margin: 0 auto;
}

.code-preview pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
}

.code-preview .code-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* -- Footer -- */
.landing-footer {
    border-top: 1px solid var(--border-primary);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.landing-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.landing-footer a:hover {
    color: var(--text-primary);
}

.landing-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Landing responsive */
@media (max-width: 768px) {
    .landing-hero h1 { font-size: 2.5rem; }
    .landing-hero .subtitle { font-size: 1.05rem; }
    .feature-cards { grid-template-columns: 1fr; }
    .landing-nav { padding: 0.75rem 1rem; }
    .landing-nav .nav-links { gap: 1rem; }
}

/* ==========================================================================
   Tour Page
   ========================================================================== */

body.tour-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -- Tour toolbar -- */
.tour-toolbar {
    position: relative;
    z-index: 100;
    background: var(--bg-toolbar);
    border-bottom: 1px solid var(--border-primary);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.tour-toolbar .toolbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.tour-toolbar .toolbar-brand .beep {
    font-weight: 800;
    color: var(--logo-beep);
}

.tour-toolbar .toolbar-brand .script {
    font-weight: 400;
    color: var(--logo-script);
}

.tour-toolbar .toolbar-brand:hover {
    text-decoration: none;
}

.tour-toolbar .toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tour-toolbar .volume-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.tour-toolbar .volume-group label {
    white-space: nowrap;
}

.tour-toolbar input[type="range"] {
    width: 120px;
    accent-color: var(--accent-range);
}

.tour-toolbar .volume-value {
    min-width: 2.5em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tour-toolbar .toc-btn {
    background: var(--btn-reset-bg);
    border: 1px solid var(--btn-reset-border);
    border-radius: 4px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s;
}

.tour-toolbar .toc-btn:hover {
    background: var(--bg-hover);
}

.tour-toolbar .panic-btn {
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: opacity 0.15s;
}

.tour-toolbar .panic-btn:hover {
    opacity: 0.85;
}

.tour-toolbar .init-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tour-toolbar .init-status.ready {
    color: var(--success-text);
}

.tour-toolbar .init-status.error {
    color: var(--error-text);
}

/* -- Tour main content (split panel) -- */
.tour-main {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* -- Lesson panel (left) -- */
.tour-lesson {
    width: 42%;
    min-width: 300px;
    padding: 2rem;
    overflow-y: auto;
    border-right: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.tour-lesson .step-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.tour-lesson h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
    border: none;
    padding: 0;
    color: var(--text-primary);
}

.tour-lesson p {
    margin: 0.75rem 0;
    line-height: 1.7;
    color: var(--text-secondary);
}

.tour-lesson code {
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    background: var(--bg-code);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: var(--text-primary);
}

.tour-tip {
    background: var(--btn-download-bg);
    border: 1px solid var(--btn-download-border);
    border-left: 3px solid var(--link-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin: 1.25rem 0 0;
    font-size: 0.9rem;
    color: var(--btn-download-text);
}

.tour-tip strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* -- Code panel (right) -- */
.tour-code {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-secondary);
}

.tour-editor-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tour-editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: var(--bg-editor);
}

.tour-editor-container .line-numbers {
    flex-shrink: 0;
    padding: 1rem 0.5rem 1rem 0.75rem;
    background: var(--bg-editor-lines);
    color: var(--text-muted);
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    white-space: pre;
    border-right: 1px solid var(--border-primary);
    overflow: hidden;
    min-width: 2.5em;
}

.tour-editor-container .tour-editor {
    display: block;
    width: 100%;
    flex: 1;
    padding: 1rem 1rem 1rem 0.75rem;
    background: var(--bg-editor);
    color: var(--text-editor);
    border: none;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    tab-size: 2;
    outline: none;
    white-space: pre;
    overflow: auto;
}

.tour-editor-container .tour-editor:focus {
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

.tour-code-toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-editor-toolbar);
    border-top: 1px solid var(--border-secondary);
    gap: 0.5rem;
    flex-shrink: 0;
}

.tour-code-toolbar button {
    border: 1px solid;
    border-radius: 4px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.tour-code-toolbar button:hover {
    opacity: 0.8;
}

.tour-code-toolbar .btn-play {
    background: var(--btn-play-bg);
    border-color: var(--btn-play-border);
    color: var(--btn-play-text);
}

.tour-code-toolbar .btn-stop {
    background: var(--btn-stop-bg);
    border-color: var(--btn-stop-border);
    color: var(--btn-stop-text);
}

.tour-code-toolbar .btn-reset {
    background: var(--btn-reset-bg);
    border-color: var(--btn-reset-border);
    color: var(--btn-reset-text);
}

.tour-code-toolbar .btn-download {
    background: var(--btn-download-bg);
    border-color: var(--btn-download-border);
    color: var(--btn-download-text);
}

.tour-status {
    padding: 0;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    flex-shrink: 0;
    max-height: 120px;
    overflow-y: auto;
}

.tour-status:not(:empty) {
    padding: 0.75rem 1rem;
    background: var(--error-bg);
    border-top: 1px solid var(--error-border);
    color: var(--error-text);
}

.tour-status.success:not(:empty) {
    background: var(--success-bg);
    border-top-color: var(--success-border);
    color: var(--success-text);
}

/* -- Bottom navigation -- */
.tour-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-toolbar);
    border-top: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.tour-nav button {
    background: var(--btn-reset-bg);
    border: 1px solid var(--btn-reset-border);
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    transition: background 0.15s;
}

.tour-nav button:hover:not(:disabled) {
    background: var(--bg-hover);
}

.tour-nav button:disabled {
    opacity: 0.4;
    cursor: default;
}

.tour-nav .nav-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* -- Table of Contents overlay -- */
.tour-toc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
}

.tour-toc-overlay.open {
    display: block;
}

.tour-toc-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.tour-toc-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
}

.tour-toc-panel h3 {
    font-size: 1rem;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.tour-toc-panel .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tour-toc-panel .toc-list li {
    margin: 0;
}

.tour-toc-panel .toc-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.tour-toc-panel .toc-list a:hover {
    background: var(--bg-hover);
    text-decoration: none;
}

.tour-toc-panel .toc-list a.active {
    background: var(--active-nav-bg);
    color: var(--active-nav-text);
}

.tour-toc-panel .toc-list .step-num {
    display: inline-block;
    width: 1.75em;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tour-toc-panel .toc-list a.active .step-num {
    color: rgba(255, 255, 255, 0.7);
}

/* -- Tour responsive -- */
@media (max-width: 900px) {
    .tour-main {
        flex-direction: column;
    }

    .tour-lesson {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
        max-height: 40vh;
        padding: 1.5rem;
    }

    .tour-code {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .tour-lesson { padding: 1rem; }
    .tour-lesson h2 { font-size: 1.25rem; }
    .tour-nav { padding: 0.5rem 1rem; }
}

/* ==========================================================================
   Static pages (About, License) — uses theme variables
   ========================================================================== */

body.static-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.static-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.static-content h1 {
    font-size: 2rem;
    margin: 0 0 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0.5rem;
}

.static-content h2 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
    color: var(--text-primary);
    border: none;
    padding: 0;
}

.static-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0.75rem 0;
}

.static-content a {
    color: var(--link-color);
}

.static-content a:hover {
    text-decoration: underline;
}

.static-content code {
    background: var(--bg-code);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}
