:root {
    color-scheme: dark;
    --bg:        #0a0a0c;
    --bg-elev:   #101015;
    --bg-hover:  #16161e;
    --line:      #1f1f2a;
    --line-strong:#2a2a38;
    --text:      #e7e9ee;
    --text-dim:  #8e93a3;
    --text-mute: #5a5f6e;
    --accent:    #67e8f9;
    --glow:      rgba(103, 232, 249, 0.10);

    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

a { color: inherit; }

/* ---------- ambient background ---------- */

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 30% 0%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 0%, #000 30%, transparent 100%);
}

.bg-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 75% 110%, var(--glow), transparent 70%);
}

/* ---------- header ---------- */

.site-header {
    padding: 2.1rem 2.5rem 1.4rem 12.5%;
    border-bottom: 1px solid var(--line);
}

.logo {
    margin: 0;
    font-size: clamp(2.3rem, 6.3vw, 4.55rem);
    font-weight: 200;
    font-style: italic;
    letter-spacing: -0.055em;
    line-height: 1.2;
    color: var(--text-dim);
    overflow: visible;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: filter 220ms ease;
}

.logo a:hover { filter: brightness(1.15); }

/* "of" stays thin/dim (inherits from .logo); "mind" gets the weight + accent gradient */
.logo .mind {
    font-weight: 600;
    color: var(--text);
    background: linear-gradient(180deg, #f5f6fa -10%, #aab3c4 55%, var(--accent) 115%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 0.3em;
    padding: 0.12em 0.18em 0.12em 0;
    display: inline-block;
}

/* ---------- layout: nav + main ---------- */

.layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    padding: 2.5rem;
    max-width: 80rem;
    width: 100%;
}

.site-nav {
    position: relative;
    border-right: 1px solid var(--line);
    padding-right: 2rem;
}

/* collapse toggle */
.nav-toggle {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 1.2rem;
    font-family: var(--mono);
    font-size: 0.95rem;
    line-height: 1;
    color: var(--text-mute);
    cursor: pointer;
    transition: color 140ms ease;
}

.nav-toggle:hover { color: var(--accent); }

/* collapsed state (class lives on <html> to avoid load flash) */
.nav-collapsed .layout { grid-template-columns: 2.2rem 1fr; }
.nav-collapsed .site-nav { padding-right: 0; }
.nav-collapsed .site-nav ol { display: none; }

.site-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: nav;
    font-family: var(--mono);
    font-size: 0.85rem;
}

.site-nav li {
    counter-increment: nav;
    margin: 0 0 0.6rem;
}

.site-nav a {
    color: var(--text-dim);
    text-decoration: none;
    display: inline-block;
    padding: 0.15rem 0;
    transition: color 140ms ease;
}

.site-nav a::before {
    content: counter(nav) ". ";
    opacity: 0.45;
    margin-right: 0.25rem;
}

.site-nav a:hover { color: var(--text); }

.site-nav a.active { color: var(--accent); }

.site-nav a.active::before { opacity: 0.8; }

/* ---------- main content ---------- */

.site-main { min-width: 0; }

/* entries on root */

.entries {
    display: grid;
    gap: 1rem;
    max-width: 52rem;
}

.entry {
    display: block;
    padding: 1.5rem 1.75rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 3px;
    text-decoration: none;
    color: inherit;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    position: relative;
    overflow: hidden;
}

/* left accent tick that grows in on hover */
.entry::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 200ms ease;
}

.entry::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 0 var(--glow);
    transition: box-shadow 220ms ease;
}

a.entry:hover {
    background: var(--bg-hover);
    border-color: var(--line-strong);
}

a.entry:hover::before { transform: scaleY(1); }
a.entry:hover::after { box-shadow: 0 0 32px 0 var(--glow); }

.entry-index {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    text-transform: lowercase;
    display: block;
    margin-bottom: 0.4rem;
}

.entry-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.015em;
}

/* locked / pending entry */

.entry--locked {
    border-style: dashed;
    border-color: var(--line-strong);
    background: transparent;
    cursor: default;
}

.entry--locked .entry-title { color: var(--text-dim); }

.entry--locked .entry-index::after {
    content: " \25C7";  /* ◇ */
    color: var(--accent);
    opacity: 0.8;
}

.countdown-row {
    display: block;
    margin-top: 0.9rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--text-mute);
}

