/* a6c.dev -- phosphor meditation
   palette: #0A0E14 #00FF41 #0D1117 #1A1E26 #FF6B35 #58A6FF #D4A84B
   fonts:   IBM Plex Mono / IBM Plex Sans / IBM Plex Serif
*/

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

:root {
    --void:        #0A0E14;
    --buffer:      #0D1117;
    --divider:     #1A1E26;
    --phosphor:    #00FF41;
    --stderr:      #FF6B35;
    --pipe:        #58A6FF;
    --gold:        #D4A84B;

    --phos-100:    rgba(0, 255, 65, 1);
    --phos-70:     rgba(0, 255, 65, 0.70);
    --phos-40:     rgba(0, 255, 65, 0.40);
    --phos-15:     rgba(0, 255, 65, 0.15);
    --phos-08:     rgba(0, 255, 65, 0.08);
    --phos-03:     rgba(0, 255, 65, 0.03);
    --phos-06:     rgba(0, 255, 65, 0.06);

    --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --sans:  'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    --serif: 'IBM Plex Serif', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
    background: var(--void);
    color: var(--phos-70);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Phosphor aging -- subtle hue drift across the day */
@keyframes phosphor-age {
    0%   { filter: hue-rotate(0deg) brightness(1); }
    50%  { filter: hue-rotate(-4deg) brightness(0.97); }
    100% { filter: hue-rotate(0deg) brightness(1); }
}
body { animation: phosphor-age 240s ease-in-out infinite; }

/* Scanline overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.06) 2px,
        rgba(0,0,0,0.06) 4px
    );
    mix-blend-mode: multiply;
}

/* Generative noise canvas */
#noise-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

/* Scroll progress cursor in the left margin */
#scroll-cursor {
    position: fixed;
    left: 14px;
    top: 0;
    width: 2px;
    height: 14px;
    background: var(--phosphor);
    box-shadow: 0 0 8px var(--phos-70);
    z-index: 50;
    transition: top 80ms linear, opacity 200ms ease;
    opacity: 0.7;
}

/* Stack of panes */
#stack {
    position: relative;
    z-index: 1;
    scroll-snap-type: y proximity;
}

.pane {
    min-height: 100vh;
    width: 100%;
    padding: 8vh clamp(20px, 6vw, 90px) 8vh clamp(40px, 8vw, 120px);
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: stretch;
}

.pane:nth-child(odd of .pane) {
    background: var(--void);
}
.pane:nth-child(even of .pane) {
    background: var(--buffer);
}
/* Fallback color alternation since :nth-child(odd of) is newer */
#pane-about, #pane-projects, #pane-colophon { background: var(--buffer); }
#pane-hero, #pane-stats, #pane-thoughts { background: var(--void); }

.pane-content {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    align-self: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 700ms ease, transform 700ms ease;
}
.pane.visible .pane-content {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HERO PANE ===== */
.hero-content {
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.boot-line {
    font-family: var(--mono);
    color: var(--phos-40);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}
.prompt-glyph {
    color: var(--phosphor);
    margin-right: 0.5em;
}
.hero-cursor-wrap { position: relative; }
.hero-title {
    font-family: var(--mono);
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: 0.05em;
    color: var(--phos-100);
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 0.4ch;
    flex-wrap: wrap;
    text-shadow: 0 0 18px rgba(0, 255, 65, 0.2);
}
.hero-typed { display: inline-block; }
.cursor-block {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--phosphor);
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.55);
    animation: blink 1s step-end infinite;
    vertical-align: -0.12em;
}
.cursor-block.small { width: 0.35em; height: 0.9em; }
@keyframes blink {
    0%, 50%   { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}
.hero-sub {
    font-family: var(--mono);
    font-weight: 300;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: var(--phos-40);
    letter-spacing: 0.05em;
    margin-top: 14px;
    min-height: 1.6em;
}
.boot-log {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--phos-40);
    margin-top: 28px;
    border-top: 1px dashed var(--phos-15);
    padding-top: 18px;
    max-width: 720px;
}
.log-line {
    line-height: 1.85;
    opacity: 0;
    transform: translateY(4px);
    animation: log-in 600ms ease forwards;
}
.boot-log .log-line:nth-child(1) { animation-delay: 1.4s; }
.boot-log .log-line:nth-child(2) { animation-delay: 1.7s; }
.boot-log .log-line:nth-child(3) { animation-delay: 2.0s; }
.boot-log .log-line:nth-child(4) { animation-delay: 2.4s; }
.boot-log .log-line:nth-child(5) { animation-delay: 2.8s; }
@keyframes log-in {
    to { opacity: 1; transform: translateY(0); }
}
.log-time { color: var(--gold); margin-right: 0.6em; }
.log-tag {
    display: inline-block;
    min-width: 4ch;
    margin-right: 0.6em;
    text-align: center;
    padding: 0 0.4em;
}
.log-tag.ok    { color: var(--phosphor); }
.log-tag.warn  { color: var(--gold); }
.log-tag.err   { color: var(--stderr); }

