/* ==========================================================
   Horacio Rubio — main stylesheet
   Palette: signal pink, deep indigo, sun, teal, violet.
   Type: Archivo (variable width) for everything; display set
   wide and heavy, body set at normal width.
   ========================================================== */

@font-face {
	font-family: "Archivo";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	font-stretch: 62% 125%;
	src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"), url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Archivo";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	font-stretch: 62% 125%;
	src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations"), url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--ink: #1A1250;
	--ink-soft: #3A3375;
	--pink: #FF2D6F;
	--sun: #FFC93C;
	--teal: #00C9A7;
	--violet: #7A5CFF;
	--paper: #F4F2FF;
	--white: #FFFFFF;

	--font: "Archivo", "Helvetica Neue", Arial, sans-serif;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.3125rem;
	--step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	--step-3: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
	--step-4: clamp(2.75rem, 1.6rem + 5vw, 5.5rem);
	--step-hero: clamp(2.75rem, 7.3vw, 7.25rem);

	--gutter: clamp(1rem, 4vw, 3rem);
	--max: 1320px;
	--section: clamp(4.5rem, 10vw, 9rem);
	--radius-lg: 28px;
	--radius-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font-family: var(--font);
	font-size: var(--step-0);
	line-height: 1.6;
	font-variation-settings: "wdth" 100;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.results :focus-visible, .journey :focus-visible { outline-color: var(--sun); }

.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--ink); color: var(--white); padding: .75rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 760px; }

.section-title, .contact__title, .ledger__area, .case__principle { overflow-wrap: break-word; hyphens: auto; }
.section-title {
	font-size: var(--step-4);
	font-weight: 850;
	font-variation-settings: "wdth" 118;
	line-height: .95;
	letter-spacing: -0.025em;
	max-width: 14ch;
}
.section-title--sm { font-size: var(--step-3); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 3.25rem; padding: .8rem 1.6rem;
	border-radius: var(--radius-pill);
	border: 2px solid var(--ink);
	font-weight: 700; font-size: var(--step-0);
	text-decoration: none; line-height: 1.1;
	transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: var(--white); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn--sm { min-height: 2.75rem; padding: .55rem 1.2rem; font-size: var(--step--1); }
.btn--lg { min-height: 3.75rem; padding: 1rem 2rem; font-size: var(--step-1); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--pink);
	border-bottom: 2px solid transparent;
	transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--ink); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.5rem; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand__mark {
	display: grid; place-items: center;
	width: 2.6rem; height: 2.6rem; border-radius: 50%;
	background: var(--ink); color: var(--pink);
	font-weight: 900; font-variation-settings: "wdth" 125; font-size: .95rem; letter-spacing: -0.02em;
}
.brand__name { font-weight: 800; font-variation-settings: "wdth" 112; font-size: 1.05rem; }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav__list { display: flex; gap: 1.75rem; }
.site-nav__list a { text-decoration: none; font-weight: 600; }
.site-nav__list a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

.site-header__tools { display: flex; align-items: center; gap: .75rem; }
.lang-switch {
	display: grid; place-items: center;
	min-width: 2.75rem; height: 2.75rem; padding-inline: .6rem;
	border: 2px solid var(--ink); border-radius: var(--radius-pill);
	font-weight: 800; font-size: var(--step--1); text-decoration: none;
}
.lang-switch:hover { background: var(--ink); color: var(--pink); }
.site-nav { margin-left: auto; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
	position: relative;
	background: var(--pink);
	padding-block: clamp(3rem, 8vw, 7rem) clamp(7rem, 13vw, 11rem);
	overflow: hidden;
}
.hero__kicker { font-weight: 600; font-size: var(--step-0); line-height: 1.5; max-width: 60ch; }
.hero__title {
	margin-block: clamp(1.25rem, 3vw, 2.5rem) clamp(2rem, 5vw, 4rem);
	font-size: var(--step-hero);
	font-weight: 900;
	font-variation-settings: "wdth" 125;
	line-height: .86;
	letter-spacing: -0.035em;
}
.hero__line { display: block; }
.hero__line { white-space: nowrap; }
html[lang^="es"] .hero__title { font-size: clamp(2.5rem, 6.15vw, 6.1rem); }
.hero__line + .hero__line { padding-left: 0.6em; }