.countdown {
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.entry--locked::after {
    content: "";
    box-shadow: none;
    animation: lockpulse 3.2s ease-in-out infinite;
}

@keyframes lockpulse {
    0%, 100% { box-shadow: inset 0 0 24px -16px var(--accent); }
    50%      { box-shadow: inset 0 0 40px -10px var(--accent); }
}

/* ---------- post page ---------- */

.post { max-width: 42rem; }

.post-title {
    margin: 0.4rem 0 1.5rem;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 500;
    letter-spacing: -0.025em;
}

.post-body {
    color: #cfd3dd;
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-body p { margin: 0 0 1.1rem; }
.post-body .muted { color: var(--text-mute); font-style: italic; }

.back {
    display: inline-block;
    margin-top: 2.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 140ms ease;
}

.back:hover { color: var(--accent); }

/* ---------- placeholder / contact pages ---------- */

.placeholder, .contact-body {
    font-family: var(--mono);
    color: var(--text-dim);
    max-width: 40rem;
}

.placeholder .status, .contact-body p {
    font-size: 1rem;
    margin: 0;
}

.placeholder .status::before {
    content: "// ";
    color: var(--accent);
    opacity: 0.7;
}

.contact-body p {
    font-size: 1.5rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.contact-body p::after {
    content: "_";
    color: var(--accent);
    margin-left: 0.15em;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- the process: pipeline ---------- */

.process-intro {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: var(--text-dim);
    margin: 0 0 2.5rem;
}

.process-intro::before { content: "// "; color: var(--accent); opacity: 0.7; }

.pipeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.stage {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    counter-increment: none;
}

/* connector line between nodes */
.stage:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.6rem;            /* center of the node */
    left: 50%;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--line-strong), var(--line));
    z-index: 0;
}

/* travelling pulse along the connector */
.stage:not(:last-child)::before {
    content: "";
    position: absolute;
    top: calc(1.6rem - 2px);
    left: 50%;
    width: 6px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px 2px var(--glow);
    z-index: 1;
    animation: flow 4s linear infinite;
}

.stage:nth-child(2)::before { animation-delay: 1s; }
.stage:nth-child(3)::before { animation-delay: 2s; }

@keyframes flow {
    0%   { transform: translateX(0);    opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.stage-node {
    position: relative;
    z-index: 2;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
    display: grid;
    place-items: center;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.stage:hover .stage-node {
    border-color: var(--accent);
    box-shadow: 0 0 24px -6px var(--glow);
}

.stage-num {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
}

.stage-name {
    margin-top: 0.9rem;
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    max-width: 8rem;
}

.stage:hover .stage-name { color: var(--text); }

.process-note {
    margin-top: 3rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-mute);
}

/* ---------- footer ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 1.25rem 2.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.site-footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 140ms ease;
}

.site-footer a:hover, .site-footer a.active { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
    .site-header { padding: 2rem 1.25rem 1.5rem; }
    .layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.25rem;
    }
    .site-nav {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding-right: 0;
        padding-bottom: 1.25rem;
    }
    .site-nav ol { display: flex; gap: 1.5rem; flex-wrap: wrap; }
    .site-nav li { margin: 0; }
    .site-footer { padding: 1rem 1.25rem; }

    /* on mobile the panel is a top bar; collapse just hides the list */
    .nav-collapsed .layout { grid-template-columns: 1fr; }
    .nav-collapsed .site-nav { border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; }
    .nav-toggle { margin-bottom: 0.8rem; }

    /* pipeline goes vertical */
    .pipeline { flex-direction: column; align-items: flex-start; gap: 0; }
    .stage {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        text-align: left;
        width: 100%;
        padding: 0.6rem 0;
    }
    .stage:not(:last-child)::after {
        top: 3.2rem;
        left: 1.6rem;
        width: 1px;
        height: 100%;
        background: linear-gradient(to bottom, var(--line-strong), var(--line));
    }
    .stage:not(:last-child)::before {
        top: 3.2rem;
        left: calc(1.6rem - 2px);
        width: 5px; height: 6px;
        animation: flowv 4s linear infinite;
    }
    @keyframes flowv {
        0% { transform: translateY(0); opacity: 0; }
        10% { opacity: 1; } 90% { opacity: 1; }
        100% { transform: translateY(100%); opacity: 0; }
    }
    .stage-name { margin-top: 0; max-width: none; }
}
