/* Pantheum — www.pantheum.tools
   Layout follows the classic Apache project site: masthead, top navigation bar,
   breadcrumb strip with publish date, left-hand section menu, content, footer. */

:root {
  --brand: #304033;
  --brand-2: #3e5444;
  --accent: #b8973f;
  --gold: #e6cf85;
  --gold-deep: #ab904d;
  --forest: #1c2a20;
  --accent-soft: #f4edd6;
  --ink: #1f2328;
  --muted: #5b6470;
  --line: #d9dfd6;
  --paper: #ffffff;
  --panel: #f4f6f2;
  --link: #2d6a45;
  --link-visited: #5a3d8f;
  --code-bg: #f2f4ef;
  --ok: #1f7a4d;
  --warn: #9a5b00;
  --maxw: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e9ee;
    --muted: #a3acb8;
    --line: #2c3a30;
    --paper: #111712;
    --panel: #18201a;
    --link: #9fd4ae;
    --link-visited: #b9a3ff;
    --code-bg: #1a231c;
    --accent-soft: #2e2918;
    --ok: #5cc48f;
    --warn: #e0a54a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.content a:visited { color: var(--link-visited); }
a.external::after { content: " ↗"; font-size: .8em; }

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: #fff; padding: 6px 10px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- masthead */

.masthead { background: linear-gradient(180deg, #364a3a 0%, var(--brand) 100%); border-bottom: 1px solid #253328; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.75rem; letter-spacing: .14em; font-weight: 700; color: var(--gold); background: linear-gradient(180deg, #faeaa8 0%, #e6cf85 45%, #c4a457 70%, #ab904d 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 1px 0 rgba(0,0,0,.12); }
.brand-sub { font-size: .8rem; color: #c3cfc2; letter-spacing: .08em; text-transform: uppercase; }
.search input[type="search"]::placeholder { color: #b5c2b4; }
.search input[type="search"] { width: 260px; max-width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: .9rem; background: rgba(255,255,255,.08); color: #eef2ec; border-color: rgba(255,255,255,.22); }

/* ---------------------------------------------------------------- top navigation */

.topnav { background: var(--forest); color: #fff; position: relative; z-index: 5; }
.topnav ul { list-style: none; margin: 0; padding: 0; }
#topnav-list { display: flex; flex-wrap: wrap; }
#topnav-list > li > a,
#topnav-list > li > details > summary {
  display: block; padding: 11px 16px; color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem; cursor: pointer;
}
#topnav-list > li > details > summary { list-style: none; }
#topnav-list > li > details > summary::-webkit-details-marker { display: none; }
#topnav-list > li > details > summary::after { content: "▾"; margin-left: 6px; font-size: .75em; opacity: .8; }
#topnav-list > li:hover > a,
#topnav-list > li > details > summary:hover,
#topnav-list > li > details[open] > summary { background: var(--brand-2); }
#topnav-list > li.here { box-shadow: inset 0 -3px 0 var(--accent); }
.topnav details { position: relative; }
.dropdown { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px 0 !important; }
.dropdown a { display: block; padding: 7px 16px; color: var(--ink); text-decoration: none; font-size: .93rem; }
.dropdown a:hover { background: var(--panel); color: var(--link); }
.menu-toggle { display: none; }

/* ---------------------------------------------------------------- breadcrumb strip */

.crumbbar { background: var(--panel); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.crumbbar-inner { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { margin: 0 4px; }
.breadcrumb [aria-current] { color: var(--ink); }
.published span + span::before { content: "|"; margin: 0 8px; }
body.home .crumbbar { display: none; }

/* ---------------------------------------------------------------- page body */

.page { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; padding-top: 28px; padding-bottom: 48px; }
body.plain .page { grid-template-columns: minmax(0, 1fr); }

.sidebar { font-size: .92rem; align-self: start; position: sticky; top: 12px; }
.sidebar h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.sidebar h2:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 4px 8px; margin-left: -8px; border-left: 3px solid transparent; text-decoration: none; color: var(--ink); }
.sidebar li a:hover { color: var(--link); background: var(--panel); }
.sidebar li a.active { border-left-color: var(--accent); font-weight: 600; background: var(--panel); }
.powered { display: block; margin-top: 26px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: .8rem; text-decoration: none; line-height: 1.4; }
.powered strong { color: var(--ink); }

/* ---------------------------------------------------------------- content typography */

.content { min-width: 0; }
.content > :first-child { margin-top: 0; }
.content h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .4em; font-weight: 700; }
.content h2 { font-size: 1.4rem; margin: 2em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.content h3 { font-size: 1.1rem; margin: 1.6em 0 .4em; }
.content p, .content ul, .content ol { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); font-size: .88em; }

code { font-family: var(--mono); font-size: .9em; background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; padding: 14px 16px; overflow-x: auto; font-size: .87rem; line-height: 1.5; position: relative; }
pre code { background: none; padding: 0; font-size: inherit; }
pre.output { border-left-color: var(--ok); }
.copy { position: absolute; top: 6px; right: 6px; font: 12px var(--font); padding: 3px 8px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 3px; cursor: pointer; opacity: 0; transition: opacity .15s; }
pre:hover .copy, .copy:focus { opacity: 1; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table.grid { border-collapse: collapse; width: 100%; font-size: .93rem; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.grid thead th { background: var(--panel); font-weight: 600; }
table.grid tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 55%, transparent); }
table.compact th, table.compact td { padding: 5px 9px; }
table.grid td.c { text-align: center; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.incubating { background: var(--accent-soft); color: var(--warn); }

.note { border: 1px solid var(--line); border-left: 4px solid var(--link); background: var(--panel); padding: 12px 16px; border-radius: 4px; margin: 0 0 1.2em; }
.note.warn { border-left-color: var(--accent); }
.note > :last-child { margin-bottom: 0; }

.btn { display: inline-block; padding: 9px 18px; border-radius: 4px; background: var(--brand); color: #fff !important; text-decoration: none; font-weight: 600; border: 1px solid var(--brand); }
.btn:hover { background: var(--brand-2); }
.btn.secondary { background: transparent; color: var(--brand) !important; border-color: var(--line); }
@media (prefers-color-scheme: dark) { .btn.secondary { color: var(--ink) !important; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1.2em; font-size: .95rem; }
dl.facts dt { font-weight: 600; color: var(--muted); }
dl.facts dd { margin: 0; }

.project-head { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.project-head img { width: 72px; height: 72px; flex: none; }
.project-head h1 { margin: 0; }
.project-head p { margin: 2px 0 0; color: var(--muted); }

/* ---------------------------------------------------------------- home */

.hero { background: linear-gradient(135deg, #2a3a2e 0%, var(--brand) 45%, #46604c 100%); color: #fff; border-radius: 6px; padding: 40px 36px; margin-bottom: 32px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -30px; bottom: -36px; width: 320px; height: 237px; background: url(../img/pantheum-logo.svg) no-repeat center / contain; opacity: .14; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-size: 2.3rem; font-weight: 700; margin: 0 0 .3em; color: var(--gold); }
.hero p { font-size: 1.12rem; max-width: 62ch; color: #dbe4d9; margin: 0 0 1.2em; }
.hero .btn { background: linear-gradient(180deg, #ecd58f, #c9a952); border-color: #c9a952; color: #1c2a20 !important; }
.hero .btn.secondary { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.4); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 0 0 1.4em; }
.card { border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 5px; padding: 18px 20px; background: var(--paper); display: flex; flex-direction: column; }
@media (prefers-color-scheme: dark) { .card { border-top-color: var(--accent); } }
.card h3 { margin: 0; font-size: 1.25rem; }
.card h3 a { text-decoration: none; }
.card-sub { color: var(--muted); font-size: .88rem; margin: 0 0 .7em !important; }
.card-meta { font-size: .82rem; color: var(--muted); margin-top: auto !important; }
.card-links { display: flex; gap: 14px; font-size: .9rem; margin: 0 !important; }
.card.incubator { border-top-color: var(--accent); background: var(--panel); }

.home-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; }

.news { list-style: none; padding: 0; margin: 0; }
.news li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.news li:first-child { padding-top: 0; }
.news time { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.news-label { font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-decoration: none; padding: 1px 9px; border-radius: 10px; color: var(--brand) !important; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.news-label:hover { background: color-mix(in srgb, var(--accent) 35%, transparent); }
@media (prefers-color-scheme: dark) { .news-label { color: var(--gold) !important; } }
.news h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.news p { margin: 0; font-size: .93rem; }

.decode { font-family: var(--mono); font-size: 1.05rem; display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 8px; }
.decode span { padding: 4px 8px; border-radius: 3px; }
.decode .ai { background: var(--brand); color: var(--gold); }
.decode .val { background: var(--accent-soft); color: var(--ink); }

/* ---------------------------------------------------------------- footer */

.footer { background: var(--forest); color: #c4cede; font-size: .9rem; padding: 32px 0 24px; }
.footer a { color: #e8edf5; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 0 0 8px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 4px 0; }
.legal { border-top: 1px solid #33443a; margin: 24px 0 0; padding-top: 16px; font-size: .8rem; line-height: 1.55; color: #9aa7bb; }
.legal a { color: #c4cede; text-decoration: underline; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 860px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sidebar { position: static; order: 2; border-top: 1px solid var(--line); padding-top: 18px; columns: 2 170px; column-gap: 24px; }
  .sidebar h2, .sidebar ul, .powered { break-inside: avoid; }
  .sidebar h2 { break-after: avoid; }
  .content { order: 1; }
  .home-cols { grid-template-columns: minmax(0, 1fr); }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { display: none; }
  .menu-toggle { display: block; background: none; border: 0; color: #fff; font: 600 .95rem var(--font); padding: 11px 0; cursor: pointer; }
  .menu-toggle::before { content: "☰ "; }
  #topnav-list { display: none; flex-direction: column; padding-bottom: 8px; }
  .topnav.open #topnav-list { display: flex; }
  #topnav-list > li > a, #topnav-list > li > details > summary { padding: 9px 4px; }
  .dropdown { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 4px 12px !important; }
  .dropdown a { color: #dfe6f0; }
  .dropdown a:hover { background: transparent; color: #fff; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .content h1 { font-size: 1.6rem; }
}

@media print {
  .masthead .search, .topnav, .sidebar, .footer-cols, .copy { display: none; }
  .page { display: block; }
}

/* ---------------------------------------------------------------- project groups */

.dropdown a.dd-group { font-weight: 600; }
.dropdown a.dd-member { padding-left: 30px; position: relative; }
.dropdown a.dd-member::before { content: ""; position: absolute; left: 18px; top: 50%; width: 6px; border-top: 1px solid var(--muted); }

table.grid tr.group-row th { background: color-mix(in srgb, var(--brand) 10%, var(--paper)); font-size: 1rem; border-left: 4px solid var(--accent); }
table.grid tr.group-row th a { font-weight: 700; margin-right: 6px; }
table.grid tr.member-row td:first-child { padding-left: 26px; }

.group-card { border-top-color: var(--accent); }
.card-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin: 0 0 4px !important; }
.member-list { list-style: none; padding: 0; margin: 0 0 1em !important; border-top: 1px solid var(--line); }
.member-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.member-list a { font-weight: 600; }

.footer li.sub { padding-left: 12px; }

.family { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0 16px; align-items: center; margin: 0 0 1.4em; }
.family .node { border: 1px solid var(--line); border-radius: 5px; padding: 12px 14px; background: var(--panel); }
.family .node strong { display: block; }
.family .arrow { color: var(--muted); font-size: .85rem; text-align: center; }
@media (max-width: 600px) { .family { grid-template-columns: 1fr; gap: 8px; } .family .arrow { transform: rotate(90deg); } }
