/* ═══════════════════════════════════════════
   aombk — style system
   palette: akira
   ═══════════════════════════════════════════ */

:root {
    --void:     #0a0a0c;
    --teal:     #115363;
    --teal-dim: #0c3a47;
    --mauve:    #5c4454;
    --burn:     #9c3111;
    --burn-bright: #c84420;
    --olive:    #7ea228;
    --olive-dim:#4a6118;
    --fg:       #8a8a82;
    --fg-dim:   #3a3a36;
    --fg-bright:#c5c5bd;
    --mono:     'IBM Plex Mono', 'Space Mono', monospace;
    --mono-alt: 'Space Mono', monospace;
}
body.font-plex  { --mono: 'IBM Plex Mono', monospace; }
body.font-vt323 { --mono: 'VT323', monospace; }
html:has(body.font-vt323) { font-size: 150%; }
body.font-vt323 .terminal,
body.font-vt323 .terminal-output,
body.font-vt323 .boot-lines { line-height: 1.15; }
body.font-vt323 .t-blank { height: .4em; }

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

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--void);
    font-family: var(--mono);
    color: var(--fg);
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--burn); color: var(--void); }




/* ═══ OVERLAYS ═══ */
.overlay-scan {
    position: fixed; inset: 0; z-index: 110;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(0,0,0,.28) 0px,
            rgba(0,0,0,.28) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(120,200,220,.02) 0px,
            rgba(120,200,220,.02) 2px,
            transparent 2px,
            transparent 4px
        );
    mix-blend-mode: multiply;
    animation: scanlineDrift 8s linear infinite;
}
@keyframes scanlineDrift {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 0 3px, 0 4px; }
}

/* Live moving noise — canvas-based TV static */
.overlay-noise {
    position: fixed; inset: 0; z-index: 11;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: .09;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}



/* Pixel grid — subtle shadow-mask / dot-pitch */
.overlay-pixgrid {
    position: fixed; inset: 0; z-index: 111;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            to right,
            rgba(0,0,0,.18) 0px,
            rgba(0,0,0,.18) 1px,
            transparent 1px,
            transparent 3px
        );
    mix-blend-mode: multiply;
    opacity: .6;
}

/* Effect toggles (via body classes) */
body.fx-off-scan     .overlay-scan,
body.fx-off-noise    .overlay-noise,
body.fx-off-grid     .overlay-pixgrid { display: none !important; }

body.fx-off-bloom .terminal-output,
body.fx-off-bloom .boot-lines,
body.fx-off-bloom .identity-name,
body.fx-off-bloom .page-header h1 { text-shadow: none !important; }

body.fx-off-jitter { animation: none !important; }

body {
    animation: hJitter 5.3s linear infinite;
}
@keyframes hJitter {
    0%, 96%, 100% { transform: translateY(0); }
    97%           { transform: translateY(1px); }
    98%           { transform: translateY(-1px); }
    99%           { transform: translateY(2px); }
}

/* Phosphor bloom on glowing text */
.terminal-output, .boot-lines, .identity-name, .page-header h1 {
    text-shadow:
        0 0 3px currentColor,
        0 0 10px rgba(120, 200, 220, .1);
}


/* Horizontal glitch bar — injected by JS */
.glitch-bar {
    position: fixed;
    z-index: 90;
    left: 0; width: 100%;
    pointer-events: none;
    animation: barFlash .08s steps(1) forwards;
}
@keyframes barFlash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* Full-page flip glitch */
.glitch-flip-h  { animation: flipH .22s steps(1) 1; }
.glitch-flip-v  { animation: flipV .22s steps(1) 1; }
.glitch-flip-hv { animation: flipHV .22s steps(1) 1; }
@keyframes flipH {
    0%   { transform: scaleX(-1); }
    60%  { transform: scaleX(-1); }
    100% { transform: scaleX(1); }
}
@keyframes flipV {
    0%   { transform: scaleY(-1); }
    60%  { transform: scaleY(-1); }
    100% { transform: scaleY(1); }
}
@keyframes flipHV {
    0%   { transform: scale(-1, -1); }
    60%  { transform: scale(-1, -1); }
    100% { transform: scale(1, 1); }
}

/* Jitter displacement */
.glitch-jitter {
    animation: jitter .18s steps(2) 1;
}
@keyframes jitter {
    0%   { transform: translate(-6px, 4px) skewX(2deg); }
    20%  { transform: translate(8px, -3px) skewX(-3deg); }
    45%  { transform: translate(-5px, -6px) skewX(1deg); }
    70%  { transform: translate(7px, 2px) skewX(-2deg); }
    100% { transform: translate(0, 0) skewX(0); }
}

