/* =============================================================================
   RENA REN LAB — STYLESHEET
   All palette + type decisions are tokens in :root below. Change them once,
   and the whole site re-themes. Colors are sampled from the cellular-landscape
   artwork so the site and the hero share one world.
   ============================================================================= */

/* ------------------------------------------------------------------ FONTS ---
   AMAGRO (wordmark) and ORTICA (headings) are commercial fonts. They are not
   bundled. The site ships with close free stand-ins (Fredoka, Fraunces) so it
   looks right immediately. To use the REAL fonts, drop the licensed web-font
   files into assets/fonts/ and uncomment the @font-face blocks below — nothing
   else needs to change.
   ---------------------------------------------------------------------------- */

@font-face {
  font-family: "Audrey";
  src: url("../fonts/Audrey-Medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Audrey";
  src: url("../fonts/Audrey-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Luxia";
  src: url("../fonts/Luxia-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Luxia";
  src: url("../fonts/Luxia-Display.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

/*
@font-face {
  font-family: "Amagro";
  src: url("../fonts/Amagro-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Ortica";
  src: url("../fonts/Ortica-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
*/

:root {
  /* ---- PALETTE (sampled from the artwork) ---- */
  --paper:        #F2E7CE;   /* warm parchment — the sky of the artwork      */
  --paper-deep:   #EADBBC;   /* slightly deeper parchment for panels         */
  --paper-veil:   #F6EEDB;   /* lightest wash, for cards                      */
  --ink:          #463C33;   /* warm sepia-charcoal — primary text           */
  --ink-soft:     #7A6E61;   /* muted text, captions                         */
  --line:         #D8C7A4;   /* hairline dividers                            */

  /* cell accents (the watercolour clusters) */
  --terracotta:   #C68457;
  --ochre:        #D2A85C;
  --sage:         #93A06F;
  --dusty-blue:   #6F8CA6;
  --plum:         #97758F;
  --rose:         #C39B86;

  --accent:       var(--terracotta);  /* default interactive accent          */

  /* ---- TYPE ROLES ---- */
  --font-brand: "Audrey", "Fredoka", system-ui, sans-serif;          /* AUDREY */
  --font-display: "Ortica", "Fraunces", Georgia, serif;              /* ORTICA */
  --font-ui: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;  /* sleek  */

  /* ---- SCALE / SPACE ---- */
  --maxw: 1280px;
  --read: 720px;            /* comfortable reading column            */
  --pad: clamp(20px, 5vw, 64px);
  --radius: 14px;

  /* ---- MOTION ---- */
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ------------------------------------------------------------------- BASE --- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ----------------------------------------------------------------- HEADER --- */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 3vw, 34px) var(--pad);
}
/* on inner pages the header sits in normal flow */
body[data-page]:not([data-page="home"]) .site-header {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.brand { text-decoration: none; line-height: 1.05; display: block; }
.brand__name {
  display: block;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(20px, 2.3vw, 30px);
  letter-spacing: .14em;
  color: var(--ink);
}
.brand__tagline {
  display: block;
  font-family: var(--font-ui);
  font-size: clamp(12px, 1.2vw, 14.4px);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
  white-space: nowrap;
}

/* nav */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 30px);
  flex-wrap: nowrap;
}
.nav a {
  font-family: var(--font-ui);
  font-size: clamp(11px, 1.2vw, 15.6px);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 4px 0;
  position: relative;
  white-space: nowrap;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -3px; height: 1.5px;
  background: var(--ink);
  transition: right .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { right: 0; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { right: 0; background: var(--terracotta); }

/* institution logo */
.inst-logo { display: inline-flex; align-items: center; text-decoration: none; }
.inst-logo img {
  height: clamp(41px, 5.3vw, 62px);
  width: auto;
  opacity: .85;
  mix-blend-mode: multiply;     /* melts the mark into the parchment */
  transition: opacity .25s var(--ease);
}
.inst-logo:hover img { opacity: 1; }

/* header right cluster */
.header__right { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
  color: var(--ink); font-family: var(--font-ui); letter-spacing: .12em; font-size: 12px;
}

/* =======================================================  HERO (home)  ===== */
.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 120%, #EFE0C0 0%, var(--paper) 55%);
}

/* the rotating "planet" of cells */
.hero__stage {
  position: absolute;
  left: 50%;
  bottom: -7%;
  width: 124%;
  min-width: 1180px;
  transform: translateX(-50%) rotate(var(--rot, 0deg));
  transform-origin: 50% 128%;
  will-change: transform;
}
.hero__img {
  display: block;
  width: 100%;
  height: auto;
  /* feather the top of the artwork into the parchment sky */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 100%);
  user-select: none;
  -webkit-user-drag: none;
}

/* entrance: fade-in, then slow ambient rotation */
.hero__stage.animate {
  animation: fadeIn 2.1s var(--ease) both;
}
.hero__stage.animate.ambient {
  animation: fadeIn 2.1s var(--ease) both, sway 12s ease-in-out 0s infinite;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sway {
  0%,100% { transform: translateX(-50%) rotate(-1deg); }
  50%     { transform: translateX(-50%) rotate(1deg); }
}

/* floating heading over the sky */
.hero__heading {
  position: absolute;
  left: 50%;
  top: clamp(22%, 26vh, 30%);
  transform: translateX(-50%);
  width: min(1440px, 94vw);
  text-align: center;
  z-index: 20;
  margin: 0;
  font-family: "Luxia", var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5.5vw, 72px);
  line-height: 1.08;
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
  opacity: 0;
  animation: rise 1.1s var(--ease) .5s both;
}
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.hero__subheading {
  position: absolute;
  left: 50%;
  top: clamp(43%, 47vh, 51%);
  transform: translateX(-50%);
  width: min(1440px, 94vw);
  text-align: center;
  z-index: 20;
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: clamp(13px, 1.7vw, 23px);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0; animation: rise 1.1s var(--ease) .7s both;
}

.hero__hint {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 20;
  font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px;
  opacity: 0; animation: rise 1.1s var(--ease) 1.1s both;
}
.hero__hint::before { content: ""; width: 26px; height: 1px; background: var(--ink-soft); }

/* ---- clickable cells (doorways) ---- */
.hotspot {
  position: absolute;
  z-index: 18;
  width: calc(var(--r) * 2px);
  height: calc(var(--r) * 2px);
  transform: translate(-50%, -50%);
  border: none; background: none; padding: 0; margin: 0;
  cursor: pointer;
  border-radius: 50%;
  color: var(--glow, var(--terracotta));
}
.hotspot__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, currentColor 30%, transparent) 0%, transparent 62%);
  opacity: 0;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  transform: scale(.7);
}
.hotspot__label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) translateY(6px);
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-veil) 90%, transparent);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 55%, var(--line));
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  box-shadow: 0 6px 20px rgba(70,60,51,.12);
}
.hotspot:hover .hotspot__ring,
.hotspot:focus-visible .hotspot__ring {
  opacity: 1; transform: scale(1);
  animation: pulse 1.8s var(--ease) infinite;
}
.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label {
  opacity: 1; transform: translate(-50%, -50%) translateY(-2px);
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 40%, transparent); }
  50%     { box-shadow: 0 0 0 10px color-mix(in srgb, currentColor 0%, transparent); }
}

