/* Faculty profile page (_layouts/faculty.html).
   Plain CSS scoped under .fp so it does not depend on the Tailwind build. */

.fp {
  --fp-orange: #f26a1b;
  --fp-orange-deep: #e2531b;
  --fp-ink: #0f1d3a;
  --fp-text: #26324a;
  --fp-muted: #5b6475;
  --fp-bar: #e6edf8;
  --fp-tile: #fde8db;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  color: var(--fp-text);
}

.fp-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.75) 42%, rgba(255,255,255,0) 54%),
    linear-gradient(135deg, #ffffff 0%, #f4f7fc 45%, #e9eff8 100%);
  box-shadow: 0 18px 50px -24px rgba(15, 29, 58, .35), 0 2px 6px rgba(15, 29, 58, .05);
  isolation: isolate;
}

/* Orange corner swooshes */
.fp-swoosh {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
.fp-swoosh--tl { top: 0; left: 0; width: 96px; height: 85px; }
.fp-swoosh--br { right: 0; bottom: 0; width: 130px; height: 77px; }
@media (min-width: 700px) {
  .fp-swoosh--tl { width: 170px; height: 150px; }
  .fp-swoosh--br { width: 220px; height: 130px; }
}

/* ---------- Campus scene ---------- */
/* Photo is shown as a plain <img> until faculty-profile.js takes over with the animated <canvas>. */
.fp-scene {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 560px;
  width: 100%;
  pointer-events: none;
}
.fp-scene img,
.fp-scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity .5s ease;
}
.fp-scene img { object-fit: cover; object-position: right 49%; }
.fp-scene canvas { opacity: 0; }
.fp-scene.is-live canvas { opacity: 1; }
.fp-scene.is-live img { opacity: 0; }

/* ---------- Main content ---------- */
.fp-main {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 24px;
  padding: 0 20px 32px;
}

.fp-photo-wrap {
  margin-top: -64px;
  display: flex;
  justify-content: center;
}
.fp-photo {
  position: relative;
  width: min(150px, 42vw);
}
.fp-photo::before {
  /* orange frame peeking out behind the photo */
  content: "";
  position: absolute;
  inset: -6px -10px -10px -6px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(242,106,27,0) 35%, rgba(242,106,27,.55) 70%, #f26a1b 100%);
  z-index: -1;
}
.fp-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.02;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 18px;
  border: 4px solid #fff;
  background: #e9eef6;
  box-shadow: 0 14px 30px -12px rgba(15, 29, 58, .45);
}

.fp-name {
  margin: 0;
  font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.35rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--fp-orange-deep);
  background: linear-gradient(90deg, #e2461b, #f47a1f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fp-award { margin: 6px 0 0; font-size: 1.05rem; font-weight: 600; color: var(--fp-ink); }
.fp-affl { margin: 2px 0 0; font-size: .95rem; color: var(--fp-muted); }
.fp-position { margin: 6px 0 0; font-size: 1.15rem; font-weight: 600; color: var(--fp-muted); }

.fp-sections { margin-top: 22px; display: grid; gap: 14px; }

.fp-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}
.fp-ico {
  width: 44px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--fp-tile);
  color: var(--fp-orange);
  box-shadow: 0 4px 10px -6px rgba(242, 106, 27, .6);
  transition: transform .25s ease, box-shadow .25s ease;
}
.fp-ico svg { width: 21px; height: 21px; }
.fp-row:hover .fp-ico { transform: translateY(-2px) rotate(-4deg); box-shadow: 0 8px 16px -8px rgba(242, 106, 27, .8); }

.fp-label {
  margin: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--fp-bar) 0%, var(--fp-bar) 70%, rgba(230, 237, 248, 0) 100%);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fp-ink);
  line-height: 1.3;
}
.fp-label .fp-val { font-weight: 700; margin-left: .35em; }

.fp-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 14px;
  display: grid;
  gap: 2px;
  font-size: .98rem;
}
.fp-list li { position: relative; padding-left: 18px; line-height: 1.45; }
.fp-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .58em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fp-orange);
}

.fp-address { margin: 8px 0 0; padding-left: 18px; font-size: .98rem; line-height: 1.5; }

.fp-contact {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 29, 58, .1);
  display: grid;
  gap: 10px;
}
.fp-contact .fp-row { align-items: center; }
.fp-contact .fp-ico { height: 34px; }
.fp-contact p { margin: 0; font-size: 1rem; }
.fp-contact strong { color: var(--fp-ink); }
.fp a.fp-link { color: var(--fp-orange-deep); text-decoration: underline; text-underline-offset: 3px; }
.fp a.fp-link:hover { color: #c23f0f; }
.fp a.fp-home { color: var(--fp-orange-deep); font-weight: 700; text-decoration: none; }
.fp a.fp-home:hover { text-decoration: underline; text-underline-offset: 3px; }
.fp a:focus-visible { outline: 2px solid var(--fp-orange); outline-offset: 3px; border-radius: 4px; }

/* Tablet: photo beside the details */
@media (min-width: 700px) {
  .fp-scene { aspect-ratio: 16 / 10; }
  .fp-main { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding: 0 36px 40px; }
  .fp-photo-wrap { margin-top: -70px; justify-content: flex-start; align-items: flex-start; }
  .fp-photo { width: 220px; }
  .fp-info { padding-top: 26px; }
}

/* Research / office / contact block: follows the details (same column) on phones and tablets */
.fp-wide { margin-top: -10px; }
.fp-wide > .fp-sections { margin-top: 0; }
@media (min-width: 700px) {
  .fp-main { row-gap: 14px; }
  .fp-wide { grid-column: 2; margin-top: 0; }
}

/* Desktop: details on the left, campus scene on the right behind a curved diagonal */
@media (min-width: 1100px) {
  .fp-card { min-height: 520px; }
  /* research, office and contact run full width under the photo to keep the page short */
  .fp-wide { grid-column: 1 / -1; }
  .fp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 0 64px 0 0; } /* wrap before the diagonal */
  .fp-tags li {
    padding: 5px 13px;
    border-radius: 999px;
    background: #fff1e7;
    border: 1px solid #fbd6bf;
    color: #a63c0c;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.3;
  }
  .fp-tags li::before { display: none; }
  .fp-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin-top: 4px; padding-right: 110px; } /* wraps before the diagonal on narrow laptops */
  .fp-contact .fp-row { grid-template-columns: 34px auto; column-gap: 10px; }
  .fp-contact .fp-ico { width: 34px; height: 30px; border-radius: 9px; }
  .fp-contact .fp-ico svg { width: 18px; height: 18px; }
  .fp-scene {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 55%;
    max-height: none;
    aspect-ratio: auto;
    z-index: 1;
  }
  .fp-scene img { object-fit: contain; object-position: right bottom; }
  .fp-main {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 48px;
    width: 57%;
    padding: 56px 0 48px 64px;
  }
  .fp-photo-wrap { margin-top: 0; }
  .fp-photo { width: 230px; }
  .fp-info { padding-top: 0; }
}

@media (min-width: 1300px) {
  .fp-main { grid-template-columns: 250px minmax(0, 1fr); gap: 56px; }
  .fp-photo { width: 250px; }
}

/* Entrance */
.fp-reveal { animation: fp-up .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes fp-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .fp *, .fp *::before { animation: none !important; transition: none !important; }
}
