:root {
  color-scheme: light;
  --paper: #faf9f5;
  --ink: #172f35;
  --muted: #485c5d;
  --teal: #205d54;
  --stroke: #cdd5cc;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, 'Aptos', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
button { color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #98512f; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1220px, calc(100% - clamp(36px, 9vw, 128px))); margin-inline: auto; }
.skip-link { position: absolute; top: .75rem; left: 1rem; z-index: 1; padding: .5rem 1rem; background: white; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }

.site-header { border-bottom: 1px solid var(--stroke); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .8rem; font: 1.28rem var(--serif); text-decoration: none; }
.monogram { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--teal); color: var(--teal); font: .78rem var(--sans); letter-spacing: .035em; }
.site-label { color: var(--muted); font-size: .9rem; }
.site-label:hover { color: var(--teal); }
.intro { padding: clamp(40px, 4.6vw, 72px) 0 clamp(28px, 3vw, 45px); }
.intro h1 { font: 400 clamp(3rem, 5.5vw, 5.5rem)/1.04 var(--serif); letter-spacing: -.055em; }
.intro h1 em { color: var(--teal); font-weight: 400; }
.intro p { max-width: 64ch; margin-top: 1rem; color: var(--muted); font-size: clamp(1.04rem, 1.25vw, 1.16rem); }

.directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3rem; margin: 0 0 4rem; }
.lab-entry { display: contents; }
#gas2d { --accent: #255c49; --tint: #e7efe6; }
#gas3d { --accent: #2f546a; --tint: #e5edf2; }
#monte-carlo { --accent: #854b32; --tint: #f5eadd; }
.lab-card {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: #fffefa;
}
.lab-figure { width: 100%; height: auto; display: block; background: var(--tint); border-bottom: 1px solid var(--stroke); }
.card-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: clamp(18px, 2vw, 28px); }
.card-body h2 { font: 400 clamp(1.6rem, 2.1vw, 2.05rem)/1.15 var(--serif); letter-spacing: -.035em; }
.card-body p { color: var(--muted); margin: .7rem 0 1.4rem; }
.open-lab { display: inline-flex; align-items: center; min-height: 44px; margin-top: auto; padding: .55rem 1.15rem; border-radius: 4px; background: var(--accent); color: white; font-weight: 600; text-decoration: none; }
.open-lab:hover { filter: brightness(.86); }
.activities-link {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 49px;
  padding: .6rem clamp(18px, 2vw, 28px); border: 0; border-top: 1px solid var(--stroke);
  background: transparent; color: var(--accent); font: 600 .94rem var(--sans); text-decoration: none;
}
.activities-link:hover, .activities-link[aria-expanded="true"] { background: var(--tint); }
.activities-link::after {
  content: ''; width: 8px; height: 8px; margin-left: auto; margin-right: .15rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg);
}
.activities-link[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.activities-link:focus-visible { outline-offset: -5px; }
.activity-count { font-size: .85rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.activity-count::before { content: '('; }
.activity-count::after { content: ')'; }

.activity-panel {
  grid-column: 1 / -1; border-top: 3px solid var(--accent); padding: 1.5rem 0 .5rem;
  scroll-margin-top: 1.25rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 0 1.1rem; }
.panel-head h3 { font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.15 var(--serif); letter-spacing: -.03em; }
.close-panel { min-height: 44px; padding: .3rem 0 .3rem .5rem; border: 0; background: transparent; color: var(--accent); font-size: .92rem; text-decoration: underline; text-underline-offset: .22em; white-space: nowrap; }
.activity-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.4rem; list-style: none; padding: 0; margin: 0; }
.activity-list li { padding: 1.15rem 0; border-top: 1px solid var(--stroke); scroll-margin-top: 1rem; }
.activity-list h4 { font: 600 1.05rem/1.4 var(--sans); color: var(--accent); }
.activity-list a:hover { text-decoration-thickness: 2px; }
.activity-list p { margin-top: .45rem; max-width: 64ch; color: var(--muted); }
.activity-list li:target { background: var(--tint); outline: 4px solid var(--tint); }

@media (max-width: 800px) {
  .directory { display: block; }
  .lab-entry { display: block; margin-bottom: 1.25rem; }
  .lab-card { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1fr); }
  .lab-figure { height: 100%; object-fit: contain; grid-row: span 2; border-bottom: 0; border-right: 1px solid var(--stroke); }
  .activity-panel { margin-top: .8rem; }
  .activity-list { gap: 0 1.25rem; }
}
@media (max-width: 570px) {
  .masthead { min-height: 61px; }
  .site-label { font-size: .83rem; }
  .intro h1 { font-size: clamp(2.65rem, 10.5vw, 3.7rem); }
  .lab-card { display: flex; }
  .lab-figure { height: auto; border-right: 0; border-bottom: 1px solid var(--stroke); }
  .card-body { padding: 1.25rem; }
  .activity-list { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; }
}
