/* Theme: clean light minimalist */
:root{
  --bg: #fafafa;
  --fg: #18181b;
  --fg2: #18181b;
  --muted: #71717a;
  --accent: #10b981;
  --accent-2: #52525b;
  --panel: #ffffff;
  --panel-soft: #f4f4f5;
  --border: #e4e4e7;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --img-shadow: 0 4px 20px rgba(0,0,0,.12), 0 1px 6px rgba(0,0,0,.08);
  --header-h: 64px;
  --viewport-fade-size: 100px;
}

/* Bebas Neue for all headings */
h1, h2, h3{
  font-family: "Bebas Neue", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: .5px;
  line-height: 1.05;
}
h3{ font-size: 28px; }

*{box-sizing:border-box}
html{height:100%}
body{
  background: var(--bg);
  color: var(--fg2);
  font:16px/1.6 "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial;
  overscroll-behavior-y: contain;
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
body::before{
  content:'';
  position:fixed;
  inset:0;
  z-index:-1;
  background:url('../img/photos/01080008.webp') center/cover no-repeat;
  opacity:0.07;
  pointer-events:none;
}
.main{ flex:1; }
.container{max-width:1100px;margin:0 auto;padding:0 20px}

/* Header */
.header{position:sticky;top:0;z-index:20;background:rgba(250,250,250,.70);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--border);left:0;right:0;width:100%}
.header__inner{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{
  font-family: "Bebas Neue", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  text-decoration: none;
  color: var(--fg2);
  letter-spacing: .5px;
}
.nav{display:flex;gap:4px;align-items:center}
.nav__link{
  color:var(--muted);
  text-decoration:none;
  border-bottom:2px solid transparent;
  opacity:.9;
  padding:6px 10px;
  border-radius:8px;
  font-weight:500;
  font-size:15px;
  transition:color .15s ease, background .15s ease;
}
.nav__link:hover{opacity:1;color:var(--fg2);background:var(--panel-soft)}
.nav__link.is-active{color:var(--fg2);opacity:1;background:var(--panel-soft);border-bottom-color:var(--accent);}
.nav-toggle{display:none;flex-direction:column;gap:5px;background:transparent;border:1px solid var(--border);padding:8px 10px;border-radius:10px;color:var(--fg2);cursor:pointer;}
.nav-toggle__bar{display:block;width:22px;height:2px;background:var(--fg2)}

@media (max-width:760px){
  .nav-toggle{display:flex}
  .nav{
    display:none;
    position:absolute;
    top:68px; right:16px; left:16px;
    padding:10px;
    border:1px solid var(--border);
    background:var(--panel);
    border-radius:14px;
    flex-direction:column;
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
  }
  .nav.is-open{ display:flex; }

  .nav__link{
    color: var(--fg2);
    border-bottom: none;
    opacity: 1;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 500;
  }
  .nav__link.is-active{
    background: rgba(16,185,129,.08);
    color: var(--accent);
  }
  .nav__link:hover{
    background: var(--panel-soft);
    color: var(--fg2);
  }
}

/* Sections + sequential fade switching */
.main{ padding:28px 0 48px; }
.section{
  min-height:60vh;
  padding:24px 0;
  opacity:1;
  filter:none;
  transition:
    opacity .4s ease,
    filter .4s ease;
  will-change: opacity, filter;
}
.section.is-hidden{ display:none; }
.section.is-enter{
  display:block;
  opacity:0;
  filter: blur(10px);
}
.section.is-enter.is-visible{
  opacity:1;
  filter:none;
}
.section.is-leave{
  opacity:0;
  filter: blur(12px);
}
@media (prefers-reduced-motion: reduce){
  .section{
    transition: opacity .1s linear;
  }
  .section.is-enter{ filter:none; }
  .section.is-leave{ filter:none; }
}
.nav__link[aria-disabled="true"] {
  pointer-events: none;
  opacity: .5;
  cursor: default;
}

/* ── Nav dropdown ─────────────────────────────────────────── */
.nav__dropdown { position: relative; }

.nav__dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
}
.nav__dropdown-toggle:hover { opacity: 1; color: var(--fg2); background: var(--panel-soft); }

