/* RenderCode Academy - Main Styles */

/* Custom scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* Accessibility - Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth transitions — only on interactive elements, not every element */
a, button, input, textarea, select,
.btn, .nav-link, .mobile-nav-link, .lesson-item,
.course-card, .stat-card, .pricing-card, .lang-pill,
.outcome-item, [class*="hover:"] {
    transition-property: color, background-color, border-color, transform, opacity, box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Focus visible styles for accessibility */
*:focus-visible {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* Button reset */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Link reset */
a {
    text-decoration: none;
    color: inherit;
}

/* Input reset */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Prevent text selection on UI elements */
button, .nav-link {
    user-select: none;
}

/* =============================================
   Module Content — High-End Technical Docs Style
   ============================================= */

/* Light mode lesson content variables */
html:not(.dark) {
    --lesson-text: #374151;
    --lesson-text-strong: #111827;
    --lesson-heading: #111827;
    --lesson-h3: #4C1D95;
    --lesson-h4: #5B21B6;
    --lesson-muted: #6B7280;
    --lesson-callout-bg: #F3F4F6;
    --lesson-callout-border: #E5E7EB;
    --lesson-code-bg: rgba(139, 92, 246, 0.08);
    --lesson-code-color: #6D28D9;
    --lesson-code-border: rgba(139, 92, 246, 0.2);
    --lesson-pre-bg: #1E1E2E;
    --lesson-pre-border: #313244;
    --lesson-pre-code: rgba(205, 214, 244, 0.9);
    --lesson-hr: #E5E7EB;
    --lesson-th-bg: #F9FAFB;
    --lesson-th-color: #111827;
    --lesson-th-border: #E5E7EB;
    --lesson-td-color: #374151;
    --lesson-td-border: rgba(229, 231, 235, 0.8);
    --lesson-link: #7C3AED;
    --lesson-link-hover: #6D28D9;
    --lesson-em: #5B21B6;
}

/* Dark mode lesson content variables */
.dark {
    --lesson-text: rgba(205, 214, 244, 0.6);
    --lesson-text-strong: rgba(205, 214, 244, 0.95);
    --lesson-heading: rgba(205, 214, 244, 0.87);
    --lesson-h3: rgba(167, 139, 250, 0.87);
    --lesson-h4: rgba(196, 181, 253, 0.87);
    --lesson-muted: #9CA3AF;
    --lesson-callout-bg: #1e1e2e;
    --lesson-callout-border: #313244;
    --lesson-code-bg: rgba(139, 92, 246, 0.12);
    --lesson-code-color: #a78bfa;
    --lesson-code-border: rgba(139, 92, 246, 0.2);
    --lesson-pre-bg: #181825;
    --lesson-pre-border: #313244;
    --lesson-pre-code: rgba(205, 214, 244, 0.9);
    --lesson-hr: #313244;
    --lesson-th-bg: #1e1e2e;
    --lesson-th-color: rgba(205, 214, 244, 0.87);
    --lesson-th-border: #313244;
    --lesson-td-color: rgba(205, 214, 244, 0.6);
    --lesson-td-border: rgba(49, 50, 68, 0.5);
    --lesson-link: #a78bfa;
    --lesson-link-hover: #c4b5fd;
    --lesson-em: rgba(196, 181, 253, 0.8);
}

.lesson-content {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: clamp(0.9rem, 1vw + 0.5rem, 1.05rem) !important;
    line-height: 1.7 !important;
    color: var(--lesson-text) !important;
    max-width: 70ch;
}

/* ── Headings ── */
.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4 {
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: var(--lesson-heading) !important;
    margin-top: 2.5rem !important;
    margin-bottom: 0.75rem !important;
}

.lesson-content h1 {
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2rem) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.25) !important;
    padding-bottom: 0.5rem !important;
}

/* H2 — left-border accent, more top margin */
.lesson-content h2 {
    font-size: clamp(1.2rem, 2vw + 0.3rem, 1.5rem) !important;
    margin-top: 3rem !important;
    padding-left: 0.875rem !important;
    border-left: 3px solid #8b5cf6 !important;
    border-bottom: none !important;
}

.lesson-content h3 {
    font-size: clamp(1rem, 1.5vw + 0.25rem, 1.2rem) !important;
    color: var(--lesson-h3) !important;
}

