/* ============================================================
   Professor Portfolio — design system
   Type: Space Grotesk (display) · IBM Plex Sans (body) · IBM Plex Mono (labels)
   ============================================================ */

:root {
  /* accent hue is swappable via Tweaks (navy default) */
  --accent-h: 255;
  --accent-c: 0.105;
  --accent-l: 0.42;

  --bg: oklch(0.985 0.004 250);
  --surface: #ffffff;
  --surface-2: oklch(0.974 0.005 250);
  --surface-3: oklch(0.962 0.006 250);

  --ink: oklch(0.245 0.022 262);
  --ink-2: oklch(0.40 0.02 262);
  --muted: oklch(0.55 0.016 262);
  --faint: oklch(0.70 0.012 262);

  --line: oklch(0.912 0.006 262);
  --line-2: oklch(0.86 0.008 262);

  --accent: oklch(var(--accent-l) var(--accent-c) var(--accent-h));
  --accent-strong: oklch(0.34 var(--accent-c) var(--accent-h));
  --accent-soft: oklch(0.955 0.02 var(--accent-h));
  --accent-line: oklch(0.88 0.03 var(--accent-h));
  --on-accent: #ffffff;

  --ok: oklch(0.52 0.10 155);
  --warn: oklch(0.62 0.12 70);
  --danger: oklch(0.55 0.16 25);
  --danger-soft: oklch(0.96 0.02 25);

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-1: 0 1px 2px oklch(0.3 0.02 262 / 0.06), 0 1px 1px oklch(0.3 0.02 262 / 0.04);
  --shadow-2: 0 4px 16px oklch(0.3 0.03 262 / 0.08), 0 1px 3px oklch(0.3 0.02 262 / 0.06);
  --shadow-3: 0 18px 50px oklch(0.25 0.04 262 / 0.18), 0 4px 14px oklch(0.25 0.03 262 / 0.10);

  --maxw: 1180px;
  --density: 1;

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: oklch(0.205 0.018 262);
  --surface: oklch(0.245 0.02 262);
  --surface-2: oklch(0.275 0.02 262);
  --surface-3: oklch(0.30 0.022 262);
  --ink: oklch(0.95 0.006 262);
  --ink-2: oklch(0.82 0.012 262);
  --muted: oklch(0.66 0.016 262);
  --faint: oklch(0.52 0.016 262);
  --line: oklch(0.34 0.02 262);
  --line-2: oklch(0.40 0.022 262);
  --accent: oklch(0.72 0.11 var(--accent-h));
  --accent-strong: oklch(0.80 0.10 var(--accent-h));
  --accent-soft: oklch(0.32 0.06 var(--accent-h));
  --accent-line: oklch(0.42 0.06 var(--accent-h));
  --on-accent: oklch(0.18 0.02 262);
  --danger-soft: oklch(0.30 0.06 25);
  --shadow-2: 0 4px 16px oklch(0 0 0 / 0.4), 0 1px 3px oklch(0 0 0 / 0.3);
  --shadow-3: 0 18px 50px oklch(0 0 0 / 0.55), 0 4px 14px oklch(0 0 0 / 0.4);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

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

/* ---------- shared utility type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.eyebrow.no-rule::before { display: none; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: calc(40px * var(--density)); }
.section-head h2 { font-size: clamp(26px, 3.4vw, 40px); }
.section-head .sub { color: var(--muted); max-width: 60ch; font-size: 16px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand .mark {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 16px;
  letter-spacing: -0.02em;
}
.brand .who { display: flex; flex-direction: column; line-height: 1.15; }
.brand .who b { font-family: var(--display); font-size: 15px; font-weight: 600; }
.brand .who span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  font-size: 14px; color: var(--ink-2); padding: 8px 12px; border-radius: var(--radius);
  position: relative; transition: color .15s, background .15s; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent);
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px; gap: 2px; box-shadow: var(--shadow-2);
  }
  .nav-links.open a.active::after { display: none; }
  .nav-toggle { display: inline-grid; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-subtle { background: var(--surface-2); color: var(--ink); }
.btn-subtle:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* icon buttons in tables */
.icon-act {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-act:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-act.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ============================================================
   BADGES / CHIPS / TAGS
   ============================================================ */
.badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line-2);
  color: var(--ink-2); background: var(--surface); display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; text-transform: uppercase;
}
.badge.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }

.tag {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}

.chip {
  font-family: var(--sans); font-size: 13px; color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  cursor: pointer; transition: all .14s; white-space: nowrap;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip .count { font-family: var(--mono); font-size: 11px; opacity: .7; margin-left: 4px; }

/* ============================================================
   CARDS / SURFACES
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 24px; }

/* placeholder for imagery */
.ph {
  position: relative; overflow: hidden; background: var(--surface-2);
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 9px,
    color-mix(in oklch, var(--line) 70%, transparent) 9px,
    color-mix(in oklch, var(--line) 70%, transparent) 10px);
  border: 1px solid var(--line); display: grid; place-items: center;
}
.ph span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  background: var(--surface); padding: 4px 10px; border-radius: 3px; border: 1px solid var(--line); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   FORMS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field .req { color: var(--danger); }
.input, .select, .textarea {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.field .hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px){ .form-grid { grid-template-columns: 1fr; } }

/* ============================================================
   MODAL
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 200; background: oklch(0.22 0.02 262 / 0.42);
  backdrop-filter: blur(3px); display: grid; place-items: start center; padding: 48px 20px;
  overflow-y: auto; animation: fade .16s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  width: 100%; max-width: 640px; box-shadow: var(--shadow-3); animation: pop .18s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 19px; }
.modal-head .eyebrow { margin-bottom: 4px; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-height: 64vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ============================================================
   TABLE (admin)
   ============================================================ */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; overflow-y: hidden; background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
/* Make the Actions column sticky on the right so it's always visible */
.tbl th:last-child, .tbl td:last-child { position: sticky; right: 0; background: var(--surface); width: 90px; min-width: 90px; box-shadow: -8px 0 12px -8px rgba(0,0,0,0.08); }
.tbl thead th:last-child { background: var(--surface-2); }
.tbl tbody tr:hover td:last-child { background: var(--surface-2); }
.tbl thead th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td .t-title { color: var(--ink); font-weight: 500; }
.tbl .right { text-align: right; }
.tbl .acts { display: inline-flex; gap: 4px; justify-content: flex-end; }
.tbl .yr { font-family: var(--mono); color: var(--ink-2); }
.tbl .cell-trunc { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td .t-title { display: inline-block; }

/* ============================================================
   ANIMATIONS / MOTION
   ============================================================ */
/* Entrance animates TRANSFORM ONLY (never opacity) so a frozen/never-running
   animation still leaves content fully visible. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: reveal .6s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes reveal { from { transform: translateY(16px); } to { transform: none; } }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); margin-top: 96px; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; padding: 40px 0; flex-wrap: wrap; }
.footer .mono { font-size: 12.5px; color: var(--muted); }

/* empty state */
.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty .mono { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* scrollbar polish */
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 14px; padding: 12px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-3); z-index: 300; display: flex; align-items: center; gap: 10px;
  animation: pop .2s ease;
}
