/* Iago Novais — portfolio */
:root {
	--ink: rgba(0, 0, 0, 0.82);
	--ink-soft: rgba(0, 0, 0, 0.62);
	--ink-faint: rgba(0, 0, 0, 0.42);
	--line: rgba(0, 0, 0, 0.12);
	--bg: #ffffff;
	--panel: #eaeaea;
	--pink: #f2386b;
	--pad: 1.25rem;
	--s1: 1rem;
	--s2: 2rem;
	--s3: 4rem;
	--s4: 7rem;
	--font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
}
@media (max-width: 760px) {
	:root { --pad: 1rem; --s1: 0.75rem; --s2: 1.5rem; --s3: 2.75rem; --s4: 4rem; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
}
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:active { opacity: 0.7; }
::selection { background: #ececec; color: inherit; }

/* ---------- top: intro + menu ---------- */
.top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 2rem;
	padding: var(--pad);
}
.intro {
	font-size: clamp(1.15rem, 2.1vw, 1.75rem);
	line-height: 1.2;
	font-weight: 500;
	letter-spacing: -0.01em;
	max-width: none;
}
@media (max-width: 1100px) { .intro br:first-of-type { display: none; } }
@media (max-width: 760px) { .intro br { display: none; } }
.intro a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.intro a:hover { border-color: currentColor; }
.menu {
	position: fixed;
	top: var(--pad);
	right: var(--pad);
	z-index: 50;
	display: flex;
	gap: 0.3rem;
	font-size: 0.82rem;
	font-weight: 500;
}
.menu a {
	background: rgba(255, 255, 255, 0.82);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	padding: 0.32em 0.8em;
	border-radius: 999px;
	transition: background .2s, color .2s;
}
.menu a:hover, .menu a[aria-current] { background: var(--ink); color: #fff; }
.top .menu-spacer { flex: none; width: 17rem; }
@media (max-width: 760px) {
	.top { flex-direction: column; padding-top: 3.4rem; gap: 0; }
	.top .menu-spacer { display: none; }
	.menu { font-size: 0.78rem; gap: 0.25rem; }
	.menu a { padding: 0.3em 0.6em; }
}

main { padding: 0 var(--pad); }

/* ---------- home grid ---------- */
.grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.5rem 1rem;
	margin-top: var(--s3);
}
.card { display: block; }
.card.wide { grid-column: 1 / -1; }
.card .thumb {
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background: var(--panel);
}
.card.wide .thumb { aspect-ratio: 16 / 9; }
.card .thumb img {
	height: 100%;
	object-fit: cover;
	transition: transform .7s cubic-bezier(.2,.7,.2,1);
}
.card:hover .thumb img { transform: scale(1.025); }
.card .cap {
	margin-top: 0.7rem;
	font-size: 0.95rem;
	font-weight: 600;
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.6em;
}
.card .cap span { color: var(--ink-faint); font-weight: 400; }
@media (max-width: 760px) {
	.grid { grid-template-columns: 1fr; gap: 2rem; }
	.card.wide .thumb { aspect-ratio: 3 / 2; }
}

/* ---------- case pages ---------- */
.case { margin-top: var(--s3); }
h1 {
	font-size: clamp(2.6rem, 6.2vw, 5.4rem);
	line-height: 1.02;
	font-weight: 500;
	letter-spacing: -0.03em;
}
.subtitle {
	margin-top: 0.6rem;
	font-size: 1rem;
	color: var(--ink-soft);
	max-width: 46em;
}
.meta {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-top: var(--s2);
	font-size: 0.9rem;
}
.label {
	display: block;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink);
	margin-bottom: 0.15rem;
}
.meta p { color: var(--ink-soft); }
.hero { margin-top: var(--s2); background: var(--panel); }
.stats {
	display: grid;
	grid-template-columns: repeat(var(--n, 4), 1fr);
	gap: 1rem;
	margin-top: var(--s2);
}
.stats b {
	display: block;
	font-size: clamp(1.7rem, 3vw, 2.5rem);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.1;
}
.stats p { margin-top: 0.45rem; font-size: 0.9rem; color: var(--ink-soft); max-width: 22em; }

