/* ===================================================================
 *  site.css: Javier Pastor Serrano, portfolio
 *  red / black / white; Archivo (expanded for display, normal for text)
 *  motif: one red square "pixel"
 * ------------------------------------------------------------------- */

/* Archivo variable (weight 100-900, width 62-125%), self-hosted, OFL licence in fonts/archivo */
@font-face {
	font-family: "Archivo";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	font-stretch: 62% 125%;
	src: url("../fonts/archivo/archivo-latin-wdth-normal.woff2") format("woff2-variations"), url("../fonts/archivo/archivo-latin-wdth-normal.woff2") format("woff2");
}

:root {
	--red: #E5242F;         /* text on white: 4.5:1 */
	--red-hot: #F0383E;     /* red on dark: 4.8:1 */
	--black: #121212;
	--graphite: #1C1C1F;
	--line-dark: #2C2C31;
	--grey: #6E6E73;        /* body on white: 5:1 */
	--grey-dark: #A1A1A6;   /* body on dark: 7:1 */
	--fog: #F4F4F4;
	--line: #E4E4E6;
	--white: #FFFFFF;

	--font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
	--wrap: 1200px;
	--gutter: clamp(20px, 4vw, 48px);
	--radius: 14px;

	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--white);
	color: var(--black);
	font: 400 1rem/1.6 var(--font);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
section[id] { scroll-margin-top: 72px; }
#intro, #contact { scroll-margin-top: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--red); color: #fff; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; border-radius: 4px; }

.pixel { display: inline-block; width: 10px; height: 10px; background: var(--red); flex: none; }

/* ---------- buttons ---------- */
.btn {
	display: inline-flex; align-items: center; gap: 10px;
	height: 52px; padding: 0 26px;
	border-radius: 999px;
	font-weight: 600; font-size: 1rem; letter-spacing: 0.005em;
	text-decoration: none; white-space: nowrap;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { border: 1.5px solid currentColor; }
.btn .fa { font-size: 1.1rem; }
@media (hover: hover) and (pointer: fine) {
	.btn-red:hover { background: #C81E28; }
	.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
}

/* ---------- header ---------- */
.site-header {
	position: fixed; inset: 0 0 auto 0; z-index: 50;
	color: #fff;
	transition: background-color 200ms ease, box-shadow 200ms ease;
}
.site-header.is-scrolled { background: rgba(18, 18, 18, 0.97); box-shadow: 0 1px 0 var(--line-dark); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand-sub { padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.65); font-stretch: 100%; font-weight: 500; }
@media (max-width: 420px) { .brand-sub { display: none; } }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-stretch: 112%; font-size: 1.05rem; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
	position: relative;
	padding: 8px 14px;
	font-weight: 500; font-size: .95rem;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	border-radius: 999px;
	transition: color 150ms ease;
}
.site-nav a:hover, .site-nav a.is-active { color: #fff; }
.site-nav a.is-active::after {
	content: ""; position: absolute; left: 50%; bottom: 0;
	width: 6px; height: 6px; margin-left: -3px; background: var(--red-hot);
}
.site-nav .nav-cv { margin-left: 8px; border: 1.5px solid rgba(255, 255, 255, 0.35); color: #fff; padding: 7px 16px; }
.site-nav .nav-cv:hover { border-color: #fff; }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
	position: absolute; left: 11px; width: 22px; height: 2px; background: #fff;
	transition: transform 200ms var(--ease-out), opacity 150ms ease;
}
.nav-toggle-bars { top: 21px; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); background: #fff; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); background: #fff; }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.site-nav {
		position: absolute; top: 72px; left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 0;
		padding: 8px var(--gutter) 24px;
		background: var(--black);
		border-bottom: 1px solid var(--line-dark);
		opacity: 0; transform: translateY(-8px); visibility: hidden;
		transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s linear 180ms;
	}
	.site-nav.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
	.site-nav a { padding: 14px 0; font-size: 1.15rem; border-radius: 0; border-bottom: 1px solid var(--line-dark); }
	.site-nav a.is-active::after { left: auto; right: 0; bottom: 50%; margin: 0 0 -3px; }
	.site-nav .nav-cv { margin: 16px 0 0; text-align: center; border-radius: 999px; }
	.site-header.menu-open { background: var(--black); }
}

/* ---------- shared bits ---------- */
.arrow { display: inline-block; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); flex: none; transition: transform 200ms var(--ease-out); }
.arrow--left { transform: rotate(-135deg); }
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: var(--red-hot); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(240, 56, 62, 0.6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(240, 56, 62, 0); } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; background: var(--black); color: #fff; overflow: hidden; }
.hero::before {           /* faint pixel grid */
	content: ""; position: absolute; inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.2px);
	background-size: 24px 24px;
	mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
	pointer-events: none;
}
.hero::after {            /* red glow that follows the pointer */
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(560px circle at var(--mx, 72%) var(--my, 38%), rgba(229, 36, 47, 0.2), transparent 62%);
	pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 80px; align-items: center; width: 100%; padding-top: 120px; padding-bottom: 88px; }
