/* ==========================================================================
   GBAITA Innovation Arena 2026 — student directory
   App shell: red masthead, group sidebar, searchable list, profile dialog.
   Design system: Archivo + Mulish, GBAITA red, warm neutrals.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --surface: #fffdf9;
  --surface-sunk: #f0d6d2;
  --ink: #231b1b;
  --ink-soft: #453b3b;
  --muted: #7a6e6c;
  --rule: #e4ddd8;
  --rule-strong: #cfc5bd;
  --red: #b00101;
  --red-deep: #8f0101;
  --red-bright: #c00000;
  --rose: #f0d6d2;

  --header-h: 64px;
  --sidebar-w: 300px;
  --ease: cubic-bezier(0.22, 0.72, 0.2, 1);
  --font-display: "Archivo", "PingFang TC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans TC", "Noto Sans SC", sans-serif;
  --font-body: "Mulish", "PingFang TC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans TC", "Noto Sans SC", sans-serif;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
}

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

a { color: inherit; }

button { font-family: inherit; }

::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.site-header :focus-visible { outline-color: #fff; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: #fff;
  color: var(--red);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ----------------------------------------------------------- password gate */

.gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  background: var(--red);
}

html.gate-unlocked .gate { display: none; }

html.gate-locked .site-header,
html.gate-locked .app,
html.gate-locked .site-footer { display: none; }

html.gate-locked body { overflow: hidden; }

.gate-card {
  width: min(440px, 100%);
  padding: 34px 32px 30px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(20, 12, 12, 0.35);
  text-align: center;
}

.gate-logo {
  height: 38px;
  width: auto;
  margin: 0 auto 18px;
}

.gate-eyebrow {
  margin: 0 0 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(35, 27, 27, 0.55);
}

.gate-title {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gate-lede {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.gate-form {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.gate-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.gate-form input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(176, 1, 1, 0.12);
}

.gate-form .btn { height: 44px; }

.gate-error {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
}

.gate-foot {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.gate-shake .gate-card { animation: gate-shake 0.28s var(--ease); }

@keyframes gate-shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (max-width: 520px) {
  .gate-card { padding: 28px 22px 24px; }
  .gate-title { font-size: 23px; }
}

@media print {
  .gate { display: none !important; }
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: relative;
  z-index: 50;
  background: var(--red);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
  padding: 0 clamp(16px, 3vw, 28px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
}

.brand-logo { height: 30px; width: auto; }

.brand-event {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.35;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.header-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 4px;
  background: #fff;
}

.lang-switch button {
  min-width: 34px;
  height: 26px;
  padding: 0 7px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.lang-switch button:hover { background: var(--rose); }

.lang-switch button[aria-pressed="true"] {
  background: var(--red-bright);
  color: #fff;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.menu-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ------------------------------------------------------------------ app */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--header-h));
}

/* --------------------------------------------------------------- sidebar */

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  border-right: 1px solid var(--rule);
  background: var(--surface);
  z-index: 40;
}

.sidebar:focus { outline: none; }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 18px 10px;
}

.sidebar-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.group-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 20px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.group-nav::-webkit-scrollbar { width: 8px; }
.group-nav::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 4px; }
.group-nav::-webkit-scrollbar-track { background: transparent; }

.side-all,
.side-group-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.side-all { margin-bottom: 4px; }

.side-all:hover,
.side-group-btn:hover { background: rgba(240, 214, 210, 0.45); }

.side-all.is-active,
.side-group-btn.is-active {
  background: var(--rose);
  color: var(--red);
}

.side-all.is-active .side-label,
.side-group-btn.is-active .side-name { font-weight: 700; }

.side-label,
.side-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-count {
  flex: none;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.side-all.is-active .side-count,
.side-group-btn.is-active .side-count { color: var(--red); opacity: 0.75; }

.side-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--group, var(--red));
}

.side-group { margin-top: 2px; }

.side-group-row { display: flex; align-items: center; gap: 2px; }

.side-chevron {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.25s var(--ease), color 0.2s;
}

.side-chevron:hover { color: var(--red); }
.side-chevron[aria-expanded="false"] { transform: rotate(-90deg); }
.side-chevron svg { display: block; }

.side-members {
  margin: 2px 0 6px 18px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--rule);
  list-style: none;
}

