/* Koraltan Lab — site styles. See DESIGN.md for the reasoning behind the tokens. */

:root {
  --indigo: #23294b;
  --indigo-deep: #171b33;
  --on-indigo: #f3f4fb;
  --on-indigo-2: #b7bddc;
  --beam: #7fe7e0;

  --paper: #f6f7fb;
  --card: #ffffff;
  --ink: #171a2b;
  --ink-2: #4a4f66;
  --ink-3: #6f7490;
  --link: #0065bd;
  --rule: #dfe2ee;
  --rule-2: #eceef5;

  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --max: 72rem;
  --gutter: clamp(1.4rem, 4vw, 3rem);
  --margin-col: 11rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
.band :focus-visible { outline-color: var(--beam); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--card); color: var(--ink); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

p { margin: 0 0 1rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.005em; }
h3 { font-size: 1.28rem; line-height: 1.3; margin: 0 0 0.5rem; }

/* ---------- indigo band: header (+ hero on the home page) ---------- */

.band { background: var(--indigo); color: var(--on-indigo); }
.band a { color: inherit; }
.band-hero { background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo) 55%, var(--indigo-deep) 100%); }

.head-row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0.5rem 2rem; padding: 1.4rem 0 1.2rem;
}

.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; text-decoration: none; }
.brand-name { font: 500 1.35rem/1 var(--serif); }
.brand-affil { font-size: 0.9rem; color: var(--on-indigo-2); }

.site-nav { margin-left: auto; display: flex; gap: 1.6rem; font-size: 0.95rem; }
.site-nav a {
  color: var(--on-indigo-2); text-decoration: none;
  padding: 0.2rem 0; border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: var(--on-indigo); }
.site-nav a[aria-current="page"] { color: var(--on-indigo); border-bottom-color: var(--beam); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem 4rem; align-items: center;
  padding: 3.5rem 0 5rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 1.2rem + 2.8vw, 3.4rem);
  line-height: 1.12; margin: 0 0 1.4rem;
  text-wrap: balance;
}

.hero .lede { font-size: 1.15rem; line-height: 1.55; color: var(--on-indigo-2); margin: 0; max-width: 34em; text-wrap: pretty; }
.hero .lede strong { color: var(--on-indigo); font-weight: 500; }

.btn {
  display: inline-block; margin-top: 1.6rem; padding: 0.7rem 1.15rem;
  border: 1.5px solid var(--beam); border-radius: 999px;
  color: var(--beam); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--beam); color: var(--indigo); }

.sky { margin: 0; justify-self: end; width: min(100%, 23rem); }
.sky picture, .sky img { display: block; width: 100%; }
.sky .gyration {
  aspect-ratio: 1 / 1; object-fit: cover;
  -webkit-mask-image: radial-gradient(circle at center, #000 54%, transparent 72%);
          mask-image: radial-gradient(circle at center, #000 54%, transparent 72%);
}
.sky figcaption { font-size: 0.85rem; line-height: 1.45; color: var(--on-indigo-2); margin-top: 0.8rem; }

/* ---------- page head (inner pages) ---------- */

.page-head { padding: 2.5rem 0 3rem; }
.page-head h1 { font-size: clamp(2rem, 1.3rem + 2vw, 2.8rem); line-height: 1.15; margin: 0 0 0.8rem; }
.page-head p { color: var(--on-indigo-2); font-size: 1.1rem; max-width: 36em; margin: 0; text-wrap: pretty; }
.page-head p a { text-decoration-color: var(--on-indigo-2); }

/* ---------- notebook-margin sections ---------- */

.section, .pub-year {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, 1fr);
  gap: 1.5rem 3.5rem;
  padding: 4.5rem 0;
  border-top: 1px solid var(--rule);
}
main > .wrap > .section:first-child, .pub-list > .pub-year:first-child { border-top: 0; }

.section > h2, .pub-year > h2 {
  font-size: 1.3rem; line-height: 1.3; margin: 0;
  position: sticky; top: 1.5rem; align-self: start;
}

.section-body { max-width: 62rem; }
.section-body > p:first-child, .section-body > .lead:first-child { margin-top: 0; }
.section-body p { max-width: 40em; text-wrap: pretty; }
.lead { font-size: 1.12rem; line-height: 1.55; }

/* research themes */
.themes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2.4rem 3rem; margin-top: 0.5rem;
}
.theme p { margin: 0; color: var(--ink-2); font-size: 1rem; }

