/* manuelmarin3.com — hand-written, no framework.
   Type: IBM Plex Sans (text) + IBM Plex Sans Condensed (display), self-hosted in /fonts.
   Color: black and white from the M3. mark, one yellow accent reserved for things you can act on. */

/* ---------- Fonts ---------- */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-condensed-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --ink: #000000;
  --ink-2: #55554f;
  --line: #e3e3de;
  --panel: #f2f2ee;
  --accent: #ffcd42;
  --accent-hover: #f2bd1d;
  --accent-ink: #000000;
  --tile-bg: #f2f2ee;
  --tile-ink: #000000;

  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", "IBM Plex Sans", sans-serif;

  --fs-0: 0.9375rem;  /* 15 */
  --fs-1: 1.0625rem;  /* 17 */
  --fs-2: 1.25rem;    /* 20 */
  --fs-3: 1.5rem;     /* 24 */
  --fs-4: 1.875rem;   /* 30 */
  --fs-5: 2.5rem;     /* 40 */
  --fs-hero: clamp(2.5rem, 1rem + 4.2vw, 4.4rem);

  --wrap: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --ink: #f4f4f0;
    --ink-2: #a5a5a0;
    --line: #2b2b2b;
    --panel: #161616;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --ink: #f4f4f0;
  --ink-2: #a5a5a0;
  --line: #2b2b2b;
  --panel: #161616;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-1);
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: 10px 14px; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; border-radius: 4px;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--ink); border-radius: 4px;
  font-weight: 600; font-size: var(--fs-0); line-height: 1;
  text-decoration: none; color: var(--ink); background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.button:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.button--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--header-h);
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; letter-spacing: -0.02em;
  text-decoration: none; line-height: 1; margin-right: auto;
}
.brand__dot { color: var(--accent); }

.site-nav__list { display: flex; align-items: center; gap: 28px; }
.site-nav__list a:not(.button) { font-weight: 500; font-size: var(--fs-0); text-decoration: none; }
.site-nav__list a:not(.button):hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.site-nav__cta .button { min-height: 38px; padding-inline: 14px; }

.menu-toggle {
  display: none; min-height: 38px; padding: 0 12px;
  border: 1.5px solid var(--ink); border-radius: 4px; background: transparent; color: var(--ink);
  font: inherit; font-weight: 600; font-size: var(--fs-0); cursor: pointer;
}

.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1.5px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; padding: 0;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 96px); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero__name { font-size: var(--fs-1); color: var(--ink-2); margin-bottom: 22px; }
.hero__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-hero);
  line-height: 0.96; letter-spacing: -0.015em; text-wrap: balance;
}
.hero__title span { display: block; }
.hero__lead { font-size: var(--fs-2); line-height: 1.5; max-width: 36ch; margin-top: 30px; }
.hero__meta { font-size: var(--fs-1); color: var(--ink-2); max-width: 50ch; margin-top: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__photo { max-width: 340px; width: 100%; justify-self: end; }
.hero__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }

/* One page-load moment: the hero rises in, nothing else animates on its own. */
.reveal { animation: rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__title .reveal:nth-child(1) { animation-delay: 60ms; }
.hero__title .reveal:nth-child(2) { animation-delay: 130ms; }
.hero__title .reveal:nth-child(3) { animation-delay: 200ms; }
.hero__lead.reveal { animation-delay: 300ms; }
.hero__meta.reveal { animation-delay: 360ms; }
.hero__actions.reveal { animation-delay: 420ms; }
.hero__photo.reveal { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); scroll-margin-top: var(--header-h); }
.section__grid {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 40px clamp(32px, 5vw, 72px); align-items: start;
}
.section__head { position: sticky; top: calc(var(--header-h) + 32px); }
.section__title {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-5);
  line-height: 1.02; letter-spacing: -0.012em; text-wrap: balance;
}
.section__lead { margin-top: 14px; color: var(--ink-2); max-width: 32ch; }

/* ---------- Roles (the resume selector) ---------- */
.roles { border-bottom: 1px solid var(--line); }
.role {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px 32px; padding-block: 30px; border-top: 1px solid var(--line);
}
.role__name {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-4);
  line-height: 1.05; letter-spacing: -0.01em;
}
.role__desc { max-width: 56ch; }
.role__resume {
  grid-column: 2; justify-self: start; margin-top: 4px;
  font-weight: 600; text-decoration-color: var(--accent); text-decoration-thickness: 2px;
  padding: 2px 6px; margin-left: -6px; border-radius: 3px;
}
.role__resume:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.role__format { font-weight: 400; color: var(--ink-2); margin-left: 6px; font-size: var(--fs-0); }
.role__resume:hover .role__format { color: var(--accent-ink); }