.hero__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2rem 4rem; }
.hero__lede { font-size: var(--step-1); line-height: 1.5; max-width: 52ch; font-weight: 500; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero__trace {
	position: absolute; left: 0; right: 0; bottom: 0;
	width: 100%; height: clamp(70px, 10vw, 150px);
}
.hero__trace path {
	fill: none; stroke: var(--ink); stroke-width: 4;
	stroke-linejoin: round; stroke-linecap: round;
	vector-effect: non-scaling-stroke;
	stroke-dasharray: 2400; stroke-dashoffset: 0;
}
.js .hero__trace path { stroke-dashoffset: 2400; animation: trace 2.4s cubic-bezier(.6,0,.2,1) .25s forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* ---------- Pillars ---------- */
.pillars { padding-block: var(--section); }
.pillars__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.pillars__intro { font-size: var(--step-1); line-height: 1.45; max-width: 38ch; color: var(--ink-soft); }
.pillars__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); }
.pillar { border-top: 4px solid var(--ink); padding-top: 1.5rem; }
.pillar:nth-child(1) { border-color: var(--pink); }
.pillar:nth-child(2) { border-color: var(--teal); }
.pillar:nth-child(3) { border-color: var(--violet); }
.pillar:nth-child(4) { border-color: var(--sun); }
.pillar__title {
	font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 112;
	line-height: 1.1; margin-bottom: .9rem; letter-spacing: -0.01em;
}
.pillar p { color: var(--ink-soft); max-width: 38ch; }

