/* Rafael Navarro · portfolio. Tokens first: every value below comes from here. */
@font-face { font-family: "General Sans"; src: url("../fonts/general-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/general-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("../fonts/general-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* colour: night ground, phosphor-green accent (the CV's green, the terminal's green) */
  --bg: #0b0f0d;
  --surface: #131a16;
  --surface-2: #1b241f;
  --term: #060907;
  --ink: #e9f0eb;
  --muted: #a3b2a9;
  --accent: #3ddc84;
  --accent-ink: #04140b;
  --accent-hover: #5fe69b;
  --strip-gap: 10px;
  --frame-gap: 8px;
  --rise: 24px;
  --term-size: 0.9375rem;

  /* type */
  --font: "General Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* the terminal is literal code, so it keeps a code face */ /* taste-skill-ignore */
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace; /* taste-skill-ignore */
  --step-small: 1rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.5rem, 1rem + 11vw, 12rem);

  /* space */
  --margin: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --gap: clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  --section: clamp(6rem, 4rem + 8vw, 13rem);
  --radius: 0;
  --bar-h: 4rem;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 160ms;
  --slow: 700ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--bar-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: var(--margin); top: 0.5rem; z-index: 30; background: var(--accent); color: var(--accent-ink); padding: 0.75rem 1rem; font-weight: 500; text-decoration: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none; border-radius: var(--radius);
  transition: transform var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.97); }
.btn--small { min-height: 2.75rem; padding: 0 1.1rem; font-size: var(--step-small); }
.link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; text-decoration-color: var(--accent); transition: color var(--fast) var(--ease); }
.link:hover { color: var(--accent); }
.link, .project__cap a, .bar__name { display: inline-flex; align-items: center; min-height: 2.75rem; }
.link--btn { text-align: left; font-size: inherit; min-height: 2.75rem; }

