@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #070a08;
    --panel: rgba(12, 17, 14, 0.92);
    --panel-solid: #0c110e;
    --text: #edf2ee;
    --muted: #8a9a8f;
    --green: #38f27d;
    --green-dim: #0da94a;
    --red: #e74438;
    --line: #203026;
    --mono: "IBM Plex Mono", "Courier New", monospace;
    --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: var(--sans);
    line-height: 1.6;
    overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; }
::selection { color: var(--bg); background: var(--green); }

#matrix {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .1;
    pointer-events: none;
    z-index: -2;
}
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: .14;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(0,0,0,.35) 4px);
}
.scanlines::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, transparent 35%, rgba(0,0,0,.55) 100%);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 15;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 5vw, 76px);
    background: rgba(7,10,8,.78);
    border-bottom: 1px solid rgba(56,242,125,.13);
    backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 13px; font: 500 .82rem var(--mono); text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: white;
    background: var(--red);
    border-radius: 5px 5px 14px 5px;
    font: 700 .8rem var(--sans);
    box-shadow: 0 0 25px rgba(231,68,56,.18);
}
.green { color: var(--green); }
nav { display: flex; gap: clamp(18px, 3vw, 42px); }
nav a { position: relative; color: var(--muted); font: 500 .72rem var(--mono); text-decoration: none; letter-spacing: .04em; transition: color .2s; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 1px; background: var(--green); transition: right .25s; }
nav a:hover, nav a.active { color: var(--green); }
nav a.active::after, nav a:hover::after { right: 0; }
.menu-toggle { display: none; border: 0; background: none; padding: 8px; }
.menu-toggle span:not(.sr-only) { display: block; width: 24px; height: 2px; margin: 5px; background: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.section { position: relative; width: min(1180px, calc(100% - 48px)); margin: auto; scroll-margin-top: 77px; }
.hero { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: clamp(40px, 7vw, 100px); padding: 130px 0 90px; }
.home-only { min-height: calc(100vh - 110px); }
.eyebrow, .command, .label, .post-meta { font-family: var(--mono); }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 1.8s infinite; }
.command { color: var(--muted); font-size: .78rem; }
.command span { color: var(--green); }
h1 { margin: 18px 0 16px; font-size: clamp(4.2rem, 9vw, 8rem); line-height: .8; letter-spacing: -.075em; }
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(237,242,238,.65); }
.role-line { display: flex; align-items: center; min-height: 34px; color: var(--text); font: 500 clamp(.9rem, 2vw, 1.1rem) var(--mono); }
.prompt { margin-right: 11px; color: var(--green); }
.cursor { color: var(--green); animation: blink .8s steps(1) infinite; }
.intro { max-width: 580px; margin: 24px 0 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.15rem); }
.hero-actions, .contact-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1px solid var(--green); font: 600 .76rem var(--mono); text-decoration: none; transition: .2s ease; }
.button.primary { color: #031408; background: var(--green); box-shadow: 0 0 25px rgba(56,242,125,.12); }
.button.secondary { color: var(--green); background: transparent; }
.button:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(56,242,125,.2); }

