/* John Cottle site. UCSB navy and gold.
   Tokens first, then base, layout, components and pages. */
:root {
  --navy: #003660;
  --navy-deep: #00243F;
  --gold: #FEBC11;
  --paper: #F4F6F9;
  --white: #FFFFFF;
  --ink: #0B2239;
  --muted: #3C4E60;
  --line: #C9D3DE;
  --wash: #E6EDF4;
  --display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.65; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #00538A; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--navy-deep); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.eyebrow.dark { color: var(--navy); }

/* ---------- header ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 1.5rem; font-weight: 500; color: var(--navy); text-decoration: none; letter-spacing: -.01em; }
.brand span { font-family: var(--body); font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 10px; letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: .92rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; transition: border-color .2s, color .2s; }
.nav a:hover { color: var(--navy); border-bottom-color: var(--gold); }
.nav a[aria-current="page"] { border-bottom-color: var(--navy); }
.nav .nav-cta { background: var(--navy); color: #fff; padding: 10px 18px; border: 0; transition: transform .2s, background .2s; }
.nav .nav-cta:hover { background: var(--navy-deep); color: #fff; transform: translateY(-1px); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; color: var(--navy); align-items: center; justify-content: center; cursor: pointer; }

/* ---------- home hero ---------- */
.hero { background-size: cover; background-position: center 35%; position: relative; color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,36,63,.93) 0%, rgba(0,36,63,.78) 45%, rgba(0,36,63,.25) 100%); }
.hero-in { position: relative; padding-top: 96px; padding-bottom: 104px; max-width: 1200px; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 5rem); max-width: 14ch; margin-bottom: 28px; font-weight: 400; }
.hero-p { max-width: 58ch; font-size: 1.08rem; color: #DCE6F0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn-gold, .btn-line, .btn-solid { display: inline-flex; align-items: center; min-height: 50px; padding: 0 26px; font-weight: 600; font-size: .92rem; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { color: var(--navy-deep); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.btn-line { border: 1px solid rgba(255,255,255,.6); color: #fff; }
.btn-line:hover { color: #fff; border-color: var(--gold); transform: translateY(-2px); }
.btn-solid { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-deep); color: #fff; transform: translateY(-2px); }

/* ---------- sections ---------- */
.section { padding-top: 96px; padding-bottom: 96px; }
.section.alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px 48px; align-items: end; margin-bottom: 48px; }
.sec-head .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.sec-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.sec-head p { color: var(--muted); margin: 0; }
.after { margin: 32px 0 0; }
.more { font-weight: 600; font-size: .92rem; color: var(--navy); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.more span { transition: transform .25s; }
a:hover > .more span, .more:hover span, a:hover .more span { transform: translateX(4px); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .3s, border-color .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); border-color: var(--navy); box-shadow: 0 14px 30px rgba(0,54,96,.12); color: var(--ink); }
.card-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--wash); display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 24px; flex: 1; }
.card-title { font-family: var(--display); font-size: 1.5rem; line-height: 1.15; font-weight: 500; color: var(--navy); }
.card-text { font-size: .93rem; color: var(--muted); line-height: 1.55; }
.card-body .more { margin-top: auto; padding-top: 8px; }

.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.mini { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--paper); transition: transform .3s, border-color .3s; }
.mini:hover { transform: translateY(-3px); border-color: var(--navy); color: var(--ink); }
.mini-img { display: block; aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.mini-img img, .lab-img img { width: 100%; height: 100%; }
.cover img { object-fit: cover; }
.contain img { object-fit: contain; padding: 10px; }
.mini-name { display: block; padding: 14px 16px 16px; font-family: var(--display); font-size: 1.15rem; line-height: 1.2; color: var(--navy); }

.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; }
.strip li { display: flex; flex-direction: column; align-items: center; text-align: center; }
.p-name { font-family: var(--display); font-size: 1.3rem; line-height: 1.15; color: var(--navy); display: block; margin: 0 0 4px; }
.p-name a { color: var(--navy); text-decoration: none; }
.p-name a:hover { text-decoration: underline; }
.p-role { font-size: .88rem; color: var(--muted); line-height: 1.4; display: block; margin: 0; }