section { margin-top: var(--s4); }
h2 {
	font-size: clamp(1.6rem, 2.6vw, 2.3rem);
	line-height: 1.08;
	font-weight: 500;
	letter-spacing: -0.02em;
}
h2 + * { margin-top: var(--s1); }
.cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s2) 2.5rem;
}
.cols p + p { margin-top: 1em; }
.prose p { color: var(--ink-soft); max-width: 40em; }
.prose p + p { margin-top: 1em; }

.steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
}
.steps .n { font-size: 0.8rem; color: var(--ink-faint); font-weight: 600; }
.steps h3 { font-size: 1rem; font-weight: 600; margin: 0.2rem 0 0.3rem; }
.steps p { font-size: 0.92rem; color: var(--ink-soft); }
.figure { margin-top: var(--s3); background: var(--panel); }
.figure figcaption, .decision figcaption {
	padding: 0.6rem 0 0;
	background: var(--bg);
	font-size: 0.82rem;
	color: var(--ink-faint);
}

.decision {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem 2.5rem;
	align-items: start;
}
.decision + .decision { margin-top: var(--s3); }
.decision h3 {
	font-size: clamp(1.15rem, 1.6vw, 1.45rem);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
	margin-bottom: 0.7rem;
}
.decision p { color: var(--ink-soft); }
.decision p + p { margin-top: 0.9em; }
.decision.full { grid-template-columns: 1fr; }
.decision.full .text { max-width: 46em; }
.decision figure { background: var(--panel); }

/* flow ticker */
.ticker {
	margin: var(--s4) calc(var(--pad) * -1) 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: clamp(1.5rem, 3vw, 2.6rem);
	font-weight: 500;
	letter-spacing: -0.02em;
	padding: 0.35em 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}
.ticker .track { display: inline-block; animation: tick 70s linear infinite; }
.ticker em { font-style: normal; color: var(--pink); margin: 0 0.6em; }
.ticker i { font-style: normal; color: var(--ink-faint); }
@keyframes tick { to { transform: translateX(-50%); } }

.next {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: var(--s4);
	padding-top: 1.2rem;
	border-top: 1px solid var(--line);
	font-weight: 500;
}
.next a:hover { color: var(--pink); }
.next .to { text-align: right; }
.next small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 0.8rem; }

/* ---------- about ---------- */
.about-row {
	display: grid;
	grid-template-columns: 1fr 1fr 2fr;
	gap: 1.5rem 2.5rem;
}
.about-row + .about-row { margin-top: var(--s4); }
.about-row .label { margin-top: 0.4rem; }
.about-row h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.about-row .prose p { color: var(--ink); }
.jobs li { list-style: none; }
.jobs li + li { margin-top: 1rem; }
.jobs b { font-weight: 600; }
.jobs span { display: block; color: var(--ink-soft); }
.contact a { border-bottom: 1px solid var(--line); }
.contact a:hover { border-color: var(--ink); }

