/* ============================================================
   The Medellín AI Lab — Academic / Institute theme
   Warm paper, serif display (Fraunces), deep-navy accent.
   ============================================================ */

:root {
  --paper:    #f6f4ee;   /* warm cream background */
  --paper-2:  #ffffff;   /* cards / panels */
  --paper-3:  #efece3;   /* subtle alt blocks */
  --ink:      #1b2027;   /* main text */
  --ink-soft: #2c333d;
  --muted:    #5a626f;
  --faint:    #8b929d;
  --navy:     #1d3f63;   /* primary accent */
  --navy-2:   #2a5688;
  --navy-deep:#142b44;
  --burg:     #8a2f3b;   /* tiny secondary accent */
  --line:     rgba(27, 32, 39, 0.12);
  --line-2:   rgba(27, 32, 39, 0.22);
  --shadow:   0 18px 44px rgba(20, 33, 56, 0.10);
  --shadow-sm:0 6px 18px rgba(20, 33, 56, 0.07);
  --maxw:     1120px;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --mono:     "JetBrains Mono", ui-monospace, monospace;
  --display:  "Fraunces", Georgia, "Times New Roman", serif;
  --body:     "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--navy); color: #fff; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 5vw, 56px);
  transition: background .35s var(--ease), border-color .35s var(--ease), padding .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(246, 244, 238, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: 13px; padding-bottom: 13px;
}
.nav__brand { display: flex; align-items: center; gap: 11px; }
.nav__name { font-family: var(--display); font-size: 15px; letter-spacing: .4px; font-weight: 500; color: var(--ink); }
.nav__name b { color: var(--navy); font-weight: 600; }
.nav__mark {
  width: 16px; height: 16px; border-radius: 4px; position: relative;
  background: var(--navy);
}
.nav__mark::after { content: ""; position: absolute; inset: 4px; border-radius: 2px; background: var(--paper); }
.nav.is-stuck .nav__mark::after { background: var(--paper); }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a { font-size: 14.5px; color: var(--muted); transition: color .2s; }
.nav__links a:hover { color: var(--navy); }
.nav__cta {
  border: 1px solid var(--navy); border-radius: 999px;
  padding: 8px 18px !important; color: var(--navy) !important;
}
.nav__cta:hover { background: var(--navy); color: #fff !important; }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--ink); transition: .3s; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-size: 15px; font-weight: 500;
  padding: 13px 24px; border-radius: 8px; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s, background .25s, border-color .25s, color .25s;
  border: 1px solid transparent;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); background: var(--navy-deep); box-shadow: var(--shadow-sm); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 130px clamp(16px, 5vw, 56px) 90px; overflow: hidden;
  background:
    radial-gradient(900px 500px at 82% 8%, rgba(29,63,99,.06), transparent 60%),
    var(--paper);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.hero__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 28%, transparent 80%);
  opacity: .6;
}
.hero__inner { position: relative; z-index: 3; max-width: var(--maxw); margin: 0 auto; width: 100%; pointer-events: none; }
.hero__inner a, .hero__inner .btn { pointer-events: auto; }

.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .5px;
  color: var(--navy); display: inline-flex; align-items: center; gap: 9px; margin-bottom: 24px;
}
.kicker__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--navy); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.hero__title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(36px, 6.4vw, 78px); line-height: 1.05; letter-spacing: -.5px; color: var(--ink);
}
.grad { color: var(--navy); font-style: italic; font-weight: 600; }
.hero__lede {
  max-width: 620px; margin: 28px 0 36px; color: var(--muted); font-size: clamp(16px, 2vw, 19px);
}
.hero__hint { color: var(--faint); font-size: 14px; white-space: nowrap; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__stats { list-style: none; display: flex; gap: clamp(22px, 5vw, 58px); margin-top: 58px; flex-wrap: wrap; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats b { font-family: var(--display); font-size: 32px; font-weight: 600; color: var(--navy); line-height: 1; }
.hero__stats span { font-size: 13px; color: var(--faint); margin-top: 7px; font-family: var(--mono); }

.hero__scroll { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3; color: var(--faint); font-size: 22px; animation: bob 2.4s var(--ease) infinite; }
@keyframes bob { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,8px); } }

