/* ============================================================
   FunLab — lab.css
   Shared styles for all FunLab pages
   ============================================================ */

:root {
    --bg:             #ffffff;
    --surface:        #f8fafc;
    --surface-hover:  #f1f5f9;
    --border:         #e2e8f0;
    --border-strong:  #cbd5e1;
    --text:           #0f172a;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --accent:         #2563eb;
    --accent-dark:    #1d4ed8;
    --accent-light:   #eff6ff;
    --accent-border:  #bfdbfe;
    --success:        #16a34a;
    --font-sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono:      'SFMono-Regular', 'SF Mono', 'Cascadia Code', 'Courier New', monospace;
    --header-height:  56px;
    --radius:         8px;
    --radius-sm:      4px;
    --shadow:         0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 14px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --max-w:          1100px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── Header ─────────────────────────────────────────────────── */
.lab-header {
    background: var(--bg);
    border-bottom: 2px solid var(--text);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.lab-header__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Brand */
.lab-header__brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
}
.lab-header__logo {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}
.lab-header__logo-fun { color: var(--text); }
.lab-header__logo-lab {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 1px;
}
.lab-header__by {
    font-size: 0.72rem;
    color: var(--text-light);
}
.lab-header__by a {
    color: var(--text-muted);
    text-decoration: none;
}
.lab-header__by a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Nav */
.lab-nav { margin-left: auto; }
.lab-nav__list {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
}
.lab-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.12s, background 0.12s;
    cursor: pointer;
}
a.lab-nav__link:hover {
    color: var(--text);
    background: var(--surface-hover);
    text-decoration: none;
}
.lab-nav__link--active {
    color: var(--accent) !important;
    background: var(--accent-light) !important;
    font-weight: 600;
}
.lab-nav__link--soon {
    opacity: 0.5;
    cursor: default;
}
.lab-nav__soon-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-light);
    padding: 0.1rem 0.3rem;
    border-radius: 99px;
}

/* Hamburger */
.lab-nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
}
.lab-nav__toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ── Main wrapper ────────────────────────────────────────────── */
.lab-main {
    flex: 1;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* ── Index hero ──────────────────────────────────────────────── */
.lab-hero {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.lab-hero__eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.9rem;
}
.lab-hero__title {
    font-size: clamp(1.8rem, 5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 1rem;
}
.lab-hero__title em {
    font-style: normal;
    color: var(--accent);
}
.lab-hero__sub {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.7;
}

/* ── Section label ───────────────────────────────────────────── */
.lab-section-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

/* ── Game card grid ──────────────────────────────────────────── */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
}

.lab-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: var(--shadow);
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
    color: inherit;
    text-decoration: none;
}
a.lab-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}
.lab-card--soon {
    background: var(--surface);
    opacity: 0.65;
    cursor: default;
}
.lab-card--soon:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.lab-card__tag {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}
.lab-card--soon .lab-card__tag { color: var(--text-light); }

.lab-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}
.lab-card__desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}
.lab-card__arrow {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.25rem;
}
.lab-card--soon .lab-card__arrow { color: var(--text-light); }

/* ── Footer ──────────────────────────────────────────────────── */
.lab-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem 2.5rem;
    margin-top: auto;
}
.lab-footer__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Embed block */
.lab-footer__embed-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.lab-footer__embed-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-width: 700px;
    background: var(--bg);
}
.lab-footer__embed-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    border: none;
    outline: none;
    padding: 0.6rem 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
    user-select: all;
    min-width: 0;
}
.lab-footer__copy-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--text);
    color: var(--bg);
    border: none;
    border-left: 1px solid var(--border-strong);
    padding: 0 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s;
    white-space: nowrap;
}
.lab-footer__copy-btn:hover { background: var(--accent); }
.lab-footer__copy-btn.--copied { background: var(--success); }

/* Bottom strip */
.lab-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}
.lab-footer__bottom a {
    color: var(--text-muted);
    text-decoration: none;
}
.lab-footer__bottom a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.lab-footer__cta {
    font-weight: 600;
    color: var(--accent) !important;
}
.lab-footer__cta:hover { text-decoration: underline !important; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
    .lab-nav__toggle { display: flex; }

    .lab-header { position: relative; }

    .lab-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 2px solid var(--text);
        padding: 0.75rem 1.5rem 1rem;
        box-shadow: var(--shadow-md);
        z-index: 99;
    }
    .lab-nav.--open { display: block; }
    .lab-nav__list { flex-direction: column; align-items: flex-start; gap: 0; }
    .lab-nav__link { width: 100%; padding: 0.55rem 0.5rem; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .lab-footer__embed-row { flex-direction: column; }
    .lab-footer__copy-btn { padding: 0.65rem; border-left: none; border-top: 1px solid var(--border-strong); }
    .lab-footer__bottom { flex-direction: column; align-items: flex-start; }
}