.nav__dropdown-toggle svg {
  width: 12px; height: 12px;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.nav__dropdown.is-open .nav__dropdown-toggle svg { transform: rotate(180deg); }

.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  padding: 6px;
  z-index: 200;
  flex-direction: column;
  gap: 2px;
}
.nav__dropdown.is-open .nav__dropdown-menu { display: flex; }

.nav__dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--fg2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav__dropdown-item:hover { background: var(--panel-soft); color: var(--accent); }
.nav__dropdown-item--disabled {
  color: var(--muted);
  pointer-events: none;
  opacity: .55;
}

@media (max-width: 760px) {
  .nav__dropdown { width: 100%; }
  .nav__dropdown-toggle {
    width: 100%; color: var(--fg2); border-bottom: none;
    font-size: 16px; padding: 12px 16px; border-radius: 10px;
    justify-content: space-between;
  }
  .nav__dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: var(--panel-soft);
    border-radius: 8px;
    margin-top: 2px;
    padding: 4px 8px;
  }
  .nav__dropdown.is-open .nav__dropdown-menu { display: flex; }
  .nav__dropdown-item { font-size: 15px; padding: 10px 12px; }
}

/* Cards, grids, bits */
.grid{
  display:grid;
  column-gap:20px;
  row-gap:24px;
}
.grid.two{ grid-template-columns:1.2fr 1fr; }
.grid.three{ grid-template-columns:repeat(3,1fr); }
@media (max-width:960px){
  .grid.two,
  .grid.three{ grid-template-columns:1fr; }
}
.card{ background:var(--panel); border:1px solid var(--border); border-radius:14px; padding:24px; box-shadow:var(--shadow); transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.card.soft{ background:var(--panel-soft); }
.title{ font-size:clamp(32px,4.5vw,52px); margin:0 0 8px; font-weight:400; letter-spacing:.5px; }
.subtitle{ font-size:clamp(22px,3vw,36px); margin:0 0 12px; font-weight:400; letter-spacing:.5px; }
.lead{ font-size:17px; color:var(--fg2); opacity:.8; line-height:1.7; }
.list{ padding-left:18px; margin:0; }
.list li{ margin:6px 0; }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.chip{ border:1px solid var(--border); border-radius:999px; padding:5px 10px; background:var(--panel-soft); color:var(--muted); font-size:13px; font-weight:500; }

/* Split layout inside the Contact card */
.contact-split{
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: center;
}
.contact-split__left{ min-width: 0; }
.contact-split__right{ justify-self: end; text-align: center; }

/* Logo tile/frame */
.logo-tile{
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.contact-logo{
  max-width: 220px;
  max-height: 120px;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.logo-caption{
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 960px){
  .contact-split{ grid-template-columns: 1fr; }
  .contact-split__right{ justify-self: center; }
  .contact-logo{ max-width: 260px; }
}
.grid.one{ grid-template-columns: 1fr; }

/* Scroll reveal */
[data-reveal]{
  --reveal: 0;
  opacity: var(--reveal);
  transform: translateY(calc((1 - var(--reveal)) * 8px));
  transition: opacity .35s linear, transform .35s ease;
  will-change: opacity, transform;
}
[data-reveal].in-view{
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce){
  [data-reveal]{ transition: none; opacity: 1; transform: none; }
}

section[data-section="research"] [data-reveal]{
  opacity: 1 !important;
  transform: none !important;
}

/* Card media for project thumbnails */
.card__media{
  overflow: hidden;
  border-radius: 10px;
  margin: 0 0 12px;
  background: #111;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  box-shadow: var(--img-shadow);
}
.card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Action row */
.card__actions{
  margin-top: 12px;
}

/* Two-column project card: 3/5 text + 2/5 image */
.card--split{
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
}

.card--split .card__body{ min-width: 0; }

.card--split .card__media{
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--img-shadow);
  height: 100%;
  aspect-ratio: auto;
}
.card--split .card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__actions{ margin-top: 12px; }

@media (max-width: 900px){
  .card--split{
    grid-template-columns: 1fr;
  }
  .card--split .card__media{
    height: auto;
    aspect-ratio: 16 / 9;
    order: -1;
  }
  .card--split .card__media img{
    height: 100%;
    object-fit: cover;
  }
}

.card__divider{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

/* 50/50 split card */
.card--split-50{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.card--split-50 .col{ min-width: 0; display: flex; flex-direction: column; }

/* Figure + caption */
.figure{
  position: relative;
  margin: 0 0 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--img-shadow);
  background: #111;
}
.figure img{
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}
.figure figcaption{
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px 10px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.figure figcaption a{
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

/* Small "PDF" badge */
.figure .badge{
  position: absolute;
  top: 8px; left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #222;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .2px;
  border: 1px solid var(--border);
}
.figure__link{ display:block; text-decoration:none; color:inherit; }

.figure__frame{
  position: relative;
  width: 100%;
}
.figure__frame::before{
  content:"";
  display:block;
  padding-top:56.25%; /* 16:9 */
}

.pdf-embed,
.figure__frame > img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  border:0;
  object-fit:cover;
}

.figure__link:hover .badge{ filter: brightness(1.02); }

.pdf-thumb{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  background:#111;
}

/* References list inside card */
.refs{
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.refs li{ margin: 4px 0; }

@media (max-width: 900px){
  .card--split-50{
    grid-template-columns: 1fr;
  }
  .card--split-50 .col:nth-child(1){ order: 1; }
  .card--split-50 .col:nth-child(2){ order: 2; }
}

/* 2×2 weave layout */
.card--weave{
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "text1 fig1"
    "fig2  text2";
  gap: 20px;
  align-items: start;
}

.card--weave .text--a  { grid-area: text1; }
.card--weave .figure--a{ grid-area: fig1; }
.card--weave .figure--b{ grid-area: fig2; }
.card--weave .text--b  { grid-area: text2; }

.card--weave .text{ min-width: 0; display: flex; flex-direction: column; }
.card--weave .figure{ margin: 0; }

@media (max-width: 900px){
  .card--weave{
    grid-template-columns: 1fr;
    grid-template-areas:
      "text1"
      "fig1"
      "fig2"
      "text2";
  }
}

#proj-sbf .figure__frame::before{
  display: none !important;
}

#proj-sbf .figure__img,
#proj-sbf .figure img{
  position: static !important;
  inset: auto !important;
  width: 100%;
  height: auto;
  object-fit: contain;
  aspect-ratio: auto;
  display: block;
}

#proj-sbf .figure{ height: auto !important; }

/* Hero */
.hero{display:grid;grid-template-columns:1.7fr 1fr;gap:24px;align-items:center}
@media (min-width:1200px){
  .hero{grid-template-columns:2fr 1fr;}
}
.hero{
  position: relative;
  overflow: hidden;
}
.hero__content{position:relative;z-index:1}
.hero__art{position:relative;min-height:220px;overflow: visible;}

@media (max-width:960px){.hero{grid-template-columns:1fr}}
.hero__art{
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px;
}
.hero-img{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s ease;
  will-change: transform;
  transform: translateZ(0);
  box-shadow: var(--img-shadow);
}

/* Split hero image */
.hero-img-split{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--img-shadow);
  display: flex;
  transition: box-shadow .25s ease;
}

.hero-img-half{
  width: 50%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Thin divider line between halves */
.hero-img-half--left::after{
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,.25);
  z-index: 2;
}

.hero-img-half img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .25s ease;
  will-change: transform;
  transform: translateZ(0);
}

/* Portrait: center-top to keep face in frame */
.hero-img-half--left img{ object-position: center top; }

/* Logo: contain so it's fully visible, with a soft background */
.hero-img-half--right{
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img-half--right img{
  object-fit: contain;
  padding: 10%;
}

@media (hover: hover) and (pointer: fine){
  .hero-img-split:hover .hero-img-half img{
    transform: scale(1.03);
  }
}

@media (max-width: 960px){
  .hero-img-split{ max-width: 340px; margin-top: 10px; }
}
.card:hover{
  border-color: #d4d4d8;
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
}

@media (max-width: 960px){
  .hero-img{
    max-width: 340px;
    margin-top: 10px;
  }
}

.section .hero{
  margin-bottom: 24px;
}

.section .hero + .grid{
  margin-top: 12px;
}

/* Buttons */
.btn{
  display:inline-block;
  padding:10px 18px;
  border-radius:10px;
  text-decoration:none;
  font-weight:600;
  font-size:15px;
  border:1px solid transparent;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    filter .12s ease,
    border-color .2s ease;
  will-change: transform, box-shadow;
  box-shadow: none;
  cursor:pointer;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active{
  transform: translateY(0);
  box-shadow: none;
}

.btn--accent{
  color:#fff;
  background: var(--accent);
  border-color: #059669;
  letter-spacing:-.1px;
}
.btn--accent:hover{ filter: brightness(1.08); }

.btn--ghost{
  color:var(--fg2);
  border-color:var(--border);
  background:var(--panel);
}
.btn--ghost:hover{ border-color:var(--accent-2); }

.btn:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  .btn:hover, .btn:active{ transform:none; }
}

/* Footer */
.footer{border-top:1px solid var(--border);padding:24px 0;color:var(--muted);font-size:14px;background:rgba(250,250,250,.70);}

/* Contact chips */
.contact{
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.contact__link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--fg2);
  text-decoration: none;
  font-weight: 500;
  max-width: 50ch;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.contact__link:hover{
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.contact__link svg{
  display: block;
  color: var(--muted);
}
.contact li{
  list-style: none;
  margin: 0;
}

.contact li.full{
  flex: 0 0 100%;
}

@media (min-width: 561px){
  .contact li:not(.full){
    flex: 1 1 calc(50% - 5px);
  }
}

@media (max-width: 560px){
  .contact li{ flex: 0 0 100%; }
}

@media (min-width: 561px){
  .contact li.full{ flex: 0 0 100%; }
  .contact li:not(.full){ flex: 0 0 auto; }
}

/* Email copy chip */
.contact__copychip{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--fg2);
  font-weight: 500;
  width: 100%;
}

.copy-text{
  user-select: text;
  cursor: text;
  word-break: break-all;
}

.copy-btn{
  margin-left: auto;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--fg2);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.copy-btn:hover{
  border-color: var(--accent-2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.contact-form-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:24px;
  margin-top:20px;
}

.contact-form-card__title,
.contact-info-card__title{
  margin:0 0 8px;
  font-size:26px;
  font-weight:400;
  letter-spacing:.5px;
}

.contact-form-card__lead{
  margin:0 0 16px;
  color:var(--muted);
}

.contact-form{
  display:grid;
  gap:16px;
}

.contact-form__group{display:grid;gap:6px;}
.contact-form__group label{font-weight:600;font-size:14px;color:var(--muted);}
.contact-form__group input,
.contact-form__group textarea{
  width:100%;
  padding:11px 14px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--panel-soft);
  font:inherit;
  color:var(--fg2);
  transition:border-color .2s ease, box-shadow .2s ease;
}

.contact-form__group textarea{min-height:140px;resize:vertical;}

.contact-form__group input:focus,
.contact-form__group textarea:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(16,185,129,.15);
}

.contact-form__actions{display:grid;gap:8px;}
.contact-form__footnote{margin:0;font-size:13px;color:var(--muted);}

.contact-info-card{
  background:var(--panel-soft);
  display:grid;
  gap:16px;
}

.contact-info-card__row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:nowrap;
}

