/* ============================================================
   BASE — shared by every page.
   Reset, typography, nav, hero, buttons, footer.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.75;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

/* Visible focus ring for keyboard users on a dark background. */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ----- SCROLLBAR ----- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ----- SKIP LINK ----- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--accent);
    color: var(--on-accent);
    padding: 10px 16px;
    font-weight: 500;
}
.skip-link:focus { left: 0; }

/* ----- LAYOUT ----- */
.shell {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    border-top: 1px solid var(--border);
    padding: var(--section-pad) 0;
}
.section:first-of-type { border-top: none; }
.section--alt { background: var(--bg-alt); }

/* ============================================================
   COMMAND LABEL  —  the "$ ls ventures/" section header
   ============================================================ */
.cmd {
    font-weight: 400;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 40px;
    letter-spacing: 0.02em;
}
.cmd::before {
    content: '$';
    color: var(--accent);
    font-weight: 500;
}
.cmd-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.cmd-row .cmd { margin-bottom: 0; }

/* A plain text link with an arrow, used for "all projects ->" */
.link-arrow {
    color: var(--accent);
    font-size: 13px;
    border-bottom: 1px solid transparent;
    transition: border-color var(--speed) var(--ease);
}
.link-arrow:hover { border-bottom-color: var(--accent); }

/* Inline link inside body copy */
.text-link {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-line);
    transition: border-color var(--speed) var(--ease);
}
.text-link:hover { border-bottom-color: var(--accent); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(16, 16, 16, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 68px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-logo {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

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

.nav-list {
    display: flex;
    align-items: center;
    gap: 18px;
    list-style: none;
}
.nav-list a {
    font-size: 13px;
    color: var(--text-dim);
    transition: color var(--speed) var(--ease);
}
.nav-list a:hover { color: var(--text); }

/* Current page. Set with aria-current in the HTML, so it is correct
   even before JavaScript runs. */
.nav-list a[aria-current="page"] { color: var(--accent); }

.nav-cv {
    font-size: 12px;
    color: var(--text-dim);
    border: 1px solid var(--border-strong);
    padding: 8px 14px;
    white-space: nowrap;
    transition: border-color var(--speed) var(--ease),
                color var(--speed) var(--ease);
}
.nav-cv:hover { border-color: var(--accent); color: var(--accent); }

/* ----- MOBILE TOGGLE ----- */
.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border-strong);
    cursor: pointer;
    width: 42px;
    height: 38px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--text);
    transition: transform var(--speed) var(--ease),
                opacity var(--speed) var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 980px) {
    .nav-toggle { display: flex; }

    .nav-menu {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 24px;
        display: none;
    }
    .nav-menu.is-open { display: flex; }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav-list a {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
        font-size: 14px;
    }
    .nav-cv {
        margin-top: 20px;
        text-align: center;
        padding: 12px 14px;
    }
}

/* ============================================================
   HERO  —  shared shape across all pages
   ============================================================ */
.hero { padding: 84px 0 var(--section-pad); }

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
    align-items: start;
}
.hero-grid--wide { grid-template-columns: 1fr; max-width: 780px; }

.hero-title {
    font-size: clamp(32px, 5.4vw, 56px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    text-transform: lowercase;
}

/* The typing animation target. min-height stops the layout jumping
   while Typed.js swaps one string for the next. */
.typedText {
    color: var(--text);
    display: inline;
}

.cursor {
    color: var(--accent);
    font-weight: 400;
    animation: blink 1.1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* Typed.js injects its own cursor; we use our own, so hide theirs. */
.typed-cursor { display: none !important; }

.hero-body {
    color: var(--text-dim);
    max-width: 56ch;
    margin-bottom: 34px;
    font-size: 14px;
    line-height: 1.85;
}

/* ----- BUTTONS ----- */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 22px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--speed) var(--ease),
                border-color var(--speed) var(--ease),
                color var(--speed) var(--ease);
}
.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}
.btn-primary:hover { background: #ffbe4d; }

.btn-ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ----- SOCIAL ROW ----- */
.social-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 13px;
    color: var(--text-faint);
}
.social-row a {
    color: var(--text-dim);
    border-bottom: 1px solid transparent;
    transition: color var(--speed) var(--ease),
                border-color var(--speed) var(--ease);
}
.social-row a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.social-row .sep { color: var(--border-strong); user-select: none; }

/* ----- PORTRAIT FRAME ----- */
.portrait {
    border: 1px solid var(--border);
    padding: 14px;
    background: var(--bg-alt);
}
.portrait img { width: 100%; height: auto; }
.portrait-caption {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-faint);
}

@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; gap: 44px; }
    .hero { padding-top: 56px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    border-top: 1px solid var(--border);
    padding: 64px 0 40px;
    background: var(--bg-alt);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 52px;
}
.footer-brand {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    display: inline-block;
}
.footer-tagline { font-size: 12px; color: var(--text-faint); }

.footer-heading {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a {
    font-size: 13px;
    color: var(--text-dim);
    transition: color var(--speed) var(--ease);
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 26px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-faint);
}
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--accent); }

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
    .footer-brand-col { grid-column: 1 / -1; }
}

/* ============================================================
   MOTION PREFERENCES
   If the visitor asks for reduced motion, everything appears
   immediately. hero.js also skips ScrollReveal and Typed.js.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .cursor { animation: none; }
}