.lesson-content h4 {
    color: var(--lesson-h4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    font-size: 0.8rem !important;
}

/* ── Body text ── */
.lesson-content p {
    margin-bottom: 1.1rem !important;
    color: var(--lesson-text) !important;
}

/* ── Custom bullet lists ── */
.lesson-content ul {
    list-style: none !important;
    margin: 0.75rem 0 1.25rem 0 !important;
    padding: 0 !important;
}

.lesson-content ul li {
    position: relative !important;
    padding-left: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    color: var(--lesson-text) !important;
}

.lesson-content ul li::before {
    content: '▹' !important;
    position: absolute !important;
    left: 0 !important;
    color: #8b5cf6 !important;
    font-size: 0.9em !important;
    line-height: 1.7 !important;
}

.lesson-content ol {
    list-style: decimal !important;
    margin: 0.75rem 0 1.25rem 1.5rem !important;
    padding: 0 !important;
}

.lesson-content ol li {
    margin-bottom: 0.5rem !important;
    padding-left: 0.25rem !important;
    color: var(--lesson-text) !important;
}

/* ── Callout card — Learning Objectives ── */
.lesson-content .learning-objectives,
.lesson-content blockquote {
    background: var(--lesson-callout-bg) !important;
    border: 1px solid var(--lesson-callout-border) !important;
    border-radius: 0.5rem !important;
    padding: 1.25rem 1.5rem !important;
    margin: 1.5rem 0 !important;
    color: var(--lesson-text) !important;
    font-style: normal !important;
}

.lesson-content blockquote {
    border-left: 3px solid #8b5cf6 !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

/* ── Inline code ── */
.lesson-content code {
    background: var(--lesson-code-bg) !important;
    color: var(--lesson-code-color) !important;
    padding: 0.15rem 0.45rem !important;
    border-radius: 4px !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
    font-size: 0.85em !important;
    border: 1px solid var(--lesson-code-border) !important;
}

/* ── Code blocks ── */
.lesson-content pre {
    background: var(--lesson-pre-bg) !important;
    border: 1px solid var(--lesson-pre-border) !important;
    border-radius: 0.5rem !important;
    padding: 1.25rem 1.5rem !important;
    overflow-x: auto !important;
    margin: 1.25rem 0 !important;
}

.lesson-content pre code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: var(--lesson-pre-code) !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
}

/* ── Divider ── */
.lesson-content hr {
    border: none !important;
    border-top: 1px solid var(--lesson-hr) !important;
    margin: 2rem 0 !important;
}

/* ── Inline emphasis ── */
.lesson-content strong {
    color: var(--lesson-text-strong) !important;
    font-weight: 600 !important;
}

.lesson-content em {
    color: var(--lesson-em) !important;
    font-style: italic !important;
}

/* ── Links ── */
.lesson-content a {
    color: var(--lesson-link) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    text-decoration-color: rgba(139, 92, 246, 0.4) !important;
}

.lesson-content a:hover {
    color: var(--lesson-link-hover) !important;
    text-decoration-color: rgba(139, 92, 246, 0.7) !important;
}

/* ── Tables ── */
.lesson-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9em;
}

.lesson-content th {
    background: var(--lesson-th-bg);
    color: var(--lesson-th-color);
    font-weight: 600;
    text-align: left;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--lesson-th-border);
}

.lesson-content td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--lesson-td-border);
    color: var(--lesson-td-color);
}

.lesson-content tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   DEEP COSMOS DESIGN SYSTEM — V2
   ============================================================ */

/* ── Color Tokens ── */
:root {
    /* Backgrounds */
    --plh-bg:              #FFFFFF;
    --plh-bg-secondary:    #F8FAFC;
    --plh-surface:         #F1F5F9;
    --plh-surface-raised:  #FFFFFF;
    --plh-border:          #E2E8F0;
    --plh-border-strong:   #CBD5E1;

    /* Brand — Purple = Learning, Progress, Actions */
    --plh-purple:          #7C3AED;
    --plh-purple-hover:    #6D28D9;
    --plh-purple-glow:     rgba(124, 58, 237, 0.15);
    --plh-purple-light:    #EDE9FE;

    /* Brand — Mint = Code, Terminal, Technical */
    --plh-mint:            #059669;
    --plh-mint-hover:      #047857;
    --plh-mint-glow:       rgba(5, 150, 105, 0.12);

    /* Semantic */
    --plh-streak:          #F59E0B;  /* amber  — streak fire, certificates */
    --plh-success:         #22C55E;  /* green  — test pass, lesson complete */
    --plh-danger:          #EF4444;  /* red    — errors */
    --plh-warning:         #F97316;  /* orange — warnings */
    --plh-info:            #3B82F6;  /* blue   — info */

    /* Text */
    --plh-text:            #0F172A;
    --plh-text-secondary:  #475569;
    --plh-text-muted:      #4B5563;  /* contrast-safe: 5.9:1 on white */
    --plh-text-inverse:    #F8FAFC;

    /* Code blocks — always dark regardless of theme */
    --plh-code-bg:         #0D1117;
    --plh-code-border:     #30363D;
    --plh-code-text:       #E6EDF3;
}