.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3.2rem; }
.figures figure { margin: 0; }
.figures img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 6px; background: var(--indigo); }
.figures .fig-tetrapods img { object-position: center 45%; }
.figures .fig-textures img { object-position: left center; }
.figures figcaption { font-size: 0.88rem; line-height: 1.45; color: var(--ink-3); margin-top: 0.7rem; }

/* how we work */
.methods { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 2rem; margin: 1.6rem 0 0; max-width: 46rem; }
.methods dt { font-weight: 500; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.methods dd { margin: 0; padding: 0.75rem 0; border-top: 1px solid var(--rule); color: var(--ink-2); }
.methods dt:first-of-type, .methods dd:first-of-type { border-top: 0; padding-top: 0; }

/* people */
.person { display: flex; gap: 1.6rem; align-items: flex-start; max-width: 44rem; }
.person-body { min-width: 0; }
.person h3 { margin-bottom: 0.15rem; }
.avatar {
  flex: 0 0 6.5rem; width: 6.5rem; aspect-ratio: 1; border-radius: 8px;
  background: var(--indigo); color: var(--on-indigo-2); object-fit: cover;
  font: 500 1.7rem/1 var(--serif); letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center;
}
.person .role { color: var(--ink-3); margin: 0 0 0.9rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; padding: 0; margin: 0.2rem 0 0; list-style: none; font-size: 0.95rem; }

/* open positions callout */
.callout {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.8rem 2rem; max-width: 46rem;
}
.callout h3 { margin-top: 0; }
.openings { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.openings li { padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.openings li:first-child { border-top: 0; padding-top: 0; }
.openings .pos { font-weight: 500; display: block; }
.openings .desc { color: var(--ink-2); font-size: 0.98rem; }
.terms { color: var(--ink-2); font-size: 0.98rem; }

/* join page */
.position, .entry { max-width: 44rem; padding-bottom: 2rem; }
.position + .position, .entry + .entry { border-top: 1px solid var(--rule-2); padding-top: 2rem; }
.position .meta { color: var(--ink-3); font-size: 0.95rem; margin: -0.2rem 0 1rem; }
.checklist { margin: 0.5rem 0 1rem 1.2rem; padding: 0; color: var(--ink-2); }
.checklist li { margin: 0.25rem 0; }

/* contact */
.contact { display: flex; flex-wrap: wrap; gap: 2rem 4rem; }
.contact address { font-style: normal; line-height: 1.55; }
.contact .note { color: var(--ink-3); font-size: 0.95rem; max-width: 26em; }

/* ---------- publications ---------- */

.pub-year { padding: 2.6rem 0; }
.pubs { list-style: none; margin: 0; padding: 0; max-width: 60rem; }
.pubs li { padding: 1rem 0; border-top: 1px solid var(--rule-2); }
.pubs li:first-child { border-top: 0; padding-top: 0; }
.pub-title { display: block; font-weight: 500; font-size: 1.05rem; line-height: 1.4; }
.pub-authors { display: block; color: var(--ink-2); font-size: 0.95rem; margin-top: 0.15rem; }
.pub-authors strong { font-weight: 500; color: var(--ink); }
.pub-ref { display: block; color: var(--ink-3); font-size: 0.92rem; margin-top: 0.15rem; }
.pub-ref .vol { font-weight: 500; }
.pubs .preprint .pub-title { font-weight: 400; }

/* ---------- imprint ---------- */
.legal { max-width: 40em; }
.legal h2 { font-size: 1.3rem; margin: 2.2rem 0 0.6rem; }
.legal h2:first-child { margin-top: 0; }

/* ---------- footer: carries the contact block on every page ---------- */

.site-foot { border-top: 1px solid var(--rule); padding: 2.4rem 0 3.5rem; font-size: 0.92rem; color: var(--ink-3); }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.2rem 3rem; }
.site-foot address { font-style: normal; line-height: 1.55; color: var(--ink-2); }
.site-foot a { color: inherit; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-content: start; }

/* ---------- responsive ---------- */

@media (max-width: 56rem) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 2.5rem 0 3.5rem; }
  .sky { justify-self: start; width: min(100%, 20rem); }
  .section, .pub-year { grid-template-columns: 1fr; gap: 1rem; padding: 3rem 0; }
  .pub-year { padding: 2.2rem 0; }
  .section > h2, .pub-year > h2 { position: static; }
  .news-controls { grid-column: 1; grid-row: 3; justify-content: flex-start; }
  .news-strip { grid-column: 1; grid-row: 2; }
  .news-card { flex-basis: 15rem; }
  .figures { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  body { font-size: 16px; }
  .site-nav { margin-left: 0; width: 100%; gap: 1.2rem; flex-wrap: wrap; }
  .methods { grid-template-columns: 1fr; gap: 0; }
  .methods dd { border-top: 0; padding-top: 0; }
  .callout { padding: 1.4rem 1.2rem; }
  .person { gap: 1rem; }
  .avatar { flex-basis: 4.5rem; width: 4.5rem; font-size: 1.2rem; }
}

@media print {
  .band, .band-hero { background: none; color: #000; }
  .band a, .brand-affil, .site-nav a, .page-head p { color: #000; }
  .sky, .btn, .skip { display: none; }
}

/* ---------- additions (Sep 2026) ---------- */

.theme h3 { font-size: 1.15rem; }
.pub-ref .doi { margin-left: 1em; white-space: nowrap; }
.person .bio { max-width: 40em; }
.group-note { color: var(--ink-2); margin-top: 1.4rem; max-width: 40em; }
.checklist li + li { margin-top: 0.35rem; }
.position h3, .entry h3 { font-size: 1.35rem; }
.position h4 { font: 500 1rem/1.4 var(--sans); margin: 1.4rem 0 0.3rem; }
.position p + h4 { margin-top: 1.1rem; }
.todo { background: #fff3b0; color: var(--ink); padding: 0 0.25em; border-radius: 2px; }

/* crop a figure whose source image carries its own white margin */
.crop { overflow: hidden; border-radius: 6px; aspect-ratio: 2 / 1; background: var(--indigo); }
.crop img { width: 100%; height: 100%; object-fit: cover; object-position: left center; border-radius: 0;
            transform: scale(1.12); transform-origin: 0 50%; }

/* news banner (home page): the one place with cards */
.news-section { grid-template-rows: auto auto; }
.news-section > h2 { grid-row: 1; }
.news-controls { grid-column: 2; grid-row: 1; display: flex; gap: 0.5rem; justify-content: flex-end; align-self: start; }
.news-section.no-scroll .news-controls { visibility: hidden; }
.news-strip { grid-column: 1 / -1; grid-row: 2; }
.news-track {
  display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0 0 0.5rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.news-track::-webkit-scrollbar { display: none; }
.news-card { flex: 0 0 18rem; scroll-snap-align: start; }
.news-card > a, .news-card > div { display: block; color: inherit; text-decoration: none; }
.news-card > a:hover .news-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.news-media { aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--indigo); margin-bottom: 0.75rem; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-media.tile { display: flex; align-items: flex-end; padding: 1rem 1.1rem; color: var(--on-indigo-2); font: 500 1.2rem/1.25 var(--serif); }
.news-card time { display: block; font-size: 0.85rem; color: var(--ink-3); }
.news-title { display: block; font-weight: 500; line-height: 1.35; margin-top: 0.15rem; }
.news-sub { display: block; font-size: 0.92rem; color: var(--ink-2); margin-top: 0.15rem; }
.news-btn {
  width: 2.25rem; height: 2.25rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--card); color: var(--ink-2); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.news-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.news-btn svg { width: 1rem; height: 1rem; }

/* research page */
.section-body > h3:first-child { margin-top: 0; }
.refs { margin-top: 1rem; }
.section-body .figure { margin: 1.8rem 0 0; max-width: 32rem; }
.section-body .figure img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 6px; background: var(--indigo); }
.section-body .figure figcaption { font-size: 0.88rem; line-height: 1.45; color: var(--ink-3); margin-top: 0.7rem; }
.fig-tetrapods img { object-position: center 45%; }

/* join */
.soon { color: var(--ink-3); }

/* team */
.person + .person { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--rule-2); }
.more { margin-top: 1.6rem; }


/* funding logos (home) */
.logos { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: center; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.logos img { display: block; height: 3.75rem; width: auto; max-width: 16rem; }
.logos .dfg { height: 2.75rem; }
.logos .mcqst { height: 4rem; }

/* projects */
.entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem 2.5rem; margin-bottom: 0.5rem; }
.entry-head > div { flex: 1 1 22rem; min-width: 0; }
.entry-head h3 { margin-bottom: 0.3rem; }
.entry-head .meta { margin-bottom: 0; }
.entry-logo { flex: 0 0 auto; width: auto; margin-top: 0.35rem; }
.entry-logo.dfg { height: 2rem; }
.entry-logo.mcqst { height: 3rem; }