.side-group:not(.is-expanded) .side-members { display: none; }

.side-student {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-soft);
  text-decoration: none;
}

.side-student:hover { background: #fff; color: var(--red); }

.side-student.is-current { color: var(--red); font-weight: 600; }

.side-student .side-local {
  flex: none;
  font-size: 10.5px;
  color: var(--muted);
}

.sidebar-foot {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule);
}

.sidebar-foot a {
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.sidebar-foot a:hover { color: var(--red); border-color: var(--rose); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 12, 12, 0.45);
}

/* ----------------------------------------------------------------- main */

.main { min-width: 0; }

.main-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 40px) clamp(18px, 3.6vw, 44px) 48px;
}

.page-head { margin-bottom: 22px; }

.page-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.page-eyebrow::before {
  content: "";
  flex: none;
  width: 22px;
  height: 1px;
  background: currentColor;
}

.page-title {
  margin: 0;
  font-size: clamp(27px, 3.2vw, 36px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.page-sub {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* --------------------------------------------------------------- toolbar */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: #fff;
  border-bottom: 1px solid var(--rule);
}

.search {
  position: relative;
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(176, 1, 1, 0.12);
}

.search-icon { flex: none; color: var(--muted); }

.search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: #8a7f7c; opacity: 1; }

.search-clear {
  flex: none;
  padding: 2px 4px;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.search-clear:hover { color: var(--ink); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.chip {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chip:hover { border-color: var(--red); color: var(--red); }

.chip[aria-pressed="true"] {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
}

.chip .chip-count {
  margin-left: 5px;
  font-size: 10px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.text-btn {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  font: inherit;
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--red);
  cursor: pointer;
}

.text-btn:hover { color: var(--red-deep); }

.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.list-meta p { margin: 0; }
.list-meta .text-btn { text-transform: none; letter-spacing: 0.01em; }

.list-meta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.select-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.select-inline select {
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background-color: #fff;
  font: inherit;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.select-inline select:hover { border-color: var(--red); }

/* ---------------------------------------------------------------- rows */

.students { border-top: 1px solid var(--rule); }

.level-section + .level-section { margin-top: 8px; }

.level-heading {
  position: sticky;
  top: 63px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 2px 8px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.level-heading .level-count {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.student-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 16px;
  grid-template-areas: "avatar info meta arrow";
  align-items: center;
  gap: 16px;
  padding: 16px 6px 16px 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s var(--ease);
}

.student-row:hover { background: #fffaf8; }

.avatar {
  grid-area: avatar;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--rose);
  color: var(--red);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.student-info {
  grid-area: info;
  min-width: 0;
}

.student-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 7px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.2s;
}

.student-row:hover .student-name { color: var(--red); }

.student-name .name-local,
.student-name .name-alias {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.student-sub {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  color: #6b5f5d;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.student-sub .sep { padding: 0 6px; color: var(--rule-strong); }

.student-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.badge.is-selected {
  border-color: var(--rose);
  background: rgba(240, 214, 210, 0.45);
  color: var(--red);
}

.meta-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.group-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--group, var(--muted));
}

.group-tag i {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--group, var(--muted));
}

.row-arrow {
  grid-area: arrow;
  display: flex;
  justify-content: flex-end;
  color: var(--rule-strong);
  transition: color 0.2s, transform 0.2s;
}

.student-row:hover .row-arrow { color: var(--red); transform: translateX(2px); }

/* --------------------------------------------------------------- dialog */

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.profile-modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 14, 14, 0.55);
  backdrop-filter: blur(2px);
}

.modal-sheet {
  position: relative;
  width: min(1000px, 100%);
  max-height: min(88vh, 1200px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 6px;
  background: #fff;
  color: var(--ink-soft);
  box-shadow: 0 30px 80px rgba(20, 12, 12, 0.35);
}

.modal-sheet:focus { outline: none; }
.profile-modal.is-open .modal-sheet { animation: modal-in 0.24s var(--ease); }


@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to { opacity: 1; transform: none; }
}

.modal-top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--rule);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 18px;
}

.modal-id {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.modal-id .avatar {
  grid-area: auto;
  width: 54px;
  height: 54px;
  font-size: 16px;
  flex: none;
}

.modal-eyebrow {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.modal-name {
  margin: 0;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.modal-sub .sep { padding: 0 6px; color: var(--rule-strong); }

.modal-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: #fff;
  font-size: 21px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.modal-close:hover {
  color: var(--red);
  border-color: var(--rose);
  background: var(--surface);
}

.modal-body { padding: 22px 28px 40px; }

.profile-headline {
  max-width: 70ch;
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(24px, 3.4vw, 44px);
}

.profile-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.block h4 {
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.block p {
  margin: 0;
  font-size: 13.4px;
  line-height: 1.62;
  color: var(--ink-soft);
}

.lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lines li {
  position: relative;
  padding-left: 14px;
  font-size: 13.4px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.lines li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--rule-strong);
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-org {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: pretty;
}

.entry-role {
  margin: 1px 0 0;
  font-size: 13.6px;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-soft);
}

.entry-dates {
  margin: 3px 0 0;
  font-size: 11.8px;
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry-body {
  margin: 6px 0 0;
  font-size: 13.2px;
  line-height: 1.6;
  color: var(--muted);
}

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.edu-school {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: pretty;
}

.edu-programme {
  margin: 1px 0 0;
  font-size: 13.4px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.edu--no-school .edu-programme {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.edu-minor {
  margin: 2px 0 0;
  font-size: 12.6px;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
}

.edu-meta {
  margin: 4px 0 0;
  font-size: 11.8px;
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.edu-note {
  margin: 4px 0 0;
  font-size: 12.4px;
  line-height: 1.55;
  color: var(--muted);
}

.extra-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 0;
}

.extra-list dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.extra-list dd {
  margin: 0 0 5px;
  font-size: 13.2px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.profile-tags span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 3px;
  background: rgba(240, 214, 210, 0.45);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

/* ---------------------------------------------------------------- about */

.about {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 80px;
}

.about-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.about-body { max-width: 70ch; }

.about-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.about-body p + p { margin-top: 10px; }

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

.site-footer {
  padding: 30px 0;
  background: #000;
  color: #fff;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 28px);
}

.footer-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo { height: 26px; width: auto; flex: none; }

.footer-org {
  max-width: 70ch;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.footer-managed {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

/* --------------------------------------------------------- states & misc */

.load-error,
.empty {
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--rule);
}

.load-error h3,
.empty h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 500;
}

.load-error p,
.empty p {
  max-width: 60ch;
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: var(--red-bright);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--red-deep); }

.noscript {
  margin: 0;
  padding: 20px;
  background: var(--rose);
  color: var(--ink);
  text-align: center;
  font-size: 14px;
}

/* ----------------------------------------------------------- CJK tuning */

:lang(zh) .page-title { letter-spacing: 0; line-height: 1.22; }
:lang(zh) .page-eyebrow,
:lang(zh) .modal-eyebrow,
:lang(zh) .block h4 { letter-spacing: 0.1em; text-transform: none; }
:lang(zh) .student-name,
:lang(zh) .modal-name,
:lang(zh) .sidebar-title,
:lang(zh) .about-title { letter-spacing: 0; }
:lang(zh) .entry-body,
:lang(zh) .edu-programme,
:lang(zh) .edu-note,
:lang(zh) .lines li,
:lang(zh) .block p { font-size: 13.8px; line-height: 1.75; }

/* --------------------------------------------------------- breakpoints */

@media (max-width: 1180px) {
  :root { --sidebar-w: 272px; }
}

@media (max-width: 900px) {
  :root { --header-h: 60px; }

  .app { display: block; min-height: 0; }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 350px);
    height: 100dvh;
    z-index: 70;
    border-right: 1px solid var(--rule);
    box-shadow: 0 20px 60px rgba(20, 12, 12, 0.28);
    transform: translateX(-103%);
    transition: transform 0.28s var(--ease);
  }

  .sidebar.is-open { transform: none; }

  .sidebar:focus { outline: none; }

.sidebar-head { padding-top: 16px; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }

  .menu-btn { display: inline-flex; }

  .brand-event { display: none; }
  .header-label { display: none; }

  .main-inner { max-width: none; padding: 22px 18px 40px; }

  .toolbar { position: static; }

  .student-row {
    grid-template-columns: 40px minmax(0, 1fr) 14px;
    grid-template-areas:
      "avatar info arrow"
      "avatar meta arrow";
    row-gap: 5px;
    align-items: start;
  }

  .avatar { width: 40px; height: 40px; font-size: 12.5px; }

  .student-meta { flex-wrap: wrap; gap: 4px 10px; white-space: normal; }

  .profile-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }

  .level-heading { position: static; }

  .profile-modal { padding: 0; }

  .modal-sheet {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .modal-head { padding: 16px 16px 12px; }
  .modal-id .avatar { width: 46px; height: 46px; font-size: 14px; }
  .modal-name { font-size: 21px; }
  .modal-body { padding: 18px 16px 36px; }
}

@media (max-width: 640px) {
  .page-eyebrow { margin-bottom: 8px; }

  .list-meta { flex-wrap: wrap; gap: 8px; }

  .select-inline { gap: 6px; }
  .select-inline select { font-size: 16px; height: 34px; }
  .page-title { font-size: 26px; }

  .search { flex-basis: 100%; }
  .search input { font-size: 16px; }

  .chips {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
  }
  .chips::-webkit-scrollbar { display: none; }

  .student-meta .meta-count { display: none; }
  .student-meta .badge.is-selected { display: none; }

  .modal-head { align-items: flex-start; }
  .modal-name { font-size: 19px; }
  .modal-sub { font-size: 12px; }

  .footer-main { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 420px) {
  .brand-logo { height: 26px; }
  .modal-id { gap: 12px; }
  .modal-id .avatar { width: 42px; height: 42px; }
}

/* ------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------- print */

@media print {
  .site-header,
  .sidebar,
  .scrim,
  .toolbar,
  .page-head,
  .list-meta,
  .about,
  .site-footer,
  .skip-link,
  .modal-close { display: none !important; }

  body { background: #fff; color: #000; font-size: 10.5pt; }

  /* Printing a profile prints that profile, not the list behind it. */
  body.profile-open .app,
  body.profile-open .site-footer { display: none !important; }

  .app { display: block; }
  .main-inner { max-width: none; padding: 0; }
  .students { border-top: 0; }
  .student-row { break-inside: avoid; }

  .profile-modal:not([hidden]) {
    position: static;
    display: block;
    padding: 0;
  }

  .profile-modal:not([hidden]) .modal-backdrop { display: none !important; }

  .profile-modal:not([hidden]) .modal-sheet {
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
  }

  .profile-modal:not([hidden]) .modal-top { position: static; border-bottom: 1px solid #ccc; }

  .modal-head { padding: 0 0 10pt; }
  .modal-body { padding: 0; }

  .profile-grid { grid-template-columns: 1fr 1.6fr; gap: 18pt; }
  .profile-headline { font-size: 10.5pt; }
  .entry-body,
  .lines li,
  .block p { color: #222; }
}