/* RGB chromatic split */
.glitch-rgb {
    animation: rgbSplit .18s steps(3) 1;
}
@keyframes rgbSplit {
    0%   { text-shadow: -3px 0 var(--burn), 3px 0 var(--teal); filter: hue-rotate(25deg); }
    50%  { text-shadow:  4px 0 var(--burn),-4px 0 var(--teal); filter: hue-rotate(-20deg); }
    100% { text-shadow: none; filter: none; }
}

/* Slice: clip a chunk and offset it */
.glitch-slice {
    animation: slice .22s steps(4) 1;
}
@keyframes slice {
    0%   { clip-path: inset(10% 0 60% 0); transform: translate(-12px, 0); }
    25%  { clip-path: inset(55% 0 20% 0); transform: translate(10px, 0); }
    50%  { clip-path: inset(30% 0 45% 0); transform: translate(-8px, 0); }
    100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

/* Invert flash */
.glitch-invert { animation: invertFlash .08s steps(1) 1; }
@keyframes invertFlash {
    0%, 60% { filter: invert(1) hue-rotate(180deg); }
    100%    { filter: none; }
}


/* ═══ BOOT SEQUENCE ═══ */
.boot {
    position: fixed; inset: 0; z-index: 100;
    background: var(--void);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    transition: opacity .8s ease, visibility .8s;
}
.boot.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.boot-lines {
    font-family: var(--mono);
    font-size: .85rem;
    line-height: 1.8;
    color: var(--fg-dim);
    max-width: 700px;
    letter-spacing: .03em;
}
.boot-lines span {
    display: block;
    opacity: 0;
    animation: bootLine .15s ease forwards;
}
.boot-lines .boot-ok { color: var(--olive-dim); }
.boot-lines .boot-err { color: var(--burn); }
.boot-lines .boot-highlight { color: var(--teal); }
@keyframes bootLine {
    to { opacity: 1; }
}


/* ═══ IDENTITY ═══ */
.identity {
    position: fixed;
    z-index: 20;
    bottom: 2rem;
    left: 2rem;
    opacity: 0;
    transition: opacity 1.5s ease;
}
.identity.visible { opacity: 1; }
.identity-name {
    font-family: var(--mono-alt);
    font-size: .95rem;
    letter-spacing: .25em;
    color: var(--fg-dim);
    text-transform: lowercase;
}




/* ═══ ESTABLISH LINK BUTTON ═══ */
.link-btn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    background: transparent;
    color: var(--fg-bright);
    font-family: var(--mono);
    font-size: 1rem;
    letter-spacing: .18em;
    padding: .9rem 1.6rem;
    border: 1px solid rgba(17, 83, 99, .45);
    cursor: pointer;
    opacity: 0;
    animation: linkBtnFadeIn 1.2s ease 1.3s forwards, linkBtnPulse 3.2s ease-in-out 2.5s infinite;
    transition: color .3s, border-color .3s, transform .3s;
}
.link-btn:hover {
    color: var(--teal);
    border-color: var(--teal);
    transform: translate(-50%, -50%) scale(1.04);
}
.link-btn.hidden {
    opacity: 0 !important;
    pointer-events: none;
    animation: none;
    transition: opacity .4s ease;
}
@keyframes linkBtnFadeIn {
    from { opacity: 0; }
    to   { opacity: .85; }
}
@keyframes linkBtnPulse {
    0%, 100% { opacity: .85; }
    50%      { opacity: .55; }
}

/* ═══ TERMINAL ═══ */
.terminal-wrap {
    position: fixed;
    inset: 0; z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}
.terminal-wrap.open {
    pointer-events: auto;
    opacity: 1;
}

.terminal {
    width: 100%;
    max-width: 960px;
    max-height: 88vh;
    background: rgba(10,10,12,.4);
    border: 1px solid rgba(17,83,99,.2);
    padding: 1.5rem;
    font-family: var(--mono);
    font-size: .85rem;
    line-height: 1.8;
    backdrop-filter: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    scrollbar-width: none;
}
.terminal-output::-webkit-scrollbar { display: none; }

.terminal-output .t-line {
    display: block;
    letter-spacing: .03em;
}
.terminal-output .t-system { color: var(--fg-dim); }
.terminal-output .t-ok      { color: var(--olive-dim); }
.terminal-output .t-err     { color: var(--burn); }
.terminal-output .t-accent  { color: var(--teal); }
.terminal-output .t-info    { color: var(--fg); }
.terminal-output .t-mauve   { color: var(--mauve); }
.terminal-output .t-input   { color: var(--fg-dim); }
.terminal-output .t-input::before { content: '> '; color: var(--olive-dim); }
.terminal-output .t-blank   { height: .8em; }
.terminal-output .t-link    {
    color: var(--teal);
    cursor: pointer;
    border-bottom: 1px solid rgba(17,83,99,.2);
    transition: border-color .2s;
}
.terminal-output .t-link:hover { border-color: var(--teal); }

