/* ========================================
   Terminal Website - Dark Theme
   ======================================== */

:root {
    --bg-color: #050f06;
    --terminal-bg: #060d07;
    --text-color: #a8ffb0;
    --text-muted: #4db055;
    --accent-color: #e8a020;
    --success-color: #39d353;
    --error-color: #f85149;
    --warning-color: #d29922;
    --border-color: #1a3d1e;
    --header-bg: #0a1a0b;
    --btn-bg: #0a1a0b;
    --btn-hover: #112614;
    --font-mono: 'Courier New', 'Consolas', 'Monaco', 'Liberation Mono', monospace;
    --phosphor-glow: rgba(57, 211, 83, 0.75);
}

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

html, body {
    height: 100%;
    background-color: var(--bg-color);
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.5;
}

/* ========================================
   Terminal Container
   ======================================== */

.terminal {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--terminal-bg);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow:
        inset 0 0 120px rgba(0, 0, 0, 0.55),
        inset 0 0 30px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(57, 211, 83, 0.07);
    animation: crtFlicker 9s ease-in-out infinite;
}

@keyframes crtFlicker {
    0%, 95%, 100% { opacity: 1; }
    96%  { opacity: 0.97; }
    97%  { opacity: 0.93; }
    98%  { opacity: 0.96; }
    99%  { opacity: 0.98; }
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.terminal-title {
    color: var(--text-muted);
    font-size: 14px;
}

.terminal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.terminal-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.terminal-nav-link:hover {
    color: var(--accent-color);
    background-color: var(--btn-hover);
}

/* ========================================
   Terminal Body & Output
   ======================================== */

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* CRT overlay: scanlines + rolling beam + vignette */
.crt-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;

    /* Static scanlines */
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.10) 2px,
        rgba(0, 0, 0, 0.10) 4px
    );
}

/* Rolling phosphor refresh beam */
.crt-overlay::before {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(
        transparent 0%,
        rgba(255, 255, 255, 0.025) 50%,
        transparent 100%
    );
    animation: scanRoll 7s linear infinite;
    pointer-events: none;
}

@keyframes scanRoll {
    0%   { top: -160px; }
    100% { top: 100%;   }
}

/* Vignette: darkened edges */
.crt-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 45%,
        rgba(0, 0, 0, 0.72) 100%
    );
    pointer-events: none;
}

/* Noise grain canvas */
#crt-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    opacity: 0.045;
    mix-blend-mode: screen;
}

.terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow:
        0 0 12px var(--phosphor-glow),
        0 0 4px rgba(57, 211, 83, 0.9),
        0 0 22px rgba(57, 211, 83, 0.3),
        1px 0 rgba(255, 0, 64, 0.12),
        -1px 0 rgba(0, 255, 200, 0.12);
}

.terminal-page {
    min-height: 100%;
}