/* ---------- bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; height: var(--bar-h);
  display: flex; align-items: center; gap: 1.5rem; padding: 0 var(--margin); background: var(--bg);
}
.bar__name { font-weight: 700; text-decoration: none; margin-right: auto; white-space: nowrap; }
.bar__nav { display: none; gap: 1.75rem; font-size: var(--step-small); }
.bar__nav a { text-decoration: none; color: var(--muted); padding: 0.5rem 0; transition: color var(--fast) var(--ease); }
.bar__nav a:hover { color: var(--ink); }
.bar__nav a.is-current { color: var(--accent); }
@media (min-width: 760px) { .bar__nav { display: flex; } }

/* ---------- hero: lit strip ---------- */
.hero {
  min-height: calc(100svh - var(--bar-h));
  display: grid; grid-template-rows: auto 1fr auto auto; gap: clamp(1rem, 2vh, 2rem);
  padding: clamp(0.5rem, 2vh, 2rem) 0 clamp(1.5rem, 4vh, 3rem);
}
.hero__head { padding: 0 var(--margin); display: grid; gap: 0.75rem; }
.hero__role { font-size: var(--step-lead); line-height: 1.25; max-width: 30ch; }
.hero__title { font-size: var(--step-display); font-weight: 700; line-height: 0.9; letter-spacing: -0.04em;
}
.strip {
  align-self: center; display: flex; gap: var(--strip-gap); height: clamp(15rem, 40vh, 26rem);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 0 var(--margin); cursor: grab; -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { display: none; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.strip.is-dragging img { pointer-events: none; }
.frame { flex: 0 0 auto; height: 100%; scroll-snap-align: center; background: var(--surface); overflow: hidden; }
.frame img { height: 100%; width: auto; object-fit: cover; user-select: none; -webkit-user-drag: none;
  transition: filter var(--slow) var(--ease), transform 1.6s var(--ease); }
.js .frame img { filter: brightness(0.5) saturate(0.7); }
.js .frame:hover img, .js .frame.is-lit img { filter: none; }
.js .frame.is-lit img { transform: scale(1.04); }
.hero__caption { padding: 0 var(--margin); font-size: var(--step-small); color: var(--muted); min-height: 1.5em; }
.hero__foot { padding: 0 var(--margin); display: grid; gap: 1.25rem; align-items: end; }
.hero__lead { max-width: 36rem; font-size: var(--step-body); }
.hero__actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
@media (min-width: 760px) {
  .hero__foot { grid-template-columns: 1fr auto; }
  .strip { height: clamp(16rem, 36vh, 24rem); }
}
@media (max-width: 759px) { .strip { height: 44svh; } }

/* entrance for the parts of each section (content stays visible without script) */
.js .reveal { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- perfil ---------- */
.about { padding: var(--section) var(--margin) 0; display: grid; gap: clamp(4rem, 8vw, 7.5rem); }
.about__row { display: grid; gap: 2rem; }
.about__heading { font-size: var(--step-lead); font-weight: 500; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; font-size: var(--step-small); }
.facts dt { color: var(--muted); }
.statement { font-size: clamp(1.375rem, 1rem + 1.4vw, 2.25rem); line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; max-width: 30ch; }
.about__text { display: grid; gap: 1.5rem; }
.about__text p:not(.statement) { max-width: 62ch; }
.record__word { font-weight: 500; }
.record li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; font-size: var(--step-small); }
.record li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .about__row { grid-template-columns: 22% 1fr; column-gap: 12%; grid-template-areas: "h t" "f t"; align-items: start; }
  .about__heading { grid-area: h; }
  .facts { grid-area: f; grid-template-columns: 1fr; }
  .about__text { grid-area: t; }
  .about__row--record { grid-template-columns: 22% 1fr 1fr; grid-template-areas: none; column-gap: 4rem; }
  .about__row--record .record__word { margin-right: auto; }
  .about__row--record { padding-left: 0; }
  .about__row--record > :first-child { grid-column: 1; }
}

/* ---------- areas ---------- */
.areas { padding: var(--section) var(--margin) 0; position: relative; }
.areas__heading { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin-bottom: clamp(2.5rem, 6vw, 6rem); }
.areas__grid { display: grid; gap: 2.5rem; }
.areas__col h3 { font-size: var(--step-lead); font-weight: 500; margin-bottom: 1rem; }
.areas__col li { font-size: var(--step-body); line-height: 1.4; color: var(--muted); padding: 0.15rem 0; transition: color var(--fast) var(--ease); cursor: default; }
.areas__col li:hover, .areas__col li.is-on { color: var(--ink); }
.areas__sum { margin-top: 1rem; font-size: var(--step-small); color: var(--muted); }
.areas__desc { display: none; }
@media (min-width: 640px) and (max-width: 899px) { .areas__grid { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
@media (min-width: 900px) {
  .areas__grid { grid-template-columns: repeat(4, 1fr); column-gap: 2rem; }
  .areas__sum { display: none; }
  .areas__desc { display: block; margin-top: 3rem; min-height: 3em; max-width: 48ch; font-size: var(--step-lead); line-height: 1.3; }
}

/* ---------- trayectoria ---------- */
.career { padding: var(--section) var(--margin) 0; display: grid; gap: 3rem; }
.career__heading, .tech__heading, .work__heading, .term__heading { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.career__heading { margin-bottom: 2rem; }
.group-word { color: var(--muted); margin: 2.5rem 0 0.5rem; font-size: var(--step-small); }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 1.25rem; min-height: 2.75rem; padding: 0.6rem 0; }
.rows__main { display: flex; flex-direction: column; }
.rows__note { color: var(--muted); font-size: var(--step-small); max-width: 54ch; }
.rows__val { color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.rows strong { font-weight: 500; }
.career__pic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
@media (min-width: 900px) { .career__pic img { aspect-ratio: 3 / 4; } }
@media (min-width: 900px) {
  .career { grid-template-columns: 1fr 34%; column-gap: 8%; align-items: start; }
  .career__col { padding-left: 14%; }
  .career__pic { position: sticky; top: calc(var(--bar-h) + 2rem); }
}

/* ---------- portafolio ---------- */
.work { padding: var(--section) var(--margin) 0; display: grid; gap: 2rem; }
.work__rail { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.work__filters[hidden], .term__chips[hidden], .link--btn[hidden] { display: none; }
.work__filters { display: flex; gap: 1.25rem; }
.filter { color: var(--muted); font-size: var(--step-body); min-height: 2.75rem; transition: color var(--fast) var(--ease); }
.filter:hover { color: var(--ink); }
.filter.is-active { color: var(--accent); }
.work__list { display: grid; gap: clamp(2rem, 3vw, 2.8rem); }
.project__strip {
  display: flex; gap: var(--frame-gap); height: 132px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; text-decoration: none;
}
.project__strip::-webkit-scrollbar { display: none; }
.project__strip > * { flex: 0 0 auto; height: 100%; width: auto; scroll-snap-align: start; transition: transform var(--fast) var(--ease); }
.project__strip:hover > * { transform: translateY(-3px); }
.card { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.25rem; padding: 0.9rem 1rem; min-width: 11rem; max-width: 18rem; background: var(--surface-2); font-size: var(--step-small); color: var(--muted); }
.card--lead { min-width: 16rem; }
.card--ink { background: var(--accent); color: var(--accent-ink); }
.card__big { font-size: var(--step-lead); font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.card--ink .card__big { color: var(--accent-ink); }
.project__cap { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; font-size: var(--step-small); }
.project__cap a { font-weight: 500; text-decoration: none; }
.project__cap a:hover { color: var(--accent); }
.project__desc { display: none; color: var(--muted); }
.project__val { color: var(--muted); }
.work__list.view-mob .is-desk { display: none; }
.work__list:hover .project { opacity: 0.72; }
.work__list:hover .project:hover { opacity: 1; }
.project { transition: opacity var(--fast) var(--ease); width: fit-content; max-width: 100%; min-width: 0; }
.hero > *, .work > *, .work__list > *, .career > *, .term > *, .about__row > *, .contact > * { min-width: 0; }
.term__chips code { font: inherit; }
@media (min-width: 900px) {
  .work { grid-template-columns: 13% 1fr; column-gap: 3%; align-items: start; }
  .work__rail { position: sticky; top: calc(var(--bar-h) + 2rem); flex-direction: column; }
  .work__heading { font-size: var(--step-lead); font-weight: 500; letter-spacing: 0; }
  .work__filters { flex-direction: column; gap: 0; }
  .project__strip { height: 280px; }
  .card { min-width: 14rem; max-width: 20rem; padding: 1.25rem; }
  .card--lead { min-width: 22rem; }
  .project__desc { display: block; }
}

/* ---------- tecnologia ---------- */
.tech { padding: var(--section) var(--margin) 0; }
.tech__head { display: grid; gap: 2rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.tech__lead { margin-top: 1.25rem; max-width: 40ch; font-size: var(--step-lead); line-height: 1.3; }
.tech__pic { overflow: hidden; background: var(--surface); }
.tech__pic img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.drift { animation: drift 24s var(--ease) infinite alternate; }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.12) translate(-3%, -2%); } }
.tech__groups { display: grid; gap: 0 3rem; }
.tgroup { break-inside: avoid; margin-bottom: 2.5rem; }
.tgroup h3 { font-size: var(--step-body); font-weight: 500; color: var(--muted); margin-bottom: 0.5rem; }
.rows--tech li { min-height: 2.75rem; padding: 0.35rem 0; align-items: center; }
.rows--tech .rows__main { flex-direction: row; align-items: center; gap: 0.6rem; }
.ico { width: 1.25rem; height: 1.25rem; fill: var(--muted); flex: none; transition: fill var(--fast) var(--ease); }
.rows--tech li:hover .ico { fill: var(--brand, var(--accent)); }
.dot { width: 0.5rem; height: 0.5rem; margin: 0 0.25rem; border-radius: 50%; background: var(--accent); flex: none; }
@media (min-width: 700px) { .tech__head { grid-template-columns: 1fr 1fr; column-gap: 3rem; align-items: end; } }
@media (min-width: 640px) {
  .tech__groups { grid-template-columns: 1fr 1fr; }
  .tcol:last-child { grid-column: 1 / -1; columns: 2; column-gap: 3rem; }
  .rows--tech li { min-height: 2.25rem; }
}
@media (min-width: 1100px) {
  .tech__groups { grid-template-columns: repeat(3, 1fr); }
  .tcol:last-child { grid-column: auto; columns: 1; }
}

/* ---------- terminal (real interface fragment: data-ui) ---------- */
.term { padding: var(--section) var(--margin) 0; display: grid; gap: 2.5rem; }
.term__intro p { margin-top: 1.25rem; max-width: 34ch; font-size: var(--step-lead); line-height: 1.3; }
.term__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.term__chips button {
  font-family: var(--mono); /* taste-skill-ignore: terminal code */ font-size: var(--step-small); min-height: 2.75rem; padding: 0 1rem;
  background: var(--surface-2); color: var(--ink); border-radius: var(--radius);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.term__chips button:hover { background: var(--accent); color: var(--accent-ink); }
.term__chips button:active { transform: scale(0.96); }
.term__win { background: var(--term); display: flex; flex-direction: column; min-height: 24rem; max-height: 34rem; }
.term__top { padding: 0.75rem 1rem; background: var(--surface); font-family: var(--mono); /* taste-skill-ignore: terminal code */ font-size: var(--step-small); color: var(--muted); }
.term__out { flex: 1; overflow-y: auto; padding: 1rem; font-family: var(--mono); /* taste-skill-ignore: terminal code */ font-size: var(--term-size); line-height: 1.55; overscroll-behavior: contain; }
.term__out pre { margin: 0 0 0.75rem; white-space: pre-wrap; word-break: break-word; font: inherit; }
.term__out code { font: inherit; }
.term__out b, .term__out .ok { color: var(--accent); font-weight: 400; }
.term__out .p, .term__form .p { color: var(--accent); }
.term__out .dim { color: var(--muted); }
.term__out a { color: var(--accent); }
.term__form { display: flex; gap: 0.6rem; align-items: center; padding: 0.75rem 1rem 1rem; font-family: var(--mono); /* taste-skill-ignore: terminal code */ font-size: var(--term-size); }
.term__form[hidden] { display: none; }
.term__form input {
  flex: 1; min-width: 0; min-height: 2.75rem; background: transparent; border: 0; color: var(--ink);
  font: 1rem var(--mono); /* taste-skill-ignore: terminal code */ caret-color: var(--accent); outline: none;
}
.term__form:focus-within { box-shadow: inset 0 -2px 0 var(--accent); } /* taste-skill-ignore: focus indicator, not at rest */
@media (min-width: 900px) { .term { grid-template-columns: 1fr 1.4fr; column-gap: 4rem; align-items: start; } }

/* ---------- contacto ---------- */
.contact { padding: var(--section) var(--margin) clamp(5rem, 8vw, 7.5rem); display: grid; gap: 2rem; grid-template-columns: 6rem 1fr; }
.contact__line { grid-column: 1 / -1; font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; max-width: 26ch; }
.contact__pic { width: 6rem; height: 6rem; object-fit: cover; }
.contact__links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; font-size: 1.125rem; }
.contact__q { font-weight: 500; margin-bottom: 0.75rem; }
.contact__links .link { word-break: break-all; }
.contact__where { grid-column: 1 / -1; margin-top: 0.75rem; font-size: var(--step-small); color: var(--muted); }
@media (min-width: 900px) {
  .contact { grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; align-items: start; }
  .contact__line { grid-column: 1 / 7; }
  .contact__pic { grid-column: 8 / 10; width: 10rem; height: 10rem; }
  .contact__links { grid-column: 10 / 13; }
}

/* ---------- footer ---------- */
.foot { padding: 0 var(--margin) 1.75rem; display: grid; gap: 0.5rem; font-size: var(--step-small); color: var(--muted); }
.foot__links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.foot__links a { color: var(--ink); text-decoration: none; min-height: 2.75rem; display: inline-flex; align-items: center; }
.foot__links a:hover { color: var(--accent); }
.foot__credits summary { cursor: pointer; min-height: 2.75rem; display: inline-flex; align-items: center; }
.foot__credits p { max-width: 70ch; padding-bottom: 1rem; }
@media (min-width: 900px) {
  .foot { grid-template-columns: 1fr auto 1fr; align-items: center; }
  .foot__right { text-align: right; }
  .foot__credits { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .drift { animation: none; }
  .js .frame.is-lit img { transform: none; }
  * { transition-duration: 1ms !important; }
}