.hero-copy { container-type: inline-size; }
.hero-title { font-stretch: 125%; font-weight: 800; font-size: min(3.4rem, 7.2cqw); white-space: nowrap; line-height: 1.04; letter-spacing: -0.025em; margin-bottom: 12px; }
.amp { font-family: Arial, Helvetica, sans-serif; font-weight: inherit; }
.hero-role .amp { font-weight: 700; }
.hero-role .role-sep { opacity: .6; margin: 0 .15em; }
.hero-role { font-stretch: 125%; font-weight: 800; font-size: min(1.7rem, 4.1cqw); white-space: nowrap; line-height: 1.15; letter-spacing: -0.02em; color: var(--red-hot); margin-bottom: 20px; }
@media (max-width: 600px) { .hero-role { font-stretch: 100%; font-size: 5cqw; } }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.word-in { display: inline-block; animation: word-up 800ms var(--ease-out) both; animation-delay: calc(var(--i) * 100ms + 100ms); }
@keyframes word-up { from { transform: translateY(105%) rotate(4deg); } to { transform: none; } }
.hero-lede { max-width: 92.7cqw; text-wrap: pretty; color: rgba(255, 255, 255, 0.72); font-size: 1.1rem; line-height: 1.6; margin-bottom: 36px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
[data-hero] { animation: rise 700ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-collage {
	display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
	transform: rotate(-4deg); width: 88%; margin-inline: auto;
}
.hero-collage > * { width: 100%; border-radius: 12px; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45); animation: tile-in 800ms var(--ease-out) both; }
.hero-collage img { aspect-ratio: 16 / 9; object-fit: cover; }
.hero-collage > :nth-child(odd):not(:first-child) { transform: translateY(30px); }
.hero-collage .tile-big { grid-column: 1 / -1; position: relative; overflow: hidden; margin-bottom: 8px; }
.hero-collage .tile-big img { display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 0; box-shadow: none; }
.hero-collage .tile-big > span { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(17, 17, 17, 0.78); color: #fff; font-size: .78rem; font-weight: 600; }
.hero-collage .tile-big .pixel { width: 7px; height: 7px; background: var(--red-hot); }
.hero-collage > :nth-child(1) { animation-delay: 300ms; }
.hero-collage > :nth-child(2) { animation-delay: 400ms; }
.hero-collage > :nth-child(3) { animation-delay: 460ms; }
.hero-collage > :nth-child(4) { animation-delay: 520ms; }
.hero-collage > :nth-child(5) { animation-delay: 580ms; }
.hero-collage > :nth-child(6) { animation-delay: 640ms; }
.hero-collage > :nth-child(7) { animation-delay: 700ms; }
@keyframes tile-in { from { opacity: 0; translate: 0 28px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }
@media (max-width: 960px) {
	.hero { min-height: 100svh; }
	.hero-inner { grid-template-columns: 1fr; padding-top: 112px; padding-bottom: 72px; }
	.hero-collage { width: 94%; max-width: 480px; margin: 12px auto 40px; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); transform: rotate(-3deg); }
	.hero-collage > :nth-child(5) { display: none; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 8vw, 104px) 0; }
.section-about { padding-bottom: clamp(40px, 4.5vw, 64px); }
.section-head { margin-bottom: 40px; }
.section-title {
	font-stretch: 125%; font-weight: 800;
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1; letter-spacing: -0.03em;
}

/* ---------- work ---------- */
.cards { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.card { grid-column: span 4; }
.card--big { grid-column: span 6; }
.card--hero { grid-column: 1 / -1; }
.card-hit {
	position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
	border-radius: var(--radius); background: var(--graphite); color: #fff; text-align: left;
	transition: transform 160ms var(--ease-out);
}
.card--hero .card-hit { aspect-ratio: 21 / 9; }
.card-hit img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.card--hero .card-hit img { object-position: 50% 28%; }
.card-hit::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0) 62%); pointer-events: none; }
.card-body { position: absolute; z-index: 1; left: 0; right: 64px; bottom: 0; padding: 18px 20px; }
.card-title { display: block; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55); font-weight: 700; font-stretch: 112%; font-size: 1.05rem; line-height: 1.2; }
.card--big .card-title { font-size: 1.4rem; }
.card--hero .card-body { padding: 28px 32px; }
.card--hero .card-title { font-stretch: 125%; font-weight: 800; font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1; letter-spacing: -0.02em; }
.card-no, .card-badge { position: absolute; z-index: 1; left: 16px; top: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(18, 18, 18, 0.72); font-size: .78rem; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.card-badge { display: inline-flex; align-items: center; gap: 9px; letter-spacing: 0; font-size: .82rem; font-weight: 600; padding: 7px 14px; left: 20px; top: 20px; }
.card-badge::before { content: ""; width: 8px; height: 8px; background: var(--red-hot); animation: pulse 2s ease-out infinite; }
.card-go { position: absolute; z-index: 1; right: 16px; bottom: 16px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--black); transition: background-color 160ms ease, color 160ms ease; }
.card-go .arrow { margin-left: -3px; }
.card--hero .card-go { right: 28px; bottom: 28px; width: 48px; height: 48px; }
@media (hover: hover) and (pointer: fine) {
	.card-hit:hover img { transform: scale(1.03); }
	.card-hit:hover .card-go { background: var(--red); color: #fff; }
}
.card-hit:active { transform: scale(0.985); }
@media (max-width: 960px) {
	.card { grid-column: span 6; }
	.card--hero { grid-column: 1 / -1; }
	.card--hero .card-hit { aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
	.cards { gap: 16px; }
	.card, .card--big { grid-column: 1 / -1; }
	.card--hero .card-body { padding: 18px; }
	.card--hero .card-go { right: 16px; bottom: 16px; width: 40px; height: 40px; }
}

/* ---------- experience + education: one timeline pattern, dark and light ---------- */
.section-exp { background: var(--graphite); color: #fff; }
.section-edu { background: var(--fog); }
.jobs { position: relative; padding-left: 44px; }
.jobs::before, .jobs::after { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--line-dark); }
.jobs::after { background: var(--red-hot); transform-origin: 50% 0; transform: scaleY(var(--tp, 0)); }
.job { position: relative; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px 56px; padding: 0 0 64px; }
.job:last-child { padding-bottom: 0; }
.job-node { position: absolute; left: -44px; top: 8px; width: 10px; height: 10px; background: var(--line-dark); transition: background-color 300ms ease, transform 400ms var(--ease-out); }
.job.is-visible .job-node, html:not(.js-reveal) .job-node { background: var(--red-hot); transform: scale(1.2); }
.job-dates { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--grey-dark); font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.now { padding: 2px 10px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.job-org { font-stretch: 118%; font-weight: 800; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.1; letter-spacing: -0.02em; }
.job-role { margin-top: 6px; color: rgba(255, 255, 255, 0.68); font-weight: 600; font-size: 1.02rem; }
.job-points { display: grid; gap: 12px; max-width: 46em; color: rgba(255, 255, 255, 0.82); }
.job-points li { position: relative; padding-left: 22px; }
.job-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--red-hot); }
.tech { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-width: 46em; margin-top: 22px; }
.tech li { display: grid; place-items: center; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line-dark); border-radius: 8px; color: var(--grey-dark); font-size: .82rem; font-weight: 500; text-align: center; line-height: 1.2; transition: border-color 160ms ease, color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .tech li:hover { border-color: var(--grey); color: #fff; } }
.tech--wide { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 6px; }
/* light variant */
.section-edu .tech { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; max-width: 46em; margin-top: 0; }
.section-edu .tech li { position: relative; display: block; min-height: 0; padding: 0 0 0 20px; border: 0; background: none; border-radius: 0; color: #3A3A3F; font-size: .92rem; text-align: left; line-height: 1.4; break-inside: avoid; }
@media (max-width: 560px) { .section-edu .tech { grid-template-columns: minmax(0, 1fr); } }
.section-edu .tech li::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; background: var(--red); }
.section-edu .jobs::before { background: var(--line); }
.section-edu .job-node { background: #C9C9CE; }
.section-edu .job-dates { color: var(--grey); }
.section-edu .job-role { color: var(--grey); }
.grade { margin-bottom: 18px; max-width: 30em; }
.grade-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.grade-top strong { font-stretch: 125%; font-weight: 800; font-size: 2rem; line-height: 1; letter-spacing: -0.02em; }
.grade-top span { color: var(--grey); font-weight: 600; }
.grade-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.grade-bar i { display: block; width: var(--w); height: 100%; background: var(--red); transform-origin: 0 50%; transition: transform 900ms var(--ease-out) 250ms; }
.js-reveal .job:not(.is-visible) .grade-bar i { transform: scaleX(0); }
.edu-text { color: var(--grey); font-size: .9rem; line-height: 1.65; max-width: 46em; }
@media (max-width: 860px) { .job { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 48px; } }

/* ---------- about ---------- */
.about-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 72px; align-items: center; margin-bottom: 64px; }
.about-copy .section-title { margin-bottom: 20px; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn-line { height: 46px; padding: 0 20px; border: 1.5px solid var(--black); }
@media (hover: hover) and (pointer: fine) { .btn-line:hover { background: var(--black); color: #fff; } }
.about-text { max-width: 30em; font-size: clamp(1.15rem, 1.8vw, 1.45rem); line-height: 1.55; text-wrap: balance; }
.about-figure { position: relative; width: 280px; }
.about-figure::after { content: ""; position: absolute; z-index: -1; right: -40px; top: -40px; width: 160px; height: 160px; background: radial-gradient(rgba(18, 18, 18, 0.18) 1.4px, transparent 1.6px) 0 0 / 16px 16px; }
.about-figure::before { content: ""; position: absolute; inset: 14px -14px 54px 14px; background: var(--red); border-radius: 18px; transition: transform 400ms var(--ease-out); }
.about-photo { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
	.about-figure:hover .about-photo { transform: translate(-4px, -4px); }
	.about-figure:hover::before { transform: translate(4px, 4px); }
}
.skill-rows { border-bottom: 1px solid var(--line); }
.skill-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 28px 0; border-top: 1px solid var(--line); }
.skill-row dt { display: flex; align-items: center; gap: 10px; color: var(--black); font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.skill-row dt::before { content: ""; width: 8px; height: 8px; background: var(--red); flex: none; }
.skill-row dd { margin: 0; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cells li { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 16px; background: var(--fog); border: 1px solid var(--fog); border-radius: 10px; font-size: .92rem; font-weight: 500; line-height: 1.25; transition: border-color 160ms ease, background-color 160ms ease, opacity 450ms var(--ease-out) calc(var(--i, 0) * 28ms), transform 450ms var(--ease-out) calc(var(--i, 0) * 28ms); }
.js-reveal .skill-rows:not(.is-visible) li { opacity: 0; transform: translateY(8px); }
.cells i { flex: none; width: 18px; text-align: center; color: var(--red); transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
	.cells li:hover { background: var(--white); border-color: var(--black); }
	.cells li:hover i { transform: scale(1.2); }
}
@media (max-width: 860px) {
	.about-top { grid-template-columns: 1fr; gap: 40px; }
	.about-figure { width: min(72%, 240px); margin-right: 14px; }
}
@media (max-width: 700px) {
	.about-top { grid-template-columns: 1fr; gap: 40px; }
	.about-figure { width: min(72%, 240px); margin-right: 14px; }
	.cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cells li { gap: 8px; padding: 8px 10px; font-size: .85rem; }
}

/* ---------- contact: flat dark section ---------- */
.section-contact { display: flex; align-items: center; min-height: calc(100svh - 72px); scroll-margin-top: 0; position: relative; background: var(--black); color: #fff; text-align: center; overflow: hidden; }
.section-contact > .wrap { width: 100%; }
.section-contact::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 55% 70% at 50% 0%, rgba(229, 36, 47, 0.26), transparent 70%), radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1.2px) 0 0 / 24px 24px; -webkit-mask-image: linear-gradient(#000, transparent 90%); mask-image: linear-gradient(#000, transparent 90%); pointer-events: none; }
.contact-card { position: relative; }
.contact-title { font-stretch: 125%; font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -0.035em; margin-bottom: 22px; }
.contact-lead { width: min(100%, 680px); margin: 0 auto 40px; color: var(--grey-dark); font-size: 1.1rem; text-wrap: balance; }
.contact-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 680px); margin: 0 auto 32px; }
.contact-actions .btn { justify-content: center; min-height: 56px; height: auto; padding: 12px 20px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.contact-actions .contact-mail { grid-column: 1 / -1; }
.contact-actions .btn-ghost { border-color: rgba(255, 255, 255, 0.28); }
.contact-meta { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 680px); margin: 0 auto; border-top: 1px solid var(--line-dark); padding-top: 24px; }
.contact-meta > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.contact-meta > div + div { border-left: 1px solid var(--line-dark); }
.contact-meta small { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-dark); }
.contact-meta b { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; }
.contact-meta .pixel { width: 8px; height: 8px; background: var(--red-hot); animation: pulse 2s ease-out infinite; }
.contact-meta .fa { color: var(--red-hot); }
@media (max-width: 560px) { .contact-actions { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: var(--black); color: rgba(255, 255, 255, 0.7); border-top: 1px solid var(--line-dark); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 26px; padding-bottom: 26px; }
.site-footer p, .site-footer a { display: flex; align-items: center; gap: 10px; }
.site-footer p::before { content: ""; width: 8px; height: 8px; background: var(--red); flex: none; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a i { color: var(--red); transition: transform 200ms var(--ease-out); }
.site-footer a:hover i { transform: translateY(-3px); }
.site-footer a { white-space: nowrap; }
@media (max-width: 520px) { .site-footer { font-size: .68rem; letter-spacing: .06em; } .site-footer p::before { margin-right: -2px; } }

/* ---------- project dialog ---------- */
.dlg {
	width: min(900px, calc(100vw - 32px));
	max-width: none; max-height: calc(100dvh - 40px);
	padding: 0; border: 0; border-radius: 20px;
	background: var(--white); color: var(--black);
	box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
	overflow: hidden;
	opacity: 0; transform: translateY(12px) scale(0.96);
	transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), overlay 240ms allow-discrete, display 240ms allow-discrete;
}
.dlg[open] { display: flex; opacity: 1; transform: none; }
@starting-style { .dlg[open] { opacity: 0; transform: translateY(12px) scale(0.96); } }
.dlg.is-closing { opacity: 0; transform: scale(0.98); transition-duration: 150ms; }
.dlg::backdrop { background: rgba(10, 10, 10, 0.78); opacity: 0; transition: opacity 240ms var(--ease-out), overlay 240ms allow-discrete, display 240ms allow-discrete; }
.dlg[open]::backdrop { opacity: 1; }
@starting-style { .dlg[open]::backdrop { opacity: 0; } }
.dlg.is-closing::backdrop { opacity: 0; }
/* three fixed zones: image, text (scrolls only if needed), footer with links and prev/next always in view */
.dlg-panel { position: relative; display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 40px); min-height: 0; }
.dlg-media { position: relative; flex: 0 1 auto; height: clamp(200px, 40vh, 460px); min-height: 120px; background: var(--graphite); }
.dlg-media img { width: 100%; height: 100%; object-fit: cover; }
.dlg-count { position: absolute; left: 20px; bottom: 16px; padding: 6px 14px; border-radius: 999px; background: rgba(18, 18, 18, 0.78); color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.dlg-close {
	position: absolute; top: 14px; right: 14px; z-index: 2;
	width: 44px; height: 44px; border-radius: 50%;
	background: rgba(18, 18, 18, 0.75); color: #fff;
	font-size: 1.7rem; line-height: 1;
	transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.dlg-close:hover { background: var(--red); }
.dlg-close:active { transform: scale(0.94); }
.dlg-body {
	flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
	padding: 26px 40px 20px;
	background:
		linear-gradient(#fff 30%, rgba(255, 255, 255, 0)) center top / 100% 36px no-repeat local,
		linear-gradient(rgba(255, 255, 255, 0), #fff 70%) center bottom / 100% 36px no-repeat local,
		radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.16), transparent) center top / 100% 12px no-repeat scroll,
		radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), transparent) center bottom / 100% 12px no-repeat scroll;
}
.dlg-body h3 { font-stretch: 118%; font-weight: 800; font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 14px; }
.dlg-text { max-width: 46em; }
.dlg-text p { color: #3A3A3F; line-height: 1.65; }
.dlg-text p + p { margin-top: 12px; }
.dlg-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 40px; border-top: 1px solid var(--line); background: var(--white); }
.dlg-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
	display: inline-flex; align-items: center; gap: 10px;
	height: 44px; padding: 0 20px;
	background: var(--black); color: #fff; border-radius: 999px;
	font-weight: 600; font-size: .95rem; text-decoration: none;
	transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.chip-link .fa { color: var(--red-hot); transition: color 150ms ease; }
.chip-link:hover { background: var(--red); }
.chip-link:hover .fa { color: #fff; }
.chip-link:active { transform: scale(0.97); }
.dlg-nav { display: flex; gap: 8px; margin-left: auto; }
.dlg-step { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: .92rem; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out); }
.dlg-step .arrow { width: 7px; height: 7px; }
.dlg-step:hover { background: var(--fog); border-color: var(--black); }
.dlg-step:active { transform: scale(0.96); }
@media (max-width: 720px) {
	.dlg { border-radius: 16px; width: calc(100vw - 20px); }
	.dlg-media { height: clamp(150px, 26vh, 240px); }
	.dlg-body { padding: 20px 20px 16px; }
	.dlg-foot { padding: 12px 20px; }
	.dlg-step { width: 44px; padding: 0; justify-content: center; }
	.dlg-step span { display: none; }
	.dlg-step .arrow { margin: 0; }
	.chip-link { padding: 0 16px; }
}

/* ---------- scroll reveal (added by site.js) ---------- */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out); }
.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.contact-actions .ref-btn { white-space: nowrap; }

.scroll-hint { position: absolute; left: 50%; bottom: 24px; z-index: 2; width: 22px; height: 36px; margin-left: -11px; border: 1.5px solid rgba(255, 255, 255, 0.35); border-radius: 12px; transition: border-color 160ms ease; }
.scroll-hint:hover { border-color: #fff; }
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--red-hot); animation: hint 1.8s var(--ease-out) infinite; }
@keyframes hint { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint span { animation: none; opacity: 1; } }
@media (max-width: 560px) {
	.hero-ctas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.hero-ctas .btn { justify-content: center; height: 48px; padding: 0 6px; font-size: .88rem; }
}
@media (max-width: 359px) { .hero-ctas { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
	.job-points { gap: 10px; font-size: .95rem; line-height: 1.5; }
	.job-points li { text-wrap: pretty; }
	.section:not(.section-edu) .tech { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; margin-top: 18px; }
	.section:not(.section-edu) .tech li { white-space: nowrap; }
	.section:not(.section-edu) .tech li.is-wide { grid-column: 1 / -1; }
}
@media (min-width: 561px) {
	.section:not(.section-edu) .tech { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.section:not(.section-edu) .tech li { white-space: nowrap; }
}
@media (min-width: 561px) and (max-width: 960px) { .hero-collage { margin-left: 0; } }
@media (min-width: 601px) and (max-width: 960px) {
	.card:last-child { grid-column: 1 / -1; }
	.card:last-child .card-hit { aspect-ratio: 21 / 9; }
}
@media (min-width: 601px) and (max-width: 760px) { .card:not(.card--hero) .card-title { font-size: .92rem; } .card-body { padding: 14px 16px; } }