/* ---------- SECTIONS ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vw, 150px) clamp(16px, 5vw, 56px); }
.section__tag { font-family: var(--mono); font-size: 13px; color: var(--navy); letter-spacing: .5px; margin-bottom: 16px; }
.section__head { margin-bottom: 56px; }
.section__head h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.3px; font-size: clamp(30px, 4.6vw, 50px); color: var(--ink); }

.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- MISSION ---------- */
.mission__statement { font-family: var(--display); font-weight: 400; font-size: clamp(23px, 3.5vw, 40px); line-height: 1.3; max-width: 980px; color: var(--ink-soft); letter-spacing: -.2px; }
.hl { color: var(--navy); font-style: italic; }
.mission__cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 36px; margin-top: 68px; }
.mission__cols h3 { font-family: var(--display); font-weight: 600; font-size: 19px; margin-bottom: 11px; color: var(--ink); }
.mission__cols p { color: var(--muted); font-size: 15.5px; }
.mission__cols em { color: var(--navy); font-style: italic; }

/* ---------- RESEARCH CARDS ---------- */
.cards { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.card {
  position: relative; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 14px; padding: 34px 30px 30px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--navy); transform: scaleY(0); transform-origin: top; transition: transform .3s var(--ease); }
.card:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card:hover::before { transform: scaleY(1); }
.card__no { font-family: var(--mono); color: var(--navy); font-size: 13px; margin-bottom: 18px; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 24px; margin-bottom: 12px; color: var(--ink); }
.card p { color: var(--muted); font-size: 15.5px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tags li { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: var(--paper-3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }

/* ---------- TIMELINE / WORK ---------- */
.timeline { display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--line); }
.item { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 26px 0 26px 30px; position: relative; transition: background .25s; border-radius: 0 12px 12px 0; }
.item::before { content: ""; position: absolute; left: -7px; top: 33px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--navy); }
.item:hover { background: linear-gradient(90deg, rgba(29,63,99,.045), transparent); }
.item__year { font-family: var(--mono); color: var(--navy); font-size: 15px; padding-top: 3px; }
.item__body h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin-bottom: 8px; color: var(--ink); }
.item__body p { color: var(--muted); font-size: 15.5px; max-width: 640px; }
.item__badge { display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; background: var(--paper-2); }

/* ---------- GALLERY / MOMENTS ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.shot { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin: 0; }
.shot img { width: 100%; height: 230px; object-fit: cover; transition: transform .5s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.shot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 12px; font-family: var(--mono); font-size: 12px; color: #fff; background: linear-gradient(180deg, transparent, rgba(20,43,68,.82)); }

/* ---------- CUALLI SPOTLIGHT ---------- */
.cualli { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(32px, 6vw, 76px); align-items: center; }
.cualli__media { display: flex; justify-content: center; }
.cualli__media img { width: 100%; max-width: 320px; border-radius: 16px; box-shadow: var(--shadow); }
.cualli__body h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.4vw, 48px); color: var(--ink); margin-bottom: 6px; letter-spacing: -.3px; }
.cualli__role { font-family: var(--mono); color: var(--navy); font-size: 14px; margin-bottom: 18px; }
.cualli__body > p { color: var(--muted); font-size: 16px; max-width: 560px; }
.cualli__points { list-style: none; margin: 24px 0 28px; display: grid; gap: 12px; }
.cualli__points li { position: relative; padding-left: 22px; color: var(--muted); font-size: 15px; }
.cualli__points li::before { content: "→"; position: absolute; left: 0; color: var(--navy); font-family: var(--mono); }
.cualli__points b { color: var(--ink); font-weight: 600; }
.cualli__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.cualli--rev .cualli__media { order: 2; }
.cualli--rev .cualli__body { order: 1; }
.cualli--rev .cualli__media img { max-width: 520px; }

