:root {
  --navy: #172a45;
  --blue: #2769b0;
  --gold: #f5c542;
  --highlight-yellow: #fff1b8;
  --ink: #1f2937;
  --muted: #5b6777;
  --paper: #f8fafc;
  --line: #d9e1ea;
  --white: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
.skip-link { background: var(--navy); border-radius: 0 0 .35rem 0; color: var(--white); font-weight: 800; left: 0; padding: .75rem 1rem; position: fixed; top: 0; transform: translateY(-120%); transition: transform .12s ease; z-index: 1000; }
.skip-link:focus { color: var(--white); outline: 3px solid #f5c542; outline-offset: 3px; transform: translateY(0); }
#main-content:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #005fcc; outline-offset: 3px; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem max(5vw, 1.5rem); background: var(--white); border-bottom: 1px solid var(--line); }
.brand { font-size: 1.15rem; font-weight: 800; color: var(--navy); text-decoration: none; }
.brand span { color: #c81e2d; }
.site-header nav { align-items: center; display: flex; gap: 1.1rem; }
.site-header nav a, .nav-menu summary { color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 600; font-size: .94rem; }
.site-header nav a:hover, .nav-menu summary:hover, .card a, .feature-grid a { color: var(--blue); }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: "⌄"; font-size: .8rem; margin-left: .3rem; }
.nav-dropdown { background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(23, 42, 69, .14); display: grid; gap: .1rem; min-width: 170px; padding: .45rem; position: absolute; right: 0; top: 1.7rem; z-index: 3; }
.nav-dropdown a { padding: .45rem .55rem; }
.nav-dropdown a:hover { background: #edf4fb; }
main { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem 4.5rem; }
.hero { padding: 5.5rem 0 1.75rem; max-width: 850px; }
/* Red marks the brand and the label above a page or section heading (base.html
   sets it from the department's accent colour). Labels inside cards are slate,
   so a grid of cards is not a grid of red. */
.eyebrow, .tag { margin: 0 0 .55rem; color: #b21f2d; font-size: .77rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hero h1, .page-heading h1 { font-family: Georgia, serif; color: var(--navy); line-height: 1.08; letter-spacing: -.025em; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.7rem); margin: .1rem 0 1.2rem; }
.lede { max-width: 650px; font-size: 1.2rem; color: var(--muted); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.button { border: 0; border-radius: .35rem; cursor: pointer; display: inline-block; font-weight: 750; padding: .72rem 1.05rem; text-decoration: none; font-size: .95rem; }
.primary { background: var(--navy); color: var(--white); }
.primary:hover { background: #0c1a2c; }
.secondary { background: var(--white); color: var(--navy); border: 1px solid #9caabb; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature-grid article { background: var(--white); display: flex; flex-direction: column; padding: 1.6rem; }
.feature-grid h2, .content-section h2, .form-card h2, .matches h2 { color: var(--navy); margin: .2rem 0 .7rem; }
.feature-grid article > a { margin-top: auto; }
.feature-grid a, .card a { font-weight: 700; text-decoration: none; }
.number { font-weight: 800; color: #b21f2d; margin: 0; }
.content-section { margin-top: 4.5rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1.2rem; }
.section-heading > a { font-weight: 700; color: var(--blue); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card, .form-card, .empty { background: var(--white); border: 1px solid var(--line); padding: 1.5rem; }
.card h2, .card h3 { margin: .1rem 0 .6rem; color: var(--navy); }
.card p { color: var(--muted); }
.topics, .role, .muted { font-size: .9rem; }
.topics { border-top: 1px solid var(--line); padding-top: .9rem; }
.page-heading { max-width: 750px; padding: 4rem 0 1.5rem; }
.page-heading h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); margin: .1rem 0 .85rem; }
.page-heading > p:last-child { color: var(--muted); font-size: 1.08rem; }
.page-heading .card-action { color: var(--blue); font-size: 1rem; font-weight: 700; text-decoration: none; }
.back-link { margin: 1.5rem 0 -2.5rem; }
.back-link a { color: var(--blue); font-weight: 700; text-decoration: none; }
.two-column { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(350px, 1.15fr); gap: 1.5rem; align-items: start; }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 750; margin-bottom: .35rem; }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=date], .field select, .search input { width: 100%; padding: .7rem .75rem; border: 1px solid #aab7c5; border-radius: .3rem; font: inherit; }
.field small { display: block; color: var(--muted); margin-top: .25rem; }
.field .error { color: #b21f2d; }
.field ul { list-style: none; padding: 0; margin: .25rem 0 0; display: grid; gap: .28rem; }
.field ul:has(input[type=checkbox]) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.field li { min-width: 0; }
.field li label { background: #fff; border: 1px solid #aab7c5; border-radius: .35rem; cursor: pointer; display: block; font-weight: 600; margin: 0; padding: .45rem .5rem; }
.field li label:has(input:checked) { background: #edf4fb; border-color: #2769b0; color: #174c82; }
.field li input { accent-color: #2769b0; margin-right: .3rem; }
.match-card { background: var(--white); border: 1px solid var(--line); padding: 1.25rem 1.3rem; margin-bottom: .75rem; display: flex; gap: 1rem; justify-content: space-between; align-items: start; }
.match-card h3 { margin: .1rem 0; }
.match-card p { margin: .35rem 0; }
.search { display: flex; max-width: 700px; gap: .6rem; margin: 0 0 1.5rem; }
.resource-grid { grid-template-columns: repeat(3, 1fr); }
.messages { margin-top: 1.5rem; }
.message { padding: .75rem 1rem; background: #e6f6ed; border-left: 4px solid #2f855a; }
.message.error { background: #fff0f1; border-left-color: #b21f2d; }
.message.info { background: #edf4fb; border-left-color: #2769b0; }
.message.warning { background: var(--highlight-yellow); border-left-color: #b48a16; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
footer { border-top: 1px solid var(--line); padding: 1.5rem max(5vw, 1.5rem); color: var(--muted); font-size: .85rem; }

@media (max-width: 980px) and (min-width: 761px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  main .button { min-height: 44px; }
  main details > summary,
  main .group-access-panel > summary { min-height: 44px; padding-block: .6rem; }
  .site-header { align-items: flex-start; gap: 1rem; flex-direction: column; }
  .site-header nav { gap: .85rem; flex-wrap: wrap; }
  .nav-dropdown { left: 0; right: auto; }
  .feature-grid, .card-grid, .resource-grid, .two-column { grid-template-columns: 1fr; }
  .hero { padding-top: 3.5rem; }
  .match-card { flex-direction: column; }
  .search { flex-direction: column; }
  .field ul:has(input[type=checkbox]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .back-link { margin-bottom: -2.5rem; }
}
/* Explicit boundary for the disposable local mid-semester interface preview. */
.synthetic-preview-banner {
  background: var(--highlight-yellow);
  border-bottom: 1px solid #e0b429;
  color: #172b4d;
  padding: 0.65rem 1rem;
  text-align: center;
}

/* Phone: reach the content sooner. */
@media (max-width: 640px) {
  .hero { padding: 1.75rem 0 1rem; }
  .hero h1 { font-size: 2.1rem; margin-bottom: .7rem; }
  .lede { font-size: 1.02rem; }
  .page-heading { padding: 1.75rem 0 1rem; }
  .page-heading h1 { font-size: 1.9rem; margin-bottom: .6rem; }
  .page-heading > p:last-child { font-size: 1rem; }
}

/* The banner's own display rule used to override the hidden attribute, so a
   dismissed banner came back on every page. */
.install-guide[hidden] { display: none; }
@media (max-width: 640px) {
  .install-guide:not([hidden]) { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; border-top: 1px solid #e8c860; border-bottom: 0; box-shadow: 0 -4px 14px rgba(23, 42, 69, .12); font-size: .88rem; padding-block: .55rem; }
  body:has(.install-guide:not([hidden])) { padding-bottom: 6.5rem; }
}

/* Links that no other rule colours used the browser's default blue and purple. */
:where(main, footer, .synthetic-preview-banner) a { color: var(--blue); }

/* Form selects were left on the browser's grey default. */
.field select { background-color: var(--white); }
.field input { text-overflow: ellipsis; }

/* Home cards: number, title, summary and link each share a row across the
   cards, so a title that wraps no longer pushes one card's text out of line. */
.feature-grid a { text-wrap: balance; }
@supports (grid-template-rows: subgrid) {
  @media (min-width: 761px) {
    .feature-grid > .content-card.content-card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
    .feature-grid > .content-card > h2 { margin-bottom: .7rem; }
    .feature-grid > .content-card > p { margin: 0 0 1.1rem; }
    .feature-grid > .content-card > a { align-self: end; margin-top: 0; }
  }
}

/* Form pages: the back link, heading and card share one centered column.
   The heading used to sit at the page edge while the card sat in the middle. */
main:has(> :is(.form-card-wide, .group-access-form, .group-list)) > :is(.back-link, .page-heading, .messages, .form-card-wide, .group-list, .my-groups-find, .my-groups-preferences, .returning-groups, .pilot-checkin-prompt) { margin-inline: auto; max-width: 720px; }

/* ---------- Home: one anchor ----------
   The headline and Explore Your Interests share a navy band; the four
   destinations sit below it, each with its own icon. */
/* The border-image paints the navy out to both screen edges without adding page width. */
.home-band { align-items: center; background: var(--navy); border-image: conic-gradient(var(--navy) 0 0) fill 0 / 0 / 0 100vw; display: grid; gap: 3.5rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); margin-bottom: 2.25rem; padding: 3.75rem 0 4rem; }
.home-band .hero { max-width: none; padding: 0; }
.home-band .hero > .eyebrow { color: #b9c9de; }
.home-band .hero h1 { color: #fff; font-size: clamp(2.3rem, 4.3vw, 3.55rem); margin-bottom: 1rem; text-wrap: balance; }
.home-band .hero .lede { color: #d3ddea; font-size: 1.12rem; max-width: 34rem; }
.home-band .interest-guide-home { background: var(--white); border: 0; border-radius: .8rem; box-shadow: 0 18px 40px rgba(6, 16, 31, .32); gap: 1rem; margin: 0; padding: 1.6rem 1.7rem 1.7rem; }
.home-band .interest-guide-copy h2 { font-size: 1.55rem; margin: 0 0 .35rem; }
.home-band .interest-guide-copy > p:last-child { font-size: .98rem; }
.home-band .interest-form { gap: .8rem; grid-template-columns: 1fr; }
.home-band + .returning-groups, .home-band ~ .home-research-checkins { margin-top: 0; }
.browse-divider { margin-top: 0; }
.feature-grid { background: none; border: 0; gap: 1rem; }
.feature-grid > .content-card.content-card { border-radius: .8rem; padding: 1.3rem 1.3rem 1.2rem; transition: border-color .12s, box-shadow .12s; }
.feature-grid > .content-card:hover { border-color: #9db7d6; box-shadow: 0 6px 18px rgba(23, 42, 69, .08); }
.feature-grid h2 { font-size: 1.22rem; margin: .9rem 0 .45rem; }
.feature-grid > .content-card > p { color: var(--muted); font-size: .97rem; }
.feature-grid > .content-card > a { font-size: .9rem; white-space: nowrap; }
.home-card-icon { align-items: center; background: #edf2f8; border-radius: .6rem; color: var(--navy); display: inline-flex; height: 2.6rem; justify-content: center; justify-self: start; width: 2.6rem; }
@media (prefers-reduced-motion: reduce) { .feature-grid > .content-card { transition: none; } }
@media (max-width: 860px) {
  .home-band { gap: 1.5rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; padding: 1.9rem 0 2.1rem; }
  .home-band .hero h1 { font-size: 2.05rem; margin-bottom: .6rem; }
  .home-band .hero .lede { font-size: 1rem; }
  .home-band .interest-guide-home { padding: 1.2rem 1.15rem 1.25rem; }
}
@media (max-width: 760px) {
  /* Phone: each destination is one compact row, and the whole row is the link. */
  .feature-grid { gap: .55rem; }
  .feature-grid > .content-card.content-card { align-items: center; column-gap: .9rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; padding: .85rem 1rem; position: relative; }
  .feature-grid .home-card-icon { grid-row: 1 / span 2; }
  .feature-grid h2 { font-size: 1.05rem; grid-column: 2; margin: 0; }
  .feature-grid > .content-card > p { font-size: .88rem; grid-column: 2; line-height: 1.4; margin: .1rem 0 0; }
  .feature-grid > .content-card > a { align-self: center; color: var(--brand-accent); font-size: 0; grid-column: 3; grid-row: 1 / span 2; margin: 0; }
  .feature-grid > .content-card > a::before { content: "→"; font-size: 1.2rem; }
  .feature-grid > .content-card > a::after { content: ""; inset: 0; position: absolute; }
  .feature-grid > .content-card:focus-within { outline: 3px solid #005fcc; outline-offset: 2px; }
  .feature-grid > .content-card > a:focus-visible { outline: none; }
}

/* ---------- Jump links (Explore results, faculty profile) ---------- */
.jump-links { border-block: 1px solid var(--line); margin-top: 1.25rem; padding: .8rem 0; }
.jump-links[hidden] { display: none; }
.jump-links-label { color: var(--muted); display: block; font-size: .78rem; font-weight: 800; letter-spacing: .08em; margin-bottom: .5rem; text-transform: uppercase; }
.jump-links ul { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.jump-links a { background: var(--white); border: 1px solid #9caabb; border-radius: 999px; color: var(--navy); display: block; font-size: .9rem; font-weight: 700; padding: .4rem .8rem; text-decoration: none; }
.jump-links a:hover, .jump-links a:focus-visible { background: #edf4fb; border-color: var(--blue); }
@media (max-width: 650px) {
  .jump-links ul { flex-wrap: nowrap; margin-inline: -1.5rem; overflow-x: auto; padding: 0 1.5rem .3rem; }
  .jump-links li { flex: 0 0 auto; }
  .jump-links a { min-height: 44px; padding-block: .6rem; }
}

/* ---------- Initials badge (faculty cards and profiles) ---------- */
.person-initials { align-items: center; background: #edf2f8; border-radius: 50%; color: var(--navy); display: inline-flex; flex: 0 0 auto; font-size: .92rem; font-weight: 800; height: 2.75rem; justify-content: center; letter-spacing: .02em; width: 2.75rem; }
.person-initials-large { font-size: 1.45rem; height: 4.75rem; width: 4.75rem; }
.person-heading { align-items: flex-start; display: flex; gap: .8rem; min-width: 0; }
.person-heading-text { min-width: 0; }

/* Labels inside cards are slate; section labels keep the accent colour. */
.content-card .tag, .content-card .eyebrow { color: var(--muted); }

/* Form cards share the rounded corners of the content cards. */
.form-card { border-radius: .65rem; }

/* Choice lists (radio and checkbox groups): each option is a tappable row. */
.choice-fieldset { border: 0; margin: 0; min-width: 0; padding: 0; }
.choice-fieldset > legend { font-weight: 750; margin-bottom: .4rem; padding: 0; }
.choice-fieldset > div { display: grid; gap: .45rem; }
.choice-fieldset > div label { align-items: center; background: var(--white); border: 1px solid #aab7c5; border-radius: .35rem; cursor: pointer; display: flex; font-weight: 600; gap: .55rem; margin: 0; min-height: 44px; padding: .5rem .75rem; }
.choice-fieldset > div label:has(input:checked) { background: #edf4fb; border-color: var(--blue); color: #174c82; }
.choice-fieldset > div input { accent-color: var(--blue); flex: 0 0 auto; height: 1.05rem; margin: 0; width: 1.05rem; }
