/* Product stylesheet. Tokens first; light by default, dark by system preference or by
   data-theme="dark". 16px side gutters, 44px minimum touch targets, no horizontal page
   scroll at phone width. University-neutral: no institutional colours here. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #1c1d1f;
  --muted: #5d6066;
  --border: #dcdcd6;
  --accent: #2f5d8a;
  --accent-text: #ffffff;
  --accent-soft: #e5edf5;
  --ok: #2c6e49;
  --ok-soft: #e3f1e8;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --danger: #a1282a;
  --danger-soft: #f8e3e3;
  --focus: #1f6feb;
  --radius: 10px;
  --gutter: 16px;
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315; --surface: #1b1c1f; --surface-2: #24262a; --text: #ececea;
    --muted: #a4a7ad; --border: #33363b; --accent: #8db4dc; --accent-text: #0e1620;
    --accent-soft: #1f2c3a; --ok: #7fc79c; --ok-soft: #1a2e22; --warn: #e2b55c;
    --warn-soft: #33290f; --danger: #f08a8b; --danger-soft: #3a1c1d; --focus: #79a8ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121315; --surface: #1b1c1f; --surface-2: #24262a; --text: #ececea;
  --muted: #a4a7ad; --border: #33363b; --accent: #8db4dc; --accent-text: #0e1620;
  --accent-soft: #1f2c3a; --ok: #7fc79c; --ok-soft: #1a2e22; --warn: #e2b55c;
  --warn-soft: #33290f; --danger: #f08a8b; --danger-soft: #3a1c1d; --focus: #79a8ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.55; overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .85rem; overflow-wrap: anywhere; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.wordmark { font-weight: 650; letter-spacing: .01em; color: var(--text); text-decoration: none;
  font-size: 1.1rem; min-height: var(--tap); display: inline-flex; align-items: center; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a, .nav button.linklike {
  min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 10px;
  color: var(--text); text-decoration: none; border-radius: 8px; }
.nav a:hover, .nav button.linklike:hover { background: var(--surface-2); }
.nav form { margin: 0; }
.preview-flag { font-size: .75rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px; }

main { padding: 20px 0 48px; }
.site-footer { border-top: 1px solid var(--border); padding: 20px 0 32px; color: var(--muted); font-size: .875rem; }

/* controls */
.btn, button, input[type=submit] {
  font: inherit; min-height: var(--tap); padding: 0 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-quiet { background: transparent; }
button.linklike { border: 0; background: none; padding: 0 10px; }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=search],
select, textarea {
  font: inherit; width: 100%; min-height: var(--tap); padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
textarea { min-height: 120px; resize: vertical; }
input[type=file] { font: inherit; width: 100%; min-height: var(--tap); padding: 8px 0; }
input[type=file]::file-selector-button { font: inherit; min-height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); margin-right: 8px; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--accent); }
label { font-weight: 550; display: block; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.field .help { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: var(--tap); padding: 8px 0; }
.check label { font-weight: 400; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* cards and surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text);
  min-height: 160px; }
.project-card:hover { border-color: var(--accent); }
.project-card, .project-card * { min-width: 0; overflow-wrap: anywhere; }
.grid > * { min-width: 0; }
.project-card h3 { color: var(--accent); overflow-wrap: anywhere; }
.project-card .meta { margin-top: auto; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; background: var(--accent-soft); }
.messages li.error { background: var(--danger-soft); color: var(--danger); }
.messages li.success { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; font-size: .78rem; color: var(--muted); background: var(--surface);
  white-space: nowrap; }
.badge-kind { color: var(--text); background: var(--surface-2); }
.badge-public { color: var(--ok); border-color: var(--ok); }
.badge-unlisted { color: var(--warn); border-color: var(--warn); }
.badge-private { color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
/* AI-assisted label: shown wherever Praxis appears or its work is shown */
.badge-ai { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.ai-label { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: .9rem; }
.ai-notice { margin-top: 16px; }
.tag { font-size: .8rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }

/* gallery */
.hero { padding: 8px 0 16px; }
.filters { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr; } }

/* project page (repository-style) */
.crumbs { font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.repo-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.repo-head h1 { overflow-wrap: anywhere; }
.repo-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .repo-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.readme { overflow-wrap: anywhere; }
.readme-title { font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.file-list > li { padding: 12px 16px; border-top: 1px solid var(--border); }
.file-list > li:first-child { border-top: 0; }
.file-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.file-row .title { font-weight: 600; overflow-wrap: anywhere; }
details > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--accent); }
.versions { list-style: none; margin: 4px 0 0; padding: 0; font-size: .9rem; }
.versions li { padding: 6px 0; border-top: 1px dashed var(--border); }
.side h2 { font-size: 1rem; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .92rem; }
.side dt { color: var(--muted); } .side dd { margin: 0; overflow-wrap: anywhere; }
.license-line { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 24px; padding-top: 12px; }

/* status strip */
.status-strip { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.status-strip li { text-align: center; font-size: .8rem; padding: 8px 4px; border-radius: 6px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.status-strip li.done { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.status-strip li.current { font-weight: 650; }
.review-note { padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .9rem; }

/* visibility control */
.vis-form { display: grid; gap: 8px; }
.vis-options { display: flex; flex-wrap: wrap; gap: 6px; }
.vis-options label { font-weight: 400; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
  padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; margin: 0; cursor: pointer; }
.consent { font-size: .85rem; color: var(--muted); }
.inline-error { color: var(--danger); font-size: .9rem; }

/* profile */
.profile-cover { height: 96px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface-2)); }
.profile-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: 20px; }
.profile-body { padding: 0 16px 16px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--surface); background: var(--surface-2);
  margin-top: -48px; object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 650; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.fineprint { font-size: 0.6rem; color: #8a8f98; margin-top: 0.4rem; }
