:root {
  --bg: #050a12;
  --panel: #0a121c;
  --panel-2: #0f1a27;
  --line: #1c2c3d;
  --line-strong: #2f4660;
  --text: #e6eef6;
  --muted: #a3b5c7;
  --dim: #8296ab;
  --sig: #4da6ff;
  --sig-soft: rgba(77, 166, 255, 0.1);
  --amber: #ffc857;
  --red: #ff7a85;
  --display: "Chakra Petch", "Segoe UI", sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(77, 166, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 166, 255, 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--text);
  font: 400 1rem/1.65 var(--body);
  overflow-x: clip;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 3px; }
::selection { background: var(--sig); color: #03101f; }

.wrap { width: min(1160px, 100%); margin-inline: auto; padding-inline: 32px; }
.ok { color: var(--sig); }
.note { color: var(--muted); font: 400 0.8125rem/1.5 var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 8px 14px; background: var(--sig); color: #03101f; font-weight: 600; }
.skip:focus { top: 12px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(6, 10, 13, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.topbar-in { display: flex; align-items: center; gap: 28px; min-height: 60px; }
.brand { font: 700 0.9375rem var(--mono); text-decoration: none; }
.topbar nav { display: flex; gap: 22px; margin-left: auto; }
.topbar nav a { color: var(--muted); font: 400 0.8125rem var(--mono); text-decoration: none; white-space: nowrap; padding-block: 6px; }
.topbar nav a:hover { color: var(--sig); }
.topbar-resume { padding: 7px 14px; border: 1px solid var(--sig); color: var(--sig); font: 500 0.8125rem var(--mono); text-decoration: none; }
.topbar-resume:hover { background: var(--sig); color: #03101f; }

/* Hero */
.hero { padding-block: 72px 56px; }
.eyebrow { color: var(--sig); font: 500 0.8125rem/1.5 var(--mono); letter-spacing: 0.04em; }
h1 { margin-top: 16px; font: 700 clamp(3.75rem, 9.5vw, 7.25rem)/0.92 var(--display); letter-spacing: -0.015em; text-transform: uppercase; }
h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 2px var(--sig); }
.hero-pitch { max-width: 31rem; margin-top: 26px; color: var(--muted); font-size: 1.125rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px;}
.btn { padding: 12px 20px; border: 1px solid var(--line-strong); font: 500 0.875rem var(--mono); text-decoration: none; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.btn:hover { border-color: var(--sig); color: var(--sig); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.btn-icon svg { width: 20px; height: 20px; }
.btn-primary { background: var(--sig); border-color: var(--sig); color: #03101f; font-weight: 700; }
.btn-primary:hover { background: #93ccff; color: #03101f; }

/* Terminal */
.terminal { min-width: 0; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 0 0 1px rgba(77, 166, 255, 0.05), 0 24px 70px rgba(0, 0, 0, 0.5); }
.term-bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--muted); font: 400 0.75rem var(--mono); }
.term-live { display: inline-flex; align-items: center; gap: 7px; }
.term-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--sig); animation: pulse 2s infinite; }
.term-screen { height: 360px; overflow-y: auto; padding: 16px; font: 400 0.8125rem/1.6 var(--mono); cursor: text; }
.term-screen p { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-screen .cmd { color: var(--text); font-weight: 700; }
.term-screen .dim { color: var(--dim); }
.term-screen .warn { color: var(--amber); }
.term-screen .err { color: var(--red); }
.term-screen a { color: var(--sig); text-underline-offset: 3px; }
.term-boot p { animation: line-in 0.25s both; }
.term-boot p:nth-child(2) { animation-delay: 0.25s; }
.term-boot p:nth-child(3) { animation-delay: 0.4s; }
.term-boot p:nth-child(4) { animation-delay: 0.55s; }
.term-boot p:nth-child(5) { animation-delay: 0.65s; }
.term-boot p:nth-child(6) { animation-delay: 0.75s; }
.term-boot p:nth-child(7) { animation-delay: 0.85s; }
.term-boot p:nth-child(8) { animation-delay: 0.95s; }
.term-boot p:nth-child(9) { animation-delay: 1.1s; }
.term-form { display: flex; gap: 10px; align-items: center; }
.term-form input { flex: 1; min-width: 0; padding: 0; background: none; border: 0; outline: 0; color: var(--text); font: 400 0.8125rem/1.6 var(--mono); caret-color: var(--sig); }
.term-form input::placeholder { color: var(--dim); }
.term-form:focus-within { box-shadow: 0 1px 0 var(--sig); }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.term-chips button { padding: 5px 10px; background: none; border: 1px solid var(--line-strong); color: var(--muted); font: 400 0.75rem var(--mono); cursor: pointer; }
.term-chips button:hover { border-color: var(--sig); color: var(--sig); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 56px; border: 1px solid var(--line); background: var(--panel); }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 18px 20px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats dt { color: var(--muted); font-size: 0.8125rem; }
.stats dd { font: 700 1.5rem/1.2 var(--display); }

/* Sections */
.section { padding-block: 72px; border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 32px; }
.sec-cmd { color: var(--sig); font: 400 0.8125rem var(--mono); }
.sec-head h2 { margin-top: 6px; font: 700 clamp(2rem, 4.5vw, 2.875rem)/1.1 var(--display); }
.sub-head { margin: 52px 0 18px; font: 600 1.375rem/1.3 var(--display); }
.sub-label { margin: 26px 0 10px; color: var(--muted); font: 500 0.75rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 3px 9px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font: 400 0.75rem/1.5 var(--mono); }
.tags-strong li { background: var(--sig-soft); border-color: rgba(77, 166, 255, 0.35); color: var(--sig); }

/* About */
.about { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; }
.badge { background: var(--panel); border: 1px solid var(--line-strong); }
.badge-photo { position: relative; overflow: hidden; background: #000; }
.badge-photo img { width: 100%; filter: grayscale(1) contrast(1.05); }
.badge-photo::after { content: ""; position: absolute; inset: 0; background: #9fb2c8; mix-blend-mode: multiply; transition: opacity 0.25s; }
.badge:hover .badge-photo::after { opacity: 0; }
.badge:hover .badge-photo img { filter: none; }
.badge figcaption { display: grid; gap: 2px; padding: 12px 14px; border-top: 1px solid var(--line); }
.badge strong { font-size: 0.875rem; line-height: 1.35; }
.badge span { color: var(--muted); font-size: 0.8125rem; }
.prose { display: grid; gap: 14px; max-width: 46rem; font-size: 1.0625rem; }
.edu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.edu li { display: grid; align-content: start; gap: 3px; padding: 16px; background: var(--panel); border: 1px solid var(--line); }
.edu span:not(.note) { color: var(--muted); font-size: 0.9375rem; }
.edu .note { margin-top: 5px; }

/* Experience */
.log { border-left: 1px solid var(--line-strong); }
.log-entry { position: relative; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 32px; padding: 0 0 44px 32px; }
.log-entry:last-child { padding-bottom: 0; }
.log-entry::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--muted); }
.log-security::before { background: var(--sig); border-color: var(--sig); box-shadow: 0 0 10px var(--sig); }
.log-meta { display: grid; align-content: start; justify-items: start; gap: 8px; color: var(--muted); font: 400 0.8125rem/1.5 var(--mono); }
.log-kind { padding: 1px 7px; border: 1px solid var(--line-strong); color: var(--dim); font-size: 0.6875rem; letter-spacing: 0.06em; }
.log-security .log-kind { border-color: var(--sig); color: var(--sig); }
.log-body h3 { font: 600 1.375rem/1.25 var(--display); }
.log-company { margin-top: 2px; color: var(--amber); font-weight: 500; }
.log-body > ul:not(.tags) { display: grid; gap: 7px; max-width: 52rem; margin: 14px 0 16px; }
.log-body > ul:not(.tags) li { position: relative; padding-left: 18px; color: #c7d4e2; }
.log-body > ul:not(.tags) li::before { content: ">"; position: absolute; left: 0; color: var(--sig); font: 400 0.8125rem/1.65rem var(--mono); }

/* CloudSentry */
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px 44px; padding: 32px; background: var(--panel); border: 1px solid var(--line-strong); }
.feature h3 { margin-top: 6px; color: var(--sig); font: 700 clamp(2rem, 4vw, 2.75rem)/1.1 var(--display); }
.feature-title { margin: 8px 0 12px; font-size: 1.125rem; font-weight: 500; line-height: 1.4; }
.feature-copy > p:not(.eyebrow, .feature-title) { color: #c7d4e2; }
.scanner { position: relative; align-self: start; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.scanner-head { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font: 400 0.75rem var(--mono); }
.scanner li { display: flex; align-items: baseline; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.scanner li:last-child { border-bottom: 0; }
.scope { flex: 0 0 42px; color: var(--amber); font: 500 0.75rem var(--mono); }
.scanner-beam { position: absolute; inset-inline: 0; top: 0; height: 56px; pointer-events: none; background: linear-gradient(transparent, rgba(77, 166, 255, 0.13)); border-bottom: 1px solid rgba(77, 166, 255, 0.65); animation: sweep 5s ease-in-out infinite; }
.pipeline { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); }
.pipeline li { display: grid; align-content: start; gap: 2px; padding: 14px 16px; border-left: 1px solid var(--line); }
.pipeline li:first-child { border-left: 0; }
.pipeline .num { color: var(--sig); font: 400 0.6875rem var(--mono); }
.pipeline strong { font: 600 1.0625rem var(--display); }
.pipeline span:last-child { color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
.builds { border-top: 1px solid var(--line); }
.builds li { display: grid; grid-template-columns: 84px minmax(0, 1fr) 150px 84px; gap: 20px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--line); }
.builds p { color: var(--muted); font-size: 0.9375rem; }
.builds a { justify-self: end; color: var(--sig); font: 400 0.8125rem var(--mono); text-underline-offset: 3px; }

/* CTF */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.board li { padding: 24px; background: var(--panel); border: 1px solid var(--line); }
.board-rank { font: 700 clamp(2.5rem, 5vw, 3.5rem)/1 var(--display); }
.board-top { border-color: var(--amber) !important; }
.board-top .board-rank { color: var(--amber); }
.board-of { margin-top: 4px; color: var(--muted); font: 400 0.8125rem var(--mono); }
.board h3 { margin-top: 18px; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.also { margin-top: 14px; color: var(--muted); font: 400 0.8125rem var(--mono); }
.lead { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lead li { padding: 20px; border: 1px solid var(--line); border-left: 2px solid var(--sig); background: var(--panel); }
.lead-role { color: var(--sig); font: 500 0.75rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.lead h4 { margin: 5px 0 7px; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.lead li > p:last-child { color: var(--muted); font-size: 0.9375rem; }

/* Credentials */
.cert-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cert-primary li { display: flex; align-items: center; gap: 20px; padding: 22px; background: var(--panel); border: 1px solid var(--sig); }
.cert-code { color: var(--sig); font: 700 clamp(2rem, 4vw, 2.625rem)/1 var(--display); }
.cert-primary h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.cert-other { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 16px; }
.cert-other li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.cert-other .note { flex: none; }

/* Skills */
.skills { border-top: 1px solid var(--line); }
.skills > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.skills dt { font: 500 0.875rem/1.8 var(--mono); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: start; }
.contact-section-title { margin-bottom: 12px; font: 600 1.5rem/1.25 var(--display); }
.contact-lead, .contact-form-note { margin-bottom: 24px; color: var(--muted); }
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.contact-card:hover { border-color: var(--sig); transform: translateX(4px); }
.contact-card-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; background: var(--panel-2); color: var(--sig); }
.contact-card-icon svg { width: 18px; height: 18px; }
.contact-card-info { flex: 1; min-width: 0; }
.contact-card-label, .form-label { color: var(--muted); font: 500 0.75rem/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.contact-card-label { display: block; }
.contact-card-value { display: block; font-size: 0.9375rem; font-weight: 500; overflow-wrap: anywhere; }
.contact-card-arrow { flex: none; color: var(--dim); font-family: var(--mono); }
.contact-card:hover .contact-card-arrow { color: var(--sig); }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-input, .form-textarea { width: 100%; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 0; color: var(--text); font: 400 0.875rem/1.6 var(--mono); transition: border-color 0.15s, box-shadow 0.15s; }
.form-textarea { display: block; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--dim); }
.form-input:focus, .form-textarea:focus { outline: 0; border-color: var(--sig); box-shadow: 0 0 0 3px var(--sig-soft); }
.contact-form button.btn-primary { width: 100%; background: var(--sig); color: #03101f; }
.contact-form button.btn-primary:hover { background: #93ccff; color: #03101f; }

.footer { padding-block: 22px; border-top: 1px solid var(--line); color: var(--muted); font: 400 0.75rem/1.6 var(--mono); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.footer a { text-underline-offset: 3px; }
.footer a:hover { color: var(--sig); }

/* Multi-page additions */
.topbar nav a[aria-current="page"] { color: var(--sig); box-shadow: 0 1px 0 var(--sig); }
main > .section:first-child { border-top: 0; }
.sec-head h1 { margin-top: 6px; font: 700 clamp(2.5rem, 6vw, 3.75rem)/1.1 var(--display); letter-spacing: 0; text-transform: none; }
.page-intro { max-width: 44rem; margin-bottom: 32px; color: var(--muted); font-size: 1.125rem; }

.empty { display: grid; gap: 6px; max-width: 44rem; padding: 24px; background: var(--panel); border: 1px dashed var(--line-strong); }
.empty p:last-child { margin-top: 10px; color: var(--muted); }
.empty a { color: var(--sig); text-underline-offset: 3px; }

.post-list { border-top: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: start; }
.post-row.has-cover { grid-template-columns: 90px 156px minmax(0, 1fr); gap: 22px; }
.post-row-cover { display: block; overflow: hidden; border: 1px solid var(--line-strong); }
.post-row-cover img { display: block; width: 156px; height: 104px; object-fit: cover; transition: transform 0.25s ease, filter 0.2s ease; }
.post-row-cover:hover img { transform: scale(1.05); filter: brightness(1.08); }
.post-row h2 { font: 600 1.375rem/1.3 var(--display); }
.post-row h2 a { text-decoration: none; }
.post-row h2 a:hover { color: var(--sig); }
.post-row p { margin: 4px 0 10px; color: var(--muted); }

.post-wrap { max-width: 780px; }
.post .sec-cmd a { text-decoration: none; }
.post h1 { margin-top: 12px; font: 700 clamp(2rem, 5vw, 3rem)/1.15 var(--display); letter-spacing: 0; text-transform: none; }
.post-body { margin-top: 32px; font-size: 1.0625rem; }
.post-body > * + * { margin-top: 16px; }
.post-body h2 { margin-top: 36px; font: 600 1.625rem/1.3 var(--display); }
.post-body h3 { margin-top: 28px; font: 600 1.25rem/1.3 var(--display); }
.post-body ul, .post-body ol { padding-left: 22px; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body a { color: var(--sig); }
.post-body code { padding: 1px 5px; background: var(--panel-2); font: 400 0.875em var(--mono); }
.post-body pre { overflow-x: auto; padding: 16px; background: var(--panel); border: 1px solid var(--line); }
.post-body pre code { padding: 0; background: none; }
.post-body figure { margin: 24px 0; }
.post-body figure img { border: 1px solid var(--line-strong); }
.post-body figcaption { margin-top: 8px; color: var(--muted); font: 400 0.8125rem/1.5 var(--mono); }
/* Per-post photo slider: main image on top, thumbnail gallery below */
.post-slider { margin: 28px 0; }
.post-slider:focus-visible { outline: 2px solid var(--sig); outline-offset: 4px; }
.slider-main { position: relative; background: #04080f; border: 1px solid var(--line-strong); }
.slider-viewport { overflow: hidden; }
.slider-track { display: flex; transition: transform 0.35s ease; }
.slider-slide { flex: 0 0 100%; min-width: 0; }
.slider-slide img { display: block; width: 100%; height: clamp(300px, 54vw, 540px); object-fit: contain; }
.slider-prev, .slider-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: rgba(5, 10, 18, 0.72); border: 1px solid var(--line-strong); color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: border-color 0.15s, color 0.15s, background-color 0.15s; }
.slider-prev:hover, .slider-next:hover { border-color: var(--sig); color: var(--sig); background: rgba(5, 10, 18, 0.92); }
.slider-prev { left: 12px; }
.slider-next { right: 12px; }
.slider-count { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 3px 9px; background: rgba(5, 10, 18, 0.72); border: 1px solid var(--line); color: var(--muted); font: 400 0.75rem var(--mono); }
.slider-cap { min-height: 1.5em; margin-top: 10px; text-align: center; color: var(--muted); font: 400 0.8125rem/1.5 var(--mono); }
.slider-thumbs { display: flex; justify-content: safe center; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.slider-thumb { flex: 0 0 auto; width: 76px; height: 56px; padding: 0; background: #04080f; border: 1px solid var(--line); cursor: pointer; opacity: 0.5; transition: opacity 0.15s ease, border-color 0.15s ease; }
.slider-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slider-thumb:hover { opacity: 0.85; }
.slider-thumb.is-active { opacity: 1; border-color: var(--sig); }
.post-slider[data-single] .slider-prev, .post-slider[data-single] .slider-next, .post-slider[data-single] .slider-count, .post-slider[data-single] .slider-thumbs { display: none; }
@media (prefers-reduced-motion: reduce) { .slider-track { transition: none; } }
.post-body .flag { overflow-wrap: anywhere; padding: 12px 16px; background: var(--sig-soft); border: 1px solid rgba(77, 166, 255, 0.35); color: var(--sig); font: 500 0.875rem/1.6 var(--mono); }
.post > .wrap > .tags { margin-top: 12px; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { display: grid; gap: 2px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; text-decoration: none; transition: border-color 0.15s; }
.post-nav a:hover { border-color: var(--sig); }
.post-nav span { color: var(--sig); font: 400 0.75rem var(--mono); }
.post-next { grid-column: 2; text-align: right; }

.event-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-card { position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 24px 56px 24px 24px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s; }
.event-card:hover { border-color: var(--sig); }
.event-card h2 { font: 700 clamp(1.75rem, 3.5vw, 2.25rem)/1.1 var(--display); }
.event-card p { color: var(--muted); }
.event-card .tags { margin-top: 4px; }
.event-card i { position: absolute; top: 24px; right: 24px; color: var(--sig); font: 400 1.125rem var(--mono); transition: transform 0.15s; }
.event-card:hover i { transform: translateX(4px); }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; height: 100%; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.project-card:hover { border-color: var(--sig); transform: translateY(-3px); }
.project-card-cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.project-card-cover img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92); transition: transform 0.3s, filter 0.15s; }
.project-card:hover .project-card-cover img { transform: scale(1.03); filter: none; }
.project-card-noimg { display: grid; place-items: center; width: 100%; height: 100%; color: var(--sig); font: 700 2.5rem var(--display); }
.project-card-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.project-card-body strong { font: 600 1.1875rem/1.25 var(--display); }
.project-card-desc { color: var(--muted); font-size: 0.9375rem; }
.project-card-body .tags { margin-top: 6px; }

.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.project-links a { padding: 9px 16px; border: 1px solid var(--line-strong); color: var(--text); font: 500 0.8125rem var(--mono); text-decoration: none; transition: border-color 0.15s, color 0.15s; }
.project-links a:hover { border-color: var(--sig); color: var(--sig); }

.resume { max-width: 900px; }
.resume-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 28px; }
.resume-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
button.btn { background: none; color: var(--text); cursor: pointer; }
.resume-head h1 { margin: 0; font: 700 clamp(2rem, 5vw, 3rem)/1.15 var(--display); letter-spacing: 0; text-transform: none; }
.resume-role { margin-top: 6px; color: var(--sig); font: 500 0.875rem var(--mono); }
.resume-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; color: var(--muted); font-size: 0.9375rem; }
.resume-contact a { overflow-wrap: anywhere; text-underline-offset: 3px; }
.resume-block { margin-top: 32px; }
.resume-block > h2 { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); font: 600 1rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.rh-icon { flex: none; width: 30px; height: 30px; padding: 6px; border: 1px solid var(--sig); border-radius: 50%; color: var(--sig); background: var(--sig-soft); }
.resume-block { position: relative; }
.resume-block > .resume-item { position: relative; margin-left: 8px; padding: 0 0 4px 24px; border-left: 1px solid var(--line-strong); }
.resume-block > .resume-item::before { content: ""; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px; border: 2px solid var(--sig); border-radius: 50%; background: var(--bg, #050a12); }
.resume-block > .resume-item:last-child { padding-bottom: 0; }
.resume-org { margin-top: 2px; color: var(--muted); font-size: 0.9375rem; }
.resume-badge { padding: 2px 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text) !important; }
.resume-block > p { margin-top: 12px; }
.resume-block > ul, .resume-item > ul { display: grid; gap: 4px; margin-top: 8px; padding-left: 20px; list-style: disc; }
.resume-block > ul { margin-top: 12px; }
.resume-item { margin-top: 16px; }
.resume-item p { color: var(--muted); }
.resume-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 20px; }
.resume-item h3 { font-size: 1rem; font-weight: 600; line-height: 1.45; }
.resume-line span { color: var(--muted); font: 400 0.8125rem var(--mono); white-space: nowrap; }
.resume-stack { font: 400 0.8125rem/1.6 var(--mono); }
.resume-skills { display: grid; gap: 8px; margin-top: 12px; }
.resume-skills > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; }
.resume-skills dt { font-weight: 600; }
.resume-skills dd { color: var(--muted); }
.resume-refs { margin-top: 28px; color: var(--muted); font-style: italic; }

@media (max-width: 760px) {
  .topbar { position: static; }
  .progress { display: none; }
  html { scroll-padding-top: 16px; }
  .topbar-in { padding-block: 12px 8px; }
  .topbar nav { flex-wrap: wrap; gap: 2px 16px; overflow: visible; }
  .post-row, .post-row.has-cover { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .post-row.has-cover .post-row-cover { order: -1; margin-bottom: 8px; }
  .post-row-cover, .post-row-cover img { width: 100%; height: auto; }
  .post-row-cover img { aspect-ratio: 16 / 10; }
  .slider-slide img { height: clamp(220px, 60vw, 420px); }
  .event-list, .post-nav, .project-grid { grid-template-columns: minmax(0, 1fr); }
  .post-next { grid-column: auto; }
  .resume-skills > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; font-size: 10pt; }
  .topbar, .footer, .skip, .resume-actions { display: none !important; }
  .section { padding: 0; border: 0; }
  .resume { max-width: none; padding: 0; line-height: 1.38; }
  .resume * { color: #111 !important; }
  .resume-block > ul, .resume-item > ul { gap: 1pt; margin-top: 3pt; }
  .resume-skills { gap: 3pt; }
  .resume-skills > div { grid-template-columns: 125pt minmax(0, 1fr) !important; gap: 8pt !important; }
  .resume a { text-decoration: none; }
  .resume-head h1 { font-size: 20pt; }
  .resume-block { margin-top: 12pt; }
  .resume-block > h2 { font-size: 12pt; border-color: #111; }
  .rh-icon { width: 18px; height: 18px; padding: 3px; background: none; border-color: #111; }
  .resume-block > .resume-item { border-color: #999; }
  .resume-block > .resume-item::before { border-color: #111; background: #fff; }
  .resume-item { margin-top: 7pt; break-inside: avoid; }
  .resume-item h3, .resume-skills dt { font-size: 10pt; }
  .resume-line span, .resume-stack { font-size: 8.5pt; }
}

/* Motion: only assets/motion.js activates these */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--sig); box-shadow: 0 0 8px var(--sig); transform: scaleX(0); transform-origin: left; }

.log { position: relative; }
.log::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 1px; background: var(--sig); transform: scaleY(var(--rail, 0)); transform-origin: top; }

.motion .spot-card, .motion .door, .motion .feature, .motion .board li, .motion .lead li, .motion .cert-primary li, .motion .edu li { position: relative; isolation: isolate; }
.motion .spot-card::before, .motion .door::before, .motion .feature::before, .motion .board li::before, .motion .lead li::before, .motion .cert-primary li::before, .motion .edu li::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(77, 166, 255, 0.11), transparent 70%);
}
.motion .spot-on::before { opacity: 1 !important; }

@media print {
  * { opacity: 1 !important; transform: none !important; }
}

@keyframes line-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes sweep { 0% { transform: translateY(-60px); } 100% { transform: translateY(300px); } }

@media (max-width: 1000px) {
  .topbar-in { flex-wrap: wrap; gap: 0 16px; padding-block: 10px 0; }
  .topbar-resume { margin-left: auto; }
  .topbar nav { order: 3; flex: 0 0 100%; margin: 6px 0 0; padding-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
  html { scroll-padding-top: 104px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .hero { padding-block: 44px 40px; }
  .section { padding-block: 52px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 36px; }
  .stats > div { padding: 14px; }
  .stats > div:nth-child(odd) { border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stats dd { font-size: 1.25rem; }
  .term-screen { height: 320px; padding: 14px; }
  .term-form input, .form-input, .form-textarea { font-size: 16px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .badge { max-width: 220px; }
  .edu, .board, .lead, .cert-primary, .cert-other, .feature { grid-template-columns: minmax(0, 1fr); }
  .log-entry { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-left: 20px; }
  .feature { padding: 20px 16px; }
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .pipeline li { grid-template-columns: 28px 76px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 10px 12px; border-left: 0; border-top: 1px solid var(--line); }
  .pipeline li:first-child { border-top: 0; }
  .builds li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; }
  .builds li > div { grid-column: 1 / -1; grid-row: 2; }
  .builds li > .note:nth-of-type(2) { grid-column: 1; grid-row: 3; }
  .builds a { grid-column: 2; grid-row: 3; }
  .skills > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* Home page */
.hero { position: relative; overflow: clip; display: flex; min-height: calc(100svh - 61px); padding-block: 40px 44px; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 55% at 50% 34%, rgba(77, 166, 255, 0.13), transparent 72%); }
.hero-scan { position: absolute; inset-inline: 0; top: 0; z-index: -1; height: 140px; opacity: 0; pointer-events: none; background: linear-gradient(transparent, rgba(77, 166, 255, 0.09)); border-bottom: 1px solid rgba(77, 166, 255, 0.5); animation: hero-scan 2.4s 0.2s cubic-bezier(0.4, 0, 0.3, 1) both; }
.hero-in { display: flex; flex-direction: column; }
.hero-focus {
  --tick: var(--line-strong);
  display: flex; flex-direction: column; align-items: center; margin-block: auto; padding: 44px 32px; text-align: center;
  background:
    linear-gradient(var(--tick), var(--tick)) 0 0 / 26px 1px, linear-gradient(var(--tick), var(--tick)) 0 0 / 1px 26px,
    linear-gradient(var(--tick), var(--tick)) 100% 0 / 26px 1px, linear-gradient(var(--tick), var(--tick)) 100% 0 / 1px 26px,
    linear-gradient(var(--tick), var(--tick)) 0 100% / 26px 1px, linear-gradient(var(--tick), var(--tick)) 0 100% / 1px 26px,
    linear-gradient(var(--tick), var(--tick)) 100% 100% / 26px 1px, linear-gradient(var(--tick), var(--tick)) 100% 100% / 1px 26px;
  background-repeat: no-repeat;
}
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; color: var(--muted); font: 400 0.8125rem/1.5 var(--mono); }
.hero-meta .eyebrow { text-wrap: balance; }
.hero-dot { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--sig); vertical-align: 0.08em; animation: pulse 2s infinite; }
.hero h1 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.26em; width: 100%; margin-top: 22px; font-size: clamp(3.25rem, 10.4vw, 8.25rem); line-height: 1; white-space: nowrap; }
.hero h1 .decode:first-child { justify-self: end; }
.hero h1 .decode { cursor: default; transition: color 0.2s ease, text-shadow 0.2s ease; }
.hero h1 .decode:hover { color: var(--sig); text-shadow: 0 0 18px rgba(77, 166, 255, 0.55); }
.hero h1 em { justify-self: start; }
.hero-pitch { max-width: 44rem; margin-top: 28px; color: var(--text); font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.5; }
.hero-detail { max-width: 100%; margin-top: 12px; color: var(--muted); font-size: 0.9375rem; }
.hero .hero-actions { justify-content: center; }
.hero-cue { align-self: center; margin-block: 24px; padding: 4px; color: var(--muted); font: 400 0.8125rem var(--mono); text-decoration: none; }
.hero-cue:hover { color: var(--sig); }
.hero-cue span { display: inline-block; margin-left: 6px; color: var(--sig); animation: cue 1.8s ease-in-out infinite; }
.hero .stats { margin-top: 0; background: rgba(10, 18, 28, 0.82); }

.home-sec { padding-block: 72px; border-top: 1px solid var(--line); }
.seam { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 28px; color: var(--muted); font: 400 0.8125rem var(--mono); }
.spotlight { padding-top: 26px; }
.spot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.spot-card { display: flex; flex-direction: column; min-width: 0; padding: 28px; background: var(--panel); border: 1px solid var(--line-strong); }
.spot-card h3 { margin-top: 6px; color: var(--sig); font: 700 clamp(2rem, 4vw, 2.75rem)/1.1 var(--display); }
.spot-copy { margin-bottom: 16px; color: #c7d4e2; }
.spot-card .scanner { align-self: stretch; margin-top: 20px; }
.spot-card .scanner li { padding-block: 10px; }
.spot-more { margin-top: auto; padding-top: 22px; }
.spotlight .terminal { display: flex; flex-direction: column; }
.spotlight .term-screen { flex: 1 1 0; height: auto; min-height: 360px; }
.motion .term-boot:not(.run) p { animation-play-state: paused; }

.sec-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px; }
.sec-idx { margin-right: 6px; color: var(--muted); }
.more { display: inline-flex; gap: 8px; color: var(--sig); font: 400 0.8125rem var(--mono); text-decoration: none; }
.more span { transition: transform 0.15s; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.more:hover span { transform: translateX(4px); }

.home-sec .builds li { position: relative; transition: padding-left 0.2s, background-color 0.2s; }
.home-sec .builds li:hover { padding-left: 14px; background: linear-gradient(90deg, var(--sig-soft), transparent 60%); box-shadow: inset 2px 0 0 var(--sig); }

.xp { border-top: 1px solid var(--line); }
.xp li { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 24px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.xp strong { font: 600 1.125rem/1.3 var(--display); }
.xp p { margin-top: 2px; color: var(--muted); font-size: 0.9375rem; }
.xp .log-kind { padding: 1px 7px; border: 1px solid var(--line-strong); color: var(--dim); font: 400 0.6875rem/1.6 var(--mono); letter-spacing: 0.06em; white-space: nowrap; }
.xp-security .log-kind { border-color: var(--sig); color: var(--sig); }

.rank-track { position: relative; display: flex; justify-content: space-between; margin-top: 18px; padding-top: 12px; color: var(--dim); font: 400 0.6875rem var(--mono); }
.rank-track::before { content: ""; position: absolute; inset: 3px 0 auto; height: 1px; background: var(--line-strong); }
.rank-track i { position: absolute; top: 0; left: var(--at); width: 7px; height: 7px; background: var(--sig); box-shadow: 0 0 10px var(--sig); }
.board-ranked li:nth-child(1) { --at: 2%; }
.board-ranked li:nth-child(2) { --at: 23%; }
.board-ranked li:nth-child(3) { --at: 20%; }
.board-top .rank-track i { background: var(--amber); box-shadow: 0 0 10px var(--amber); }

.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.door { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 20px 24px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s; }
.door strong { font: 600 1.25rem/1.3 var(--display); }
.door span { grid-row: 2; color: var(--muted); font-size: 0.9375rem; }
.door i { grid-area: 1 / 2 / 3; align-self: center; color: var(--sig); font: 400 1.125rem var(--mono); transition: transform 0.15s; }
.door:hover { border-color: var(--sig); }
.door:hover i { transform: translateX(4px); }

.home-certs { margin-top: 12px; }

.home-contact { padding-block: 104px; text-align: center; background: radial-gradient(50% 70% at 50% 100%, rgba(77, 166, 255, 0.1), transparent 75%); }
.home-contact h2 { margin-top: 12px; font: 700 clamp(2.5rem, 7vw, 5rem)/1.05 var(--display); }
.home-contact-lead { margin-top: 16px; color: var(--muted); font-size: 1.125rem; }
.home-email { display: block; width: fit-content; max-width: 100%; margin: 28px auto 20px; color: var(--sig); font: 500 clamp(1.125rem, 3.4vw, 2rem)/1.3 var(--mono); overflow-wrap: anywhere; text-decoration: none; background: linear-gradient(var(--sig), var(--sig)) 0 100% / 0 1px no-repeat; transition: background-size 0.25s; }
.home-email:hover { background-size: 100% 1px; }

@keyframes hero-scan {
  0% { opacity: 0; transform: translateY(-140px); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(100vh); }
}
@keyframes cue { 50% { transform: translateY(4px); } }

@media (max-width: 1000px) {
  .hero { min-height: 0; }
  .hero-focus { margin-block: 12px; }
  .spot-grid { grid-template-columns: minmax(0, 1fr); }
  .spotlight .term-screen { flex: none; height: 360px; }
}

@media (max-width: 760px) {
  .hero-focus { padding: 32px 16px; }
  .hero h1 { grid-template-columns: minmax(0, 1fr); font-size: clamp(3.25rem, 20vw, 7rem); }
  .hero h1 .decode:first-child, .hero h1 em { justify-self: center; }
  .home-sec { padding-block: 52px; }
  .spotlight { padding-top: 20px; }
  .spot-card { padding: 20px 16px; }
  .spotlight .term-screen { height: 320px; min-height: 0; }
  .xp li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .xp li > div { grid-column: 1 / -1; grid-row: 2; }
  .doors { grid-template-columns: minmax(0, 1fr); }
  .home-contact { padding-block: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scanner-beam, .hero-scan { display: none; }
}

/* Featured: two photos and a short list of picked writeups and projects */
.feat-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feat-photo { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 5; background: #04080f; border: 1px solid var(--line-strong); text-decoration: none; transition: border-color 0.15s; }
.feat-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92); transition: transform 0.4s ease, filter 0.2s; }
.feat-photo:hover { border-color: var(--sig); }
.feat-photo:hover img { transform: scale(1.04); filter: none; }
.feat-photo span { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; background: rgba(5, 10, 18, 0.8); border: 1px solid var(--line); color: var(--text); font: 500 0.8125rem var(--mono); }
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px 52px 20px 20px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.15s; }
.pick:hover { border-color: var(--sig); }
.pick-kind { color: var(--sig); font: 400 0.75rem var(--mono); }
.pick strong { font: 600 1.1875rem/1.25 var(--display); }
.pick-desc { color: var(--muted); font-size: 0.9375rem; }
.pick i { position: absolute; top: 20px; right: 20px; color: var(--sig); font: 400 1.125rem var(--mono); font-style: normal; transition: transform 0.15s; }
.pick:hover i { transform: translateX(4px); }
@media (max-width: 640px) { .feat-photos, .picks { grid-template-columns: minmax(0, 1fr); } .feat-photo { aspect-ratio: 4 / 3; } }