/* ---------- Work ---------- */
.work { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 32px; }
.project__link { display: block; text-decoration: none; }
.project__tile {
  display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 12%;
  background: var(--tile-bg); color: var(--tile-ink); border-radius: 6px; overflow: hidden;
}
.project__tile img { max-width: 70%; max-height: 82%; object-fit: contain; }
.project__tile--text {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 1rem + 3.5vw, 3.25rem);
  line-height: 0.95; letter-spacing: -0.015em; text-align: center;
}
.project__body { display: block; margin-top: 16px; }
.project__title {
  display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3); line-height: 1.1;
  text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: transparent; text-underline-offset: 0.14em;
  transition: text-decoration-color 120ms ease;
}
.project__link:hover .project__title { text-decoration-color: var(--accent); }
.project__desc { display: block; margin-top: 8px; max-width: 46ch; }
.project__tags { display: block; margin-top: 8px; font-size: var(--fs-0); color: var(--ink-2); }

/* ---------- Experience ---------- */
.jobs { border-bottom: 1px solid var(--line); }
.job {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 8px 32px; padding-block: 30px; border-top: 1px solid var(--line);
}
.job__dates { font-size: var(--fs-0); color: var(--ink-2); padding-top: 0.35em; }
.job__title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3); line-height: 1.1; }
.job__org { display: block; font-family: var(--font-sans); font-weight: 400; font-size: var(--fs-1); color: var(--ink-2); margin-top: 4px; }
.job__points { margin-top: 14px; max-width: 62ch; }
.job__points li { position: relative; padding-left: 18px; margin-top: 8px; }
.job__points li::before {
  content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; background: var(--ink-2);
}

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.skills dt { font-weight: 600; }
.skills dd { margin-top: 6px; color: var(--ink-2); }

/* ---------- Education ---------- */
.education { border-bottom: 1px solid var(--line); }
.education li { padding-block: 20px; border-top: 1px solid var(--line); }
.education__what { font-weight: 600; }
.education__where { color: var(--ink-2); margin-top: 2px; }


/* ---------- Project request form ---------- */
.request { display: grid; gap: 18px; }
.request__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; }
.field__label { font-weight: 600; font-size: var(--fs-0); }
.field__optional { font-weight: 400; color: var(--ink-2); }
.field__input {
  width: 100%; min-height: 46px; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: var(--fs-1); line-height: 1.4;
  transition: border-color 120ms ease;
}
.field__input:hover { border-color: var(--ink-2); }
.field__input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent); }
.field__input::placeholder { color: var(--ink-2); opacity: 0.8; }
textarea.field__input { resize: vertical; min-height: 140px; }
select.field__input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%2355554f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field__input:invalid.is-touched { border-color: #b3261e; }
.request__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.request__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 4px; }
.request__status { font-size: var(--fs-0); color: var(--ink-2); min-height: 1.4em; }
.request__status.is-error { color: #b3261e; }
.request__note { font-size: var(--fs-0); color: var(--ink-2); }
.request__done {
  padding: 24px; border: 1.5px solid var(--ink); border-radius: 6px;
}
.request__done h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3); line-height: 1.1; }
.request__done p { margin-top: 10px; max-width: 48ch; }
.request__done a { font-weight: 600; }
@media (max-width: 700px) { .request__row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .field__input { transition: none; } }

/* ---------- Contact (inverted block) ---------- */
.section--contact { background: #000000; color: #f4f4f0; border-top: 0; }
:root[data-theme="dark"] .section--contact { border-top: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .section--contact { border-top: 1px solid var(--line); } }
.section--contact .section__title { max-width: 18ch; }
.contact__lead { margin-top: 16px; opacity: 0.8; }
.contact__email {
  display: inline-block; margin-top: 28px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; line-height: 1;
  font-size: clamp(1.6rem, 0.6rem + 4.2vw, 4rem); color: var(--accent);
  text-decoration: none; overflow-wrap: anywhere;
}
.contact__email:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }
.contact__list { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; }
.contact__list a:hover { text-decoration-color: var(--accent); }
.section--contact :focus-visible { outline-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 28px; font-size: var(--fs-0); color: var(--ink-2); }
.site-footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .section__grid { grid-template-columns: 1fr; gap: 28px; }
  .section__head { position: static; }
  .role { grid-template-columns: 1fr; gap: 8px; }
  .role__resume { grid-column: 1; }
  .work { grid-template-columns: 1fr; gap: 36px; }
  .job { grid-template-columns: 1fr; gap: 4px; }
  .skills { grid-template-columns: 1fr; gap: 20px; }

  .menu-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav__list li { border-top: 1px solid var(--line); }
  .site-nav__list li:first-child { border-top: 0; }
  .site-nav__list a:not(.button) { display: block; padding: 14px 0; font-size: var(--fs-1); }
  .site-nav__cta { padding-top: 12px; border-top: 0 !important; }
  .site-nav__cta .button { width: 100%; justify-content: center; min-height: 44px; }
}

@media (max-width: 700px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo { max-width: 280px; justify-self: start; order: -1; }
  .hero__photo img { aspect-ratio: 1; }
}

@media (max-width: 480px) {
  .hero__actions .button { flex: 1 1 auto; justify-content: center; }
  .contact__list { flex-direction: column; gap: 10px; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .hero__actions, .theme-toggle, .menu-toggle { display: none !important; }
  .section--contact { background: none; color: inherit; }
  .contact__email { color: inherit; }
  a { text-decoration: none; }
  .section { break-inside: avoid; }
}
