/* Scrollable Matrix-style resume page. Builds on the tokens and rain styles in matrix.css.
   Readability rules: mono font for headings/labels, sans for reading text;
   bright green only for highlights; glow only on h1/h2. */

:root {
	--text: #cfe8d4;   /* body text: soft mint, easier on the eyes than pure green */
	--head: #e6fff0;   /* headings */
	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	--panel-solid: rgba(0, 10, 2, .97);
}

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body.page { height: auto; min-height: 100%; color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6; }
body.page::after { display: none; } /* no full-page scanlines: they cut text contrast */

/* rain is full strength on the first screen, then fades so it doesn't compete with reading */
body.page #rain { transition: opacity .8s; }
body.page.scrolled #rain { opacity: .15; }

h1, h2, h3, .brand, .links, .btn, .tags, .kicker, .role, .stats, time, .num, .idx, .facts dt, .card summary::after, .foot { font-family: var(--mono); }

a { color: var(--green); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--green); color: #000; padding: 6px 10px; }
.skip:focus { left: 8px; }

/* ---------- nav ---------- */
.topnav {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; gap: 16px;
	padding: 12px max(16px, calc((100% - 1040px) / 2));
	background: rgba(0, 0, 0, .9);
	border-bottom: 1px solid var(--dim);
	backdrop-filter: blur(4px);
}
.brand { font-weight: 700; text-decoration: none; text-shadow: var(--glow); }
.links { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.links a { padding: 4px 10px; border-radius: 4px; text-decoration: none; color: var(--text); opacity: .75; white-space: nowrap; font-size: 14px; }
.links a:hover, .links a.active { color: var(--green); opacity: 1; background: rgba(0, 255, 65, .08); }

.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- layout ---------- */
main, .foot { position: relative; z-index: 1; }
main > header, main > section {
	width: min(1040px, calc(100% - 32px));
	margin: 0 auto;
	padding: 72px 0 24px;
}
section { border-top: 1px dashed rgba(0, 143, 17, .4); }

h1, h2, h3 { color: var(--head); margin: 0; }
h1, h2 { text-shadow: var(--glow); }
h2 { font-size: 26px; margin-bottom: 24px; letter-spacing: .02em; }
h2 .idx { color: var(--green); font-size: 18px; }
h3 { font-size: 16px; line-height: 1.5; }
h3.sub { margin: 32px 0 16px; color: var(--green); }
.about h3.sub { margin: 24px 0 12px; }
.lead { font-size: 18px; line-height: 1.7; margin: 0 0 16px; max-width: 70ch; }
.muted { color: #8fb39a; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.btn {
	display: inline-block; padding: 10px 18px;
	border: 1px solid var(--green); border-radius: 4px;
	text-decoration: none; color: var(--green); font-weight: 700; font-size: 14px;
	transition: background .15s, color .15s, box-shadow .15s;
}
.btn.small { padding: 5px 10px; font-size: 13px; white-space: nowrap; }
.btn.primary { background: var(--green); color: #000; }
.btn:hover, .btn:focus-visible { background: var(--head); color: #000; box-shadow: 0 0 18px rgba(0, 255, 65, .5); outline: none; }

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; gap: 48px; min-height: calc(100vh - 60px); border: 0; }
.avatar {
	position: relative; flex: none; width: 220px; height: 220px;
	border-radius: 50%; overflow: hidden; outline: none;
	border: 2px solid var(--green); box-shadow: 0 0 40px rgba(0, 255, 65, .35);
}
/* cut-out portrait in real colours (transparent background) so the live rain shows through the circle */
.avatar { background: radial-gradient(circle at 50% 40%, rgba(0, 255, 65, .1), transparent 70%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.kicker { color: var(--green); margin: 0 0 8px; }
.notfound { justify-content: center; text-align: center; }
.notfound .actions { justify-content: center; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.1; }
.role { font-size: clamp(18px, 3vw, 24px); margin: 8px 0; color: var(--green); }
.key_skills { margin: 12px 0 0; }
.key_skills li { font-size: 14px; padding: 4px 12px; color: var(--head); }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 8px 0 0; }
.stats li { min-width: 120px; padding: 10px 14px; border: 1px solid var(--dim); border-radius: 6px; background: var(--panel-solid); }
.stats strong { display: block; font-size: 24px; color: var(--green); }
.stats span { font-size: 13px; color: var(--text); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; }
.facts { margin: 0; padding: 16px; border: 1px solid var(--dim); border-radius: 6px; background: var(--panel-solid); }
.facts dt { color: var(--green); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 0 0 12px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--dim); }
.timeline li { position: relative; padding: 0 0 28px 16px; }
.timeline li::before {
	content: ""; position: absolute; left: -27px; top: 6px;
	width: 12px; height: 12px; border-radius: 50%;
	background: #000; border: 2px solid var(--green); box-shadow: var(--glow);
}
.job_head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.job_head .company { color: var(--green); font-weight: 400; }
.timeline time { color: var(--warn); font-size: 14px; white-space: nowrap; }
.timeline p { margin: 2px 0 0; max-width: 70ch; }
.clients { color: var(--head); }
.highlights { margin: 8px 0 0; padding-left: 1.2em; max-width: 75ch; }
.highlights li { margin: 4px 0; }
.highlights li::marker { color: var(--green); }

/* ---------- projects ---------- */
.cards { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 16px; }
.card { flex: 0 1 510px; border: 1px solid var(--dim); border-radius: 6px; background: var(--panel-solid); transition: border-color .15s, box-shadow .15s; }
.card:hover, .card[open] { border-color: var(--green); box-shadow: 0 0 20px rgba(0, 255, 65, .15); }
.card summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 16px; cursor: pointer; list-style: none; }
.card summary::-webkit-details-marker { display: none; }
.card summary:focus-visible { outline: 1px solid var(--green); }
.card .num { color: var(--green); font-weight: 700; }
/* equal-size closed cards: title and impact reserve fixed lines, tags stay on 1 line (max 4 + "+N") */
.card h3 { min-height: calc(2 * 1.5em); }
.card .impact { grid-column: 2; min-height: calc(2 * 1.5em); font-size: 15px; line-height: 1.5; color: var(--green); }
.card .tags { grid-column: 2; flex-wrap: nowrap; overflow: hidden; }
/* amber pill so the expand action stands out from the green card */
.card summary::after {
	content: "Show details ▾"; grid-column: 2; justify-self: start; margin-top: 6px;
	padding: 3px 12px; border: 1px solid var(--warn); border-radius: 999px;
	font-size: 13px; font-weight: 700; color: var(--warn);
	transition: background .15s, color .15s;
}
.card[open] summary::after { content: "Hide details ▴"; }
.card summary:hover::after, .card summary:focus-visible::after { background: var(--warn); color: #000; }
.detail { padding: 0 16px 16px; font-size: 15px; }
.detail ul { margin: 6px 0 6px 1.2em !important; padding: 0; }
.detail li { margin: 6px 0; }
.detail strong { color: var(--head); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags > * { padding: 2px 8px; border: 1px solid rgba(0, 143, 17, .8); border-radius: 3px; font-size: 13px; background: rgba(0, 255, 65, .06); }

/* ---------- skills ---------- */
.skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.skills > div { flex: 0 1 320px; text-align: center; padding: 16px; border: 1px solid var(--dim); border-radius: 6px; background: var(--panel-solid); }
.skills h3 { margin-bottom: 12px; color: var(--green); }
.skills .tags { justify-content: center; }
.skills .tags li { font-size: 14px; padding: 4px 10px; }
/* category filter: only shown when JS runs, otherwise all categories are simply listed */
.skill_tabs { display: none; }
.js .skill_tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px; }
.skill_tabs button {
	padding: 6px 14px; border: 1px solid var(--dim); border-radius: 999px; cursor: pointer;
	background: transparent; color: var(--text); font: 14px var(--mono);
	transition: background .15s, color .15s, border-color .15s;
}
.skill_tabs button:hover, .skill_tabs button:focus-visible { border-color: var(--green); color: var(--green); outline: none; }
.skill_tabs button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #000; font-weight: 700; }
.skills.filtered > div { flex-basis: 640px; }
/* 2-row clamp (max-height set by matrix-page.js) */
.skills .tags { position: relative; overflow: hidden; }
.tags_more {
	margin-top: 10px; padding: 3px 12px; cursor: pointer;
	background: transparent; border: 1px solid var(--warn); border-radius: 999px;
	color: var(--warn); font: 700 13px var(--mono);
	transition: background .15s, color .15s;
}
.tags_more:hover, .tags_more:focus-visible { background: var(--warn); color: #000; outline: none; }

/* ---------- certifications ---------- */
.certs_grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.certs_grid figure { flex: 0 1 180px; margin: 0; padding: 16px; text-align: center; border: 1px solid var(--dim); border-radius: 6px; background: var(--panel-solid); transition: transform .15s, border-color .15s; }
.certs_grid figure:hover { transform: translateY(-3px); border-color: var(--green); }
.certs_grid img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; }
.certs_grid figure:focus { outline: none; border-color: var(--green); }
.certs_grid figcaption { font-size: 14px; line-height: 1.4; margin-top: 8px; }

/* ---------- contact / footer ---------- */
.contact { padding: 32px; text-align: center; border: 1px solid var(--green); border-radius: 8px; background: var(--panel-solid); box-shadow: 0 0 40px rgba(0, 255, 65, .12); }
.contact .lead { margin-left: auto; margin-right: auto; }
.contact .actions { justify-content: center; }
.foot { text-align: center; padding: 48px 16px 32px; color: #8fb39a; font-size: 13px; }

/* ---------- reveal on scroll (only when JS runs, so content never stays hidden) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
	.hero { flex-direction: column; text-align: center; gap: 24px; padding-top: 40px; min-height: 0; }
	.avatar { width: 160px; height: 160px; margin: 0 auto; }
	.hero .actions, .stats, .key_skills { justify-content: center; }
	.about { grid-template-columns: 1fr; }
	.topnav .brand { display: none; }
	.links { margin: 0; }
	main > header, main > section { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.cursor { animation: none; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
	#rain, .topnav, .foot { display: none; }
	body.page, .card, .facts, .stats li, .skills > div, .contact, .certs_grid figure { background: #fff; color: #000; text-shadow: none; box-shadow: none; }
	h1, h2, h3, .stats strong, .card .impact, .company { color: #000; text-shadow: none; }
	.js .reveal { opacity: 1; transform: none; }
}
