/* ═══════════════════════════════════════════════════════════════════
   blok — base stylesheet
   Shared by index, report, themes and welcome. Page-specific rules
   live alongside this file in css/<page>.css and load after it.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg:     #0a0a0a;
    --fg:     #d8d8d8;
    --dim:    #7a7a7a;
    --border: #2a2a2a;
    /* The app's accent is #c0392b, but as text on near-black that falls
       under 4.5:1 — this is the lighter mirror the app uses for text. */
    --accent: #ef5350;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    max-width: 780px;
    background: var(--bg);
    color: var(--fg);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

h2 {
    margin: 0.5rem 0 1rem;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

p { margin: 0 0 1rem; }

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

/* ── header ──────────────────────────────────────────────────────── */

.ascii-header {
    white-space: pre;
    overflow-x: auto;
    color: var(--accent);
    font-size: clamp(7px, 2.6vw, 11px);
    line-height: 1.15;
    margin-bottom: 3rem;
}

/* ── sections ────────────────────────────────────────────────────── */

section { margin-bottom: 3.5rem; }

.terminal-prompt {
    color: var(--dim);
    font-size: 12px;
    margin-bottom: 0.25rem;
}
.terminal-prompt::before {
    content: '~/blok $ ';
    color: #444;
}

/* Sits at the end of a prompt line and blinks like a real one. */
.cursor {
    display: inline-block;
    width: 7px;
    height: 0.95em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 4px;
    animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; }
}

/* ── buttons and links ───────────────────────────────────────────── */

.download-btn,
.register-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.download-btn::before,
.register-btn::before {
    content: '$ ';
    color: var(--dim);
    font-weight: 300;
    margin-right: 0.25rem;
}
.download-btn:hover,
.register-btn:hover:not(:disabled) {
    background: rgba(239, 83, 80, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 83, 80, 0.08);
}
.register-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.version-info {
    color: var(--dim);
    font-size: 11px;
    margin-top: 0.75rem;
}

/* Both nav links sit in normal flow above the header, so they never
   collide with the ASCII art the way fixed corners would on narrow
   screens. */
.register-nav-btn,
.report-nav-btn {
    display: inline-block;
    margin: 0 0.75rem 1.5rem 0;
    padding: 0.35rem 0.8rem;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 300;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.register-nav-btn::before { content: './'; color: #444; }
.report-nav-btn::before   { content: '! ';  color: #444; }
.register-nav-btn:hover,
.report-nav-btn:hover {
    border-style: solid;
    border-color: var(--accent);
    color: var(--accent);
}
.register-nav-btn {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── feature grid ────────────────────────────────────────────────── */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.feature-item {
    border: 1px dashed var(--border);
    padding: 0.9rem 1rem;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.feature-item:hover {
    border-style: solid;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.015);
    transform: translateX(4px);
}

.feature-name {
    color: var(--accent);
    font-size: 13px;
}
.feature-name::before { content: '> '; color: var(--dim); }

.feature-desc {
    color: var(--dim);
    font-size: 11px;
    margin-top: 0.3rem;
    line-height: 1.6;
}

/* ── tech stack ──────────────────────────────────────────────────── */

.skill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-item {
    border: 1px solid var(--border);
    padding: 0.25rem 0.7rem;
    color: var(--dim);
    font-size: 11px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.skill-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── links section ───────────────────────────────────────────────── */

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.contact-links a::before { content: '→ '; color: var(--dim); }
.contact-links a:hover { border-bottom-color: var(--accent); }

.contact-links a.coffee-link { color: #d4a017; }
.contact-links a.coffee-link:hover { border-bottom-color: #d4a017; }


/* ── download grid ───────────────────────────────────────────────── */

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.dl-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.dl-card:hover {
    border-style: solid;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.015);
    transform: translateY(-2px);
}

.dl-os {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}
.dl-os::before { content: '↓ '; color: var(--dim); font-weight: 300; }

/* Asset names are long and hyphenated; let them wrap rather than widen
   the card past its grid track. */
.dl-file {
    color: var(--dim);
    font-size: 11px;
    word-break: break-all;
}

.dl-size {
    color: #555;
    font-size: 11px;
}

/* Nothing matched in the release — the card still links to the releases
   page, so it stays clickable but stops advertising a file. */
.dl-card--missing { opacity: 0.55; }
.dl-card--missing .dl-file { text-decoration: line-through; }
/* ── footer ──────────────────────────────────────────────────────── */

footer {
    border-top: 1px dashed var(--border);
    padding-top: 1.5rem;
    margin-top: 4rem;
    color: var(--dim);
    font-size: 11px;
}
footer p { margin: 0 0 0.35rem; }

/* ── register modal ──────────────────────────────────────────────── */

/* index.js flips this between 'none' and 'flex'. */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.85);
    overflow-y: auto;
}

.modal-box {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 1.75rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.terminal-prompt-modal {
    color: var(--dim);
    font-size: 12px;
}
.terminal-prompt-modal::before { content: '$ '; color: #444; }

.modal-close {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--dim);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close:hover { color: var(--accent); }

.modal-title {
    margin: 0 0 0.75rem;
    font-size: 16px;
}

/* ── forms ───────────────────────────────────────────────────────── */

.register-form { margin-top: 0.5rem; }

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-label {
    color: var(--dim);
    font-size: 12px;
}
.form-label::before { content: '> '; }

.form-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    font-weight: 300;
    padding: 0.35rem 0;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
}
.form-input::placeholder { color: #4a4a4a; }
.form-input:focus { border-bottom-color: var(--accent); }

/* index.js and report.js toggle these between 'none' and 'block'. */
.form-message {
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 12px;
    line-height: 1.5;
}

.form-error {
    border: 1px solid #e74c3c;
    background: rgba(231, 76, 60, 0.05);
    color: #e74c3c;
}
.form-error::before { content: '[!] '; }

.form-success {
    border: 1px solid #27ae60;
    background: rgba(39, 174, 96, 0.05);
    color: #27ae60;
}
.form-success::before { content: '[✓] '; }

/* ── narrow screens ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    body { padding: 1.5rem 1rem 3rem; }
    section { margin-bottom: 2.5rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .modal-box { padding: 1.25rem; }
}
