/* Mauricio Abarca — personal site. No external fonts or trackers (privacy-friendly, GDPR-safe). */
:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --text: #0f172a;
  --muted: #4b5870;
  --line: #e3e8ef;
  --accent: #2456d6;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0ff;
  --teal: #0f8a7e;
  --glow-1: rgba(36, 86, 214, .14);
  --glow-2: rgba(15, 138, 126, .12);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1c;
    --surface: #111829;
    --surface-2: #162035;
    --text: #e7ebf3;
    --muted: #a0abc0;
    --line: #233049;
    --accent: #84a6ff;
    --accent-ink: #0a0f1c;
    --accent-soft: #18264a;
    --teal: #3dd6c3;
    --glow-1: rgba(132, 166, 255, .16);
    --glow-2: rgba(61, 214, 195, .10);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.mono {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--teal)); color: #fff;
  font-size: 14px; font-weight: 750; letter-spacing: .02em;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav .lang { border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13px; letter-spacing: .04em; }
@media (max-width: 680px) { .nav .hide-sm { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: -1;
}
.hero::before { width: 520px; height: 520px; background: var(--glow-1); top: -220px; right: -120px; }
.hero::after { width: 420px; height: 420px; background: var(--glow-2); bottom: -240px; left: -160px; }
.eyebrow {
  display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--teal);
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.06; letter-spacing: -.03em;
  margin: 0 0 22px; max-width: 17ch; font-weight: 760;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--muted); max-width: 62ch; margin: 0 0 30px; }
.lead strong { color: var(--text); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 11px;
  font-weight: 620; font-size: 16px; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.meta { margin-top: 22px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.meta span::before { content: "●"; color: var(--teal); font-size: 9px; vertical-align: 2px; margin-right: 8px; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 52px;
}
@media (min-width: 820px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); padding: 20px 20px 18px; }
.stat b { display: block; font-size: clamp(1.7rem, 3.4vw, 2.2rem); letter-spacing: -.02em; line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.4; }

/* Sections */
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--line); }
.kicker { font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; max-width: 24ch; }
.intro { color: var(--muted); max-width: 64ch; margin: 0 0 34px; }
h3 { font-size: 1.12rem; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.005em; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.icon svg { width: 22px; height: 22px; }

/* Approach steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 880px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  position: relative; counter-increment: step; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 22px;
}
.steps li::before {
  content: counter(step, decimal-leading-zero); display: block; font-size: 13px; font-weight: 700;
  letter-spacing: .08em; color: var(--teal); margin-bottom: 8px;
}
.steps li p { margin: 0; color: var(--muted); font-size: 15.5px; }
@media (min-width: 880px) {
  .steps li:not(:last-child)::after {
    content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
    background: var(--bg); border: 1px solid var(--line); color: var(--muted); z-index: 1;
  }
}

/* Case studies */
.cases { display: grid; gap: 18px; }
.case {
  display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
@media (min-width: 880px) { .case { grid-template-columns: 0.9fr 1.6fr; gap: 32px; padding: 30px; } }
.tag {
  display: inline-block; font-size: 12.5px; font-weight: 650; letter-spacing: .04em; color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, transparent); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.case h3 { font-size: 1.28rem; }
.case dl { margin: 0; display: grid; gap: 14px; }
.case dt { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.case dd { margin: 2px 0 0; }
.note { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* Experience */
.exp { display: grid; gap: 40px; }
@media (min-width: 900px) { .exp { grid-template-columns: 1.55fr 1fr; gap: 48px; } }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); align-self: start; }
.timeline > li { position: relative; padding: 0 0 26px 24px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.org { font-weight: 700; font-size: 1.05rem; }
.when { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.roles { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.roles li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.timeline p { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; }
.side h3 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.side ul.plain { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 8px; font-size: 15.5px; }
.side ul.plain small { color: var(--muted); display: block; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li {
  font-size: 14px; padding: 5px 11px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--text);
}

/* Contact */
.contact {
  text-align: left; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--teal) 10%, var(--surface)));
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: clamp(26px, 5vw, 48px);
}
.contact h2 { max-width: none; }
.contact .intro { margin-bottom: 26px; }

footer { padding: 34px 0 44px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
@media print {
  .site-header, .cta, .hero::before, .hero::after { display: none; }
  section { padding: 24px 0; }
}