/* ---------- Results ledger ---------- */
.results { background: var(--ink); color: var(--white); padding-block: var(--section); }
.results__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem clamp(2rem, 6vw, 6rem); }
.results__head { position: sticky; top: 7rem; align-self: start; }
.results__intro { margin-top: 1.5rem; max-width: 34ch; color: #CFCBF2; font-size: var(--step-1); line-height: 1.45; }

.ledger { border-top: 1px solid rgba(255,255,255,.22); }
.ledger { margin: 0; }
.ledger__row {
	display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	align-items: baseline; gap: .5rem 2rem;
	padding-block: 1.6rem;
	border-bottom: 1px solid rgba(255,255,255,.22);
}
.ledger__area {
	font-size: var(--step-2); font-weight: 850; font-variation-settings: "wdth" 118;
	line-height: 1.1; letter-spacing: -0.01em; color: var(--sun);
}
.ledger__row:nth-child(3n+2) .ledger__area { color: var(--teal); }
.ledger__row:nth-child(3n+3) .ledger__area { color: #FF7AA3; }
.ledger__text { margin: 0; color: #E7E4FF; max-width: 46ch; }

/* ---------- Work ---------- */
.work { padding-block: var(--section); }
.work__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.work__intro { font-size: var(--step-1); line-height: 1.45; max-width: 36ch; color: var(--ink-soft); }
.work__list { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }

.case {
	--tone: var(--pink);
	--on-tone: var(--ink);
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	border: 2px solid var(--ink);
	border-radius: var(--radius-lg);
	overflow: hidden;
}
.case--teal { --tone: var(--teal); }
.case--sun { --tone: var(--sun); }
.case--violet { --tone: var(--violet); --on-tone: var(--white); }
.case:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.case:nth-child(even) .case__result { order: 2; border-left: 2px solid var(--ink); border-right: 0; }

.case__result {
	background: var(--tone); color: var(--on-tone);
	padding: clamp(1.75rem, 4vw, 3.25rem);
	display: flex; flex-direction: column; justify-content: flex-end; gap: .75rem;
	border-right: 2px solid var(--ink);
	min-height: 18rem;
}
.case__principle {
	font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
	font-weight: 900; font-variation-settings: "wdth" 120;
	line-height: .98; letter-spacing: -0.025em;
	max-width: 11ch;
}

.case__body { padding: clamp(1.75rem, 4vw, 3.25rem); display: flex; flex-direction: column; gap: 1rem; }
.case__kind { font-weight: 700; color: var(--ink-soft); font-size: var(--step--1); }
.case__title {
	font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 110;
	line-height: 1.12; letter-spacing: -0.01em; max-width: 24ch;
}
.case__body > p:not(.case__kind) { max-width: 62ch; color: var(--ink-soft); }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .75rem; }
.tags li {
	font-size: var(--step--1); font-weight: 600;
	padding: .3rem .8rem; border-radius: var(--radius-pill);
	background: var(--paper);
}

/* ---------- How I build (loop) ---------- */
.pattern { background: var(--violet); color: var(--white); padding-block: var(--section); }
.pattern :focus-visible { outline-color: var(--white); }
.pattern__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem 4rem; align-items: end; }
.pattern__head p { font-size: var(--step-1); max-width: 36ch; line-height: 1.45; }

.loop {
	counter-reset: loop;
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.25rem; margin-top: clamp(2.5rem, 5vw, 4rem);
}
.loop__step {
	counter-increment: loop;
	position: relative;
	background: var(--white); color: var(--ink);
	border-radius: var(--radius-lg);
	padding: 1.75rem 1.5rem 1.75rem;
}
.loop__step::before {
	content: counter(loop);
	display: grid; place-items: center;
	width: 2.75rem; height: 2.75rem; border-radius: 50%;
	background: var(--ink); color: var(--white);
	font-weight: 800; margin-bottom: 1.25rem;
}
.loop__step:not(:last-child)::after {
	content: ""; position: absolute; top: 3.1rem; right: -1.25rem;
	width: 1.25rem; height: 3px; background: var(--white);
}
.steps h3, .creds h3, .loop__step h3 { line-height: 1.25; }
.loop__step h3 { font-size: var(--step-1); font-weight: 800; font-variation-settings: "wdth" 110; line-height: 1.2; margin-bottom: .5rem; }
.loop__step p { color: var(--ink-soft); }
.pattern__statement {
	margin-top: clamp(3rem, 6vw, 5rem);
	font-size: var(--step-3); font-weight: 850; font-variation-settings: "wdth" 115;
	line-height: 1.05; letter-spacing: -0.02em; max-width: 24ch;
}
.pattern__also { margin-top: 2rem; max-width: 70ch; color: #EDE8FF; }

/* ---------- How I diagnose ---------- */
.method { padding-block: var(--section); background: var(--paper); }
.method__inner .section-title { max-width: 16ch; }
.steps {
	counter-reset: step;
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2.5rem clamp(1.5rem, 4vw, 3.5rem);
	margin-top: clamp(2.5rem, 5vw, 4rem);
}
.steps li { counter-increment: step; }
.steps li::before {
	content: counter(step);
	display: block;
	font-size: var(--step-4); font-weight: 900; font-variation-settings: "wdth" 125;
	line-height: 1; color: transparent;
	-webkit-text-stroke: 2px var(--pink);
	margin-bottom: .75rem;
}
.steps h3 { font-size: var(--step-1); font-weight: 800; margin-bottom: .35rem; }
.steps p { color: var(--ink-soft); max-width: 32ch; }
.method__tools { margin-top: 3rem; font-weight: 600; max-width: 60ch; }

/* ---------- Journey ---------- */
.journey { background: var(--ink); color: var(--white); padding-block: var(--section); }
.acts {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(2rem, 4vw, 3.5rem);
	margin-top: clamp(2.5rem, 5vw, 4rem);
}
.act { border-top: 2px solid rgba(255,255,255,.3); padding-top: 1.5rem; }
.act:last-child { border-top-color: var(--sun); }
.act__years {
	font-size: var(--step-3); font-weight: 900; font-variation-settings: "wdth" 120;
	line-height: 1; letter-spacing: -0.02em; color: var(--sun);
	margin-bottom: 1rem;
}
.act__title { font-size: var(--step-1); font-weight: 800; line-height: 1.25; margin-bottom: .6rem; }
.act p:not(.act__years) { color: #CFCBF2; max-width: 36ch; }
.journey__closing {
	margin-top: clamp(3rem, 6vw, 5rem);
	font-size: var(--step-2); font-weight: 700; font-variation-settings: "wdth" 108;
	line-height: 1.3; max-width: 34ch;
}

/* ---------- Credentials ---------- */
.creds { padding-block: calc(var(--section) * .75); }
.creds__inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 2rem 4rem; }
.creds__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.creds h3 { font-size: var(--step-0); font-weight: 800; margin-bottom: .75rem; }
.creds li { padding-block: .45rem; border-bottom: 1px solid #DCD8F5; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact { background: var(--sun); padding-block: var(--section); }
.contact__title {
	font-size: var(--step-4); font-weight: 900; font-variation-settings: "wdth" 122;
	line-height: .95; letter-spacing: -0.03em; max-width: 16ch;
}
.contact__body { margin-top: 2rem; font-size: var(--step-1); max-width: 54ch; line-height: 1.5; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.contact__pending {
	margin-top: 2rem; padding: 1rem 1.25rem; max-width: 60ch;
	border: 2px dashed var(--ink); border-radius: 14px; font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #CFCBF2; padding-block: 2.5rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.site-footer__name { color: var(--white); font-weight: 800; font-variation-settings: "wdth" 112; }
.site-footer__meta { font-size: var(--step--1); }
.site-footer__top { font-weight: 600; font-size: var(--step--1); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* ---------- Inner pages ---------- */
.page { padding-block: clamp(3rem, 8vw, 6rem) var(--section); }
.page__head { margin-bottom: 2.5rem; }
.page__title {
	font-size: var(--step-3); font-weight: 900; font-variation-settings: "wdth" 118;
	line-height: 1; letter-spacing: -0.02em;
}
.page__date { font-weight: 600; color: var(--ink-soft); margin-bottom: .75rem; }
.page__media { margin-bottom: 2.5rem; }
.page__media img { border-radius: var(--radius-lg); }
.page--404 p { margin-top: 1.5rem; }

.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 110; line-height: 1.15; margin-top: 2em; }
.prose h3 { font-size: var(--step-1); font-weight: 800; margin-top: 1.75em; }
.prose ul { list-style: disc; padding-left: 1.25em; }
.prose ol { list-style: decimal; padding-left: 1.25em; }
.prose li + li { margin-top: .4em; }
.prose a { text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose blockquote { margin: 2em 0; padding-left: 1.25rem; border-left: 4px solid var(--pink); font-size: var(--step-1); }

.post-list { display: grid; gap: 2rem; }
.post-card { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.post-card__date { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.post-card__title { font-size: var(--step-2); font-weight: 800; line-height: 1.15; margin-block: .4rem .6rem; }
.post-card__title a { text-decoration: none; }
.post-card__title a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.loop__step:nth-child(2)::after { display: none; }
	.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pillars__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.creds__inner { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
	.nav-toggle {
		display: grid; place-items: center;
		width: 3rem; height: 3rem; border-radius: 50%;
		border: 2px solid var(--ink); background: transparent; cursor: pointer;
	}
	.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
		display: block; width: 1.2rem; height: 2px; background: var(--ink); position: relative;
		transition: transform .2s ease, background-color .2s ease;
	}
	.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
	.nav-toggle__bars::before { top: -6px; }
	.nav-toggle__bars::after { top: 6px; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

	.site-nav {
		position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; align-items: flex-start; gap: 1.5rem;
		background: var(--pink); padding: 1.5rem var(--gutter) 2rem;
		border-bottom: 2px solid var(--ink);
		display: none;
	}
	.site-nav.is-open { display: flex; }
	.site-nav__list { flex-direction: column; gap: 1rem; }
	.site-nav__list a { font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 115; }

	.hero__foot { grid-template-columns: 1fr; }
	.pillars__grid, .pillars__head { grid-template-columns: 1fr; }
	.results__inner { grid-template-columns: minmax(0, 1fr); }
	.results__head { position: static; }
	.case, .case:nth-child(even) { grid-template-columns: 1fr; }
	.case__result, .case:nth-child(even) .case__result { order: 0; border: 0; border-bottom: 2px solid var(--ink); min-height: 0; padding-top: 2.5rem; }
	.pattern__head, .work__head { grid-template-columns: 1fr; }
	.acts { grid-template-columns: 1fr; }
	.creds__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.loop { grid-template-columns: 1fr; }
	.loop__step::after { display: none; }
	.steps { grid-template-columns: 1fr; }
	.ledger__row { grid-template-columns: 1fr; }
	.hero__title { font-size: 11.6vw; line-height: .95; }
	html[lang^="es"] .hero__title { font-size: 9.8vw; }
	.hero__line { white-space: normal; }
	.contact__title { font-size: clamp(2rem, 10.2vw, 2.75rem); }
	.hero__line + .hero__line { padding-left: 0; }
	.brand__name { display: none; }
	.btn--lg { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .hero__trace path { animation: none; stroke-dashoffset: 0; }
	.btn, .site-header, .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { transition: none; }
}