.terminal { overflow: hidden; background: var(--panel); border: 1px solid #273b2d; border-radius: 7px; box-shadow: 0 30px 90px rgba(0,0,0,.5), 0 0 55px rgba(56,242,125,.05); transform: perspective(1000px) rotateY(-3deg); }
.terminal-bar { height: 38px; display: flex; align-items: center; padding: 0 14px; color: #708077; background: #111713; border-bottom: 1px solid var(--line); font: .62rem var(--mono); }
.terminal-bar > span { margin: auto; transform: translateX(-24px); }
.traffic-lights { display: flex; gap: 7px; }
.traffic-lights i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.traffic-lights i:nth-child(2) { background: #d5b934; }
.traffic-lights i:nth-child(3) { background: var(--green-dim); }
.terminal-body { padding: clamp(20px, 4vw, 36px); font-family: var(--mono); }
.beastie { margin: 0 0 28px; color: var(--red); font: 600 clamp(.58rem, 1.25vw, .82rem)/1.1 var(--mono); filter: drop-shadow(0 0 9px rgba(231,68,56,.25)); }
.system-data { margin: 0; font-size: clamp(.65rem, 1.3vw, .8rem); }
.system-data div { display: grid; grid-template-columns: 85px 1fr; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.system-data dt { color: var(--green); }
.system-data dd { margin: 0; color: #b9c4bc; }
.palette { display: flex; margin: 23px 0; }
.palette i { width: 29px; height: 7px; background: var(--red); }
.palette i:nth-child(2) { background:#f0c633; }.palette i:nth-child(3) { background:#38f27d; }.palette i:nth-child(4) { background:#23aee9; }.palette i:nth-child(5) { background:#9369ec; }.palette i:nth-child(6) { background:#edf2ee; }
.shell-line { margin: 0; color: #aab6ad; font-size: .72rem; }
.shell-line > span:first-child { color: var(--green); }
.block-cursor { display: inline-block; width: 7px; height: 13px; margin-left: 5px; vertical-align: -2px; background: var(--green); animation: blink .8s steps(1) infinite; }
.scroll-hint { position: absolute; bottom: 24px; left: 0; color: #68766d; font: .63rem var(--mono); text-decoration: none; writing-mode: vertical-rl; letter-spacing: .1em; }
.scroll-hint span { margin-top: 10px; color: var(--green); }

.content-section { padding: 120px 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 700px; margin-bottom: 56px; }
.section-heading h2 { margin: 12px 0; font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1; letter-spacing: -.05em; }
.section-heading h2 span { color: var(--red); font: 500 .8rem var(--mono); letter-spacing: 0; vertical-align: middle; }
.section-heading > p:last-child { color: var(--muted); }
.post-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.latest-grid .post-card { display: flex; flex-direction: column; min-height: 330px; color: inherit; text-decoration: none; }
.latest-grid .post-card .post-link { margin-top: auto; }
.archive-link { margin-top: 28px; }
.post-card { min-height: 190px; padding: clamp(24px, 4vw, 42px); background: linear-gradient(135deg, rgba(17,25,20,.96), rgba(8,13,10,.96)); border: 1px solid var(--line); transition: border-color .25s, transform .25s; }
.post-grid > .post-card:first-child { grid-row: span 2; min-height: 396px; display: flex; flex-direction: column; justify-content: center; }
.post-card:hover { transform: translateY(-4px); border-color: var(--green-dim); }
.post-card h3 { margin: 8px 0 12px; font-size: clamp(1.3rem, 3vw, 2rem); }
.post-card p { color: var(--muted); }
.post-meta { color: var(--green) !important; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.post-link { margin-top: 20px; color: var(--green); font: .72rem var(--mono); }
.post-card.small { display: flex; align-items: flex-start; gap: 24px; }
.post-card.small h3 { font-size: 1.18rem; }
.post-card.small p { margin: 5px 0; font-size: .88rem; }
.post-number { color: var(--red); font: 500 .72rem var(--mono); }

.cv-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.cv-main, .skills-panel { padding: clamp(28px, 5vw, 56px); background: var(--panel-solid); border: 1px solid var(--line); }
.label { color: var(--green); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.cv-main h3 { max-width: 700px; margin: 20px 0; font-size: clamp(1.7rem, 4vw, 3.2rem); line-height: 1.15; letter-spacing: -.04em; }
.cv-main > p:not(.label) { color: var(--muted); }
.text-link { display: inline-block; margin-top: 20px; color: var(--green); font: .76rem var(--mono); text-underline-offset: 5px; }
.skills-panel ul { margin: 20px 0 0; padding: 0; list-style: none; }
.skills-panel li { padding: 15px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.skills-panel li span { margin-right: 15px; color: var(--red); font: .65rem var(--mono); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border: 1px solid var(--line); }
.principles div { padding: 32px; border-right: 1px solid var(--line); }
.principles div:last-child { border-right: 0; }
.principles span { color: var(--green); font: .65rem var(--mono); }
.principles h3 { margin: 12px 0 6px; }
.principles p { margin: 0; color: var(--muted); font-size: .86rem; }

.contact-section { width: 100%; max-width: none; padding: 120px max(24px, calc((100% - 1180px)/2)); background: linear-gradient(100deg, rgba(13,28,18,.95), rgba(6,12,8,.95)); border-block: 1px solid var(--line); }
.contact-panel { max-width: 900px; }
.contact-panel h2 { margin: 25px 0; font-size: clamp(3rem, 8vw, 7rem); line-height: .92; letter-spacing: -.07em; }
.contact-panel h2 span { color: var(--green); }
.contact-panel > p:not(.command) { max-width: 590px; color: var(--muted); font-size: 1.05rem; }
.email-address { display: inline-block; margin-top: 25px; color: var(--green); font: clamp(.72rem, 2vw, .9rem) var(--mono); text-underline-offset: 5px; }

.subpage-main { min-height: calc(100vh - 110px); padding-top: 78px; }
.page-hero { width: min(1180px, calc(100% - 48px)); margin: auto; padding: 100px 0 55px; }
.page-hero h1 { margin: 20px 0; font-size: clamp(3.8rem, 9vw, 7.5rem); }
.page-hero > p:last-child { max-width: 650px; color: var(--muted); }
.search-wrap { position: relative; width: min(1180px, calc(100% - 48px)); margin: 0 auto 30px; }
.search-wrap label { display: block; margin-bottom: 10px; color: var(--green); font: .7rem var(--mono); }
.search-input { width: 100%; padding: 18px 20px 18px 48px; color: var(--text); background: var(--panel); border: 1px solid var(--line); outline: 0; font: .85rem var(--mono); }
.search-input:focus { border-color: var(--green); box-shadow: 0 0 25px rgba(56,242,125,.08); }
.search-icon { position: absolute; left: 19px; bottom: 17px; color: var(--green); font-family: var(--mono); }
.blog-archive { width: min(1180px, calc(100% - 48px)); margin: 0 auto 120px; display: grid; gap: 14px; }
.blog-archive .post-card { min-height: 0; display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 25px; color: inherit; text-decoration: none; }
.blog-archive .post-card h2 { margin: 0 0 6px; font-size: clamp(1.25rem, 3vw, 1.8rem); }
.blog-archive .post-card p { margin: 0; }
.empty-state { display: none; padding: 40px; color: var(--muted); border: 1px dashed var(--line); font-family: var(--mono); }

/* Blog */
.featured-posts, .archive-section { width: min(1180px, calc(100% - 48px)); margin: auto; }
.featured-posts { padding-bottom: 100px; }
.archive-section { padding: 80px 0 120px; border-top: 1px solid var(--line); }
.archive-heading { margin-bottom: 30px; }
.archive-heading h2 { margin: 5px 0 0; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -.05em; }
.square-card { aspect-ratio: 1; }
.blog-archive { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.blog-archive .archive-card { min-height: 300px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 28px; }
.archive-card h3 { margin: 12px 0 10px; font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.15; }
.archive-card > p:not(.post-meta) { margin: 0; font-size: .9rem; }
.archive-card .post-link { margin-top: auto; }
.blog-archive .empty-state { grid-column: 1 / -1; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; color: var(--muted); font: .72rem var(--mono); }
.page-button { padding: 10px 14px; color: var(--green); background: transparent; border: 1px solid var(--line); cursor: pointer; font: inherit; }
.page-button:hover:not(:disabled) { border-color: var(--green); }
.page-button:disabled { opacity: .35; cursor: not-allowed; }

/* Contact */
.contact-page { display: grid; place-items: center; padding-inline: 24px; }
.contact-page .contact-panel { width: min(1040px, 100%); padding: 100px 0; }
.contact-page h1 { max-width: 900px; margin: 25px 0; font-size: clamp(3.3rem, 8vw, 7rem); line-height: .9; }
.contact-page h1 span { color: var(--green); -webkit-text-stroke: 0; }
.contact-page .contact-panel > p:last-of-type { max-width: 610px; color: var(--muted); font-size: 1.05rem; }
.contact-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.contact-option { min-height: 220px; display: flex; flex-direction: column; align-items: flex-start; position: relative; padding: 28px; color: inherit; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: transform .25s, border-color .25s; }
.contact-option:hover { transform: translateY(-4px); border-color: var(--green); }
.contact-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 30px; color: var(--bg); background: var(--green); font: 700 .72rem var(--mono); }
.contact-option > span:nth-child(2) { display: flex; flex-direction: column; }
.contact-option small { color: var(--green); font: .65rem var(--mono); letter-spacing: .12em; }
.contact-option strong { margin-top: 5px; font-size: 1.1rem; }
.contact-option em { margin-top: 4px; color: var(--muted); font: normal .7rem var(--mono); word-break: break-word; }
.contact-option b { position: absolute; top: 28px; right: 28px; color: var(--green); font-weight: 400; }

/* Home resume */
.resume-section { padding: 110px 0; border-top: 1px solid var(--line); }
.resume-heading { display: grid; grid-template-columns: minmax(220px, .55fr) 1.45fr; gap: 40px; align-items: end; margin-bottom: 48px; }
.resume-heading .command { margin: 0 0 8px; }
.resume-heading h2 { margin: 0; font-size: clamp(2.5rem, 6vw, 5rem); line-height: .95; letter-spacing: -.055em; }
.summary-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.summary-panel p { margin: 0; padding: clamp(28px, 5vw, 52px); color: #b8c3bb; background: var(--panel-solid); font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.65; }
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill-card { min-height: 280px; padding: 30px; background: var(--panel); border: 1px solid var(--line); }
.skill-card > span { color: var(--red); font: .68rem var(--mono); }
.skill-card h3 { margin: 25px 0 12px; font-size: 1.3rem; }
.skill-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.experience-list { border-top: 1px solid var(--line); }
.experience-item { display: grid; grid-template-columns: minmax(260px, .7fr) 1.3fr; gap: clamp(30px, 7vw, 90px); padding: 42px 0; border-bottom: 1px solid var(--line); }
.experience-item h3 { margin: 7px 0 2px; font-size: clamp(1.35rem, 3vw, 2rem); }
.experience-item .company { margin: 0; color: var(--green); font: .75rem var(--mono); }
.experience-item > p { margin: 0; color: var(--muted); }

/* Simple contact links */
.contact-icons { display: flex; gap: 22px; margin-top: 48px; }
.contact-icons a { width: 132px; height: 132px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--green); background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: transform .25s, color .25s, border-color .25s, background .25s; }
.contact-icons a:hover { transform: translateY(-5px); color: var(--bg); background: var(--green); border-color: var(--green); }
.contact-icons svg { width: 38px; height: 38px; fill: currentColor; }
.contact-icons span { font: .68rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.article { width: min(760px, calc(100% - 48px)); margin: auto; padding: 105px 0 120px; }
.article-back { color: var(--green); font: .72rem var(--mono); text-decoration: none; }
.article header { margin: 55px 0 60px; }
.article h1 { margin: 18px 0 25px; font-size: clamp(2.8rem, 8vw, 5.7rem); line-height: .95; }
.article-lead { color: var(--muted); font-size: 1.15rem; }
.article-body { color: #b5c0b8; font-size: 1.02rem; }
.article-body h2 { margin: 55px 0 18px; color: var(--text); font-size: 1.7rem; }
.article-body code { color: var(--green); font-family: var(--mono); }
.article-body pre { overflow-x: auto; padding: 24px; color: #c7d2ca; background: var(--panel-solid); border: 1px solid var(--line); font: .82rem/1.7 var(--mono); }
.article-body li { margin-bottom: 9px; }
footer { width: min(1180px, calc(100% - 48px)); min-height: 110px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #657169; font: .66rem var(--mono); }
footer a { color: var(--green); text-decoration: none; }
.red { color: var(--red); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 4px var(--green); } }

@media (max-width: 800px) {
    .site-header { height: 66px; padding: 0 22px; }
    .menu-toggle { display: block; cursor: pointer; }
    nav { position: absolute; top: 66px; left: 0; right: 0; display: none; flex-direction: column; gap: 0; padding: 10px 24px 20px; background: #090d0a; border-bottom: 1px solid var(--line); }
    nav.open { display: flex; }
    nav a { padding: 13px 0; }
    nav a::after { display: none; }
    .article-header nav { position: static; display: flex; flex-direction: row; gap: 4px; padding: 0; background: transparent; border: 0; }
    .article-header nav a { padding: 8px; }
    .section { width: min(100% - 36px, 650px); }
    .hero { grid-template-columns: 1fr; padding-top: 110px; }
    .terminal { transform: none; }
    .scroll-hint { display: none; }
    .post-grid, .latest-grid, .cv-layout, .blog-archive, .contact-options { grid-template-columns: 1fr; }
    .latest-grid .post-card { min-height: 240px; }
    .square-card { aspect-ratio: auto; }
    .blog-archive .post-card { grid-template-columns: 1fr; gap: 8px; }
    .post-grid > .post-card:first-child { min-height: 300px; }
    .principles { grid-template-columns: 1fr; }
    .principles div { border-right: 0; border-bottom: 1px solid var(--line); }
    .principles div:last-child { border-bottom: 0; }
    .contact-section { width: 100%; padding-inline: 24px; }
    .featured-posts, .archive-section { width: min(100% - 36px, 650px); }
    .contact-option { min-height: 190px; }
    .resume-heading { grid-template-columns: 1fr; gap: 15px; }
    .summary-panel, .skills-grid { grid-template-columns: 1fr; }
    .experience-item { grid-template-columns: 1fr; gap: 20px; }
    footer { flex-direction: column; align-items: flex-start; justify-content: center; padding: 25px 0; }
    footer p { margin: 0; }
}

@media (max-width: 430px) {
    .brand > span:last-child { display: none; }
    h1 { font-size: 4rem; }
    .terminal-body { padding: 22px 17px; }
    .beastie { font-size: .58rem; }
    .system-data div { grid-template-columns: 72px 1fr; }
    .post-card.small { flex-direction: column; gap: 5px; }
    .contact-icons { gap: 10px; }
    .contact-icons a { width: calc((100vw - 68px) / 3); height: calc((100vw - 68px) / 3); }
    .contact-icons svg { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    #matrix { display: none; }
}