.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.about-img { margin: 0; padding-top: 72px; }
.about-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.about-text h2 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: 24px; }
.about-text p { color: var(--muted); max-width: 62ch; }
.about-text h3 { font-size: 1.4rem; margin: 36px 0 12px; color: var(--navy); }
.plain { list-style: none; margin: 0; padding: 0; max-width: 62ch; color: var(--muted); font-size: .95rem; }
.plain li { padding: 8px 0; border-top: 1px solid var(--line); }
.plain li a { color: var(--navy); }

.contact { background: var(--navy); color: #fff; padding: 96px 0; }
.contact-in { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 48px; align-items: end; }
.contact h2 { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 16ch; margin-bottom: 20px; font-weight: 400; }
.contact p { color: #D6E0EA; max-width: 52ch; }
.email { display: inline-block; font-family: var(--display); font-size: clamp(1.5rem, 4vw, 2.6rem); color: #fff; text-decoration: none; border-bottom: 3px solid var(--gold); padding-bottom: 6px; margin-top: 12px; word-break: break-word; transition: color .2s; }
.email:hover { color: var(--gold); }
address { font-style: normal; color: #D6E0EA; font-size: .95rem; line-height: 1.7; }

/* ---------- interior pages ---------- */
.page-hero { background: var(--navy); color: #fff; padding: 72px 0 64px; position: relative; background-size: cover; background-position: center 40%; }
.page-hero.has-img { padding: 120px 0 72px; }
.page-hero.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,36,63,.45) 0%, rgba(0,36,63,.88) 100%); }
.page-hero .wrap { position: relative; }
.page-hero h1 { font-size: clamp(2.1rem, 5.4vw, 4rem); max-width: 22ch; font-weight: 400; }
.page-hero .lead { margin: 20px 0 0; max-width: 62ch; font-size: 1.1rem; color: #DCE6F0; }
.page-hero .lead a { color: var(--gold); }
.page-hero a { color: var(--gold); }
.page-hero a.btn-solid { background: var(--gold); color: var(--navy-deep); }
.page-hero a.btn-solid:hover { background: #fff; color: var(--navy-deep); }

.prose-wrap { padding-top: 56px; padding-bottom: 96px; }
.prose { max-width: 78ch; }
.prose p, .prose li { color: var(--ink); }
.prose h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); color: var(--navy); margin: 56px 0 18px; padding-top: 28px; border-top: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.4rem; color: var(--navy); margin: 36px 0 12px; }
.prose ul { padding-left: 1.2em; }
.prose p.lbl { margin: 1.4em 0 .4em; font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prose p.lbl + ul { margin-top: 0; }
.prose li { margin-bottom: .4em; }
.prose figure { margin: 24px 0; }
.prose figure img { border: 1px solid var(--line); background: #fff; max-height: 560px; width: auto; max-width: 100%; }
.prose figure.side { float: right; width: min(300px, 42%); margin: 0 0 24px 32px; }
.prose .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 40px; align-items: start; margin: 24px 0; }
.prose .cols > div > *:first-child { margin-top: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 40px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.jump span { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--navy); color: var(--navy); font-size: .85rem; font-weight: 600; text-decoration: none; transition: background .2s, color .2s; }
.btn:hover { background: var(--navy); color: #fff; }
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { border-collapse: collapse; width: 100%; }
td, th { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose-wrap::after { content: ""; display: block; clear: both; }

/* research hub */
.rows { padding-top: 64px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 72px; }
.row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: center; }
.row.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.row.flip .row-img { order: 2; }
.row-img { display: block; overflow: hidden; aspect-ratio: 3 / 2; background: var(--wash); }
.row-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.row-img:hover img { transform: scale(1.03); }
.row-text h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 16px; }
.row-text h2 a { color: var(--navy); text-decoration: none; }
.row-text p { color: var(--muted); }

/* facilities hub */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; padding: 64px 0 96px; }
.lab-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--white); border: 1px solid var(--line); transition: transform .3s, border-color .3s, box-shadow .3s; }
.lab-card:hover { transform: translateY(-4px); border-color: var(--navy); box-shadow: 0 14px 30px rgba(0,54,96,.12); color: var(--ink); }
.lab-img { display: block; aspect-ratio: 16 / 10; background: #fff; overflow: hidden; }
.lab-body { display: flex; flex-direction: column; gap: 10px; padding: 22px; flex: 1; }
.lab-name { font-family: var(--display); font-size: 1.5rem; line-height: 1.15; color: var(--navy); }
.lab-note { font-size: .93rem; color: var(--muted); }
.lab-body .more { margin-top: auto; padding-top: 6px; }

/* people */
.people-intro { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: center; }
.portrait { margin: 0; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border: 3px solid var(--gold); }
.people-intro h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 12px; }
.people-intro p { color: #DCE6F0; margin-bottom: .8em; }
.people-intro .small { font-size: .9rem; color: #B9CBDC; }
.join-note { font-size: 1.15rem; max-width: 62ch; padding: 20px 24px; background: var(--white); border-left: 4px solid var(--gold); margin-bottom: 56px; }
.wrap.section > h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: var(--navy); margin: 0 0 28px; }
.wrap.section > h3 { font-size: 1.4rem; color: var(--navy); margin: 40px 0 20px; }
.people-grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px; }
.people-grid.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; }
.people-grid.small .p-name { font-size: 1.1rem; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; }
.people-grid.small .avatar { max-width: 150px; }
.people-grid.past { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 32px 20px; margin-bottom: 40px; }
.people-grid.past .avatar { max-width: 120px; }
.people-grid.past .p-name { font-size: 1.1rem; }
.p-note { font-size: .78rem; line-height: 1.45; color: var(--muted); margin: 8px 0 0; }
.p-note a { color: var(--navy); }
.wrap.section > h2:not(:first-child) { margin-top: 72px; }
.alumni { list-style: none; padding: 0; margin: 0 0 16px; max-width: 80ch; }
.alumni li { padding: 12px 0; border-top: 1px solid var(--line); font-size: .96rem; }
.alumni li span { color: var(--muted); }

