/* ===== NYU Perstare (official NYU typeface) ===== */
@font-face {
  font-family: "NYU Perstare Condensed";
  src: url("fonts/NYUPerstareCondensed-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NYU Perstare";
  src: url("fonts/NYUPerstare-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NYU Perstare";
  src: url("fonts/NYUPerstare-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NYU Perstare";
  src: url("fonts/NYUPerstare-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===== Tokens ===== */
:root {
  --nyu-violet: #57068C;
  --nyu-violet-dark: #3D0561;
  --nyu-violet-soft: #F3ECF8;
  --ink: #19141F;
  --paper: #F5F3F7;
  --surface: #FFFFFF;
  --surface-2: #FAF8FB;
  --border: #E4DEEA;
  --muted: #6E6577;
  --good: #1E8E5A;
  --good-soft: #E6F5EE;
  --warn: #B7791F;
  --warn-soft: #FBF1E0;
  --shadow: 0 1px 2px rgba(25,20,31,.06), 0 10px 28px -16px rgba(25,20,31,.28);
  --radius: 10px;
  --font-headline: "NYU Perstare Condensed", Arial Narrow, sans-serif;
  --font-display: "NYU Perstare", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--nyu-violet); outline-offset: 2px; }

/* ===== Top bar (NYU-style) ===== */
.topbar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--nyu-violet); color: #fff;
  padding: 12px 28px;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.topbar-logo { height: 36px; width: auto; display: block; }
.topbar-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.topbar-title em { font-style: normal; font-weight: 400; opacity: .85; }
.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-nav a {
  text-decoration: none; color: rgba(255,255,255,.85); font-size: 13.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; transition: background .15s, color .15s;
}
.topbar-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-nav a.is-active { background: #fff; color: var(--nyu-violet); }
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 7px 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35);
  background: transparent; color: #fff; cursor: pointer;
}
.pill-btn:hover { background: rgba(255,255,255,.12); }
.pill-btn.solid { background: #fff; color: var(--nyu-violet); border-color: #fff; }
.pill-btn.solid:hover { background: #F0E6F7; }
.topbar-email { font-size: 12.5px; color: rgba(255,255,255,.75); font-family: var(--font-mono); }

/* ===== Hero photo (landing page) ===== */
.hero {
  width: 100%; height: 320px; overflow: hidden; position: relative;
  border-bottom: 4px solid var(--nyu-violet);
}
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 74%; display: block; }
@media (max-width: 700px) { .hero { height: 190px; } }

/* ===== Page shell ===== */
.page { max-width: 1080px; margin: 0 auto; padding: 34px 28px 70px; }
.eyebrow { margin: 0; color: var(--nyu-violet); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.page-title {
  font-family: var(--font-display); font-weight: 900; font-size: 36px; line-height: 1.08;
  letter-spacing: -.02em; margin: 6px 0 8px; color: var(--ink);
}
.lede { margin: 6px 0 26px; color: var(--ink); font-size: 15px; max-width: 64ch; line-height: 1.6; }
.lede.muted { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
h2.section-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.section { margin-bottom: 42px; }
.section-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* ===== Banners / flash ===== */
.banner {
  display: block; padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 20px;
  border: 1px solid var(--border);
}
.banner-good { background: var(--good-soft); color: #146643; border-color: #BFE6D3; }
.banner-warn { background: var(--warn-soft); color: #8A5A14; border-color: #EFD9A6; }
.banner-error { background: #FBEAEA; color: #97281F; border-color: #F0C4C0; }
.banner strong { font-weight: 700; }

/* ===== Stat tiles ===== */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 6px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.stat-value { font-family: var(--font-mono); font-size: 30px; font-weight: 600; margin-top: 6px; color: var(--ink); }
.stat-value.accent { color: var(--nyu-violet); }
.stat-caption { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ===== Card / table ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: 13.3px; vertical-align: middle; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--nyu-violet); font-weight: 700; background: var(--nyu-violet-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.is-matched { opacity: .55; }
td.name-cell strong { display: block; font-size: 13.6px; }
td.name-cell span { font-size: 11.5px; color: var(--muted); }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--nyu-violet-soft); color: var(--nyu-violet); border: 1px solid #DCC7EA;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; max-width: 230px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chip-more { font-size: 11px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-matched { background: var(--good-soft); color: var(--good); }

input[type="radio"].row-radio { width: 16px; height: 16px; accent-color: var(--nyu-violet); }

/* ===== Buttons ===== */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 8px; padding: 10px 18px;
  font-size: 13.8px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
}
.btn-primary { background: var(--nyu-violet); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--nyu-violet-dark); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }

.match-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; flex-wrap: wrap; }
.match-bar-hint { font-size: 12.5px; color: var(--muted); }
.empty-state { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ===== Forms ===== */
.auth-card { max-width: 420px; margin: 40px auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; padding: 22px; }
.form-grid.single { grid-template-columns: 1fr; max-width: 420px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--nyu-violet); }
.field textarea { resize: vertical; min-height: 70px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 14px; }
.check-item { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.check-item input { accent-color: var(--nyu-violet); width: 16px; height: 16px; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding-top: 6px; flex-wrap: wrap; }
.form-actions .hint { font-size: 11.5px; color: var(--muted); }
.form-error { color: #97281F; font-size: 12.5px; margin: -8px 0 4px; }

/* ===== Profile / connection ===== */
.profile-card { display: flex; justify-content: space-between; gap: 20px; padding: 22px; flex-wrap: wrap; }
.profile-main strong { font-size: 17px; }
.profile-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.profile-bio { margin-top: 10px; font-size: 13.5px; max-width: 48ch; }

.connection-card { padding: 24px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.connection-avatar {
  width: 54px; height: 54px; border-radius: 50%; background: var(--nyu-violet-soft); color: var(--nyu-violet);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700;
  font-size: 19px; flex-shrink: 0;
}
.connection-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ===== Landing chooser ===== */
.chooser-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 22px; }
.chooser-card {
  display: flex; flex-direction: column; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.chooser-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(67,22,107,.35); }
.chooser-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--nyu-violet); }
.chooser-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 6px 0 8px; }
.chooser-desc { font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; }
.chooser-cta { margin-top: 18px; justify-content: center; text-decoration: none; }
.chooser-login {
  display: block; text-align: center; margin-top: 10px; font-size: 12px; font-weight: 600;
  color: var(--nyu-violet); text-decoration: none;
}
.chooser-login:hover { text-decoration: underline; }

/* ===== License usage ===== */
.license-panel { padding: 18px 20px; margin-bottom: 14px; }
.license-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.license-head strong { font-size: 15px; }
.license-count { font-family: var(--font-mono); font-size: 15px; color: var(--nyu-violet); font-weight: 600; }
.license-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.license-bar-fill { height: 100%; background: var(--nyu-violet); border-radius: 999px; transition: width .3s; }
.license-bar-fill.is-warn { background: var(--warn); }
.license-bar-fill.is-over { background: #C0392B; }
.license-caption { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ===== Chat / conversation ===== */
.chat-thread { max-height: 380px; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.chat-msg { display: flex; }
.chat-msg-mine { justify-content: flex-end; }
.chat-bubble { max-width: 72%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.chat-msg-mine .chat-bubble { background: var(--nyu-violet-soft); border-color: #DCC7EA; }
.chat-sender { font-size: 10.5px; font-weight: 700; color: var(--nyu-violet); margin-bottom: 2px; text-transform: uppercase; letter-spacing: .03em; }
.chat-body { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-time { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: right; }
.chat-compose { display: flex; gap: 10px; padding: 14px 18px; align-items: flex-end; }
.chat-compose textarea {
  flex: 1; min-height: 44px; max-height: 140px; resize: vertical; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13.5px;
}
.chat-compose textarea:focus { border-color: var(--nyu-violet); }

/* ===== Timeline ===== */
.timeline { list-style: none; margin: 0; padding: 6px 4px; }
.timeline-item {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 14px; align-items: start;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--muted); }
.timeline-dot-registered { background: var(--nyu-violet); }
.timeline-dot-matched { background: var(--good); }
.timeline-dot-profile_updated { background: var(--warn); }
.timeline-dot-meeting_scheduled { background: #2B6CB0; }
.timeline-label { font-weight: 700; font-size: 13.5px; }
.timeline-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.timeline-time { font-size: 11.5px; color: var(--muted); text-align: right; line-height: 1.4; white-space: nowrap; }

.site-footer { border-top: 1px solid var(--border); margin-top: 8px; }
.footer-brand {
  max-width: 1080px; margin: 0 auto; padding: 22px 28px 4px; font-size: 12px; font-weight: 600; color: var(--ink);
}
.footer-brand a { color: var(--nyu-violet); text-decoration: none; }
.footer-brand a:hover { text-decoration: underline; }
.disclaimer { max-width: 1080px; margin: 0 auto; padding: 0 28px 24px; font-size: 10.5px; color: var(--muted); }

@media (max-width: 860px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .chooser-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .page { padding: 26px 16px 56px; }
}
