/* ------------------------------------------------------------------
 * Pablo Hidalgo — CV
 * Cream "material" palette, display type in Audiowide, body in Inter.
 * ------------------------------------------------------------------ */
:root {
  /* palette taken from the background clip: chalk paper → slate grey → ink */
  --paper: #E2DFD8;
  --paper-rgb: 226, 223, 216;
  --paper-2: #D3D2CB;
  --ink: #0C0C0E;
  --text: #2B2E30;
  --mute: #3F4648;
  --slate: #8E9A9B;
  --line: rgba(12, 12, 14, .2);
  --accent: #C8102E;
  --f-display: "Audiowide", system-ui, sans-serif;
  --f-body: "Inter", -apple-system, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: 22px;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, p { margin: 0; }

.disp {
  font-family: var(--f-display); font-weight: 400; letter-spacing: -.005em;
  line-height: 1.02; text-transform: uppercase; color: var(--ink);
}
.disp em, .accent { font-style: normal; color: var(--accent); }

/* small caps label used everywhere (nav, kickers, "read more") */
.label {
  font: 600 10.5px/1 var(--f-body); letter-spacing: .2em; text-transform: uppercase;
}

/* film grain */
.grain {
  position: fixed; inset: -50%; width: 200%; height: 200%;
  pointer-events: none; z-index: 40; opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .7 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
}

/* ---------------- nav ---------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad); color: var(--ink);
}
.nav .wm { font: 600 12px/1 var(--f-body); letter-spacing: .02em; }
.nav ul { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav ul a { font: 600 10.5px/1 var(--f-body); letter-spacing: .18em; text-transform: uppercase; }
.nav ul a[aria-current] { border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.nav .li-lang { margin-left: 10px; padding-left: 18px; border-left: 1px solid currentColor; height: 24px; display: flex; align-items: center; }
.nav .menu { display: none; font: 600 10.5px/1 var(--f-body); letter-spacing: .18em; text-transform: uppercase; }
body.on-dark .nav { color: #fff; }

.lang {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 10.5px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 999px; padding: 6px 10px 5px;
}
.lang svg { width: 12px; height: 12px; display: block; }

.overlay {
  position: fixed; inset: 0; z-index: 55; background: var(--paper);
  display: none; flex-direction: column; justify-content: center; padding: var(--pad);
}
.overlay.on { display: flex; }
.overlay > a.disp { display: block; padding: 10px 0; font-size: clamp(28px, 8vw, 44px); }
.overlay > a[aria-current] { color: var(--accent); }
.overlay .x { position: absolute; top: 18px; right: var(--pad); }
.overlay .lang { position: absolute; left: var(--pad); bottom: 28px; padding: 8px 12px 7px; }

@media (max-width: 860px) {
  .nav ul { display: none; }
  .nav .menu { display: block; }
}

/* ---------------- liquid background ---------------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bg .fallback { position: absolute; inset: 0; background: var(--paper); }
.bg .shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(var(--paper-rgb), .6) 0, rgba(var(--paper-rgb), 0) 16%, rgba(var(--paper-rgb), 0) 78%, rgba(var(--paper-rgb), .45) 100%);
}

/* scroll cue: label + animated line */
.cue {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font: 600 clamp(12px, 1.4vw, 14px)/1.4 var(--f-body); letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink); text-align: center;
}
.cue i { display: block; width: 1px; height: 44px; background: currentColor; animation: drop 1.6s var(--ease) infinite; }
.cue.center {
  position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content;
  bottom: clamp(28px, 6vh, 56px); opacity: 0; animation: up 1s var(--ease) .8s forwards;
}
@keyframes drop {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@keyframes up { to { opacity: 1; transform: none; } }

/* ---------------- home ---------------- */
.h0 { position: relative; z-index: 1; min-height: 100svh; }
.stage { position: relative; z-index: 1; height: 260vh; }
.stick { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.veil { position: absolute; inset: 0; opacity: 0; }
.veil svg { width: 100%; height: 100%; display: block; }
.veil .fill { fill: var(--paper); }
.sub {
  position: absolute; left: var(--pad); right: var(--pad); top: 50%;
  transform: translateY(var(--sub-off, 60px)); text-align: center;
  opacity: 0; transition: opacity .6s var(--ease); pointer-events: none;
}
.sub.on { opacity: 1; }
.sub span {
  display: block; font-family: var(--f-display); font-size: clamp(17px, 2.4vw, 30px);
  line-height: 1.2; letter-spacing: .02em; text-transform: uppercase; max-width: 34ch; margin: 0 auto;
}
.sub b { display: block; margin-top: 10px; font: 600 clamp(12px, 1.3vw, 15px)/1.6 var(--f-body); letter-spacing: .16em; text-transform: uppercase; }
.sub b em { font-style: normal; color: var(--accent); }
.cap {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(24px, 5vh, 56px);
  opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.cap.on { opacity: 1; transform: none; }
.cap .cue { flex-direction: row; justify-content: space-between; text-align: left; }
.cap .cue i { height: 28px; }

.h2 {
  position: relative; z-index: 1; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--pad); background: rgba(var(--paper-rgb), .86);
}
.menu2 { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.menu2 a {
  display: block; padding: clamp(16px, 2.6vw, 30px) 0; border-bottom: 1px solid var(--line);
  font-size: calc(clamp(26px, 5.4vw, 76px) * .9);
  transition: padding-left .5s var(--ease), opacity .9s var(--ease), transform .9s var(--ease);
}
.menu2 a:hover { padding-left: 12px; color: var(--accent); }
.menu2 a:nth-child(2) { transition-delay: .08s; }
.menu2 a:nth-child(3) { transition-delay: .16s; }
.menu2 a:nth-child(4) { transition-delay: .24s; }

/* ---------------- inner pages ---------------- */
.open {
  position: relative; z-index: 1; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(60px + var(--pad)) var(--pad) clamp(90px, 14vh, 140px);
}
.k {
  font: 600 10.5px/1 var(--f-body); letter-spacing: .24em; text-transform: uppercase; color: var(--mute);
  display: flex; gap: 14px; align-items: center; margin-bottom: clamp(18px, 3vw, 32px);
}
.k::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.open .h { font-size: calc(clamp(34px, 6vw, 92px) * .9); max-width: 15ch; }
.lead {
  margin-top: clamp(18px, 3vw, 32px); max-width: 52ch;
  font: 400 clamp(16px, 1.7vw, 20px)/1.55 var(--f-body); color: var(--text);
}
.page {
  position: relative; z-index: 1; padding: 160px var(--pad) clamp(80px, 11vw, 168px);
  background: linear-gradient(180deg, rgba(var(--paper-rgb), 0) 0, rgba(var(--paper-rgb), .84) 180px);
}
.block + .block { margin-top: clamp(64px, 9vw, 128px); }
.block > .k { margin-bottom: clamp(20px, 3vw, 32px); }

/* reveal */
.r { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.r.in { opacity: 1; transform: none; }

/* accordion list */
.list { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 24px;
  padding: clamp(22px, 3vw, 36px) 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.row > b { font-size: calc(clamp(20px, 2.8vw, 40px) * .9); }
.row .more { white-space: nowrap; transition: color .3s; }
.row:hover .more, .row.is-open .more { color: var(--accent); }
.row .body { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.row .inner { min-height: 0; overflow: hidden; opacity: 0; transition: opacity .4s var(--ease); }
.row.is-open .body { grid-template-rows: 1fr; }
.row.is-open .inner { opacity: 1; }
.row .meta { margin: 14px 0 12px; color: var(--mute); line-height: 1.6; }
.row .meta .sep { margin: 0 8px; opacity: .5; }
.row ul { margin: 0; padding: 0 0 6px 18px; max-width: 64ch; }
.row ul li, .row .inner p { font: 400 clamp(15px, 1.4vw, 17px)/1.55 var(--f-body); color: var(--text); margin: 4px 0; }
.row .inner p { max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips span {
  font: 600 10px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 99px; padding: 7px 11px 6px;
}
.tagline { color: var(--accent); }

/* numbered steps (3 columns) */
.steps { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.step { border-bottom: 1px solid var(--line); padding: clamp(24px, 3vw, 40px) 0; }
.step i {
  display: block; font-style: normal; font-size: calc(clamp(48px, 7vw, 100px) * .9);
  color: transparent; -webkit-text-stroke: 1px var(--slate); margin-bottom: 18px;
}
.step b { display: block; font-size: calc(clamp(18px, 2.2vw, 30px) * .9); margin-bottom: 16px; }
.step ul { list-style: none; margin: 0; padding: 0; }
.step li {
  font: 400 clamp(15px, 1.3vw, 16.5px)/1.4 var(--f-body); color: var(--text);
  padding: 9px 0; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px;
}
.step li small { font: 600 10px/1.6 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { padding: clamp(24px, 3vw, 40px); border-left: 1px solid var(--line); }
  .step:first-child { padding-left: 0; border-left: 0; }
}

.mision {
  margin-top: clamp(48px, 7vw, 104px); max-width: 60ch;
  font: 500 clamp(20px, 2.6vw, 34px)/1.3 var(--f-body); letter-spacing: -.015em; color: var(--ink);
}
.mision small { display: block; margin-top: 18px; font: 600 10.5px/1 var(--f-body); letter-spacing: .22em; text-transform: uppercase; }

/* big-number cases (2 columns) */
.cases { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.case { border-bottom: 1px solid var(--line); padding: clamp(28px, 4vw, 56px) 0; min-width: 0; }
.case .n { font-size: calc(clamp(40px, 6vw, 92px) * .9); font-variant-numeric: tabular-nums; }
.case .w { margin-top: 12px; font: 600 11px/1.5 var(--f-body); letter-spacing: .2em; text-transform: uppercase; }
.case .t { margin-top: 18px; font: 400 clamp(15px, 1.3vw, 16.5px)/1.55 var(--f-body); color: var(--text); max-width: 40ch; }
@media (min-width: 860px) {
  .cases { grid-template-columns: repeat(2, 1fr); }
  .case { padding: clamp(28px, 4vw, 56px); border-left: 1px solid var(--line); }
  .case:nth-child(odd) { padding-left: 0; border-left: 0; }
}


/* buttons + contact lines */
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: clamp(28px, 4vw, 48px); }
.cta a {
  display: inline-flex; align-items: center; gap: 10px; padding: 16px 22px; border-radius: 99px;
  border: 1px solid var(--line); font: 600 12px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .3s, background .3s, color .3s;
}
.cta a.p { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cta a:hover { border-color: var(--ink); }
.cta a.p:hover { background: var(--accent); border-color: var(--accent); }
.contact-lines { border-top: 1px solid var(--line); }
.contact-lines a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: clamp(18px, 2.6vw, 30px) 0; border-bottom: 1px solid var(--line);
}
.contact-lines a b { font-size: calc(clamp(20px, 3vw, 40px) * .9); transition: color .3s, transform .6s var(--ease); }
.contact-lines a:hover b { color: var(--accent); transform: translateX(8px); }
.contact-lines a span { text-align: right; overflow-wrap: anywhere; }

/* next page + footer */
.next, footer { position: relative; z-index: 1; background: rgba(var(--paper-rgb), .9); }
.next { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 88px) var(--pad); }
.next .label { display: block; margin-bottom: 16px; }
.next a { font-size: calc(clamp(28px, 5.4vw, 80px) * .9); display: inline-block; transition: transform .6s var(--ease), color .3s; }
.next a:hover { transform: translateX(10px); color: var(--accent); }
footer {
  padding: 22px var(--pad); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font: 500 10.5px/1.6 var(--f-body); letter-spacing: .14em; text-transform: uppercase;
}

@media (max-width: 640px) {
  .contact-lines a { flex-direction: column; align-items: flex-start; gap: 8px; }
  .contact-lines a span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .cue i { animation: none; }
  .r { opacity: 1; transform: none; transition: none; }
}

/* row header: title + always-visible meta line */
.row .hd { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row .hd > b { font-size: calc(clamp(20px, 2.8vw, 40px) * .9); }
.row .hd .label { color: var(--mute); line-height: 1.6; }
.row .hd .label .org { color: var(--accent); }
.row .inner > :first-child { margin-top: 18px; }
.row.flat { cursor: default; }

/* featured project: screenshot + story */
.work {
  display: grid; grid-template-columns: 1fr; gap: clamp(20px, 3vw, 40px);
  padding: clamp(28px, 4vw, 56px) 0; border-top: 1px solid var(--line);
}
.work:last-of-type { border-bottom: 1px solid var(--line); }
.work .shot {
  display: block; align-self: start; overflow: hidden; border-radius: 6px;
  border: 1px solid var(--line); background: var(--paper-2);
}
.work .shot img {
  display: block; width: 100%; height: auto; max-width: 100%;
  filter: grayscale(1) contrast(1.05); transform: scale(1.001);
  transition: filter .6s var(--ease), transform .9s var(--ease);
}
.work .shot:hover img, .work .shot:focus-visible img { filter: none; transform: scale(1.03); }
.work-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.work-body .tool { color: var(--accent); }
.work-body h2 { font-size: calc(clamp(28px, 4.4vw, 64px) * .9); }
.work-body .stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 6px 0 4px; }
.work-body .stat .n { font-size: calc(clamp(36px, 5vw, 76px) * .9); font-variant-numeric: tabular-nums; }
.work-body .stat .w { font: 600 11px/1.5 var(--f-body); letter-spacing: .2em; text-transform: uppercase; max-width: 26ch; }
.work-body p { font: 400 clamp(15px, 1.4vw, 17px)/1.6 var(--f-body); color: var(--text); max-width: 52ch; }
.work-body .links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 6px; }
.work-body .links a { border-bottom: 1px solid currentColor; padding-bottom: 4px; transition: color .3s; }
.work-body .links a:hover { color: var(--accent); }
@media (min-width: 860px) {
  .work { grid-template-columns: 1.15fr 1fr; align-items: center; }
  .work:nth-of-type(even) .shot { order: 2; }
}
@media (prefers-reduced-motion: reduce) { .work .shot img { transition: none; } }
.work + .block { margin-top: clamp(56px, 8vw, 112px); }

/* role tag: Account Manager / Business Analyst */
.role {
  display: inline-block; font: 600 10px/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 99px; padding: 6px 10px 5px;
  margin-right: 8px; vertical-align: middle;
}
.case > .role { margin-bottom: 18px; }
.work-body .tool { color: var(--mute); }

/* keep hero copy readable over the clip: chalk wash on the text side */
.open::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--paper-rgb), .9) 0, rgba(var(--paper-rgb), .78) 42%, rgba(var(--paper-rgb), 0) 78%);
}
@media (max-width: 860px) {
  .open::before { background: rgba(var(--paper-rgb), .8); }
}

/* nav gets a frosted chalk bar once the page scrolls */
.nav { transition: background .4s var(--ease), backdrop-filter .4s var(--ease); }
.nav.solid { background: rgba(var(--paper-rgb), .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* tools used in a role / project: solid ink chips after a small label */
.chips.tools { align-items: center; margin-top: 10px; }
.chips.tools .tl { border: 0; padding: 0 4px 0 0; color: var(--mute); }
.chips.tools span:not(.tl) { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* result placeholders the owner still has to fill in */
mark.ph {
  background: rgba(200, 16, 46, .08); color: var(--accent);
  border: 1px dashed currentColor; border-radius: 4px; padding: 0 6px; font-weight: 500;
}

/* empty screenshot slot until the real capture is added */
.work .shot-ph {
  aspect-ratio: 16 / 9; max-width: 100%; display: grid; place-items: center; padding: 16px;
  border-style: dashed; text-align: center; font: 600 11px/1.5 var(--f-body); letter-spacing: .12em; text-transform: uppercase;
}
.chips.tools span.pend { background: none; border: 0; padding: 0; }
.chips.soft { align-items: center; margin-top: 14px; }
.chips.soft .tl { border: 0; padding: 0 4px 0 0; color: var(--mute); }

/* ---------------- inverted mode (dark clip, light figure) ---------------- */
:root[data-mode="dark"] {
  --paper: #1E2127;
  --paper-rgb: 30, 33, 39;
  --paper-2: #2A2E35;
  --ink: #EEEBE4;
  --text: #CFD2D4;
  --mute: #A3AAAD;
  --slate: #6F7A7C;
  --line: rgba(238, 235, 228, .2);
  --accent: #FF5A6E;
  color-scheme: dark;
}
:root[data-mode="dark"] #scrub { filter: invert(1); }
:root[data-mode="dark"] .grain { filter: invert(1); mix-blend-mode: screen; opacity: .04; }
:root[data-mode="dark"] mark.ph { background: rgba(255, 90, 110, .12); }
html, body, .nav.solid, .page, .h2, .next, footer { transition: background-color .45s var(--ease), color .45s var(--ease); }

/* mode toggle pill (sits next to the language pill) */
.nav .li-lang { gap: 8px; }
.mode {
  display: inline-grid; place-items: center; width: 30px; height: 26px;
  border: 1px solid currentColor; border-radius: 999px; color: inherit;
}
.mode svg { width: 14px; height: 14px; display: block; transition: transform .45s var(--ease); }
:root[data-mode="dark"] .mode svg { transform: rotate(180deg); }
.mode:hover, .lang:hover { color: var(--accent); }
.overlay .mode { position: absolute; right: var(--pad); bottom: 28px; width: auto; height: auto; padding: 8px 12px 7px; gap: 8px; grid-auto-flow: column; font: 600 10.5px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) {
  html, body, .nav.solid, .page, .h2, .next, footer { transition: none; }
  .mode svg { transition: none; }
}
.nav .m-only { display: none; }
@media (max-width: 860px) { .nav .m-only { display: inline-grid; margin-left: auto; margin-right: 16px; } }

/* all portfolio previews share one frame size */
.work .shot { aspect-ratio: 2.8 / 1; width: 100%; }
.work .shot img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.work .shot-ph { aspect-ratio: 2.8 / 1; }
@media (min-width: 860px) {
  .work { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .work:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}

/* scroll cue in the accent red (same as nav hover), both modes */
.cue, .cap .cue { color: var(--accent); }
.cue:hover { color: var(--ink); }