.contact-info-card__row .btn{
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.contact-info-card__row .btn:first-of-type{margin-left:auto;}
.contact-btn svg{display:block;width:16px;height:16px;}

@media (max-width:720px){
  .contact-info-card__row{
    flex-direction:column;
    align-items:stretch;
  }
  .contact-info-card__row .btn{margin-left:0;width:100%;justify-content:center;}
}

.contact-info-card__hint{margin:0;font-size:13px;color:var(--muted);}

.contact-form__status{
  margin:0;
  font-size:14px;
  color:var(--muted);
}
.contact-form__status.is-pending{color:var(--accent-2);}
.contact-form__status.is-success{color:#059669;}
.contact-form__status.is-error{color:#dc2626;}

/* Viewport fades */
.viewport-fade{
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 1;
}

.viewport-fade.top{
  top: 0;
  height: max(var(--viewport-fade-size), calc(var(--header-h) * 3));
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(250,250,250,0) 100%);
}

.viewport-fade.bottom{
  bottom: 0;
  height: var(--viewport-fade-size);
  background: linear-gradient(to top, var(--bg) 0%, rgba(250,250,250,0) 100%);
}

.viewport-fade.is-visible{
  opacity: 1;
}

/* Chips */
.chips{
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.chip{
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.chips .chip svg{ width: 14px; height: 14px; }

@supports not (gap: 1rem){
  .chips{ margin: 8px -4px 0; }
  .chip{ margin: 4px; }
}

/* SBF card specific */
#proj-sbf .text{
  align-self: center;
  gap: 15px;
}

#proj-sbf .figure{
  align-self: start;
}

#proj-sbf .text p{
  margin-bottom: 10px;
}

#proj-sbf .text > :first-child{ margin-top: 15; }
#proj-sbf .text > :last-child{  margin-bottom: 15px; }

.card__actions{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.card__actions .chips{
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card__actions .btn{ flex: 0 0 auto; }

@media (max-width: 560px){
  .card__actions .chips{ width: 100%; }
}

/* GCVR: force image to fill the full media column */
#proj-gcvr.card--split{ align-items: stretch; }
#proj-gcvr .card__media{
  aspect-ratio: auto;
  height: 100%;
  display: flex;
}
#proj-gcvr .card__media picture{
  display: flex;
  width: 100%;
  height: 100%;
}
#proj-gcvr .card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#proj-3i .card__body{ align-self: center; }
#proj-3i .card__body > :first-child{ margin-top: 0; }
#proj-3i .card__body > :last-child{  margin-bottom: 0; }

#proj-3i.card--split{
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: stretch;
  gap: 20px;
}

