/* StructBio's own pages — home, group and about.
 *
 * Blue, white and near-black ink. One committed light palette rather than a
 * light/dark pair: these pages do not follow the reader's preference, because a
 * page that switched out from under the suite bar would read as two different
 * sites. Light is also what the suite already is — Motif Scanner (#f7f6f2) and
 * AlproDB (#f7f9fc) both sit on light grounds, so these pages now match them.
 *
 * The tokens are named for the role they play, not the colour they hold, so the
 * palette can be re-pointed without every name in the file becoming a lie.
 *
 * The suite bar, breadcrumb and footer are not styled here — they come from the
 * shared shell (structbio/static/shell.css). The bar and footer are blue: they are
 * the suite's signature across all three tools, and they bookend the page.
 */

:root {
  --bg:         #ffffff;
  --surface:    #f8fafc;
  --surface-2:  #eef3f9;
  --line:       #e3e9f0;
  --line-lit:   #c9d5e3;
  --rule:       #b7c8dc;   /* divider meant to be seen, not merely implied */

  --ink:        #0d1526;
  --ink-dim:    #55647a;

  --blue:       #2563eb;
  --blue-lit:   #1d4ed8;   /* darkened from the dark palette's #3b82f6 — that blue
                              carried on black but is thin against white */
  --blue-deep:  #1e3a8a;

  --white:      #ffffff;   /* true white, for logo tiles that need it regardless */

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  /* Holds the shared footer against the bottom of the window on short pages.
     Scoped to this stylesheet, which only StructBio's own pages load — making
     <body> a flex container inside any of the three tools would rearrange
     layouts we do not control. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body > .sb-foot { margin-top: auto; }

a { color: inherit; }

/* ── Home ────────────────────────────────────────────────────────────────── */
.page-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(3.5rem, 8vw, 6rem);
}

/* Masthead: the lab first, the institute under it, both centred. This is the
   headline of the page — it outranks "Tools" below, which is only a section
   heading. Tracking is set in em so it scales with the type instead of blowing
   the line out at the large end. */
.masthead {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5.5vw, 3.75rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}

.lab-name {
  margin: 0 0 .55rem;
  font-size: clamp(1.35rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: .07em;   /* .16em was set for 13px type; it tears a 35px line apart */
  text-transform: uppercase;
  color: var(--ink);
}

.lab-affil {
  margin: 0;
  font-size: clamp(.95rem, 2vw, 1.35rem);
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--ink-dim);
}

.tools-heading {
  margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
  font-size: clamp(1.2rem, 2.9vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--ink);
}
/* Every step of this clamp stays under .lab-name's matching step — the two floors
   are what decide the hierarchy on a phone, where both bottom out. */

/* A short blue rule, centred under the heading — the page's one piece of ornament. */
.tools-heading::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin: .95rem auto 0;
  background: var(--blue);
  border-radius: 2px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
  align-items: stretch;
}

/* A blue outline at rest, not just on hover — on white a neutral hairline barely
   registered. 2px, not 1.5: a fractional border floors to 1px on a 1x display, so
   the half never rendered. */
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.6rem 1.6rem;
  background: var(--surface);
  border: 2px solid var(--blue);
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .06);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.tool-card:hover,
.tool-card:focus-visible {
  background: var(--white);
  border-color: var(--blue-lit);
  box-shadow: 0 10px 28px rgba(37, 99, 235, .22);
  transform: translateY(-3px);
  outline: none;
}

.card-logo {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.tool-card:hover .card-logo { border-color: var(--line-lit); }
.card-logo img { display: block; width: 68px; height: 68px; }
.card-logo .logo-raster {
  width: 60px; height: 60px;
  object-fit: contain;
  background: var(--white);   /* the Motif Scanner mark is drawn on white */
  border-radius: 11px;
  padding: 2px;
}

.card-title {
  margin: 0 0 .55rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.tool-card:hover .card-title { color: var(--blue-lit); }

.card-blurb {
  margin: 0 0 1.6rem;
  max-width: 34ch;      /* keeps centred lines from running too wide to scan */
  font-size: .9rem;
  line-height: 1.6;
  color: var(--ink-dim);
}

.card-go {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: auto;
  padding-top: .25rem;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--blue-lit);
}
.card-go svg { transition: transform .2s ease; }
.tool-card:hover .card-go svg { transform: translateX(3px); }

/* ── Article pages (about, 404) ──────────────────────────────────────────── */
.page { width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2.5rem) clamp(3rem, 7vw, 4.5rem); }
.page-narrow { max-width: 620px; }
.page-head { margin-bottom: 2rem; }
.page-head h1 {
  margin: 0 0 .6rem;
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--ink);
}
.page-lede { margin: 0; font-size: 1.02rem; color: var(--ink-dim); max-width: 62ch; }

