/* =========================================================
   Ada Marlowe — CV template
   Direction: "engineering drafting paper"
   Display  : Bricolage Grotesque
   Body     : IBM Plex Sans
   Data/UI  : IBM Plex Mono
   ========================================================= */

:root {
  --paper:   #e9ecf1;   /* cool drafting-paper background */
  --paper-2: #f4f6f9;   /* raised surfaces */
  --ink:     #161a23;   /* near-black ink */
  --muted:   #5a6172;   /* secondary text */
  --line:    #c7cdd8;   /* ruled / grid lines */
  --accent:  #3d4dff;   /* electric indigo */
  --accent-ink: #1f2bb0;
  --codecard-bg: #161a23; /* fixed in both themes */

  color-scheme: light;

  --maxw: 1080px;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  /* type scale */
  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.86rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.2rem);
  --step-3:  clamp(2.4rem, 1.9rem + 2.5vw, 3.6rem);
  --step-hero: clamp(3.4rem, 2rem + 8vw, 8rem);

  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="dark"] {
  --paper:   #0f1218;
  --paper-2: #1a1f29;
  --ink:     #e7e9f3;
  --muted:   #9aa1bd;
  --line:    #2a313f;
  --accent:  #6b78ff;
  --accent-ink: #aab4ff;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  /* faint full-page graph paper */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  background-position: -1px -1px;
}
/* keep the grid quiet */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--paper);
  opacity: 0.78;
  z-index: -1;
  pointer-events: none;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#main { flex: 1; }
/* Páginas de una sola sección corta: el contenido se centra en el alto
   disponible. `safe` evita que se recorte por arriba si no cabe. */
.main--center { display: grid; align-content: safe center; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
}
.mark__glyph {
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--ink);
  color: var(--paper);
  padding: 0.18rem 0.4rem;
  border-radius: 3px;
}
.mark__sep { color: var(--line); }
.mark__role { color: var(--muted); }

.nav {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  font-size: var(--step--1);
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--ink); }
.nav a.is-active {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.topbar__cta { white-space: nowrap; }

/* theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.theme-toggle:active { transform: translateY(0); }
.theme-toggle__icon { display: block; }

/* language toggle reuses the theme-toggle look, but holds a 2-letter label */
.lang-toggle {
  width: auto;
  min-width: 2.2rem;
  padding: 0 0.55rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  transition: transform 0.15s var(--ease), background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--lg { padding: 0.9rem 1.6rem; font-size: var(--step-0); }

.link-arrow {
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.link-arrow span { transition: transform 0.2s var(--ease); display: inline-block; }
.link-arrow:hover { color: var(--accent-ink); border-color: var(--accent); }
.link-arrow:hover span { transform: translateX(3px); }

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--accent-ink);
  letter-spacing: 0.02em;
  margin: 0 0 1.5rem;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 7rem) var(--gutter) clamp(3rem, 6vh, 5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
.hero__grid { display: none; }

.hero__name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: var(--step-hero);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}
.hero__lede {
  max-width: 46ch;
  font-size: var(--step-1);
  color: var(--ink);
  margin: 0 0 1.75rem;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}
.chip__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* remote-ready block — headline signal for remote recruiters */
.remote-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  margin-bottom: 1.4rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.remote-badge__label {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.remote-badge__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip--accent {
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--paper-2));
}

/* ---------- generic section ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4.5rem) var(--gutter);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  border-top: 1px solid var(--line);
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  position: sticky;
  top: 5rem;
  align-self: start;
  height: fit-content;
}
.section__num {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--accent);
  font-weight: 600;
}
.section__title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  margin: 0;
}
.section__body { min-width: 0; }

/* Página dedicada: la sección ocupa todo el ancho en lugar de compartirlo con
   una columna de título, que ahí no orienta — solo estrecha el contenido. */
.section--full {
  grid-template-columns: 1fr;
  max-width: 1180px;
  gap: 1.5rem;
  border-top: 0;
  justify-items: center;
}
.section--full .section__head {
  position: static;
  top: auto;
  justify-content: center;
}
.section--full .section__title { font-size: var(--step-3); }
.section--full .section__body { width: 100%; }
.section--full .contact {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 2.5rem;
}
/* el gap del grid ya separa; los márgenes propios lo duplicarían */
.section--full .contact .section__intro,
.section--full .contact .contact__links { margin: 0; }
.section__intro {
  font-size: var(--step-1);
  max-width: 55ch;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--muted);
}
.section__more {
  grid-column: 2;
  margin: 2.25rem 0 0;
  text-align: center;
}
.section__more .btn span {
  display: inline-block;
  transition: transform 0.2s var(--ease);
}
.section__more .btn:hover span { transform: translateX(4px); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px dashed var(--line);
}
.timeline__item:first-child { padding-top: 0; }
.timeline__item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline__when {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
  padding-top: 0.35rem;
}
.timeline__what h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: var(--step-1);
  margin: 0 0 0.2rem;
  letter-spacing: -0.01em;
}
.timeline__org {
  margin: 0 0 0.6rem;
  color: var(--accent-ink);
  font-weight: 500;
}
.timeline__detail { margin: 0; color: var(--muted); max-width: 58ch; }