kbd {
    font-family: var(--mono);
    font-size: 0.85em;
    padding: 1px 6px;
    border: 1px solid var(--phos-40);
    background: rgba(0, 255, 65, 0.05);
    color: var(--phosphor);
    border-radius: 2px;
    margin: 0 2px;
}

/* ===== PANE DIVIDERS (tmux-style status bar) ===== */
.pane-divider {
    border: none;
    height: 24px;
    background: var(--divider);
    position: relative;
    margin: 0;
    z-index: 2;
    cursor: row-resize;
}
.pane-divider::before {
    content: attr(data-status);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--phos-40);
    letter-spacing: 0.05em;
}
.pane-divider:hover::after {
    content: 'pid ' attr(data-status);
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--gold);
}

/* ===== PANE HEADER ===== */
.pane-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--phos-40);
    letter-spacing: 0.04em;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.prompt-char {
    color: var(--phosphor);
    font-weight: 500;
}
.blink-soft {
    animation: blink 1s step-end infinite;
}
.pane-title {
    font-family: var(--mono);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    letter-spacing: 0.05em;
    color: var(--phos-100);
    line-height: 1.2;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.18);
}
.title-block {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--phosphor);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    animation: blink 1s step-end infinite;
}
.pane-intro {
    font-family: var(--mono);
    color: var(--phos-40);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* ===== BADGES ===== */
.badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border: 1px solid currentColor;
    text-transform: none;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-running     { color: var(--phosphor); }
.badge-deprecated  { color: var(--gold); }
.badge-error       { color: var(--stderr); }

/* ===== ABOUT ===== */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 60px;
    align-items: start;
}
.about-prose p {
    margin-bottom: 1.4em;
    color: var(--phos-70);
    max-width: 60ch;
}
.about-prose .quote {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--phos-100);
    border-left: 2px solid var(--phos-40);
    padding-left: 22px;
    line-height: 1.5;
    max-width: 28ch;
}

.ascii-box {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--phos-70);
    line-height: 1.45;
    background: var(--phos-03);
    padding: 18px 22px;
    white-space: pre;
    border: none;
    overflow-x: auto;
}
.ascii-box.small { font-size: 0.72rem; padding: 14px 18px; }

/* ===== STATS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px 60px;
    margin-bottom: 32px;
}
.stat-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-num {
    font-family: var(--mono);
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--phos-100);
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 0 14px rgba(0, 255, 65, 0.25);
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--phos-40);
    letter-spacing: 0.05em;
}
.stats-foot {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--phos-40);
    margin-top: 24px;
}
.ts { color: var(--gold); }

/* ===== PROJECTS / CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    perspective: 1000px;
}
.card {
    background: transparent;
    min-height: 240px;
    cursor: pointer;
    outline: none;
}
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 240px;
    transform-style: preserve-3d;
    transition: transform 600ms ease-in-out;
}
.card.flipped .card-inner {
    transform: rotateY(180deg);
}
.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--buffer);
    border: 1px solid var(--phos-15);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.card-face::before {
    content: '+';
    position: absolute;
    top: -1px; left: -1px;
    color: var(--phos-40);
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1;
    padding: 2px 4px;
    background: var(--buffer);
}
.card-face::after {
    content: '+';
    position: absolute;
    bottom: -1px; right: -1px;
    color: var(--phos-40);
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1;
    padding: 2px 4px;
    background: var(--buffer);
}
.card-back {
    transform: rotateY(180deg);
    background: var(--void);
    border-color: var(--phos-40);
}
.card-title {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--phos-100);
    letter-spacing: 0.03em;
}
.card-desc {
    font-family: var(--sans);
    color: var(--phos-70);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 4px;
    flex: 1;
}
.card-prompt {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--phos-40);
    letter-spacing: 0.05em;
    margin-top: auto;
}
.card-back-title {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--phos-100);
}
.card-stack {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--gold);
}
.card-back p {
    font-size: 0.9rem;
    color: var(--phos-70);
    line-height: 1.6;
}
.card-links {
    margin-top: auto;
    font-family: var(--mono);
    font-size: 0.8rem;
}

/* ===== PIPE LINKS (underline-draw) ===== */
.pipe-link {
    color: var(--pipe);
    text-decoration: none;
    background-image: linear-gradient(var(--pipe), var(--pipe));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1px;
    transition: background-size 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
    padding-bottom: 2px;
}
.pipe-link:hover,
.pipe-link:focus {
    background-size: 100% 1px;
}