.terminal-log {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

@keyframes termLine {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.output-line {
    margin-bottom: 5px;
    animation: termLine 0.08s ease forwards;
}

.output-command {
    color: var(--accent-color);
}

.output-prompt {
    color: var(--success-color);
}

.output-error {
    color: var(--error-color);
}

.output-info {
    color: var(--text-muted);
}

.output-success {
    color: var(--success-color);
}

.output-warning {
    color: var(--warning-color);
}

/* ASCII Art and Headers */
@keyframes logoSweep {
    from { background-position: 120% center; }
    to   { background-position:   0% center; }
}

@keyframes logoGlitch {
    0%, 79%, 100% {
        filter: drop-shadow(0 0 8px rgba(57, 211, 83, 0.55)) drop-shadow(0 0 2px rgba(57, 211, 83, 0.8));
        transform: none;
        opacity: 1;
    }
    80% {
        filter: drop-shadow(-4px 0 #ff0040) drop-shadow(4px 0 #00ffcc) drop-shadow(0 0 6px rgba(57,211,83,0.4));
        transform: translateX(3px);
    }
    82% {
        filter: drop-shadow(4px 0 #ff0040) drop-shadow(-4px 0 #00ffcc);
        transform: translateX(-3px);
    }
    84% {
        filter: drop-shadow(0 0 8px rgba(57, 211, 83, 0.55));
        transform: none;
    }
    86% {
        filter: drop-shadow(-2px 0 #ff0040) drop-shadow(0 0 4px rgba(57,211,83,0.3));
        transform: skewX(-3deg);
        opacity: 0.88;
    }
    88% {
        filter: drop-shadow(0 0 8px rgba(57, 211, 83, 0.55)) drop-shadow(0 0 2px rgba(57, 211, 83, 0.8));
        transform: none;
        opacity: 1;
    }
}

.ascii-art {
    background: linear-gradient(
        90deg,
        #39d353  0%,
        #a0f0b0 42%,
        #ffffff 50%,
        #a0f0b0 58%,
        #39d353 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    width: fit-content;
    margin: 0 auto 10px;
    font-size: min(calc((100vw - 40px) / 46), 20px);
    filter: drop-shadow(0 0 8px rgba(57, 211, 83, 0.55)) drop-shadow(0 0 2px rgba(57, 211, 83, 0.8));
    animation:
        logoSweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards,
        logoGlitch 6s 1.6s infinite;
}

/* ========================================
   Skill Badges
   ======================================== */

.skill-section {
    margin: 8px 0 12px 0;
}

.skill-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    padding-left: 2px;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 13px;
    font-family: var(--font-mono);
    line-height: 1.4;
    cursor: default;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.skill-badge.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.skill-badge i {
    font-size: 14px;
    color: inherit;
}

/* Core Competencies — green (mastered) */
.badge-core .skill-badge {
    color: #3fb950;
    background-color: rgba(63, 185, 80, 0.1);
    border-color: rgba(63, 185, 80, 0.35);
}

/* Skills in Development — amber (active) */
.badge-developing .skill-badge {
    color: #e8a020;
    background-color: rgba(232, 160, 32, 0.1);
    border-color: rgba(232, 160, 32, 0.35);
}

/* Targeted Skills — purple (future) */
.badge-targeted .skill-badge {
    color: #a371f7;
    background-color: rgba(163, 113, 247, 0.1);
    border-color: rgba(163, 113, 247, 0.35);
}

.chronicle-typer {
    font-size: 1.50em;
    font-family: 'VT323', var(--font-mono);
}

.title-line {
    position: relative;
    left: 0ch;
    -webkit-text-fill-color: #8b949e;
    color: #8b949e;
}

.title-typer {
    -webkit-text-fill-color: #a0f0b0;
    color: #a0f0b0;
    font-size: 1.50em;
    font-family: 'VT323', var(--font-mono);
}

.title-typer.title-glitch {
    animation: titleGlitch 0.55s forwards;
}

@keyframes titleGlitch {
    0%  { text-shadow: 0 0 6px rgba(57,211,83,0.5); }
    15% { text-shadow: -3px 0 #ff0040, 3px 0 #00ffcc, 0 0 10px rgba(57,211,83,0.3); -webkit-text-fill-color: #fff; }
    30% { text-shadow: 3px 0 #ff0040, -3px 0 #00ffcc; }
    45% { text-shadow: 0 0 8px rgba(57,211,83,0.5); }
    60% { text-shadow: -2px 0 #ff0040, 0 0 6px rgba(57,211,83,0.3); transform: skewX(-3deg); -webkit-text-fill-color: #a0f0b0; }
    80% { text-shadow: 2px 0 #00ffcc, 0 0 4px rgba(57,211,83,0.4); transform: skewX(1deg); }
    100% { text-shadow: 0 0 6px rgba(57,211,83,0.5); transform: none; }
}

@keyframes neonSlideIn {
    /* Phase 1: width slides open, text invisible */
    0%   { max-width: 0;    opacity: 0; text-shadow: none; }
    20%  { max-width: 4em;  opacity: 0; text-shadow: none; }
    /* Phase 2: struggling bulb — quick bright bursts */
    24%  { opacity: 1;   text-shadow: 0 0 10px #a0f0b0, 0 0 22px #39d353; }
    27%  { opacity: 0;   text-shadow: none; }
    30%  { opacity: 1;   text-shadow: 0 0 12px #a0f0b0, 0 0 26px #39d353; }
    33%  { opacity: 0;   text-shadow: none; }
    36%  { opacity: 1;   text-shadow: 0 0 10px #a0f0b0, 0 0 20px #39d353; }
    39%  { opacity: 0;   text-shadow: none; }
    /* Phase 3: catches and settles */
    43%  { opacity: 1;   text-shadow: 0 0 12px #a0f0b0, 0 0 20px #39d353; }
    55%  { opacity: 0.85; text-shadow: 0 0 6px #a0f0b0; }
    100% { max-width: 4em; opacity: 1; text-shadow: 0 0 4px #a0f0b0; }
}

.neon-api {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    -webkit-text-fill-color: #a0f0b0;
    animation: neonSlideIn 2.6s forwards;
}

.section-header {
    color: var(--success-color);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
    margin: 15px 0 10px 0;
}

.terminal-command-footer {
    margin-top: 24px;
}

.terminal-command-footer.footer-pending {
    opacity: 0;
    pointer-events: none;
}

.terminal-command-footer.footer-visible {
    opacity: 1;
}

.terminal-command-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.terminal-command-list span {
    opacity: 1;
}

.footer-pending .terminal-command-list span {
    opacity: 0;
}

.terminal-command-list span.cmd-visible {
    animation: termLine 0.12s ease forwards;
}

/* Links in terminal */
.terminal-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
}

.terminal-link:hover {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

/* ========================================
   Input Line
   ======================================== */

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
    position: relative;
    cursor: text;
    opacity: 0;
}

.terminal-input-line.input-visible {
    animation: termLine 0.5s ease forwards;
}

.prompt {
    color: var(--success-color);
    margin-right: 10px;
    white-space: nowrap;
    text-shadow:
        0 0 10px var(--phosphor-glow),
        0 0 3px rgba(57, 211, 83, 0.9);
}

.input-mirror {
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 16px;
    white-space: pre;
    text-shadow:
        0 0 8px var(--phosphor-glow),
        0 0 2px rgba(57, 211, 83, 0.85);
}

.terminal-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.cursor {
    color: var(--success-color);
    animation: blink 1s step-end infinite;
    text-shadow:
        0 0 14px var(--phosphor-glow),
        0 0 5px #39d353,
        0 0 2px #a8ffb0;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================
   Content Styling (Terminal)
   ======================================== */

.project-item {
    margin: 15px 0;
    padding: 10px;
    border-left: 2px solid var(--accent-color);
    background-color: rgba(88, 166, 255, 0.05);
}

.project-title {
    color: var(--accent-color);
    font-weight: bold;
}

.project-desc {
    color: var(--text-muted);
    margin: 5px 0;
}

.project-tech {
    color: var(--warning-color);
    font-size: 14px;
}

.home-welcome {
    opacity: 0;
}

.project-internal {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding: 2px 9px;
    border-radius: 4px;
    border: 1px solid rgba(210, 153, 34, 0.4);
    background-color: rgba(210, 153, 34, 0.1);
    color: var(--warning-color);
    font-size: 12px;
    font-family: var(--font-mono);
    cursor: default;
    position: relative;
    vertical-align: middle;
}

.project-internal::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--header-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: var(--font-mono);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.project-internal:hover::after {
    opacity: 1;
}

.project-github {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding: 2px 9px;
    border-radius: 4px;
    border: 1px solid rgba(232, 160, 32, 0.4);
    background-color: rgba(232, 160, 32, 0.08);
    color: var(--accent-color);
    font-size: 12px;
    font-family: var(--font-mono);
    text-decoration: none;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.project-github:hover {
    background-color: rgba(232, 160, 32, 0.18);
    border-color: rgba(232, 160, 32, 0.7);
    color: var(--accent-color);
}

.contact-item {
    margin: 8px 0;
}

.contact-label {
    color: var(--text-muted);
    display: inline-block;
    min-width: 100px;
}

/* ========================================
   Contact Cards
   ======================================== */

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    position: relative;
}

.contact-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-left: 2px solid var(--accent-color);
    background-color: rgba(232, 160, 32, 0.04);
    color: var(--text-color);
    font-family: var(--font-mono);
    text-decoration: none;
    position: relative;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
    outline: none;
}

.contact-card:hover {
    background-color: rgba(232, 160, 32, 0.10);
    border-left-color: var(--success-color);
    transform: translateX(2px);
}

.contact-card:focus-visible {
    background-color: rgba(57, 211, 83, 0.08);
    border-left-color: var(--success-color);
}

.contact-card:focus-visible::before {
    content: '> ';
    position: absolute;
    left: -14px;
    color: var(--success-color);
    text-shadow: 0 0 6px var(--phosphor-glow);
}

.contact-card:focus-visible::after {
    content: ' <';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color);
    text-shadow: 0 0 6px var(--phosphor-glow);
}

.status-led {
    width: 0.7em;
    height: 0.7em;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow:
        0 0 4px var(--success-color),
        0 0 10px rgba(57, 211, 83, 0.7);
    display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
    .status-led {
        animation: ledPulse 1.6s ease-in-out infinite;
    }
}

@keyframes ledPulse {
    0%, 100% {
        opacity: 0.85;
        box-shadow:
            0 0 4px var(--success-color),
            0 0 8px rgba(57, 211, 83, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow:
            0 0 6px var(--success-color),
            0 0 18px rgba(57, 211, 83, 0.9);
    }
}

.card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.card-prefix {
    color: var(--success-color);
    font-size: 13px;
    opacity: 0.65;
}

.card-target {
    color: var(--accent-color);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-action {
    color: var(--text-muted);
    font-size: 12px;
    border: 1px solid rgba(77, 176, 85, 0.4);
    padding: 2px 8px;
    border-radius: 3px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.contact-card:hover .card-action,
.contact-card:focus-visible .card-action {
    color: var(--success-color);
    border-color: var(--success-color);
}

.copy-toast {
    position: absolute;
    right: 14px;
    transform: translate(8px, -50%);
    background-color: var(--header-bg);
    color: var(--success-color);
    border: 1px solid var(--success-color);
    border-radius: 3px;
    padding: 3px 9px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
    z-index: 5;
}

.copy-toast.is-visible {
    opacity: 1;
    transform: translate(0, -50%);
}

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

/* Mobile contact cards: simpler spacing, full-width */
.mobile-page .contact-cards {
    margin: 12px 0;
}

.mobile-page .contact-card {
    padding: 12px 14px;
    font-size: 14px;
}

.mobile-page .card-prefix {
    display: none;
}

/* Table-like formatting */
.info-row {
    display: flex;
    margin: 5px 0;
}

.info-label {
    color: var(--warning-color);
    min-width: 150px;
}

.info-value {
    color: var(--text-color);
}

/* ========================================
   Scrollbar Styling
   ======================================== */

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   Desktop/Mobile Visibility
   ======================================== */

.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* ========================================
   Mobile App UI
   ======================================== */

.mobile-app {
    display: none;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-color);
    overflow: hidden;
}

/* Portrait: Rotate Prompt */
.rotate-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-align: center;
    padding: 20px;
}

.rotate-icon {
    font-size: 64px;
    color: var(--accent-color);
    animation: rotateHint 2s ease-in-out infinite;
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    50%       { transform: rotate(90deg); }
}

/* Landscape: Main Layout */
.mobile-landscape {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 16px 20px 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Shrink the ASCII art for mobile (scoped so desktop is unaffected) */
.mobile-app .ascii-art {
    font-size: min(calc((100vw - 32px) / 64), 14px);
    line-height: 1.2;
    margin: 0 auto;
}

/* Mobile Content */
.mobile-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.mobile-page {
    display: none;
    animation: fadeIn 0.2s ease;
}

.mobile-page.active {
    display: block;
}

/* Home page: center the intro vertically within the available area */
.mobile-page#page-home {
    text-align: center;
}

.mobile-page#page-home.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

/* Bump the intro typer sizes on mobile home for legibility */
.mobile-page#page-home .chronicle-typer,
.mobile-page#page-home .title-typer {
    font-size: 1.35em;
}

.mobile-page#page-home .home-welcome {
    margin-top: 10px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 1.5;
}

.mobile-page .lead {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.mobile-page p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.mobile-project {
    border-left: 2px solid var(--accent-color);
    padding-left: 12px;
    margin-bottom: 16px;
}

.mobile-project h3 {
    color: var(--accent-color);
    font-size: 13px;
    margin-bottom: 4px;
}

.mobile-project p {
    margin-bottom: 4px;
}

.mobile-tech {
    font-size: 11px;
    color: var(--text-muted);
}

.mobile-link {
    color: var(--accent-color);
    text-decoration: none;
}

.mobile-link:hover {
    text-decoration: underline;
}

/* ========================================
   Command Pad — bottom-docked nav
   ======================================== */

.command-pad {
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    background-color: var(--header-bg);
    padding: 10px 14px 12px;
    margin: 8px -20px 0;
}

.pad-prompt {
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.4;
    min-height: 1.4em;
    color: var(--text-color);
    text-shadow:
        0 0 8px var(--phosphor-glow),
        0 0 2px rgba(57, 211, 83, 0.85);
}

.pad-prompt .prompt {
    color: var(--success-color);
    margin-right: 8px;
    white-space: nowrap;
}

.pad-input-mirror {
    color: var(--text-color);
    white-space: pre;
}

.pad-cursor {
    color: var(--success-color);
    margin-left: 1px;
    animation: blink 1s step-end infinite;
}

.pad-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.pad-key {
    min-height: 44px;
    padding: 10px 6px;
    background-color: var(--btn-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
    cursor: pointer;
    text-shadow:
        0 0 8px var(--phosphor-glow),
        0 0 2px rgba(57, 211, 83, 0.6);
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.08s ease;
    -webkit-tap-highlight-color: transparent;
}

.pad-key:hover,
.pad-key:focus-visible {
    color: var(--text-color);
    border-color: var(--accent-color);
    outline: none;
}

.pad-key.active {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: var(--btn-hover);
}

.pad-key:active {
    transform: scale(0.97);
}

.pad-key[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.55;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
}


/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none !important;
}

.text-accent { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }

/* ========================================
   Blog
   ======================================== */

.blog-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 18px 0;
}

.blog-search {
    width: 100%;
    background-color: var(--header-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease;
}

.blog-search:focus {
    border-color: var(--accent-color);
}

.blog-search::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 4px;
    border: 1px solid rgba(63, 185, 80, 0.35);
    background-color: rgba(63, 185, 80, 0.08);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.blog-tag:hover,
.blog-tag:focus-visible {
    color: var(--accent-color);
    border-color: var(--accent-color);
    outline: none;
}

.blog-tag.is-active {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: rgba(232, 160, 32, 0.10);
}

.blog-tag.is-mini {
    padding: 2px 8px;
    font-size: 11px;
    cursor: default;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--accent-color);
    border-radius: 4px;
    background-color: rgba(10, 26, 11, 0.55);
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
    cursor: pointer;
}

.post-item:hover,
.post-item:focus-visible {
    border-color: var(--accent-color);
    background-color: var(--btn-hover);
    outline: none;
}

.post-item:active {
    transform: scale(0.997);
}

.post-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.post-date { color: var(--text-muted); }
.post-meta { color: var(--text-muted); opacity: 0.85; }

.post-title {
    color: var(--accent-color);
    font-size: 15px;
    margin-bottom: 4px;
}

.post-summary {
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.blog-empty,
.blog-loading,
.blog-error {
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
}

.blog-footer {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    font-size: 12px;
}

.terminal-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
}

.terminal-link:hover {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

/* ---- Single post ---- */

.post-back {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    margin: 6px 0 12px 0;
    cursor: pointer;
}

.post-back:hover,
.post-back:focus-visible {
    color: var(--accent-color);
    outline: none;
}

.post-article {
    padding: 4px 0 8px 0;
}

.post-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.post-headline {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 6px;
}

.post-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.post-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-color);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
    color: var(--accent-color);
    margin: 22px 0 10px 0;
    font-weight: normal;
    line-height: 1.3;
}

.post-body h1 { font-size: 19px; }
.post-body h2 { font-size: 17px; }
.post-body h3 { font-size: 15px; }
.post-body h4 { font-size: 14px; color: var(--text-color); }

.post-body p {
    margin: 0 0 12px 0;
}

.post-body a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
}

.post-body a:hover {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

.post-body ul,
.post-body ol {
    margin: 0 0 12px 22px;
}

.post-body li {
    margin-bottom: 4px;
}

.post-body blockquote {
    margin: 12px 0;
    padding: 8px 14px;
    border-left: 2px solid var(--accent-color);
    background-color: rgba(232, 160, 32, 0.06);
    color: var(--text-muted);
    font-style: italic;
}

.post-body blockquote p:last-child {
    margin-bottom: 0;
}

.post-body code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    padding: 1px 6px;
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--success-color);
}

.post-body pre {
    position: relative;
    margin: 14px 0;
    padding: 12px 14px;
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--success-color);
    border-radius: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
    line-height: 1.55;
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 10px 0;
}

.post-body hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 22px 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.post-body th,
.post-body td {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-body th {
    background-color: var(--header-bg);
    color: var(--accent-color);
    font-weight: normal;
}

.post-body iframe {
    max-width: 100%;
    margin: 12px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.code-copy {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.post-body pre:hover .code-copy,
.code-copy:focus-visible {
    opacity: 1;
}

.code-copy:hover {
    color: var(--accent-color);
    background-color: var(--btn-hover);
}

/* highlight.js — CRT phosphor theme */
.hljs               { color: var(--text-color); background: transparent; }
.hljs-comment,
.hljs-quote         { color: var(--text-muted); font-style: italic; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag           { color: var(--accent-color); }
.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition      { color: var(--success-color); }
.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-attr,
.hljs-selector-pseudo { color: var(--warning-color); }
.hljs-variable,
.hljs-attr,
.hljs-params        { color: var(--text-color); }
.hljs-deletion      { color: var(--error-color); }
.hljs-emphasis      { font-style: italic; }
.hljs-strong        { font-weight: bold; }

/* Mobile blog overrides */
.mobile-page .blog-search { font-size: 13px; padding: 8px 10px; }
.mobile-page .post-item { padding: 10px 12px; }
.mobile-page .post-headline { font-size: 18px; }
.mobile-page .post-body { font-size: 13px; line-height: 1.6; }
.mobile-page .post-body pre { font-size: 12px; }
.mobile-page .blog-tag { min-height: 28px; padding: 4px 10px; }
.mobile-page .code-copy { opacity: 1; }