/* ---------- footer ---------- */
footer {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: var(--s4) var(--pad) var(--pad);
	font-size: 0.82rem;
	color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
	h1 { line-height: 0.98; }
	h2 { line-height: 1.08; }
	.meta { grid-template-columns: 1fr 1fr; gap: 1rem; }
	.stats { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
	.cols, .decision, .about-row { grid-template-columns: 1fr; }
	.steps { grid-template-columns: 1fr 1fr; gap: 1.25rem 1rem; }
	.about-row h2 { margin-top: -0.6rem; }
	.next { flex-direction: column; }
	.next .to { text-align: left; }
}

/* mobile: images run edge to edge, text keeps its margin */
@media (max-width: 760px) {
	.hero, .figure, .decision figure, .card .thumb {
		margin-left: calc(var(--pad) * -1);
		margin-right: calc(var(--pad) * -1);
	}
	.figure figcaption, .decision figcaption { padding-left: var(--pad); padding-right: var(--pad); }
	.decision figure { margin-top: 0.5rem; }
}

/* mobile: tighter line spacing */
@media (max-width: 760px) {
	body { line-height: 1.38; }
	.intro { line-height: 1.12; }
	.subtitle, .stats p, .steps p, .meta p, .jobs span { line-height: 1.35; }
	.decision h3 { line-height: 1.15; }
}


/* ---------- mobile polish: edge-to-edge images, tighter leading ---------- */
@media (max-width: 760px) {
	body { line-height: 1.42; }
	.intro { line-height: 1.12; }
	.subtitle, .meta, .stats p, .steps p, .prose p, .decision p, .jobs span { line-height: 1.4; }
	.stats b { line-height: 1.05; }
	.decision h3 { line-height: 1.15; }
	.hero, .figure, .decision figure, .card .thumb {
		margin-left: calc(var(--pad) * -1);
		margin-right: calc(var(--pad) * -1);
	}
	.grid { gap: 2.25rem; }
	.card .cap { font-size: 1.05rem; flex-direction: column; gap: 0.1rem; line-height: 1.25; }
	.figure figcaption, .decision figcaption { padding: 0.6rem var(--pad) 0; }
}

/* ---------- motion ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; transition: none; }
	.ticker .track { animation: none; }
	html { scroll-behavior: auto; }
}

.thanks { margin-top: var(--s3); color: var(--ink-soft); font-style: italic; max-width: 46em; }

/* language switch, pinned bottom-right */
.lang {
	position: fixed;
	right: var(--pad);
	bottom: var(--pad);
	z-index: 50;
	display: flex;
	gap: 0.3rem;
	font-size: 0.8rem;
	font-weight: 500;
}
.lang a {
	background: rgba(255, 255, 255, 0.82);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid var(--line);
	padding: 0.32em 0.8em;
	border-radius: 999px;
	transition: background .2s, color .2s;
}
.lang a:hover, .lang a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
footer { justify-content: flex-start; gap: 2rem; padding-bottom: calc(var(--pad) + 2.6rem); }

/* ---------- v5 polish ---------- */
/* flow strip: one colour, no rules, bigger, arrows only */
.ticker {
	border: 0;
	font-size: clamp(2.2rem, 5.2vw, 4.6rem);
	letter-spacing: -0.03em;
	color: var(--ink);
	padding: 0.1em 0;
}
.ticker .track { animation-duration: 90s; }
.ticker i, .ticker em { all: unset; }
/* classic link blue on prev/next and inline links */
.next a:hover { color: #1a0dab; }
a.inline { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a.inline:hover { color: #1a0dab; }
/* desktop-only line break in subtitles */
@media (max-width: 760px) { br.desk { display: none; } }
/* footer: Top aligned with the right column */
footer.inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
footer.home { display: flex; }
@media (max-width: 760px) { footer.inner { grid-template-columns: 1fr auto; gap: 1rem; } }
/* vertical infinite scroll for process boards */
.vmarquee { height: 34rem; overflow: hidden; position: relative; }
.vmarquee .vtrack { animation: vscroll 60s linear infinite; }
.vmarquee:hover .vtrack { animation-play-state: paused; }
@keyframes vscroll { to { transform: translateY(-50%); } }
@media (max-width: 760px) { .vmarquee { height: 22rem; } }
@media (prefers-reduced-motion: reduce) { .vmarquee .vtrack { animation: none; } }

/* about portrait */
.portrait { background: var(--panel); }
.portrait img { aspect-ratio: 2 / 3; object-fit: cover; }
@media (max-width: 760px) { .portrait { margin: 0 calc(var(--pad) * -1); } }