.terminal-input-line {
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,.03);
    padding-top: .75rem;
    cursor: text;
}
.terminal-prompt {
    color: var(--olive-dim);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: .4rem;
}
.terminal-input-mirror {
    color: var(--fg-bright);
    font-family: var(--mono);
    font-size: .85rem;
    letter-spacing: .03em;
    white-space: pre;
}
.prompt-cursor {
    display: inline-block;
    min-width: .55em; height: 1.1em;
    background: var(--olive);
    color: #000;
    animation: cursorBlink .7s step-end infinite;
    flex-shrink: 0;
    vertical-align: text-bottom;
    text-align: center;
    line-height: 1.1em;
}
#cursor-char { font-family: var(--mono); font-size: .85rem; }
.terminal-input {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    background: none;
    border: none;
    outline: none;
    font-family: var(--mono);
    font-size: 16px; /* prevents iOS zoom on focus */
    caret-color: transparent;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}


/* ═══ HINT ═══ */
.hint {
    position: fixed;
    z-index: 30;
    bottom: 2rem;
    right: 2rem;
    font-size: .75rem;
    letter-spacing: .12em;
    color: var(--fg-dim);
    opacity: 0;
    transition: opacity 1s ease;
}
.hint.visible { opacity: .5; }
.hint.hidden { opacity: 0; }
.hint em {
    font-style: normal;
    color: var(--teal);
}


/* ═══ PAGE TRANSITION ═══ */
.transition-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: var(--void);
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}
.transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}


/* ═══ CONTENT PAGES ═══ */

/* Back button on sub-pages */
.back-btn {
    position: fixed;
    top: 2rem; left: 2rem;
    z-index: 60;
    font-family: var(--mono);
    font-size: .8rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--fg-dim);
    background: none;
    border: 1px solid rgba(255,255,255,.06);
    padding: .5rem 1rem;
    cursor: pointer;
    transition: color .3s, border-color .3s;
    text-decoration: none;
    display: inline-block;
}
.back-btn:hover {
    color: var(--teal);
    border-color: var(--teal);
}

/* Works page */
.page-content {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow-y: auto;
    padding: 5rem 2rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--teal-dim) transparent;
}
.page-content::-webkit-scrollbar { width: 2px; }
.page-content::-webkit-scrollbar-thumb { background: var(--teal-dim); }

.page-header {
    max-width: 700px;
    margin-bottom: 3rem;
}
.page-header h1 {
    font-family: var(--mono-alt);
    font-size: 1rem;
    letter-spacing: .25em;
    text-transform: lowercase;
    color: var(--fg-dim);
    margin-bottom: .5rem;
}
.page-header .page-desc {
    font-size: .8rem;
    color: var(--fg-dim);
    opacity: .5;
    letter-spacing: .05em;
}

/* Work items */
.work-list {
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.work-entry {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,.03);
    cursor: pointer;
    transition: background .3s;
}
.work-entry:hover { background: rgba(17,83,99,.04); }
.work-idx {
    font-size: .75rem;
    color: var(--teal-dim);
    letter-spacing: .1em;
}
.work-name {
    font-size: .9rem;
    color: var(--fg);
    letter-spacing: .08em;
}
.work-type {
    font-size: .75rem;
    color: var(--fg-dim);
    letter-spacing: .1em;
    text-align: right;
}

/* About content */
.about-block {
    max-width: 560px;
    margin-bottom: 3rem;
}
.about-block p {
    font-size: .9rem;
    line-height: 2;
    color: var(--fg);
    letter-spacing: .02em;
}
.about-block .about-label {
    font-size: .75rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--fg-dim);
    margin-bottom: 1rem;
    opacity: .5;
}

.about-data {
    max-width: 560px;
}
.about-row {
    display: flex;
    justify-content: space-between;
    padding: .6rem 0;
    border-bottom: 1px solid rgba(255,255,255,.03);
    font-size: .85rem;
}
.about-key { color: var(--fg-dim); letter-spacing: .1em; }
.about-val { color: var(--fg); text-align: right; }


/* ═══ RESPONSIVE ═══ */
@media (max-width: 600px) {
    .terminal-wrap { padding: 0.75rem; align-items: flex-start; padding-top: 1rem; }
    .terminal {
        padding: 0.9rem;
        font-size: .78rem;
        line-height: 1.6;
        max-width: 100%;
        max-height: calc(100dvh - 2rem);
        width: 100%;
    }
    .terminal-input-mirror { font-size: .78rem; }
    .prompt-cursor { width: .6em; height: 1em; }
    .terminal-output { padding-right: 0.25rem; }
    .identity { bottom: 1rem; left: 1rem; }
    .hint { bottom: 1rem; right: 1rem; font-size: .7rem; }
    .page-content { padding: 4rem 1.25rem 1.25rem; }
    .glitch-bar { max-height: 4px; }
}