#proj-3i .card__media{
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--img-shadow);
}
#proj-3i .card__media img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

@media (max-width: 900px){
  #proj-3i.card--split{
    grid-template-columns: 1fr;
  }
  #proj-3i .card__media,
  #proj-3i .card__media img{
    height: auto;
    width: 100%;
  }
}

/* Subtle image zoom on hover */
.card__media,
.figure .figure__frame{
  overflow: hidden;
  border-radius: 10px;
}

.card__media img,
.figure .figure__frame img{
  transition: transform .25s ease;
  will-change: transform;
  transform: translateZ(0);
}

/* Talleres image */
.talleres-img{
  transition: transform .25s ease;
  will-change: transform;
  transform: translateZ(0);
  box-shadow: var(--img-shadow);
  border-radius: 8px;
}

/* Foster image */
.foster-img{
  transition: transform .25s ease;
  will-change: transform;
  transform: translateZ(0);
  box-shadow: var(--img-shadow);
  border-radius: 8px;
}

@media (hover: hover) and (pointer: fine){
  .card__media:hover img,
  .figure .figure__frame:hover img,
  .hero__art:hover .hero-img{
    transform: scale(1.03);
  }

  .talleres-img:hover{
    transform: scale(1.02);
  }

  .foster-img:hover{
    transform: scale(1.02);
  }

  .figure__link:focus-visible .figure__frame img{
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce){
  .card__media img,
  .figure .figure__frame img,
  .hero-img,
  .talleres-img,
  .foster-img{
    transition: none;
    transform: none;
  }
}

/* Image frames */
.card__media,
.figure .figure__frame{
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--img-shadow);
}