.dark {
    /* Deep Cosmos — night sky palette */
    --plh-bg:              #07090F;
    --plh-bg-secondary:    #0D1117;
    --plh-surface:         #161B27;
    --plh-surface-raised:  #1C2333;
    --plh-border:          #1E2A42;
    --plh-border-strong:   #2D3F5E;

    --plh-purple:          #8B5CF6;
    --plh-purple-hover:    #A78BFA;
    --plh-purple-glow:     rgba(139, 92, 246, 0.18);
    --plh-purple-light:    rgba(139, 92, 246, 0.12);

    /* Mint green on dark = terminal energy */
    --plh-mint:            #10B981;
    --plh-mint-hover:      #34D399;
    --plh-mint-glow:       rgba(16, 185, 129, 0.15);

    --plh-streak:          #FBBF24;
    --plh-success:         #4ADE80;
    --plh-danger:          #F87171;
    --plh-warning:         #FB923C;
    --plh-info:            #60A5FA;

    --plh-text:            #E6EDF3;
    --plh-text-secondary:  #8B949E;
    --plh-text-muted:      #6E7681;
    --plh-text-inverse:    #0F172A;
}

/* ── Type Scale ── */
.text-display { font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.text-h1      { font-size: clamp(2rem, 4vw, 2.5rem);   font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.text-h2      { font-size: clamp(1.5rem, 3vw, 2rem);   font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.text-h3      { font-size: clamp(1.25rem, 2.5vw, 1.5rem); font-weight: 600; line-height: 1.4; }
.text-body    { font-size: 1rem;    font-weight: 400; letter-spacing: 0.01em; line-height: 1.6; }
.text-small   { font-size: 0.875rem; font-weight: 400; letter-spacing: 0.02em; line-height: 1.5; }
.text-caption { font-size: 0.75rem;  font-weight: 500; letter-spacing: 0.04em; line-height: 1.4; }

/* Gradient text — use ONCE per page on the hero headline only */
.text-gradient {
    background: linear-gradient(135deg, var(--plh-purple), #C084FC 60%, #818CF8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Global Focus Ring ── */
*:focus-visible {
    outline: 2px solid var(--plh-purple) !important;
    outline-offset: 2px;
    border-radius: 4px;
}
*:focus:not(:focus-visible) {
    outline: none;
}

/* ── Skip Navigation Link ── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--plh-purple);
    color: white;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: top 0.2s;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
    outline: none;
}

/* ============================================================
   PAGE TRANSITION — the single cheapest quality upgrade
   ============================================================ */
@keyframes page-enter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}
.page-content {
    animation: page-enter 0.25s ease-out both;
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.1s ease-out, box-shadow 0.15s, background 0.15s, border-color 0.15s;
    user-select: none;
    will-change: transform;
}

.btn-primary {
    background: var(--plh-purple);
    color: #fff;
}
.btn-primary:hover {
    background: var(--plh-purple-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--plh-purple-glow);
}
.btn-primary:active { transform: scale(0.97); box-shadow: none; }

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--plh-border-strong);
    color: var(--plh-text);
}
.btn-secondary:hover {
    border-color: var(--plh-purple);
    background: var(--plh-purple-light);
    transform: translateY(-1px);
    color: var(--plh-purple);
}
.btn-secondary:active { transform: scale(0.97); }

.btn-success {
    background: var(--plh-success);
    color: #fff;
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-success:active { transform: scale(0.97); }

.btn-sm  { padding: 0.5rem 1rem;   font-size: 0.8125rem; border-radius: 8px; }
.btn-lg  { padding: 1rem 2rem;     font-size: 1.0625rem; }
.btn-icon {
    padding: 0.5rem;
    border-radius: 8px;
    background: transparent;
    color: var(--plh-text-secondary);
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.btn-icon:hover { background: var(--plh-surface); color: var(--plh-text); }
.btn-icon:active { transform: scale(0.92); }

/* Loading state inside button */
.btn.loading { pointer-events: none; opacity: 0.7; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn .spinner { animation: btn-spin 0.6s linear infinite; }

/* ============================================================
   COURSE CARDS
   ============================================================ */
.course-card {
    background: var(--plh-surface-raised);
    border: 1px solid var(--plh-border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s;
}
.course-card:hover {
    transform: translateY(-4px);
    border-color: var(--plh-border-strong);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.dark .course-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--plh-purple);
}
.course-card .card-cover {
    overflow: hidden;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.course-card:hover .card-cover .card-icon {
    transform: scale(1.08);
    transition: transform 0.3s ease-out;
}

/* ============================================================
   LESSON SIDEBAR STATES
   ============================================================ */
.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--plh-text-secondary);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    border-left: 2px solid transparent;
    text-decoration: none;
}
.lesson-item:hover {
    background: var(--plh-surface);
    color: var(--plh-text);
}
.lesson-item.active {
    background: var(--plh-purple-light);
    border-left-color: var(--plh-purple);
    color: var(--plh-purple);
    font-weight: 600;
}
.lesson-item.completed { color: var(--plh-success); }
.lesson-item.completed .lesson-icon { color: var(--plh-success); }
.lesson-item.locked { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.phase-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--plh-text-muted);
    padding: 1rem 0.75rem 0.375rem;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: var(--plh-surface-raised);
    border: 1px solid var(--plh-border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.stat-card .stat-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    line-height: 1;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--plh-text);
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-label  { font-size: 0.8125rem; font-weight: 500; color: var(--plh-text-muted); }
.stat-card .stat-context { font-size: 0.75rem; color: var(--plh-text-muted); margin-top: 2px; }

/* Streak card highlight */
.stat-card.streak .stat-icon { color: var(--plh-streak); }
.stat-card.streak .stat-context { color: var(--plh-streak); font-weight: 500; }

/* ============================================================
   SKELETON LOADING SCREENS
   ============================================================ */
@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position:  200% 0; }
}
.skeleton {
    background: linear-gradient(
        90deg,
        var(--plh-surface)      25%,
        var(--plh-surface-raised) 50%,
        var(--plh-surface)      75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 8px;
}
.skeleton-text  { height: 1rem;   margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; margin-bottom: 0.75rem; width: 60%; }
.skeleton-stat  { height: 5rem;   border-radius: 14px; }
.skeleton-card  { height: 12rem;  border-radius: 14px; }
.skeleton-line  { height: 0.875rem; margin-bottom: 0.4rem; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar-track {
    background: var(--plh-surface);
    border-radius: 999px;
    overflow: hidden;
    height: 8px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--plh-purple);
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.progress-bar-fill.mint { background: var(--plh-mint); }
.progress-bar-fill.streak { background: var(--plh-streak); }

/* Staggered activity bar entrance */
@keyframes bar-rise {
    from { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
    to   { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
}
.activity-bar { animation: bar-rise 0.4s ease-out both; }
.activity-bar:nth-child(1) { animation-delay: 0.00s; }
.activity-bar:nth-child(2) { animation-delay: 0.05s; }
.activity-bar:nth-child(3) { animation-delay: 0.10s; }
.activity-bar:nth-child(4) { animation-delay: 0.15s; }
.activity-bar:nth-child(5) { animation-delay: 0.20s; }
.activity-bar:nth-child(6) { animation-delay: 0.25s; }
.activity-bar:nth-child(7) { animation-delay: 0.30s; }

/* ============================================================
   LESSON COMPLETION ANIMATION
   ============================================================ */
@keyframes check-draw {
    from { stroke-dashoffset: 100; }
    to   { stroke-dashoffset: 0;   }
}
@keyframes check-appear {
    0%   { transform: scale(0.4); opacity: 0; }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1);   opacity: 1; }
}
.check-svg-animated path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: check-draw 0.4s ease-out 0.1s both;
}
.check-svg-animated {
    animation: check-appear 0.35s ease-out both;
}

/* ============================================================
   TOAST NOTIFICATION SYSTEM
   ============================================================ */
#toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
}
.toast {
    background: var(--plh-surface-raised);
    border: 1px solid var(--plh-border);
    border-radius: 12px;
    padding: 0.875rem 1.125rem;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    pointer-events: all;
    overflow: hidden;
    position: relative;
    animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.dark .toast { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.toast.removing { animation: toast-out 0.2s ease-in both; }

.toast-body {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.toast-icon   { font-size: 1.125rem; flex-shrink: 0; }
.toast-msg    { font-size: 0.875rem; font-weight: 500; color: var(--plh-text); flex: 1; }
.toast-close  { font-size: 1.25rem; line-height: 1; opacity: 0.4; cursor: pointer; padding: 0; background: none; border: none; color: inherit; }
.toast-close:hover { opacity: 0.8; }

.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2.5px;
    border-radius: 999px;
}
@keyframes toast-progress { from { width: 100%; } to { width: 0%; } }
@keyframes toast-in  {
    from { transform: translateX(calc(100% + 1.5rem)); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
    to   { transform: translateX(calc(100% + 1.5rem)); opacity: 0; }
}

/* ============================================================
   APTITUDE TIMER STATES
   ============================================================ */
.timer-display   { font-variant-numeric: tabular-nums; transition: color 0.3s; }
.timer-normal    { color: var(--plh-text); }
.timer-warning   { color: var(--plh-warning); font-weight: 600; }
.timer-critical  { color: var(--plh-danger); font-weight: 700; }
@keyframes timer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.timer-critical  { animation: timer-pulse 1s ease-in-out infinite; }

/* ============================================================
   PRICING PAGE ENHANCEMENTS
   ============================================================ */
.pricing-card {
    background: var(--plh-surface-raised);
    border: 1.5px solid var(--plh-border);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.pricing-card.popular {
    border-color: var(--plh-purple);
    box-shadow: 0 0 0 4px var(--plh-purple-glow);
    transform: scale(1.04);
    z-index: 1;
    position: relative;
}
@keyframes popular-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--plh-purple-glow); }
    50%       { box-shadow: 0 0 0 8px transparent; }
}
.pricing-card.popular { animation: popular-pulse 2.5s ease-in-out infinite; }

.savings-badge {
    display: inline-block;
    background: var(--plh-streak);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

/* ============================================================
   NAVBAR — animated underline for active link
   ============================================================ */
.nav-link-animated {
    position: relative;
    padding-bottom: 3px;
}
.nav-link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--plh-purple);
    border-radius: 999px;
    transition: width 0.2s ease-out;
}
.nav-link-animated.active::after,
.nav-link-animated:hover::after { width: 100%; }

/* Mobile menu — smooth slide */
.mobile-menu-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.mobile-menu-drawer.open { max-height: 30rem; }

/* ============================================================
   CODE OUTPUT PANEL
   ============================================================ */
.output-stdout { color: var(--plh-code-text); }
.output-stderr { color: var(--plh-warning); }
.output-error  { color: var(--plh-danger); }

@keyframes output-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60%  { transform: translateX(-5px); }
    40%, 80%  { transform: translateX(5px); }
}
.output-shake { animation: output-shake 0.35s ease-out; }

/* Language pill selector */
.lang-pills { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1.5px solid var(--plh-border);
    background: var(--plh-surface);
    color: var(--plh-text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.lang-pill:hover { border-color: var(--plh-border-strong); color: var(--plh-text); }
.lang-pill.active {
    border-color: var(--plh-mint);
    background: var(--plh-mint-glow);
    color: var(--plh-mint);
    font-weight: 600;
}

/* ============================================================
   PRO BADGE
   ============================================================ */
.badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--plh-streak), #F97316);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    border-radius: 999px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-state img { opacity: 0.8; }
.empty-state h3  { color: var(--plh-text); }
.empty-state p   { color: var(--plh-text-muted); max-width: 36ch; }

/* ============================================================
   SMOOTH SCROLLING
   ============================================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================================
   SCROLL-REVEAL ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ============================================================
   REDUCED MOTION — respect user preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration:        0.01ms !important;
        animation-iteration-count: 1      !important;
        transition-duration:       0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
