/* ---------- Common scene container ---------- */
.scene {
    position: absolute;
    inset: 0;
    padding: clamp(14px, 2.4vw, 28px);
    color: var(--phosphor);
    font-family: var(--font-amstrad);
    font-size: clamp(14px, 1.6vw, 18px);
    line-height: 1.45;
    text-shadow:
        0 0 3px var(--text-glow),
        0 0 8px var(--text-glow-far);
    overflow: hidden;
    z-index: 10;
    transition: opacity 0.35s ease;
}

.scene[hidden] { display: none; }

/* ---------- Scene 1: Boot ---------- */
.scene-boot { font-family: var(--font-amstrad); }

.boot-output {
    margin: 0;
    padding: 0;
    white-space: pre;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.boot-input {
    margin-top: 0;
}

.prompt-line {
    display: inline;
    word-break: break-all;
}

.cursor {
    display: inline-block;
    width: 0.6em;
    margin-left: 1px;
    transform: translateY(0.05em);
    animation: cursor-blink 0.6s steps(1) infinite;
}

.cursor.solid { animation: none; }

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

.cat-entry.tappable {
    cursor: pointer;
    color: #ffd84a;
    text-shadow:
        0 0 4px rgba(255, 216, 74, 0.6),
        0 0 10px rgba(255, 216, 74, 0.3);
    animation: cat-tap-pulse 1.3s steps(2) infinite;
    -webkit-tap-highlight-color: rgba(255, 216, 74, 0.35);
    border-radius: 2px;
}

.cat-entry.tappable:active,
.cat-entry.tappable:focus {
    background: rgba(255, 216, 74, 0.25);
    outline: none;
}

@keyframes cat-tap-pulse {
    50% { filter: brightness(1.45); }
}

/* ---------- Scene 2: Loading ---------- */
.scene-loading {
    padding: 0;
}

.loading-border {
    position: absolute;
    inset: 0;
    background: #ff0000;
    animation: tape-flicker 0.18s steps(1) infinite;
    z-index: 1;
}

.scene-loading.disc .loading-border {
    animation: disc-flicker 0.05s steps(1) infinite;
}

@keyframes tape-flicker {
    0%   { background: #ff2200; }
    9%   { background: #ffe800; }
    18%  { background: #00ff44; }
    27%  { background: #00e8ff; }
    36%  { background: #2244ff; }
    45%  { background: #ff22cc; }
    54%  { background: #ffffff; }
    63%  { background: #000000; }
    72%  { background: #ff8800; }
    81%  { background: #88ff00; }
    90%  { background: #0088ff; }
    100% { background: #ff0044; }
}

@keyframes disc-flicker {
    0%   { background: #00aa44; }
    50%  { background: #002211; }
    100% { background: #00aa44; }
}

.loading-inner {
    position: absolute;
    inset: clamp(20px, 4vw, 40px);
    background: #000;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 28px);
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.8),
        0 0 0 2px rgba(0,0,0,0.5);
}

/* The "card" holds title + logo + company. The line-by-line reveal
   (clip-path with steps) clips it from the bottom, so the visible band
   grows from top to bottom in chunks — like Amstrad tape data being
   decoded a row at a time. */
.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 3vw, 36px);
    clip-path: inset(0 0 100% 0);
}

.loading-card.reveal {
    animation: tape-reveal var(--reveal-duration, 6s) steps(40) forwards;
}

@keyframes tape-reveal {
    to { clip-path: inset(0 0 0 0); }
}

.loading-title {
    margin: 0;
    color: #00d8ff;                      /* Amstrad-like bright cyan */
    font-family: var(--font-amstrad);
    font-size: clamp(22px, 4.6vw, 56px);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
    text-shadow:
        2px 2px 0 #ff2266,               /* magenta hard-shadow, 1-pixel offset */
        4px 4px 0 #000;
}

.loading-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1vw, 12px);
}

.loading-logo {
    width: clamp(72px, 12vw, 140px);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: contrast(1.05) saturate(1.15);
}

.loading-company {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-amstrad);
    font-size: clamp(13px, 1.7vw, 20px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #00d8ff;
}

.loading-status {
    position: absolute;
    bottom: clamp(10px, 2vw, 18px);
    left: 0;
    right: 0;
    text-align: center;
    color: #ffd84a;                      /* Amstrad-ish yellow */
    font-family: var(--font-amstrad);
    font-size: clamp(11px, 1.3vw, 15px);
    letter-spacing: 0.06em;
}

/* ---------- Scene 3: CV ---------- */
.scene-cv {
    display: flex;
    flex-direction: column;
}

.cv-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
    /* Custom scrollbar to feel CRT-ish */
    scrollbar-width: thin;
    scrollbar-color: var(--phosphor-dim) transparent;
}

.cv-scroll::-webkit-scrollbar { width: 8px; }
.cv-scroll::-webkit-scrollbar-thumb {
    background: var(--phosphor-dim);
    border-radius: 4px;
}

.cv-section { margin-bottom: 1.4em; }

.cv-h1 {
    font-size: 1.35em;
    margin: 0 0 0.1em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cv-sub {
    margin: 0 0 0.8em;
    color: var(--phosphor-dim);
}

.cv-h2 {
    font-size: 1.05em;
    margin: 0 0 0.2em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cv-h2::before { content: '> '; }

.cv-rule {
    border: 0;
    border-top: 1px dashed var(--phosphor-dim);
    margin: 0 0 0.6em;
}

.cv-item { margin-bottom: 0.7em; }

.cv-item-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5em;
    font-weight: bold;
}

.cv-item-meta {
    color: var(--phosphor-dim);
    font-style: normal;
}

.cv-item-desc {
    margin-top: 0.15em;
    color: var(--phosphor);
}

.cv-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.2em 1em;
}

.cv-list li::before { content: '• '; color: var(--phosphor-dim); }

.cv-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0.2em 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.cv-bullet-list li {
    padding-left: 1.1em;
    text-indent: -1.1em;
}

.cv-bullet-list li::before {
    content: '› ';
    color: var(--phosphor-dim);
}

.cv-h3 {
    font-size: 0.95em;
    margin: 1em 0 0.3em;
    color: var(--phosphor-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ---------- Blog ---------- */
.blog-link {
    color: var(--phosphor);
    text-decoration: underline;
}
.blog-link:hover { filter: brightness(1.3); }

.blog-body {
    margin-top: 0.4em;
}
.blog-body p { margin: 0.6em 0; }
.blog-body h1, .blog-body h2, .blog-body h3 {
    margin: 1.1em 0 0.3em;
    letter-spacing: 0.03em;
}
.blog-body h1 { font-size: 1.2em; text-transform: uppercase; }
.blog-body h2 { font-size: 1.05em; color: var(--phosphor); }
.blog-body h2::before { content: '> '; color: var(--phosphor-dim); }
.blog-body h3 { font-size: 0.95em; color: var(--phosphor-dim); }

.blog-body ul, .blog-body ol {
    margin: 0.4em 0 0.6em;
    padding-left: 1.4em;
}
.blog-body li { margin: 0.15em 0; }

.blog-body a {
    color: var(--phosphor);
    text-decoration: underline;
}

.blog-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0 4px;
    border-radius: 2px;
    font-family: var(--font-amstrad);
}
.blog-body pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-left: 2px solid var(--phosphor-dim);
    overflow-x: auto;
    margin: 0.6em 0;
}
.blog-body pre code {
    background: transparent;
    padding: 0;
    white-space: pre;
}

.blog-body blockquote {
    margin: 0.6em 0;
    padding: 0.2em 0 0.2em 0.9em;
    border-left: 2px solid var(--phosphor-dim);
    color: var(--phosphor-dim);
    font-style: italic;
}

.blog-back {
    display: inline-block;
    margin-top: 1.2em;
}

.cv-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 1.4em;
    color: var(--phosphor-dim);
}

.cv-contact-list a { color: var(--phosphor); text-decoration: underline; }

.cv-actions {
    display: flex;
    gap: 1.2em;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px dashed var(--phosphor-dim);
    margin-top: 12px;
}

.cv-btn {
    color: var(--phosphor);
    text-decoration: none;
    font-family: var(--font-amstrad);
    font-size: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: filter 0.15s ease, text-shadow 0.15s ease;
}

.cv-btn:hover, .cv-btn:focus {
    filter: brightness(1.3);
    text-shadow:
        0 0 4px var(--phosphor),
        0 0 14px var(--text-glow);
    outline: none;
}