/* ---------- NEWS ---------- */
.news__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.post { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px; display: flex; flex-direction: column; min-height: 200px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.post:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.post--pinned { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--navy); }
.post__tag { font-family: var(--mono); font-size: 11.5px; color: var(--navy); margin-bottom: 14px; }
.post--soon { opacity: .68; }
.post--soon .post__tag { color: var(--faint); }
.post h3 { font-family: var(--display); font-weight: 600; font-size: 21px; margin-bottom: 10px; color: var(--ink); }
.post p { color: var(--muted); font-size: 14.5px; flex: 1; }
.post time { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 16px; }
.news__note { margin-top: 28px; color: var(--muted); }
.news__note a { color: var(--navy); border-bottom: 1px solid var(--line-2); }

/* ---------- FOUNDER ---------- */
.founder { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.founder__photo { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.founder__photo img { width: 100%; aspect-ratio: 4/4.4; object-fit: cover; object-position: 60% 30%; }
.founder__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(20,43,68,.42)); }
.founder__caption { position: absolute; left: 16px; bottom: 14px; z-index: 2; font-family: var(--mono); font-size: 12px; color: #fff; background: rgba(20,43,68,.55); padding: 5px 10px; border-radius: 6px; backdrop-filter: blur(6px); }
.founder__bio h2 { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3.8vw, 44px); margin-bottom: 6px; color: var(--ink); letter-spacing: -.3px; }
.founder__role { font-family: var(--mono); color: var(--navy); font-size: 14px; margin-bottom: 20px; }
.founder__bio p { color: var(--muted); font-size: 16px; max-width: 540px; }
.founder__links { display: flex; gap: 22px; margin-top: 26px; flex-wrap: wrap; }
.founder__links a { font-family: var(--mono); font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--line-2); padding-bottom: 3px; transition: color .2s, border-color .2s; }
.founder__links a:hover { color: var(--navy); border-color: var(--navy); }

/* ---------- CONTACT ---------- */
.contact { position: relative; }
.contact__inner { max-width: 760px; }
.contact h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.6vw, 50px); color: var(--ink); letter-spacing: -.3px; }
.contact__lede { color: var(--muted); margin: 18px 0 38px; font-size: 17px; max-width: 520px; }
.contact__form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .3px; }
.field input, .field textarea {
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 13px 15px; color: var(--ink); font-family: var(--body); font-size: 15px; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(29,63,99,.12); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.contact__form .btn { grid-column: 1 / -1; justify-self: start; }
.contact__direct { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.contact__direct a { color: var(--navy); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px clamp(16px, 5vw, 56px); max-width: var(--maxw); margin: 0 auto; text-align: center; }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 15px; letter-spacing: .3px; color: var(--ink); }
.footer__brand b { color: var(--navy); }
.footer__meta { color: var(--muted); font-size: 14px; margin: 16px 0 6px; }
.footer__meta a { color: var(--navy); }
.footer__copy { color: var(--faint); font-size: 13px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .nav__links { position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); flex-direction: column; justify-content: center; gap: 26px; background: var(--paper-2); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .35s var(--ease); box-shadow: -20px 0 50px rgba(20,33,56,.1); }
  .nav__links.open { transform: none; }
  .nav__toggle { display: flex; z-index: 60; }
  .nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mission__cols { grid-template-columns: 1fr; gap: 28px; }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .cualli { grid-template-columns: 1fr; }
  .cualli__media { order: -1; }
  .news__grid { grid-template-columns: 1fr; }
  .founder { grid-template-columns: 1fr; }
  .founder__photo { max-width: 360px; }
  .contact__form { grid-template-columns: 1fr; }
  .item { grid-template-columns: 70px 1fr; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
