/* about.uruguayo.me: no web fonts, no external requests. Light and dark
   follow prefers-color-scheme; motion is off under prefers-reduced-motion. */

:root {
  --bg: #f7f7f5;
  --bg-alt: #eeeeea;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #545b64;
  --border: #d9dad6;
  --accent: #1f56c7;
  --accent-strong: #163f94;
  --accent-soft: #e3ebfb;
  --on-accent: #ffffff;
  --sun: #c98a00;
  --error: #b42318;
  --success: #12733a;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 16px rgb(16 24 40 / 6%);
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1217;
    --bg-alt: #151a21;
    --surface: #1a2029;
    --text: #e7e9ec;
    --muted: #a3acb7;
    --border: #2b333e;
    --accent: #8db2ff;
    --accent-strong: #b5ceff;
    --accent-soft: #1c2a44;
    --on-accent: #0b1020;
    --sun: #f2c14e;
    --error: #ff8f85;
    --success: #6fd49a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: .18em;
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--accent-strong);
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2.5rem, 46rem);
}

.muted {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.icon {
  flex: none;
  vertical-align: -.2em;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 12px rgb(0 0 0 / 6%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.brand {
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--text);
  padding: .25rem .1rem;
}

.brand:hover {
  color: var(--accent);
}

.nav-list {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-list a {
  display: block;
  padding: .4rem .7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}

.nav-list a:hover,
.nav-list a[aria-current="true"] {
  color: var(--text);
  background: var(--bg-alt);
}

@media (max-width: 40rem) {
  .brand {
    display: none;
  }

  .header-inner {
    justify-content: center;
  }

  .nav-list a {
    padding: .4rem .55rem;
    font-size: .9rem;
  }
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  opacity: .9;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(1.75rem, 5vw, 3.5rem);
}

.hero-photo img {
  width: clamp(9rem, 18vw, 12.5rem);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
}

.eyebrow {
  margin-bottom: .4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.6rem);
  letter-spacing: -.025em;
  margin-bottom: .35em;
}

.role {
  font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem);
  max-width: 36rem;
  margin-bottom: .6rem;
}

.location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  color: var(--text);
  margin-bottom: 1.6rem;
}

.location .city {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.location .icon {
  color: var(--sun);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.4rem;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  text-decoration: none;
  padding: .2rem 0;
}

.social a:hover {
  color: var(--text);
}

@media (max-width: 40rem) {
  .hero-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .location {
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
  }

  .location .muted:not(.sep) {
    padding-left: calc(18px + .35rem);
  }

  .location .sep {
    display: none;
  }
}

/* Buttons ----------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

.button:hover {
  color: var(--text);
  border-color: var(--muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.button[disabled] {
  opacity: .65;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

/* Sections ---------------------------------------------------------------- */

.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-intro {
  color: var(--muted);
  margin-top: -.6rem;
  margin-bottom: 1.6rem;
}

.prose p {
  font-size: 1.08rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Timeline ---------------------------------------------------------------- */

.timeline {
  position: relative;
  padding-left: 1.75rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: .35rem;
  top: .5rem;
  bottom: .5rem;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border) 35%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.9rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: .4rem;
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
  transform: translateX(-.04rem);
}

.timeline-item:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-meta {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .2rem;
}

.timeline-item h3 {
  margin-bottom: .1rem;
}

.timeline-item .org {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
}

.timeline-item .org::before {
  content: "· ";
  color: var(--muted);
}

.place {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: .4rem;
}

.timeline-item p:last-child {
  margin-bottom: 0;
}

/* Cards, education, certifications ---------------------------------------- */

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2.5rem 3rem;
}

.card-list {
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
}

.card h3 {
  margin-bottom: .35rem;
}

.card p {
  margin-bottom: .2rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card cite {
  font-style: italic;
}

.cert-list {
  display: grid;
  gap: .6rem;
}

.cert-list li {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .6rem;
  align-items: baseline;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.cert-list strong {
  color: var(--accent);
  min-width: 6.5rem;
}

/* Skills ------------------------------------------------------------------ */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem 2rem;
}

.skill-group h3 {
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .7rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chips li {
  padding: .3rem .8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .95rem;
  transition: border-color .2s ease, transform .2s var(--ease);
}

.chips li:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.chips .muted {
  font-size: .85em;
}

/* Projects ---------------------------------------------------------------- */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1rem;
  transition: border-color .2s ease, box-shadow .25s ease, transform .25s var(--ease);
}

.project:hover,
.project:has(a:focus-visible) {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project h3 {
  font-family: var(--mono);
  font-size: 1rem;
  margin-bottom: .45rem;
}

.project h3 a {
  color: var(--text);
  text-decoration: none;
}

/* The whole card is the link's click target. */
.project h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.project h3 a:focus-visible {
  outline: none;
}

.project:has(a:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.project p {
  color: var(--muted);
  font-size: .97rem;
}

.project .lang {
  margin: auto 0 0;
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .88rem;
}

.dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--muted);
}

.dot-c { background: #555555; }
.dot-cpp { background: #f34b7d; }
.dot-go { background: #00add8; }
.dot-java { background: #b07219; }
.dot-rust { background: #dea584; }

.more {
  margin: 1.5rem 0 0;
}

/* Contact ----------------------------------------------------------------- */

.contact-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: .35rem;
}

.field label {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
  resize: vertical;
  min-height: 9rem;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

[aria-invalid="true"] {
  border-color: var(--error) !important;
}

.hint {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
}

/* Honeypot: off-screen for people, still in the form for naive bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}

.status {
  margin: 0;
  min-height: 1.6em;
}

.status.is-error,
.notice-error {
  color: var(--error);
}

.status.is-success,
.notice-success {
  color: var(--success);
}

.privacy {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
}

.thanks {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.thanks h3 {
  color: var(--success);
}

/* Server-rendered contact page (no JavaScript) */

.standalone {
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}

.notice {
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  font-size: .95rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 2rem;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

/* Motion ------------------------------------------------------------------ */

/* Entrance: plain CSS, so it plays (and ends visible) even without JavaScript. */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.92);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.enter {
  animation: rise .7s var(--ease) both;
}

.hero-photo.enter {
  animation-name: pop;
  animation-duration: .8s;
}

.enter-2 { animation-delay: .08s; }
.enter-3 { animation-delay: .18s; }
.enter-4 { animation-delay: .28s; }
.enter-5 { animation-delay: .38s; }

/* Scroll reveal: only once main.js has confirmed IntersectionObserver works
   (class js-reveal on <html>); without it everything is simply visible. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .7s var(--ease);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js-reveal .projects .reveal:nth-child(3n + 2),
.js-reveal .skill-groups .reveal:nth-child(3n + 2),
.js-reveal .cert-list .reveal:nth-child(2) {
  transition-delay: .08s;
}

.js-reveal .projects .reveal:nth-child(3n),
.js-reveal .skill-groups .reveal:nth-child(3n),
.js-reveal .cert-list .reveal:nth-child(3) {
  transition-delay: .16s;
}

.js-reveal .cert-list .reveal:nth-child(4) {
  transition-delay: .24s;
}

.js-reveal .cert-list .reveal:nth-child(5) {
  transition-delay: .32s;
}

/* The timeline line grows as the section comes into view. */
.js-reveal .timeline::before {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.4s var(--ease);
}

.js-reveal .timeline.is-visible::before {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js-reveal .reveal,
  .js-reveal .timeline::before {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .contact,
  .actions,
  .skip-link {
    display: none;
  }

  .section-alt {
    background: none;
  }

  .js-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}
