/* Inter (SIL Open Font License 1.1), self-hosted latin subset */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("assets/fonts/inter-latin.woff2") format("woff2"); }

/* ===== Tokens ===== */
:root {
  --navy-900: #071428;
  --navy-800: #0b1f3f;
  --navy-700: #13305c;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0b1730;
  --muted: #4a5873;
  --line: #dbe2ec;
  --accent: #0f766e;
  --accent-strong: #0d5f59;
  --accent-soft: #e2f4f1;
  --gold: #8a5a00;
  --gold-soft: #fbf0d6;
  --shadow: 0 1px 2px rgba(11, 23, 48, .06), 0 8px 24px rgba(11, 23, 48, .07);
  --radius: 16px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07111f;
    --surface: #0e1a2d;
    --surface-2: #13233b;
    --text: #e6ecf5;
    --muted: #a3b1c7;
    --line: #22344f;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: rgba(45, 212, 191, .12);
    --gold: #f6c453;
    --gold-soft: rgba(246, 196, 83, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Language switching: only the active language is rendered */
html[lang="es"] .en, html[lang="en"] .es { display: none !important; }

/* ===== Header ===== */
.top {
  position: sticky; top: 0; z-index: 50;
  background: #071428;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #2dd4bf; color: var(--navy-900); font-size: .82rem; font-weight: 800; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: #c9d4e6; text-decoration: none; font-size: .9rem; font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.lang {
  margin-left: 8px; display: inline-flex; align-items: center; gap: 6px;
  font: 600 .85rem var(--font); color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px; padding: 7px 14px; min-height: 36px;
}
.lang:hover { background: rgba(255, 255, 255, .14); }
@media (max-width: 820px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(45, 212, 191, .16), transparent 60%),
              linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff;
  padding: 72px 0 84px;
}
.hero::after { /* subtle data grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .7;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.35fr .9fr; gap: 48px; align-items: center; }
.avatar {
  position: relative; width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #2dd4bf, #13305c);
  border: 2px solid rgba(255, 255, 255, .25);
  font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; color: #fff;
  margin-bottom: 22px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); font-weight: 800; }
.headline { margin-top: 14px; font-size: clamp(1.08rem, 2.2vw, 1.35rem); font-weight: 600; color: #dbe6f5; }
.stack { margin-top: 10px; font-family: var(--mono); font-size: .92rem; color: #5eead4; }
.where { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: #b8c6dc; font-size: .95rem; }
.cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  font: 600 .95rem var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #2dd4bf; color: var(--navy-900); }
.btn-primary:hover { background: #5eead4; color: var(--navy-900); }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.social { display: flex; gap: 6px; margin-left: 4px; }
.social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: #c9d4e6; }
.social a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.social .icon { width: 22px; height: 22px; }

.facts {
  list-style: none; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 8px 22px;
}
.facts li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.facts li:last-child { border-bottom: 0; }
.facts .icon { width: 22px; height: 22px; color: #5eead4; margin-top: 2px; }
.facts strong { display: block; font-size: .95rem; color: #fff; }
.facts span.d { display: block; font-size: .88rem; color: #b8c6dc; }
.facts .honor .icon { color: #f6c453; }
@media (max-width: 860px) {
  .hero { padding: 48px 0 56px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 480px) {
  .cta .btn { flex: 1 1 calc(50% - 6px); padding: 0 12px; }
  .social { margin-left: 0; }
}

/* ===== Sections ===== */
section { padding: 88px 0; scroll-margin-top: 60px; }
section.alt { background: var(--surface-2); }

.eyebrow { font-family: var(--mono); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sec-title { font-size: clamp(1.75rem, 3.6vw, 2.4rem); font-weight: 800; margin-top: 8px; }
.sec-head { margin-bottom: 40px; max-width: 720px; }
.sec-head p { margin-top: 12px; color: var(--muted); }
@media (max-width: 600px) { section { padding: 64px 0; } .sec-head { margin-bottom: 28px; } }

/* About */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.about-text p { font-size: 1.12rem; line-height: 1.75; }
.about-side { display: grid; gap: 14px; }
.mini {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.mini h3 { font-size: .8rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.mini p { font-weight: 600; }
.mini p small { font-weight: 400; color: var(--muted); font-size: .9rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 28px; } }

/* ===== Projects ===== */
.projects { display: grid; gap: 32px; }
.project {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow);
}
.project:nth-child(even) .media { order: 2; }
.media {
  position: relative; min-height: 340px;
  background: linear-gradient(145deg, var(--navy-800), var(--navy-700));
  display: flex; align-items: center; justify-content: center; padding: 36px 28px;
  overflow: hidden;
}
.browser {
  width: 100%; max-width: 520px; border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.browser .bar { display: flex; gap: 6px; padding: 9px 12px; background: #e9edf3; }
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: #c3cbd8; }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.phone {
  position: absolute; right: 22px; bottom: -40px; width: 30%; max-width: 150px;
  border-radius: 22px; padding: 6px; background: #0a0f1a;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .45);
}
.phone img { border-radius: 16px; aspect-ratio: 9 / 18; object-fit: cover; object-position: top; width: 100%; }
.body { padding: 34px 34px 32px; display: flex; flex-direction: column; }
.p-num { font-family: var(--mono); font-size: .8rem; color: var(--accent); font-weight: 600; }
.project h3 { font-size: 1.55rem; font-weight: 800; margin-top: 6px; }
.tagline { color: var(--muted); font-weight: 500; margin-top: 4px; }
.meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.meta b { color: var(--text); font-weight: 600; }
.desc { margin-top: 14px; }
.points { margin-top: 12px; list-style: none; display: grid; gap: 7px; }
.points li { position: relative; padding-left: 20px; font-size: .95rem; }
.points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li {
  font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
}
.links { margin-top: auto; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 10px; font-weight: 600; font-size: .9rem; text-decoration: none;
  border: 1px solid var(--line); color: var(--text); background: var(--surface);
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links a.main { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.links a.main:hover { background: var(--navy-700); color: #fff; }
@media (prefers-color-scheme: dark) {
  .links a.main { background: #2dd4bf; border-color: #2dd4bf; color: var(--navy-900); }
  .links a.main:hover { background: #5eead4; color: var(--navy-900); }
}
.note { margin-top: 16px; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.note .icon { margin-top: 3px; color: var(--gold); }
.badge-honor {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  padding: 5px 11px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}

/* Illustrations & logo */
.media-art { padding: 0; }
.media-art img.art { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.media-art .badge-float { z-index: 1; }
.media-art img.art.contain { object-fit: contain; }
.art-tag { position: absolute; right: 12px; bottom: 12px; font-size: .72rem; font-weight: 600; color: #c9d4e6; background: rgba(7, 20, 40, .7); border: 1px solid rgba(255,255,255,.15); padding: 3px 9px; border-radius: 999px; }
.logo-card { background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.logo-card img { width: 150px; height: 150px; }
.projects-more .project .media-logo { align-items: center; padding: 20px; }
.edu-logo { width: 64px; height: 64px; border-radius: 12px; background: #fff; padding: 4px; margin-top: 14px; border: 1px solid var(--line); }
.media .badge-float {
  position: absolute; top: 18px; left: 18px;
  background: #fbf0d6; color: #6b4600; border-color: transparent;
}

/* Placeholders */
.ph {
  width: 100%; max-width: 460px; aspect-ratio: 16 / 10; border-radius: 12px;
  border: 1.5px dashed rgba(255, 255, 255, .28);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #b8c6dc; text-align: center; padding: 20px;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 16px 16px;
}
.ph .icon { width: 40px; height: 40px; color: #5eead4; }
.ph strong { color: #fff; font-size: 1.05rem; }
.ph span { font-size: .85rem; }

/* Compact projects */
.projects-more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.projects-more .project { grid-template-columns: 1fr; }
.projects-more .project { grid-template-rows: auto 1fr; }
.projects-more .project .media { order: 0; min-height: 0; height: 230px; padding: 24px 20px 0; align-items: flex-end; }
.projects-more .browser { border-radius: 8px 8px 0 0; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.projects-more .ph { margin-bottom: 24px; height: calc(100% - 24px); aspect-ratio: auto; }
.projects-more .body { padding: 24px; }
.projects-more h3 { font-size: 1.25rem; }
@media (max-width: 960px) {
  .media-art { aspect-ratio: 16 / 10; }
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .media { order: 0; }
  .media { min-height: 0; padding: 28px 20px 52px; }
  .projects-more { grid-template-columns: 1fr; }
  .projects-more .project .media { padding-bottom: 0; height: auto; min-height: 200px; }
  .projects-more .project .media-art { padding: 0; }
  .projects-more .project .media-logo { padding: 20px; }
  .projects-more .ph { height: 180px; }
}
@media (max-width: 560px) {
  .body { padding: 24px 20px; }
  .phone { right: 12px; bottom: -28px; width: 28%; border-radius: 16px; padding: 4px; }
  .phone img { border-radius: 12px; }
  .project h3 { font-size: 1.35rem; }
}
@media (min-width: 961px) and (max-width: 1100px) { .projects-more { grid-template-columns: 1fr 1fr; } }

/* ===== Experience ===== */
.xp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 30px 34px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.when { font-family: var(--mono); font-size: .8rem; color: var(--accent); font-weight: 600; }
.timeline h3 { font-size: 1.1rem; font-weight: 700; margin-top: 2px; }
.org { color: var(--muted); font-size: .93rem; }
.timeline p.x { margin-top: 6px; font-size: .95rem; }
.edu {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.edu h3.k { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.edu .degree { font-size: 1.3rem; font-weight: 800; margin-top: 10px; }
.edu .school { color: var(--muted); margin-top: 2px; }
.edu .badge-honor { margin-top: 18px; font-size: .85rem; padding: 7px 13px; }
.edu .thesis { margin-top: 12px; font-size: .95rem; }
.edu hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.langs { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.langs li { display: flex; justify-content: space-between; font-weight: 600; }
.langs li span { color: var(--muted); font-weight: 500; }
@media (max-width: 860px) { .xp-grid { grid-template-columns: 1fr; gap: 36px; } }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.skill {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
}
.skill h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.skill h3 .icon { color: var(--accent); width: 20px; height: 20px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.chips li { font-size: .84rem; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
section.alt .chips li { background: var(--bg); }

/* ===== Certifications ===== */
.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cert {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px;
}
.cert .issuer { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.cert ul { list-style: none; margin-top: 10px; display: grid; gap: 8px; }
.cert li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.cert li .icon { color: var(--accent); margin-top: 4px; }
.cert.featured {
  grid-column: 1 / -1; display: flex; gap: 22px; align-items: center;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); border-color: transparent; color: #fff;
}
.cert.featured .seal {
  flex: none; width: 76px; height: 76px; border-radius: 18px; display: grid; place-items: center;
  background: rgba(45, 212, 191, .14); border: 1px solid rgba(45, 212, 191, .45); color: #5eead4;
}
.cert.featured .seal .icon { width: 38px; height: 38px; }
.cert.featured .issuer { color: #5eead4; }
.cert.featured h3 { font-size: 1.45rem; font-weight: 800; margin-top: 4px; }
.cert.featured p { color: #c9d4e6; font-size: .95rem; margin-top: 4px; }
@media (max-width: 700px) {
  .certs { grid-template-columns: 1fr; }
  .cert.featured { flex-direction: column; align-items: flex-start; }
}

/* ===== Contact ===== */
.contact { background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #fff; text-align: center; }
.contact .eyebrow { color: #5eead4; }
.contact .sec-head { margin: 0 auto 36px; }
.contact .sec-head p { color: #c9d4e6; }
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 900px; margin: 0 auto; }
.contact-cards a {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 18px;
  border-radius: 14px; text-decoration: none; color: #fff;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  transition: background .2s, border-color .2s;
}
.contact-cards a:hover { background: rgba(255, 255, 255, .09); border-color: #2dd4bf; color: #fff; }
.contact-cards .icon { width: 28px; height: 28px; color: #5eead4; }
.contact-cards strong { font-size: 1rem; }
.contact-cards span { font-size: .85rem; color: #b8c6dc; overflow-wrap: anywhere; }
.copy {
  margin-top: 22px; font: 600 .9rem var(--font); color: #c9d4e6; background: none;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 9px 18px; cursor: pointer; min-height: 40px;
}
.copy:hover { color: #fff; border-color: #fff; }
@media (max-width: 700px) { .contact-cards { grid-template-columns: 1fr; } }

footer { background: var(--navy-900); color: #8fa0bb; font-size: .85rem; padding: 24px 0; text-align: center; border-top: 1px solid rgba(255, 255, 255, .06); }

/* ===== Motion (minimal) ===== */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