/* ---------- tags ---------- */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.8rem 0 0;
  padding: 0;
}
.tags li {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.2rem 0.55rem;
}
.tags--lg li {
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--paper-2);
  padding: 0.4rem 0.8rem;
}

/* ---------- skills marquee (full-bleed band) ---------- */
.marquee-band {
  width: 100%;
  padding: clamp(2rem, 5vh, 3.5rem) 0;
  border-top: 1px solid var(--line);
}
.marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  /* fade in/out at the edges of the viewport */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 0;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
/* second band (dev tools) scrolls the opposite way */
.marquee__track--reverse { animation-direction: reverse; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  /* margin (not flex gap) keeps the -50% loop seamless */
  margin-right: 10.5rem;
}
.marquee__logo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
}
.marquee__img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
/* monochrome (black) logos — flip to light so they read on dark theme */
[data-theme="dark"] .marquee__img--mono { filter: invert(1) brightness(1.6); }
.marquee__logo--text {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.marquee__name {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -28px rgba(61, 77, 255, 0.6);
}
/* media slot for a demo GIF/screenshot (16:9). Replace the placeholder div
   with an <img>/<video> and it fills this frame automatically. */
.card__media {
  aspect-ratio: 16 / 9;
  margin: -0.2rem 0 1rem;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--line) 22%, transparent) 0 10px,
      transparent 10px 20px
    );
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card__media img,
.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card__media-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.card__title {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0;
}
.card__desc { margin: 0 0 1rem; color: var(--muted); flex: 1; }
.card__stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.8rem;
  padding: 0;
}
.card__stack li {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 3px;
  padding: 0.18rem 0.5rem;
}
.card__actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.card__btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
}
/* Placeholder "live demo" link until a real URL is added. */
.card__btn[href=""] {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- github activity ---------- */
.github-graph {
  display: block;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  /* keep the contribution grid on white in both themes, like GitHub itself */
  background: #ffffff;
  overflow-x: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.github-graph:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 40px -28px rgba(61, 77, 255, 0.6);
}
.github-graph img {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}
.github-note {
  margin: 0.9rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- contact ---------- */
/* ---------- 404 ---------- */
.notfound { display: grid; justify-items: center; text-align: center; }
.notfound__code {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(4.5rem, 3rem + 12vw, 11rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  margin: 0;
}
.notfound__stamp {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 3px;
  padding: 0.35rem 0.7rem;
  margin-bottom: 1.5rem;
}
/* La ruta pedida, tal cual, para que se vea el error de tipeo. */
.notfound__path {
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink);
  word-break: break-all;
}
.notfound__routes {
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  text-align: left;
  min-width: min(340px, 100%);
}
.notfound__routes a { font-family: "IBM Plex Mono", monospace; }

.section--contact { border-bottom: 1px solid var(--line); }
.contact__pitch {
  font-size: var(--step-1);
  max-width: 40ch;
  margin: 0 0 1.6rem;
}
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.6rem;
}

/* ---------- footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--step--1);
  color: var(--muted);
}

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

/* tablet */
@media (max-width: 900px) {
  .section {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .section__more { grid-column: 1; }
  .section__head { position: static; top: auto; }
}

/* phone */
@media (max-width: 760px) {
  /* En móvil solo sobreviven los enlaces de ruta: los de sección (#hash)
     saturan la barra y el usuario ya llega a ellos haciendo scroll. */
  .nav { gap: 0.2rem; margin-left: auto; }
  .nav a:not(.nav__route) { display: none; }
  .section { gap: 1.4rem; }
  .projects { grid-template-columns: 1fr; }
  .timeline__item { grid-template-columns: 1fr; gap: 0.4rem; }
  .timeline__when { padding-top: 0; }
  /* tighten the tripled marquee gap and logo size on small screens */
  .marquee__item { margin-right: 4.5rem; }
  .marquee__logo,
  .marquee__img { width: 46px; height: 46px; }
  .footer { justify-content: flex-start; }
}

/* small phone */
@media (max-width: 430px) {
  .topbar { gap: 0.6rem; padding-inline: 1rem; }
  .nav a { padding-inline: 0.4rem; }
  .mark__sep, .mark__role { display: none; }
  .topbar__cta { padding: 0.5rem 0.75rem; }
  .hero { padding-top: clamp(2rem, 6vh, 3rem); }
  .hero__links { gap: 1rem; }
  .marquee__item { margin-right: 3.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chip__dot { animation: none; }
  .btn:hover, .card:hover, .theme-toggle:hover { transform: none; }
  .marquee__track { animation: none; }
  body { transition: none; }
}