/* ===== THOUGHTS / MASONRY LOG ===== */
.masonry {
    column-count: 3;
    column-gap: 20px;
}
@media (max-width: 980px) { .masonry { column-count: 2; } }
@media (max-width: 620px) { .masonry { column-count: 1; } }
.log-block {
    break-inside: avoid;
    margin: 0 0 20px;
    padding: 18px 22px;
    background: var(--phos-03);
    font-family: var(--mono);
    font-size: 0.92rem;
    color: var(--phos-70);
    line-height: 1.7;
}
.log-block:nth-child(odd) { background: var(--phos-06); }
.log-block.wide p { font-size: 0.92rem; }
.log-stamp {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--gold);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}
.log-block em {
    font-family: var(--serif);
    font-style: italic;
    color: var(--phos-100);
}

/* ===== COLOPHON ===== */
.colophon-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 60px;
    align-items: start;
    margin-bottom: 36px;
}
.colophon-prose p {
    margin-bottom: 1.4em;
    color: var(--phos-70);
    max-width: 60ch;
}
.serif-quote {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--phos-100);
    line-height: 1.5;
}
.shutdown-line {
    font-family: var(--mono);
    color: var(--phos-70);
    font-size: 1rem;
    letter-spacing: 0.04em;
    border-top: 1px dashed var(--phos-15);
    padding-top: 22px;
}

/* ===== COMMAND PALETTE TRIGGER ===== */
#palette-trigger {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 100;
    background: rgba(10, 14, 20, 0.85);
    border: 1px solid var(--phos-40);
    padding: 8px 14px;
    color: var(--phosphor);
    font-family: var(--mono);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 200ms ease, border-color 200ms ease;
}
#palette-trigger:hover {
    background: rgba(0, 255, 65, 0.08);
    border-color: var(--phosphor);
}
.trigger-glyph { font-weight: 600; }
.trigger-hint { color: var(--phos-40); font-size: 0.75rem; }

/* ===== COMMAND PALETTE DIALOG ===== */
#palette {
    position: fixed;
    left: 50%;
    bottom: 24px;
    top: auto;
    transform: translateX(-50%);
    width: min(640px, 92vw);
    max-height: 70vh;
    margin: 0;
    padding: 0;
    background: rgba(10, 14, 20, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--phos-40);
    color: var(--phos-70);
    z-index: 1000;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(0, 255, 65, 0.08);
    animation: palette-in 200ms ease-out;
}
#palette::backdrop {
    background: rgba(10, 14, 20, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
@keyframes palette-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#palette-form {
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    gap: 12px;
}
.palette-prompt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--phos-15);
    padding-bottom: 10px;
}
.palette-prompt {
    font-family: var(--mono);
    color: var(--phosphor);
    font-size: 0.95rem;
}
#palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--phos-100);
    font-family: var(--mono);
    font-size: 1rem;
    caret-color: var(--phosphor);
}
#palette-input::placeholder { color: var(--phos-40); }
.palette-caret {
    width: 0.5em;
    height: 1em;
    background: var(--phosphor);
    animation: blink 1s step-end infinite;
}
#palette-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 50vh;
    overflow-y: auto;
}
#palette-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 8px;
    font-family: var(--mono);
    font-size: 0.92rem;
    color: var(--phos-70);
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
#palette-list li:hover,
#palette-list li.active {
    background: rgba(0, 255, 65, 0.07);
    border-left-color: var(--phosphor);
    color: var(--phos-100);
}
#palette-list li.hidden { display: none; }
.cmd { color: var(--phosphor); }
.cmd-desc { color: var(--phos-40); font-size: 0.82rem; }
.palette-foot {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--phos-40);
    border-top: 1px solid var(--phos-15);
    padding-top: 10px;
    margin: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
    .about-grid,
    .colophon-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .pane { padding: 8vh clamp(20px, 5vw, 40px) 8vh clamp(28px, 6vw, 48px); }
    .pane-divider::before { font-size: 0.65rem; padding: 0 12px; }
    #scroll-cursor { left: 8px; }
}