.prose { font-size: .95rem; color: var(--ink-dim); }
.prose h2 { margin: 2.25rem 0 .75rem; font-size: 1.1rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.prose p { margin: 0 0 1rem; max-width: 68ch; }
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--blue-lit); text-decoration: none; font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose code {
  font-family: var(--mono);
  font-size: .86em;
  padding: .12rem .38rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--blue-deep);
}
.prose pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; color: #334155; font-size: .84rem; line-height: 1.7; }

.tool-list { margin: 0 0 1rem; }
.tool-list-row { padding: 1rem 0; border-top: 1px solid var(--line); }
.tool-list-row dt { margin: 0 0 .35rem; font-weight: 700; color: var(--ink); font-size: 1rem; }
.tool-list-row dt a { color: var(--blue-lit); text-decoration: none; }
.tool-list-row dt code { margin-left: .5rem; font-size: .75rem; font-weight: 400; }
.tool-list-row dd { margin: 0; font-size: .9rem; max-width: 68ch; }

.lab-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
/* Drawn for light backgrounds, and now on one — no tile needed. */
.lab-logo {
  height: 88px;
  width: auto;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
  .tool-card:hover { transform: none; }
}

/* ── Group page ──────────────────────────────────────────────────────────── */
/* Wider than .page's 820px prose measure: the group photo is the substance of
   this page and reads badly boxed into a column of text width. The prose blocks
   inside still cap their own line length. */
.page-wide { max-width: 1040px; }

.group-photo {
  margin: 0 0 clamp(2.25rem, 5vw, 3.25rem);
}
/* The statement carries its own top spacing, so the figure does not also need it. */
.group-photo:has(+ .group-statement) { margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem); }
.group-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 2px solid var(--blue);
  box-shadow: 0 10px 30px rgba(37, 99, 235, .14);
}
.group-photo figcaption {
  margin-top: .85rem;
  font-size: .85rem;
  line-height: 1.55;
  color: var(--ink-dim);
  text-align: center;
}

/* The lab's statement, directly under the photograph. Set larger and in full ink
   rather than the dimmed body colour — it carries the page, and it is the first
   thing read after the photo. Held to a reading measure and centred under the wide
   photo above it, so the line length stays scannable at 1040px. */
.group-statement {
  max-width: 74ch;
  margin: 0 auto clamp(2.5rem, 5.5vw, 3.5rem);
  padding-top: clamp(.25rem, 1.5vw, .75rem);
  text-align: center;
}
.group-statement p {
  margin: 0;
  font-size: clamp(1rem, 1.9vw, 1.14rem);
  line-height: 1.72;
  color: var(--ink);
}
.group-statement p + p { margin-top: 1rem; }

.group-section { margin-bottom: clamp(2.25rem, 5vw, 3.25rem); }

/* Section headings carry the same short blue rule the home page's "Tools" has,
   left-aligned here because these sections are not centred. */
.section-title {
  margin: 0 0 1.4rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.section-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: .7rem;
  background: var(--blue);
  border-radius: 2px;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(.9rem, 2vw, 1.25rem);
}
.research-card {
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line-lit);
  border-radius: 13px;
}
.research-card h3 {
  margin: 0 0 .55rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.research-card p {
  margin: 0;
  font-size: .89rem;
  line-height: 1.62;
  color: var(--ink-dim);
}

.roster-band + .roster-band { margin-top: 1.75rem; }
.roster-title {
  margin: 0 0 .85rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-lit);
}
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.person {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  padding: .9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
}
.person-name  { font-weight: 600; font-size: .96rem; color: var(--ink); }
.person-role  { font-size: .82rem; color: var(--blue-lit); font-weight: 500; }
.person-focus { font-size: .82rem; line-height: 1.5; color: var(--ink-dim); }

.contact-card {
  padding: clamp(1.4rem, 3vw, 1.9rem);
  background: var(--surface-2);
  border: 1px solid var(--line-lit);
  border-radius: 13px;
}
.contact-email {
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 600;
  color: var(--blue-lit);
  text-decoration: none;
  word-break: break-all;   /* the address must not push the card wide on a phone */
}
.contact-email:hover { text-decoration: underline; }
.contact-note {
  margin: .7rem 0 0;
  font-size: .89rem;
  color: var(--ink-dim);
  max-width: 60ch;
}
/* The lab's own site, between the note and the address. Set apart from the email
   above it — same blue, but sans and carrying a mark, so the two are not read as
   one wrapped line. */
.contact-site {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .9rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--blue-lit);
  text-decoration: none;
}
.contact-site:hover { text-decoration: underline; }
.contact-site svg { flex: none; }

.contact-address {
  margin: 1.1rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-lit);
  font-style: normal;
  font-size: .87rem;
  line-height: 1.7;
  color: var(--ink-dim);
}