/* ===== Publications Section ===== */
.pub-card{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-header{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pub-title{
  font-family: "Inter", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--fg2);
  letter-spacing: -.1px;
}

.pub-authors{
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  color: var(--fg2);
  opacity: 0.8;
}

.pub-meta{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  margin: 0;
  color: var(--muted);
}

.pub-journal{
  font-style: italic;
  font-weight: 600;
}

.pub-year{
  font-weight: 600;
}

.pub-status{
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(16,185,129,.10);
  color: #059669;
  border: 1px solid rgba(16,185,129,.2);
}

.pub-separator{
  color: var(--border);
}

.pub-description{
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
  color: var(--fg2);
  opacity: 0.82;
}

.pub-links{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

/* Smaller button variant */
.btn--sm{
  padding: 6px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn--sm svg{
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

/* Creative Photo Collage Layout */
.photo-collage-creative{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  gap: 3px;
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--img-shadow);
}

.photo-item{
  position: relative;
  overflow: hidden;
  background: #111;
}

.photo-large{
  grid-column: span 2;
  grid-row: span 2;
}

.photo-tall{
  grid-column: span 1;
  grid-row: span 2;
}

.photo-wide{
  grid-column: span 2;
  grid-row: span 1;
}

.photo-xlarge{
  grid-column: span 2;
  grid-row: span 2;
}

.photo-small{
  grid-column: span 1;
  grid-row: span 1;
}

.photo-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
  transform: translateZ(0);
}

@media (hover: hover) and (pointer: fine){
  .photo-item:hover img{
    transform: scale(1.02);
  }
}

.photo-item { cursor: zoom-in; }

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.is-open { display: flex; }

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  user-select: none;
}

.lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.lightbox__close:hover { background: rgba(255,255,255,.25); }

@media (max-width: 1024px){
  .photo-collage-creative{
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 160px;
  }
}

@media (max-width: 768px){
  .photo-collage-creative{
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
    gap: 3px;
  }

  .photo-large{
    grid-column: span 2;
    grid-row: span 2;
  }

  .photo-wide{
    grid-column: span 2;
  }
}

@media (max-width: 768px){
  .pub-title{ font-size: 18px; }
  .pub-authors{ font-size: 14px; }
  .pub-description{ font-size: 15px; }
}

@media (max-width: 768px){
  .card > div[style*="display: flex"]{
    flex-direction: column !important;
    align-items: center !important;
  }

  .card > div[style*="display: flex"] > div[style*="margin-top"]{
    margin-top: 0 !important;
  }

  .card > div[style*="display: flex"] img,
  .card > div[style*="display: flex"] video{
    width: 100% !important;
    max-width: 400px;
  }

  .card > div[style*="display: flex"] > div[style*="flex-direction: column"]{
    width: 100%;
    align-items: center;
  }

  .card > div[style*="display: flex"] > div[style*="flex: 1"]{
    width: 100%;
  }
}

@media (max-width: 480px){
  .card{ padding: 18px; }
  .card h3{ font-size: 22px; }
  .card h4{ font-size: 17px; }

  .card > div[style*="display: flex"] img,
  .card > div[style*="display: flex"] video{
    max-width: 100% !important;
  }

  .foster-img,
  .talleres-img{
    width: 100% !important;
  }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark){
  body::before{
    opacity: 0.22;
  }

  :root{
    --bg: #09090b;
    --fg: #fafafa;
    --fg2: #f4f4f5;
    --muted: #a1a1aa;
    --accent: #34d399;
    --accent-2: #a1a1aa;
    --panel: #18181b;
    --panel-soft: #27272a;
    --border: #3f3f46;
    --shadow: 0 1px 3px rgba(0,0,0,.2), 0 4px 16px rgba(0,0,0,.25);
    --img-shadow: 0 4px 20px rgba(0,0,0,.4), 0 1px 6px rgba(0,0,0,.25);
  }

  .header{
    background: rgba(9,9,11,.25);
  }

  .footer{
    background: rgba(9,9,11,.25);
  }

  .btn--accent{
    color: #052e16;
    background: var(--accent);
    border-color: #059669;
  }

  .btn--ghost{
    background: var(--panel);
    color: var(--fg2);
    border-color: var(--border);
  }

  .copy-btn{
    background: var(--panel-soft);
    color: var(--fg2);
  }

  .pub-status{
    background: rgba(52,211,153,.10);
    color: #34d399;
    border-color: rgba(52,211,153,.2);
  }

  .contact-form__status.is-success{ color: #34d399; }
  .contact-form__status.is-error{ color: #f87171; }

  .figure .badge{
    background: rgba(24,24,27,.92);
    color: var(--fg2);
    border-color: var(--border);
  }

  .card:hover{
    border-color: #52525b;
  }

  .viewport-fade.top{
    background: linear-gradient(to bottom, rgba(9,9,11,.25) 0%, rgba(9,9,11,0) 100%);
  }
  .viewport-fade.bottom{
    background: linear-gradient(to top, rgba(9,9,11,.25) 0%, rgba(9,9,11,0) 100%);
  }
}