/* =======================================================  INNER PAGES  ===== */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) var(--pad) 120px;
}
.page__eyebrow {
  font-family: var(--font-ui);
  font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 14px;
}
.page__title {
  font-family: "Luxia", var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -.015em;
  margin: 0 0 36px;
  color: var(--ink);
  text-wrap: balance;
}
.page__intro {
  max-width: var(--read);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.7;
  margin: -16px 0 36px;
  color: color-mix(in srgb, var(--ink) 80%, #000);
}
.page__intro a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }
.page__intro a:hover { color: var(--ink); }
.prose {
  max-width: var(--read);
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.75;
  color: color-mix(in srgb, var(--ink) 92%, #000);
}
.prose p { margin: 0 0 1.2em; }
.prose strong { font-weight: 600; }

.research-layout { display: flex; align-items: flex-start; gap: clamp(30px, 4vw, 60px); max-width: 1200px; }
.research-layout .prose { max-width: none; flex: 1 1 0%; min-width: 0; }
.research-illustration-wrap { flex: 0 0 auto; width: clamp(200px, 22vw, 340px); text-align: center; }
.research-illustration { width: 100%; opacity: .8; }
.research-illustration__credit { display: block; margin-top: .3em; font-size: 11px; color: #999; }
@media (max-width: 680px) {
  .research-layout { flex-direction: column; align-items: center; }
  .research-illustration { width: 60%; }
}

.research-divider { border: none; border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); margin: 2.5em 0 0; max-width: 1200px; }
.research-sections { max-width: 1200px; margin-top: 2em; display: flex; flex-direction: column; gap: 2em; }
.research-card {
  padding: 1.6em 2em;
  background: color-mix(in srgb, var(--terracotta) 6%, var(--cream));
  border-left: 4px solid var(--terracotta);
  border-radius: 6px;
}
.research-card__heading {
  font-family: "Luxia", var(--font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  margin: 0 0 .6em;
  color: var(--ink);
}
.research-card__body {
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.7;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 90%, #000);
}
.research-card__img { width: 80%; margin-top: .5em; }

/* a faint band of the cell texture at the foot of inner pages, for cohesion */
.page-texture {
  height: 130px;
  background: url("../img/cell-landscape.jpg") center 30% / cover no-repeat;
  opacity: .14;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 70%);
          mask-image: linear-gradient(to bottom, transparent, #000 70%);
  pointer-events: none;
}

/* ---- Rena Ren (bio) layout ---- */
.bio { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: clamp(28px,5vw,64px); align-items: start; }
.bio__portrait {
  width: 100%; border-radius: var(--radius);
  display: block;
  box-shadow: 0 24px 60px -28px rgba(70,60,51,.45);
}
.bio__portrait-cap { font-size: 13px; color: var(--ink-soft); margin-top: 12px; letter-spacing: .02em; }
@media (max-width: 760px) {
  .bio { grid-template-columns: 1fr; }
  .bio__media { max-width: 320px; }
}

/* ---- Lab members (one per row + divider) ---- */
.invite {
  max-width: none;
  font-size: clamp(20px,1.6vw,23px);
  line-height: 1.7; color: var(--ink); margin-bottom: 8px;
}
.member-list { margin-top: 40px; }
.member {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.member:last-child { border-bottom: 1px solid var(--line); }
.member__photo {
  width: 132px; height: 132px; border-radius: 50%;
  object-fit: cover; background: var(--paper-deep);
  box-shadow: 0 14px 34px -18px rgba(70,60,51,.5);
}
.member:last-child .member__photo { opacity: .65; }
.member__photo--ph {
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 40px; color: var(--ink-soft);
}
.member__name { font-family: var(--font-brand); font-weight: 700; font-size: clamp(22px,2.4vw,30px); margin: 0; display: flex; align-items: center; gap: .4em; }
.member__linkedin { color: #0a66c2; display: inline-flex; transition: opacity .2s; }
.member__linkedin:hover { opacity: .7; }
.member__linkedin svg { width: .75em; height: .75em; }
.member__role { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--terracotta); margin: 6px 0 12px; }
.member__blurb { color: var(--ink-soft); max-width: none; margin: 0; }
@media (max-width: 560px) {
  .member { grid-template-columns: 84px 1fr; gap: 18px; }
  .member__photo { width: 84px; height: 84px; }
}

/* openings */
.openings { margin-top: 64px; }
.openings__title { font-family: "Luxia", var(--font-display); font-weight: 700; font-size: clamp(28px,5vw,57px); margin: 0 0 20px; }
.openings__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.opening {
  background: var(--paper-veil); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
}
.opening h4 { margin: 0 0 12px; font-size: 28.5px; letter-spacing: .04em; font-family: var(--font-display); font-weight: 700; }
.opening h5 { margin: 14px 0 4px; font-size: 17px; font-weight: 700; color: var(--ink); }
.opening p { margin: 0; color: var(--ink-soft); font-size: 17.4px; }

/* ---- Publications (one per row + divider) ---- */
.pub-list { margin-top: 16px; }
.pub-year {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 36px);
  margin: 48px 0 8px;
  color: var(--ink);
}
.pub-year:first-child { margin-top: 0; }
.pub {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(19px,1.9vw,24px); margin: 0 0 6px; line-height: 1.3; }
.pub__title a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.pub__title a:hover { border-bottom-color: var(--terracotta); color: var(--terracotta); }
.pub__venue { color: var(--terracotta); font-size: 15px; margin: 0 0 6px; font-style: italic; }
.pub__authors { color: var(--ink-soft); font-size: 15px; margin: 0; line-height: 1.5; }
.pub__intro { color: var(--ink); font-size: 15px; margin: 16px 0 12px; line-height: 1.7; max-width: none; }
.pub__figure { display: block; max-width: 100%; margin: 12px 0 0; border-radius: 8px; }
.pub__figure--half { max-width: 50%; }
.empty-note { color: var(--ink-soft); font-style: italic; margin-top: 24px; }

/* ---- Contact ---- */
.contact-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-veil);
  padding: clamp(28px, 4vw, 48px);
  max-width: 560px;
}
.contact-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: none; }
.contact-label { font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.contact-value { font-size: clamp(17px,1.6vw,21px); }
.contact-value a { color: var(--terracotta); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--terracotta) 40%, transparent); }
.contact-value a:hover { border-bottom-color: var(--terracotta); }

/* ---------------------------------------------------------- HOME FOOTER --- */
.home-footer {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  z-index: 20;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #000;
}

/* ----------------------------------------------------------------- FOOTER --- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px var(--pad);
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------- RESPONSIVE --- */
@media (max-width: 880px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: absolute; top: 100%; right: var(--pad);
    flex-direction: column; align-items: flex-end; gap: 16px;
    background: var(--paper-veil); border: 1px solid var(--line); border-radius: 12px;
    padding: 18px 22px; min-width: 200px;
    box-shadow: 0 24px 50px -24px rgba(70,60,51,.4);
    display: none;
  }
  .nav.open { display: flex; }
  body[data-page="home"] .nav { top: calc(100% - 6px); }
}
@media (max-width: 480px) {
  .brand__tagline { white-space: normal; max-width: 60vw; }
}

/* -------------------------------------------------------- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .hero__stage.animate, .hero__stage.animate.ambient { animation: none; transform: translateX(-50%) rotate(0); }
  .hero__heading, .hero__hint { opacity: 1; }
}