/* round member photos */
.avatar { display: block; width: 100%; max-width: 200px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: 50% 22%; background: var(--wash); border: 1px solid var(--line); margin: 0 auto 14px; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-deep); color: #C4D2DF; padding: 64px 0 24px; font-size: .92rem; }
.foot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 40px; }
.foot-name { font-family: var(--display); font-size: 1.6rem; color: #fff; margin: 0 0 8px; }
.site-footer a { color: #fff; text-decoration: none; display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.label { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); font-size: .82rem; }
.legal p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sec-head, .about, .contact-in, .row, .row.flip, .foot { grid-template-columns: minmax(0, 1fr); }
  .row.flip .row-img { order: 0; }
  .about-img { padding-top: 0; max-width: 360px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .people-intro { grid-template-columns: 140px minmax(0, 1fr); gap: 24px; }
  .rows { gap: 56px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 16px; border-top: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); min-height: 48px; display: flex; align-items: center; }
  .nav .nav-cta { margin-top: 12px; justify-content: center; border: 0; }
  .brand span { display: none; }
  .hero-in { padding-top: 64px; padding-bottom: 72px; }
  .hero::before { background: linear-gradient(180deg, rgba(0,36,63,.9) 0%, rgba(0,36,63,.8) 100%); }
  .page-hero.has-img { padding: 88px 0 56px; }
  .prose figure.side { float: none; width: 100%; margin: 0 0 24px; }
  .people-intro { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 200px; }
}
@media (max-width: 640px) { .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}

.prose strong.me{text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}

.prose ul.profiles,.profiles{list-style:none;margin:0 0 28px;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.profiles a{display:inline-flex;align-items:center;gap:9px;padding:9px 16px 9px 12px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--navy);font:500 .9rem/1 'IBM Plex Sans',sans-serif;text-decoration:none}
.profiles a:hover{border-color:var(--navy);background:var(--wash)}
.profiles svg{width:22px;height:22px;flex:none}
.prose ul.profiles li{margin:0;padding:0}.prose ul.profiles li::before{content:none}
.prose a{overflow-wrap:anywhere}
