/* research.matthiasgruber.com — tokens per docs/research-site-architecture.md §6 (shared with the map page palette) */
:root {
  --bg: #fbfbf8; --surface: #ffffff; --surface-2: #f2f2ed; --fg: #1d1d1b; --muted: #5d5d58;
  --line: #deded8; --accent: #b2380b; --accent-hover: #8f2c08; --accent-fg: #ffffff;
  --callout-bg: #fff3ea; --chip-bg: #eeeee8; --focus: #0b5cad; --img-plate: #ffffff;
  --shadow: 0 1px 3px #0000001a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161615; --surface: #20201e; --surface-2: #2a2a27; --fg: #e9e9e4; --muted: #a8a8a0;
    --line: #3a3a36; --accent: #e8946a; --accent-hover: #f2ab88; --accent-fg: #161615;
    --callout-bg: #2b1e16; --chip-bg: #2e2e2b; --focus: #7fb4ff; --img-plate: #ecece6;
    --shadow: 0 1px 3px #00000066;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161615; --surface: #20201e; --surface-2: #2a2a27; --fg: #e9e9e4; --muted: #a8a8a0;
  --line: #3a3a36; --accent: #e8946a; --accent-hover: #f2ab88; --accent-fg: #161615;
  --callout-bg: #2b1e16; --chip-bg: #2e2e2b; --focus: #7fb4ff; --img-plate: #ecece6;
  --shadow: 0 1px 3px #00000066;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; margin: 0.4rem 0 0.8rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 2.4rem 0 0.9rem; }
h3 { font-size: 1.08rem; margin: 0.35rem 0 0.2rem; line-height: 1.35; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 0.5rem; }

/* header / nav */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header nav { max-width: 72rem; margin: 0 auto; padding: 0.55rem 16px; display: flex; align-items: center; gap: 0.6rem; }
.brand { font-weight: 650; color: var(--fg); text-decoration: none; white-space: nowrap; margin-right: auto; min-height: 44px; display: flex; align-items: center; }
.brand span { color: var(--muted); font-weight: 400; margin-left: 0.3em; }
@media (max-width: 420px) { .brand span { display: none; } }
.nav-links { display: none; gap: 0.2rem; align-items: center; }
.nav-links a, .menu-panel a { color: var(--fg); text-decoration: none; padding: 0.45rem 0.6rem; border-radius: 6px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.nav-links a:hover, .menu-panel a:hover { background: var(--surface-2); color: var(--fg); }
.nav-links a[aria-current="page"], .menu-panel a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
a.pill { background: var(--callout-bg); color: var(--accent); font-weight: 600; }
a.pill:hover { background: var(--accent); color: var(--accent-fg); }
.theme-toggle {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.tt-icon { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
:root[data-theme="light"] .tt-icon { background: transparent; }
:root[data-theme="dark"] .tt-icon { background: currentColor; }
.nav-menu { flex-shrink: 0; }
.nav-menu summary { list-style: none; cursor: pointer; padding: 0.45rem 0.8rem; border: 1px solid var(--line); border-radius: 22px; min-height: 44px; display: flex; align-items: center; }
.nav-menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 16px; left: 16px; top: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 0.5rem; display: flex; flex-direction: column; }
.menu-panel a.pill { justify-content: center; margin-bottom: 0.35rem; }
@media (min-width: 1100px) {
  .nav-links { display: flex; }
  .nav-menu { display: none; }
}

/* layout */
.wrap { max-width: 48rem; margin: 0 auto; padding: 1.2rem 16px 3rem; }
.lead { font-size: 1.12rem; color: var(--muted); }
.crumb { font-size: 0.9rem; color: var(--muted); margin: 0.6rem 0 0; }
.crumb a { color: var(--muted); }
.hero { padding: 1.4rem 0 0.4rem; }
.button { display: inline-block; background: var(--accent); color: var(--accent-fg); text-decoration: none; padding: 0.7rem 1.1rem;
  border-radius: 8px; font-weight: 600; min-height: 44px; margin: 0.25rem 0.4rem 0.25rem 0; }
.button:hover { background: var(--accent-hover); color: var(--accent-fg); }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.callout { background: var(--callout-bg); border-left: 4px solid var(--accent); padding: 0.8rem 1rem; border-radius: 6px; }
.chip { display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650;
  color: var(--muted); background: var(--chip-bg); padding: 0.15rem 0.5rem; border-radius: 999px; }
.plate { background: var(--img-plate); padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
:root[data-theme="dark"] .plate, :root[data-theme="dark"] .legacy img { filter: brightness(0.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plate, :root:not([data-theme="light"]) .legacy img { filter: brightness(0.92); } }
.art { display: block; max-width: 220px; margin: 0 auto 1.4rem; }
.prose p, .prose li { max-width: 40rem; }
.more, .strip a { font-weight: 600; }
.strip { margin-top: 2.4rem; padding: 0.9rem 1rem; border: 1px dashed var(--line); border-radius: 8px; }
.related { margin-top: 2.4rem; color: var(--muted); }
ul.links { padding-left: 1.1rem; }
ul.links li { margin: 0.3rem 0; }
.cite { background: var(--surface-2); padding: 0.8rem 1rem; border-radius: 6px; }

/* cards */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem;
  margin-bottom: 0.8rem; color: var(--fg); text-decoration: none; box-shadow: var(--shadow); }
a.card:hover { border-color: var(--accent); color: var(--fg); }
.card .sub { color: var(--muted); margin: 0.1rem 0 0.4rem; }
.card p { margin: 0.35rem 0; }
.card .meta { font-size: 0.88rem; color: var(--muted); }
.card .doi { overflow-wrap: anywhere; }
.paper.key { border-color: var(--accent); }
.c-title { display: block; font-weight: 650; margin: 0.35rem 0 0.15rem; }
.card.link .sub { display: block; font-size: 0.92rem; }
.grid2 { display: grid; gap: 0.8rem; }
.grid2 > .card, .grid2 > .feature { margin: 0; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.features { display: grid; gap: 0.9rem; margin-top: 1.6rem; }
.feature { display: grid; grid-template-columns: 96px 1fr; column-gap: 1rem; align-content: start; background: var(--surface);
  border: 1px solid var(--accent); border-radius: 12px; padding: 1rem; color: var(--fg); text-decoration: none; box-shadow: var(--shadow); }
.feature:hover { background: var(--callout-bg); color: var(--fg); }
.feature img { grid-row: 1 / span 4; width: 96px; align-self: center; }
.feature .chip { justify-self: start; }
.f-title { font-weight: 700; font-size: 1.12rem; margin: 0.25rem 0; color: var(--accent); }
.f-text { color: var(--muted); font-size: 0.95rem; }
.cta { font-weight: 600; font-size: 0.92rem; margin-top: 0.35rem; color: var(--accent); }
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; } }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem; text-decoration: none; color: var(--fg); min-height: 44px; }
.tile:hover { border-color: var(--accent); color: var(--fg); }
.t-title { display: block; font-weight: 650; color: var(--accent); margin-bottom: 0.25rem; }
.t-text { display: block; font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* legacy MoC7 / book markup reused from the main site */
.legacy .hero h1 { margin-top: 0.6rem; }
.legacy .tagline, .legacy .event-slot { color: var(--muted); margin: 0.2rem 0; }
.legacy figure.teaser { margin: 1.2rem 0; }
.legacy figure.teaser video, .legacy figure.teaser img { width: 100%; max-width: 420px; display: block; margin: 0 auto; border-radius: 10px; }
.pub { display: flex; flex-direction: column; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 0.8rem; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); }
a.pub:hover { border-color: var(--accent); color: var(--fg); }
.pub.featured { border-color: var(--accent); }
.pub-tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; color: var(--accent); }
.pub-title { font-weight: 650; margin: 0.25rem 0 0.15rem; }
.pub-subtitle, .pub p { color: var(--muted); font-size: 0.95rem; margin: 0.2rem 0; }
.pub-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.pub-body { display: flex; flex-direction: column; }
.legacy h2 { text-transform: none; }
.pdf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.pdf-pair .pub { margin: 0; }
.pdf-thumb { width: 100%; max-width: 120px; background: var(--img-plate); border-radius: 4px; margin-bottom: 0.5rem; }
.kit-card, .contribute-card, .map-card { display: grid; grid-template-columns: 96px 1fr; column-gap: 1rem; align-content: center; }
.kit-sample, .contribute-art, .map-art { grid-row: 1 / span 5; width: 96px; border-radius: 6px; background: var(--img-plate); align-self: center; }
@media (min-width: 640px) { .map-card { grid-template-columns: 180px 1fr; } .map-art { width: 180px; } }
.legal-note { font-size: 0.85rem; color: var(--muted); }
.book-info p, .book-info li { max-width: 40rem; }
.nowrap { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { video.motion { display: none; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.4rem 16px 2rem; text-align: center; font-size: 0.9rem; color: var(--muted); }
.site-footer p { max-width: 60rem; margin: 0.3rem auto; }
.site-footer .fine { font-size: 0.82rem; }

/* book cover art icon (No Outside, INF-115) — cards, link cards and legacy pub cards */
.card.with-cover, .book-card { display: grid; grid-template-columns: 72px 1fr; column-gap: 1rem; align-content: start; }
.card.with-cover > :not(.cover), .book-card > :not(.cover) { grid-column: 2; }
.cover { grid-column: 1; grid-row: 1 / span 8; width: 72px; height: auto; border-radius: 3px; align-self: start;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.legacy img.cover { filter: none; }
