/* ==========================================================================
   OpportunityHub, design system
   Warm premium palette · glass surfaces · heavy tactile UI
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  --bg: #f4ecde;
  --bg-2: #ece0cc;
  --surface: rgba(252, 247, 239, 0.72);
  --surface-strong: #fbf6ec;
  --border: rgba(92, 64, 40, 0.12);
  --border-strong: rgba(92, 64, 40, 0.2);

  --text: #2c2014;
  --muted: #66553f;
  --faint: #705d46;

  --accent: #a14f1d;
  --accent-hover: #8a4318;
  --accent-soft: rgba(161, 79, 29, 0.12);
  --accent-ink: #fff8f0;

  --success: #446f41;
  --danger: #b3402e;
  --warning: #8a6510;
  --info: #7a5c34;

  --shadow-sm: 0 1px 2px rgba(80, 50, 20, 0.06), 0 2px 8px rgba(80, 50, 20, 0.05);
  --shadow-md: 0 2px 6px rgba(80, 50, 20, 0.07), 0 12px 28px rgba(80, 50, 20, 0.09);
  --shadow-lg: 0 4px 12px rgba(80, 50, 20, 0.08), 0 24px 60px rgba(80, 50, 20, 0.14);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --ease: cubic-bezier(0.22, 0.9, 0.3, 1);
  --t-fast: 150ms;
  --t: 190ms;
  --t-slow: 220ms;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --nav-h: 68px;
}

[data-theme="dark"] {
  --bg: #1b1310;
  --bg-2: #241a13;
  --surface: rgba(42, 31, 23, 0.6);
  --surface-strong: #2a1f17;
  --border: rgba(244, 234, 220, 0.11);
  --border-strong: rgba(244, 234, 220, 0.2);

  --text: #f4eadc;
  --muted: #a8937d;
  --faint: #95836e;

  --accent: #e08a4e;
  --accent-hover: #eda06a;
  --accent-soft: rgba(224, 138, 78, 0.14);
  --accent-ink: #241407;

  --success: #8db97f;
  --danger: #e08573;
  --warning: #e3b852;
  --info: #cdaa72;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Contrast: light-mode text tokens above are tuned to meet WCAG AA (4.5:1)
   against --bg, --bg-2 and --surface-strong. */

/* ---------- 2. Reset ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

/* The [hidden] attribute must always win over display:flex/grid utility
   classes on the same element (e.g. .field, .side-row toggled by JS). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* ---------- 3. Ambient background ---------------------------------------- */
.bg-layer {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1100px 600px at 85% -10%, var(--bg-2), transparent 60%),
    radial-gradient(900px 700px at -10% 40%, var(--bg-2), transparent 55%),
    var(--bg);
  transition: background var(--t-slow) var(--ease);
}

.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
}
.blob.b1 { width: 520px; height: 520px; top: -160px; right: -80px;
  background: radial-gradient(circle at 30% 30%, #f5cfa6, transparent 70%); }
.blob.b2 { width: 460px; height: 460px; top: 42%; left: -180px;
  background: radial-gradient(circle at 60% 40%, #f3ddbd, transparent 70%); }
.blob.b3 { width: 380px; height: 380px; bottom: -120px; right: 18%;
  background: radial-gradient(circle at 40% 60%, #ecc9a8, transparent 70%); }

[data-theme="dark"] .blob.b1 { background: radial-gradient(circle at 30% 30%, #4a2f1c, transparent 70%); }
[data-theme="dark"] .blob.b2 { background: radial-gradient(circle at 60% 40%, #3d2a1a, transparent 70%); }
[data-theme="dark"] .blob.b3 { background: radial-gradient(circle at 40% 60%, #45301d, transparent 70%); }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.35;
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 10%, transparent 75%);
}

.bg-noise {
  position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 4. Typography ------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 550; line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.02rem; font-weight: 650; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }

.lede { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- 5. Layout ------------------------------------------------------ */
.container { width: min(1180px, 100% - 48px); margin-inline: auto; }
.section { padding: 88px 0; }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 44px; }
.section-head.row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---------- 6. Glass & cards ---------------------------------------------- */
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
          backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border);
}

.card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease);
}
a.card:hover, .card.lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* ---------- 7. Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; line-height: 1.2;
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease),
              background var(--t) var(--ease), border-color var(--t) var(--ease),
              color var(--t) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.97); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(80, 40, 10, 0.25), 0 8px 20px rgba(194, 102, 45, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 2px 4px rgba(80, 40, 10, 0.25), 0 12px 28px rgba(194, 102, 45, 0.38),
              inset 0 1px 0 rgba(255, 255, 255, 0.25); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px) scale(0.97); }

.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: var(--accent); color: var(--accent-ink); }

.btn-ghost { border-color: var(--border-strong); background: transparent; }
.btn-ghost:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }

.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: rgba(179, 64, 46, 0.1); }

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease),
              border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- 8. Forms -------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* Show/hide password button inside password boxes (added by main.js) */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.textarea { resize: vertical; min-height: 110px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7861' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.field-error { color: var(--danger); font-size: 0.8rem; }

/* Password strength meter + rules checklist (sign-up, change password) */
.pw-meter { display: grid; gap: 8px; margin-top: -4px; }
.pw-bar { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 200ms var(--ease), background-color 200ms var(--ease); }
.pw-strength { font-size: 0.8rem; font-weight: 650; color: var(--muted); min-height: 1.2em; }
.pw-meter:not([data-level]) .pw-bar, .pw-meter:not([data-level]) .pw-strength { display: none; }
.pw-meter[data-level="weak"] .pw-bar span { width: 33%; background: var(--danger); }
.pw-meter[data-level="medium"] .pw-bar span { width: 66%; background: var(--warning); }
.pw-meter[data-level="strong"] .pw-bar span { width: 100%; background: var(--success); }
.pw-meter[data-level="weak"] .pw-strength { color: var(--danger); }
.pw-meter[data-level="medium"] .pw-strength { color: var(--warning); }
.pw-meter[data-level="strong"] .pw-strength { color: var(--success); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 0.8rem; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; flex-shrink: 0; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before { background: currentColor; }
@media (max-width: 420px) { .pw-rules { grid-template-columns: 1fr; } }

.input-error, .editor-title.input-error, .editor-body.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(179, 64, 46, 0.13) !important;
}
.editor-title.input-error { border: 1px solid var(--danger); border-radius: var(--r-sm); padding: 4px 10px; }

.req { color: var(--danger); font-weight: 700; }
.check {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: var(--text);
  cursor: pointer; user-select: none;
}
/* Custom tick box */
.check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  position: relative; flex-shrink: 0;
  width: 20px; height: 20px; margin: 0;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-strong);
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
              transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.check:hover input[type="checkbox"] { border-color: var(--accent); }
.check input[type="checkbox"]:checked {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(194, 102, 45, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
/* The tick */
.check input[type="checkbox"]::after {
  content: ""; position: absolute;
  left: 6px; top: 2.5px; width: 5px; height: 10px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0;
  border-radius: 1px;
  transform: rotate(45deg) scale(0);
  transition: transform 160ms var(--spring);
}
.check input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.check input[type="checkbox"]:active { transform: scale(0.88); }
.check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* In the opportunity editor, each toggle is its own tidy row */
.side-group .check {
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 550;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.side-group .check:hover { border-color: var(--border-strong); background: var(--surface-strong); }
.side-group .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 9. Navbar -------------------------------------------------------- */
.nav-wrap {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: min(1180px, 100%);
  padding: 9px 12px 9px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-slow) var(--ease), background var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}
.nav.scrolled { box-shadow: var(--shadow-md); }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin-right: 10px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #e0a05e);
  color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px rgba(194,102,45,.35);
  font-family: var(--font-display); font-size: 1.05rem;
}
.logo-mark-img {
  object-fit: cover;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}
.logo b { font-weight: 750; }
.logo span.thin { font-weight: 450; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-links a {
  padding: 8px 13px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 550; color: var(--muted);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }
.nav-links a:active { transform: scale(0.95); }

.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.bell { position: relative; }
.bell .dot {
  position: absolute; top: 7px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  font-size: 0.62rem; font-weight: 700; line-height: 16px; text-align: center;
}

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-2), var(--accent-soft));
  border: 1px solid var(--border-strong);
  color: var(--accent); font-weight: 700; font-size: 0.82rem;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; }

/* Profile picture: change button + crop modal */
.pfp-wrap { position: relative; border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; flex-shrink: 0; }
.pfp-overlay {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(20, 12, 6, 0.5); color: #fff; font-size: 0.72rem; font-weight: 650;
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.pfp-wrap:hover .pfp-overlay { opacity: 1; }

.crop-modal-backdrop {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(20, 12, 6, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px; animation: fadeIn 0.2s var(--ease);
}
.crop-modal-backdrop[hidden] { display: none; }
.crop-modal {
  width: 100%; max-width: 380px; text-align: center;
  padding: 26px 26px 22px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: subPrefsIn 0.26s var(--ease);
}
.crop-modal h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; }
.crop-modal > p { margin: 4px 0 16px; }
.crop-stage {
  width: 240px; height: 240px; border-radius: 50%; margin: 0 auto; overflow: hidden;
  background-color: var(--bg-2); background-repeat: no-repeat; background-position: center; background-size: 100%;
  border: 2px solid var(--border-strong); cursor: grab; user-select: none; touch-action: none;
}
.crop-stage.dragging { cursor: grabbing; }
.crop-zoom-row { display: flex; align-items: center; gap: 10px; margin: 18px 4px 4px; }
.crop-actions { display: flex; gap: 10px; margin-top: 20px; }
.crop-actions .btn { flex: 1; }
.av-range { width: 100%; accent-color: var(--accent); cursor: pointer; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 220px; padding: 8px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  z-index: 110;
}
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 10px;
  font-size: 0.88rem; font-weight: 550; color: var(--text); text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--accent-soft); }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown-menu .who { padding: 8px 12px 4px; }
.dropdown-menu .who b { display: block; font-size: 0.9rem; }
.dropdown-menu .who span { font-size: 0.76rem; color: var(--muted); }

.hamburger { display: none; }

.mobile-menu {
  position: fixed; top: 82px; left: 20px; right: 20px; z-index: 99;
  border-radius: var(--r-lg); padding: 12px;
  box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; gap: 2px;
}
.mobile-menu.open { display: flex; animation: pop-in var(--t-slow) var(--ease); }
.mobile-menu a { padding: 12px 16px; border-radius: 12px; font-weight: 550; }
.mobile-menu a:hover { background: var(--accent-soft); }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

main { padding-top: calc(var(--nav-h) + 28px); min-height: 72vh; }

/* ---------- 10. Hero --------------------------------------------------------- */
.hero { padding: 72px 0 40px; text-align: center; position: relative; }
.hero-badges {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 28px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.hero-badge.badge-students {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent;
}
.hero-badge .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(77, 124, 74, 0.5); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(77, 124, 74, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(77, 124, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(77, 124, 74, 0); }
}

.hero h1 { max-width: 17ch; margin: 0 auto 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin: 0 auto 40px; }

.hero-search { max-width: 640px; margin: 0 auto 18px; position: relative; }
.hero-search form {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.hero-search form:focus-within { box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft); border-color: var(--accent); }
.hero-search input {
  flex: 1; border: none; background: none; outline: none; font-size: 1rem; min-width: 0;
}
.hero-search .search-ico { color: var(--muted); flex-shrink: 0; }

.suggest {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 50;
  border-radius: var(--r-md); padding: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  text-align: left;
}
.suggest.open { opacity: 1; transform: none; pointer-events: auto; }
.suggest .s-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.suggest .s-item:hover, .suggest .s-item.sel { background: var(--accent-soft); }
.suggest .s-mono {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700;
  background: linear-gradient(135deg, var(--bg-2), var(--accent-soft)); color: var(--accent);
}
.suggest .s-item b { display: block; font-size: 0.88rem; line-height: 1.3; }
.suggest .s-item span { font-size: 0.75rem; color: var(--muted); }
.suggest .s-label { padding: 6px 10px 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

.hero-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 860px; margin: 0 auto;
  border-radius: var(--r-lg); padding: 26px 12px;
  box-shadow: var(--shadow-sm);
}
.stat { text-align: center; padding: 4px 12px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat b { font-family: var(--font-display); font-size: 2rem; font-weight: 600; display: block; line-height: 1.1; }
.stat b .plus { color: var(--accent); }
.stat span { font-size: 0.8rem; color: var(--muted); font-weight: 550; }

/* ---------- 11. Chips & badges ------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.76rem; font-weight: 650;
  border: 1px solid transparent;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
a.chip:hover, button.chip:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }

.chip-neutral { background: var(--bg-2); color: var(--muted); }
.chip-outline { background: transparent; border-color: var(--border-strong); color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-published { background: rgba(77, 124, 74, 0.14); color: var(--success); }
.badge-draft { background: var(--bg-2); color: var(--muted); }
.badge-pending { background: rgba(194, 102, 45, 0.14); color: var(--accent); }
.badge-archived { background: rgba(120, 100, 80, 0.12); color: var(--faint); }
.badge-suspended { background: rgba(179, 64, 46, 0.12); color: var(--danger); }
.badge-active { background: rgba(77, 124, 74, 0.14); color: var(--success); }
.badge-submitted { background: var(--accent-soft); color: var(--accent); }
.badge-reviewing { background: rgba(138, 106, 63, 0.15); color: var(--info); }
.badge-accepted { background: rgba(77, 124, 74, 0.14); color: var(--success); }
.badge-rejected { background: rgba(179, 64, 46, 0.12); color: var(--danger); }

.deadline-chip { font-size: 0.78rem; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.deadline-chip.urgent { color: var(--danger); }
.deadline-chip.closed { color: var(--faint); }

/* ---------- 12. Opportunity cards ---------------------------------------------- */
.opp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.opp-card {
  display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
  position: relative;
}
.opp-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.opp-card:active { transform: translateY(-2px) scale(0.995); }

.opp-banner {
  height: 128px; position: relative;
  background-size: cover; background-position: center;
}
.opp-banner .banner-tint { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(30,18,8,0.18)); }

/* category gradient fallbacks for banners */
.cat-scholarship    { background: linear-gradient(120deg, #e8b184, #c96f35 60%, #a9541f); }
.cat-competition    { background: linear-gradient(120deg, #dcc394, #b98d43 60%, #8f6a2a); }
.cat-research       { background: linear-gradient(120deg, #c9b8a0, #8f7757 60%, #6b573d); }
.cat-internship     { background: linear-gradient(120deg, #e3b9a0, #b97653 60%, #8f5232); }
.cat-fellowship     { background: linear-gradient(120deg, #d8ad8e, #a86a48 60%, #7d4a2e); }
.cat-summer-program { background: linear-gradient(120deg, #ecc9a0, #d19752 60%, #a06a2f); }
.cat-other          { background: linear-gradient(120deg, #d9c2a8, #a98a63 60%, #7c6244); }
.opp-banner.cat-fallback::after {
  content: ""; position: absolute; inset: 0; opacity: 0.35;
  background-image: radial-gradient(rgba(255,255,255,0.32) 1.3px, transparent 1.3px);
  background-size: 22px 22px;
}

.opp-logo {
  position: absolute; left: 20px; bottom: -22px; z-index: 2;
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-weight: 750; font-size: 0.92rem; color: var(--accent);
  font-family: var(--font-display);
}
.opp-logo img { width: 100%; height: 100%; object-fit: cover; }

.opp-card .bookmark-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255, 253, 248, 0.85); color: #6b573d;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}
[data-theme="dark"] .opp-card .bookmark-btn { background: rgba(42, 31, 23, 0.8); color: var(--muted); }
.opp-card .bookmark-btn:hover { transform: scale(1.08); color: var(--accent); }
.opp-card .bookmark-btn:active { transform: scale(0.9); }
.bookmark-btn.on { color: var(--accent) !important; }
.bookmark-btn.on svg { fill: currentColor; }

.opp-body { padding: 34px 20px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.opp-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opp-title { font-family: var(--font-body); font-size: 1.06rem; font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.opp-card a.opp-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.opp-org { font-size: 0.82rem; color: var(--muted); font-weight: 550; }
.opp-desc { font-size: 0.87rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.opp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 20px 16px; margin-top: auto;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem; color: var(--muted);
}
.opp-foot .loc { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.opp-foot .loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.opp-card.featured-card { grid-row: span 1; }
.featured-flag {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(30, 18, 8, 0.55); color: #ffe9d2;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- 13. Category tiles / org cards -------------------------------------- */
.cat-tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 26px 22px; border-radius: var(--r-lg);
  background: var(--surface-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-tile .cat-ico {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--accent-soft); color: var(--accent);
}
.cat-tile b { font-size: 1.02rem; }
.cat-tile span { font-size: 0.8rem; color: var(--muted); }
.cat-tile .arrow { position: absolute; right: 20px; top: 26px; color: var(--faint); transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.cat-tile:hover .arrow { transform: translateX(4px); color: var(--accent); }

.org-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: var(--r-md);
  background: var(--surface-strong); border: 1px solid var(--border);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.org-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.org-mono {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center; font-weight: 750; font-family: var(--font-display);
  background: linear-gradient(135deg, var(--bg-2), var(--accent-soft)); color: var(--accent);
}
.org-mono img { width: 100%; height: 100%; object-fit: cover; }
.org-card b { display: block; font-size: 0.92rem; line-height: 1.3; }
.org-card span { font-size: 0.76rem; color: var(--muted); }

/* Partnership cards */
.partner-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px; border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.partner-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.partner-orgs { display: flex; align-items: center; gap: 14px; }
.partner-orgs .org-mono { width: 52px; height: 52px; border-radius: 14px; font-size: 1rem; }
.partner-x { font-family: var(--font-display); font-size: 1.4rem; color: var(--accent); font-weight: 600; }
.partner-body h3 { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; }
.partner-body p { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }
.partner-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.partner-del { position: absolute; top: 16px; right: 16px; }

/* ---------- 14. Testimonials ------------------------------------------------------ */
.testi-card {
  padding: 28px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-sm);
}
.testi-card p { font-size: 0.96rem; line-height: 1.65; }
.testi-card p::before { content: "“"; font-family: var(--font-display); font-size: 2.2rem; color: var(--accent); display: block; line-height: 0.6; margin-bottom: 10px; }
.testi-who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.testi-who b { display: block; font-size: 0.9rem; }
.testi-who span { font-size: 0.78rem; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 2px; font-size: 0.85rem; }

/* Auto-scrolling review gallery (marquee) */
.review-marquee {
  overflow: hidden;
  width: 100%;
  padding: 14px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.review-track {
  display: flex;
  width: max-content;
  animation: review-marquee 40s linear infinite;
}
.review-marquee:hover .review-track { animation-play-state: paused; }
.marquee-card {
  flex: 0 0 340px;
  width: 340px;
  margin-right: 22px;
}
@keyframes review-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .review-track { animation: none; }
  .review-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 640px) {
  .marquee-card { flex-basis: 282px; width: 282px; }
}

/* ---------- 15. Newsletter --------------------------------------------------------- */
.newsletter {
  border-radius: var(--r-xl); padding: 56px 48px;
  text-align: center; position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.newsletter::before {
  content: ""; position: absolute; inset: -40%;
  background: radial-gradient(600px 300px at 50% 0%, var(--accent-soft), transparent 65%);
  pointer-events: none;
}
.newsletter h2, .newsletter p, .newsletter form { position: relative; }
.newsletter form {
  display: flex; gap: 10px; max-width: 480px; margin: 28px auto 0;
  padding: 8px; border-radius: 999px;
  background: var(--surface-strong); border: 1px solid var(--border-strong);
  transition: box-shadow var(--t) var(--ease);
}
.newsletter form:focus-within { box-shadow: 0 0 0 4px var(--accent-soft); }
.newsletter input { flex: 1; border: none; background: none; outline: none; padding-left: 14px; min-width: 0; }

/* ---------- 16. Footer -------------------------------------------------------------- */
footer.site-footer {
  margin-top: 80px; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--bg-2));
  padding: 64px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-grid .blurb { color: var(--muted); font-size: 0.9rem; max-width: 34ch; margin-top: 14px; }
.footer-grid .made-by {
  display: inline-block; margin-top: 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.82rem; font-weight: 650;
}
.footer-col h4 { margin-bottom: 14px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.footer-col a { display: block; padding: 5px 0; font-size: 0.9rem; color: var(--muted); transition: color var(--t) var(--ease), transform var(--t-fast) var(--ease); }
.footer-col a:hover { color: var(--accent); transform: translateX(3px); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--muted);
}
a.footer-social { display: inline-flex; align-items: center; gap: 6px; }
svg.i { display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.stat-card .ico, .notif-ico { font-size: 1.15rem; }
footer.portal-footer { margin-top: 0; padding: 0 0 28px; background: none; border-top: none; }

/* ---------- 17. Theme toggle ---------------------------------------------------------- */
.theme-toggle .sun, .theme-toggle .moon { transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease); }
[data-theme="light"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }

/* ---------- 18. Auth pages ------------------------------------------------------------- */
.auth-wrap { display: grid; place-items: center; padding: 40px 0 90px; }
.auth-card {
  width: min(430px, 100%); padding: 40px 36px;
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 0.88rem; color: var(--muted); }
.auth-foot a { color: var(--accent); font-weight: 650; }
.demo-hint { margin-top: 20px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 0.78rem; color: var(--muted); line-height: 1.7; }
.demo-hint code { background: var(--surface-strong); padding: 1px 6px; border-radius: 5px; font-size: 0.74rem; }

/* ---------- 19. Explore ------------------------------------------------------------------ */
.page-head { padding: 30px 0 34px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }

.explore-layout { display: grid; grid-template-columns: 264px 1fr; gap: 32px; align-items: start; }

.filters {
  position: sticky; top: calc(var(--nav-h) + 26px);
  padding: 22px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 18px;
  max-height: calc(100vh - var(--nav-h) - 50px); overflow-y: auto;
}
.filters h3 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.filters h3 button { font-size: 0.78rem; color: var(--accent); font-weight: 650; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }

/* Category pills, the fun, tappable way to browse by type */
.cat-pills {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 0 0 30px; padding-bottom: 2px;
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 0.92rem; font-weight: 650; color: var(--muted);
  background: var(--surface-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--spring), background var(--t) var(--ease),
              color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.cat-pill .pe { font-size: 1.08rem; line-height: 1; }
.cat-pill:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); box-shadow: var(--shadow-md); }
.cat-pill:active { transform: translateY(0) scale(0.94); }
.cat-pill.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 8px 20px rgba(194, 102, 45, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
@media (max-width: 640px) {
  .cat-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
               scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .cat-pills::-webkit-scrollbar { display: none; }
  .cat-pill { flex: 0 0 auto; }
}

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.results-head .count { font-size: 0.9rem; color: var(--muted); }
.results-head .count b { color: var(--text); }
.sort-row { display: flex; align-items: center; gap: 10px; }
.filters-toggle { display: none; }

.load-sentinel { height: 10px; }
.loading-row { display: flex; justify-content: center; padding: 30px 0; }

/* ---------- 20. Skeletons & spinners ------------------------------------------------------ */
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton-card { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.sk { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-strong) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.sk-banner { height: 128px; }
.sk-line { height: 12px; border-radius: 6px; margin: 12px 20px; }
.sk-line.w60 { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 21. Empty states ---------------------------------------------------------------- */
.empty {
  text-align: center; padding: 70px 30px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  color: var(--muted);
}
.empty .empty-ico {
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 20px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: var(--accent-soft); color: var(--accent);
}
.empty b { display: block; font-size: 1.05rem; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 0.88rem; max-width: 40ch; margin: 0 auto 20px; }

/* ---------- 21b. Reviews ------------------------------------------------------------------------ */
.reviews-top { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }

.review-summary { text-align: center; padding: 28px 24px; }
.review-summary .big-score {
  font-family: var(--font-display); font-size: 3.4rem; font-weight: 600; line-height: 1;
  color: var(--accent);
}
.dist { margin-top: 20px; display: flex; flex-direction: column; gap: 7px; }
.dist-row { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--muted); }
.dist-label { width: 26px; text-align: right; flex-shrink: 0; }
.dist-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.dist-bar span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #e0a05e); transition: width 600ms var(--ease); }
.dist-n { width: 18px; flex-shrink: 0; }

/* Static star display (on review cards + summary) */
.star-row { letter-spacing: 2px; font-size: 0.9rem; white-space: nowrap; }
.star-row span { color: var(--border-strong); }
.star-row span.on { color: var(--accent); }
.star-row.lg { font-size: 1.35rem; display: block; margin: 10px 0 4px; }

/* Interactive star input (reverse-order radios → fill on hover/check) */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-input label {
  font-size: 2.1rem; line-height: 1; padding: 0 3px; cursor: pointer;
  color: var(--border-strong);
  transition: transform 150ms var(--spring), color 150ms var(--ease);
}
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--accent); }
.star-input label:hover, .star-input label:hover ~ label { transform: scale(1.12); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 720px) {
  .reviews-top { grid-template-columns: 1fr; }
}

/* ---------- 22. Opportunity detail ------------------------------------------------------------ */
.detail-hero {
  height: 300px; border-radius: var(--r-xl); overflow: hidden; position: relative;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-md);
}
.detail-hero .banner-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,12,5,0.05), rgba(20,12,5,0.4)); }

.detail-head {
  position: relative; z-index: 2;
  margin: -76px 28px 0; padding: 28px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap;
}
.detail-logo {
  width: 76px; height: 76px; border-radius: 20px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display); font-weight: 750; font-size: 1.5rem; color: var(--accent);
}
.detail-logo img { width: 100%; height: 100%; object-fit: cover; }
.detail-head-info { flex: 1; min-width: 260px; }
.detail-head-info h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 6px 0 10px; }
.detail-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.detail-grid { display: grid; grid-template-columns: 1fr 330px; gap: 32px; margin-top: 44px; align-items: start; }

.prose { font-size: 0.98rem; line-height: 1.75; }
.prose h2 { font-size: 1.5rem; margin: 38px 0 14px; }
.prose h3 { font-size: 1.22rem; margin: 34px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.prose h4 { margin: 26px 0 10px; }
.prose p { margin: 0 0 14px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose blockquote {
  margin: 20px 0; padding: 14px 20px;
  border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--accent-soft); font-style: italic;
}
.prose code { background: var(--bg-2); padding: 2px 7px; border-radius: 6px; font-size: 0.86em; }
.prose a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose hr { border: none; height: 1px; background: var(--border); margin: 30px 0; }

.info-card { padding: 22px; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.info-card + .info-card { margin-top: 18px; }
.info-card h4 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; font-size: 0.88rem; }
.info-row + .info-row { border-top: 1px dashed var(--border); }
.info-row .k { color: var(--muted); flex-shrink: 0; }
.info-row .v { font-weight: 600; text-align: right; }

.countdown { display: flex; gap: 10px; margin-top: 6px; }
.countdown .cd {
  flex: 1; text-align: center; padding: 10px 4px;
  border-radius: var(--r-sm); background: var(--accent-soft);
}
.countdown .cd b { display: block; font-size: 1.3rem; font-family: var(--font-display); color: var(--accent); line-height: 1.2; }
.countdown .cd span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; font-size: 0.88rem;
}
.doc-item + .doc-item { border-top: 1px dashed var(--border); }
.doc-item .doc-ico {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}

.preview-banner {
  position: sticky; top: calc(var(--nav-h) + 18px); z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px 18px; margin-bottom: 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 650; font-size: 0.88rem;
  box-shadow: var(--shadow-md);
}

/* ---------- 23. Portal ------------------------------------------------------------------------- */
.portal-layout { display: grid; grid-template-columns: 232px 1fr; gap: 32px; align-items: start; }
.portal-side {
  position: sticky; top: calc(var(--nav-h) + 26px);
  padding: 16px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 4px;
}
.portal-side .side-label { padding: 10px 12px 6px; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.portal-side a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  font-size: 0.9rem; font-weight: 550; color: var(--muted);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.portal-side a:hover { background: var(--accent-soft); color: var(--text); }
.portal-side a.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(194,102,45,.3); }
.portal-side a:active { transform: scale(0.97); }
.portal-side .new-btn { margin: 10px 4px 4px; }

.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.portal-head h1 { font-size: 1.9rem; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card {
  padding: 22px; border-radius: var(--r-lg);
  background: var(--surface-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .ico {
  width: 38px; height: 38px; border-radius: 11px; margin-bottom: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat-card b { font-size: 1.7rem; font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
.stat-card span { font-size: 0.8rem; color: var(--muted); font-weight: 550; }

.panel {
  background: var(--surface-strong); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 22px;
}
.panel + .panel { margin-top: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.panel-head a { font-size: 0.82rem; color: var(--accent); font-weight: 650; }
.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.panel-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; }
.chart-legend { display: flex; gap: 18px; font-size: 0.76rem; color: var(--muted); margin-top: 8px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; font-size: 0.88rem; }
.list-row + .list-row { border-top: 1px dashed var(--border); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.list-row .grow span { font-size: 0.76rem; color: var(--muted); }
.list-row .actions { display: flex; gap: 6px; flex-shrink: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--accent-soft); }
.table td .cell-main { font-weight: 650; display: block; line-height: 1.3; }
.table td .cell-sub { font-size: 0.76rem; color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 16px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border);
  transition: all var(--t) var(--ease);
}
.tabs a:hover { border-color: var(--accent); color: var(--accent); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tabs a .n { opacity: 0.7; font-size: 0.76rem; margin-left: 4px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; font-size: 0.88rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted);
  transition: all var(--t) var(--ease);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- 24. Editor ---------------------------------------------------------------------------- */
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }

.editor-main { min-width: 0; }
.editor-topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 22px;
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.save-indicator { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--muted); }
.save-indicator .dot-s { width: 8px; height: 8px; border-radius: 50%; background: var(--success); transition: background var(--t) var(--ease); }
.save-indicator.saving .dot-s { background: var(--accent); animation: pulse-s 0.8s infinite alternate; }
@keyframes pulse-s { to { opacity: 0.4; } }

.editor-banner-zone {
  height: 190px; border-radius: var(--r-lg); overflow: hidden; position: relative;
  border: 1.5px dashed var(--border-strong);
  display: grid; place-items: center;
  color: var(--muted); font-size: 0.88rem; font-weight: 550;
  cursor: pointer; margin-bottom: 24px;
  background-size: cover; background-position: center;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.editor-banner-zone:hover { border-color: var(--accent); color: var(--accent); }
.editor-banner-zone.has-img { border-style: solid; color: transparent; }
.editor-banner-zone.has-img:hover::after {
  content: "Replace banner"; position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(20, 12, 5, 0.45); color: #fff; font-weight: 650;
}

.editor-title {
  width: 100%; border: none; background: none; outline: none;
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 550; line-height: 1.15;
  color: var(--text); margin-bottom: 18px;
}
.editor-title::placeholder { color: var(--faint); }

.editor-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 8px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid var(--border-strong); border-bottom: none;
  background: var(--surface);
}
.editor-toolbar button {
  min-width: 34px; height: 32px; padding: 0 10px; border-radius: 8px;
  font-size: 0.84rem; font-weight: 650; color: var(--muted);
  transition: all var(--t-fast) var(--ease);
}
.editor-toolbar button:hover { background: var(--accent-soft); color: var(--accent); }
.editor-toolbar button:active { transform: scale(0.92); }
.editor-toolbar .tb-sep { width: 1px; background: var(--border); margin: 4px 6px; }
.editor-toolbar .tb-right { margin-left: auto; display: flex; gap: 4px; }
.editor-toolbar .tb-active { background: var(--accent); color: var(--accent-ink); }

.editor-body {
  width: 100%; min-height: 420px;
  padding: 20px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem; line-height: 1.7;
  outline: none; resize: vertical;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.editor-body:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.md-preview {
  min-height: 420px; padding: 24px;
  border: 1px solid var(--border-strong); border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--surface-strong);
}

.editor-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--nav-h) + 26px); max-height: calc(100vh - var(--nav-h) - 46px); overflow-y: auto; padding-bottom: 20px; }
.side-group { padding: 18px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; }
.side-group > h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.side-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-group .input, .side-group .select, .side-group .textarea { padding: 9px 12px; font-size: 0.88rem; }
.logo-upload { display: flex; align-items: center; gap: 12px; }
.logo-upload .cur-logo { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; background: var(--bg-2); color: var(--faint); font-size: 0.7rem; }
.logo-upload .cur-logo img { width: 100%; height: 100%; object-fit: cover; }
.attach-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); padding: 6px 0; }

/* ---------- 25. Toasts ------------------------------------------------------------------------------ */
#toast-stack {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 48px));
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--r-md);
  background: var(--surface-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem; font-weight: 550;
  animation: toast-in 260ms var(--ease);
  position: relative; overflow: hidden;
}
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: currentColor; opacity: 0.3;
  animation: toast-bar 4s linear forwards;
  transform-origin: left;
}
.toast.leaving { animation: toast-out 220ms var(--ease) forwards; }
.toast .t-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 0.75rem; }
.toast-success { color: var(--success); } .toast-success .t-ico { background: rgba(77,124,74,.15); }
.toast-error { color: var(--danger); } .toast-error .t-ico { background: rgba(179,64,46,.13); }
.toast-info { color: var(--info); } .toast-info .t-ico { background: rgba(138,106,63,.14); }
.toast .t-msg { color: var(--text); font-weight: 550; }

@keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px) scale(0.96); } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- 26. Modal --------------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(28, 18, 8, 0.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(420px, 100%);
  padding: 30px; border-radius: var(--r-lg);
  background: var(--surface-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.97);
  transition: transform var(--t-slow) var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal h3 { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 27. Notifications page --------------------------------------------------------------------- */
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-strong);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.notif-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.notif-item.unread { border-left: 3px solid var(--accent); background: var(--surface); }
.notif-ico {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.notif-item .grow { flex: 1; }
.notif-item time { font-size: 0.75rem; color: var(--faint); }

/* ---------- 28. Scroll reveal ------------------------------------------------------------------------ */
/* Kept deliberately light: only section headings fade in as you scroll.
   Everything else marked .reveal is simply visible. */
.section-head.reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.section-head.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .section-head.reveal { opacity: 1; transform: none; }
}

/* ---------- 29. Error pages ------------------------------------------------------------------------------ */
.error-wrap { text-align: center; padding: 90px 20px; }
.error-code {
  font-family: var(--font-display); font-size: clamp(6rem, 18vw, 10rem); line-height: 1;
  color: var(--accent);
}
.error-wrap h1 { font-size: 1.8rem; margin: 8px 0 12px; }
.error-wrap p { color: var(--muted); max-width: 42ch; margin: 0 auto 30px; }

/* ---------- 30. Utilities ---------------------------------------------------------------------------------- */
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ---------- 30b. Heavy motion ------------------------------------------------------------------------------- */
:root { --spring: cubic-bezier(0.3, 1.45, 0.45, 1); }

.btn, .icon-btn { transition-timing-function: var(--spring); }

.opp-card, .cat-tile, .org-card, .stat-card, .testi-card, .info-card {
  transition: transform 280ms var(--spring), box-shadow 280ms var(--ease),
              border-color var(--t) var(--ease);
}

/* ---------- 30c. Heavy cursor ------------------------------------------------------------------------------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none; border-radius: 50%;
  opacity: 0; transition: opacity 250ms var(--ease);
  will-change: transform;
}
.cursor-dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--accent); }
.cursor-ring {
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1.5px solid var(--accent);
}
body.cursor-on .cursor-dot { opacity: 1; }
body.cursor-on .cursor-ring { opacity: 0.45; }

@media (pointer: fine) {
  body.cursor-on, body.cursor-on * { cursor: none !important; }
  body.cursor-on input, body.cursor-on textarea,
  body.cursor-on select, body.cursor-on [contenteditable] { cursor: auto !important; }
}

/* ---------- 30d. Extra motion ------------------------------------------------------------------------------- */
/* Hero headline words rise in one by one */
.hero h1.hero-anim .hw {
  display: inline-block;
  opacity: 0; transform: translateY(0.55em) rotate(2.5deg);
  transition: opacity 500ms var(--ease), transform 650ms var(--spring);
}
.hero h1.hero-anim.go .hw { opacity: 1; transform: none; }


/* Light sweep across primary buttons on hover */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: 0; width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-180%) skewX(-20deg);
  transition: transform 550ms var(--ease);
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(300%) skewX(-20deg); }

/* Eyebrow underline draws itself in on reveal */
.eyebrow::before { transition: width 600ms 180ms var(--ease); }
.section-head.reveal:not(.in) .eyebrow::before { width: 0; }

/* Bell wiggles while notifications are unread */
.bell:has(.dot) svg { animation: bell-wiggle 3.2s ease-in-out infinite; transform-origin: 50% 15%; }
@keyframes bell-wiggle {
  0%, 86%, 100% { transform: rotate(0); }
  89% { transform: rotate(13deg); }
  92% { transform: rotate(-11deg); }
  95% { transform: rotate(6deg); }
  98% { transform: rotate(-3deg); }
}

/* Logo tips its hat on hover */
.logo-mark, .logo-mark-img { transition: transform 260ms var(--spring); }
.logo:hover .logo-mark, .logo:hover .logo-mark-img { transform: rotate(-7deg) scale(1.1); }

/* Org logo lifts off the card banner on hover */
.opp-logo { transition: transform 260ms var(--spring); }
.opp-card:hover .opp-logo { transform: translateY(-4px) rotate(-3deg); }

/* Navbar compresses slightly once you scroll */
.nav { transition: box-shadow var(--t-slow) var(--ease), background var(--t-slow) var(--ease),
                   transform var(--t-slow) var(--ease), padding var(--t-slow) var(--ease); }
.nav.scrolled { padding-top: 6px; padding-bottom: 6px; }

/* ---------- 30e. Digest sign-up form ------------------------------------------------------------------------ */
.subscribe-form { position: relative; max-width: 520px; margin: 26px auto 0; text-align: left; }

/* The pill-shaped email + button row */
.subscribe-row {
  display: flex; gap: 10px; padding: 8px;
  border-radius: 999px;
  background: var(--surface-strong); border: 1px solid var(--border-strong);
  transition: box-shadow var(--t) var(--ease);
}
.subscribe-row:focus-within { box-shadow: 0 0 0 4px var(--accent-soft); }
.subscribe-form input[type="email"] {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  padding-left: 16px; color: var(--text); font-size: 0.95rem;
}
/* Reset the legacy `.newsletter form` pill styling when our form is nested inside it */
.newsletter form.subscribe-form { display: block; padding: 0; border: none; background: none; border-radius: 0; }

/* Collapsible personalization panel */
.sub-prefs { margin-top: 14px; text-align: center; }
.sub-prefs > summary {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none; list-style: none;
  font-size: 0.88rem; font-weight: 650; color: var(--muted);
  padding: 7px 4px; transition: color var(--t) var(--ease);
}
.sub-prefs > summary:hover { color: var(--accent); }
.sub-prefs > summary:focus { outline: none; }
.sub-prefs > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sub-prefs > summary::-webkit-details-marker { display: none; }
.sub-prefs > summary::marker { content: ""; }
.sub-prefs > summary svg { transition: transform var(--t) var(--ease); }
.sub-prefs[open] > summary svg { transform: rotate(180deg); }

.sub-prefs-body {
  margin-top: 18px; text-align: center;
  display: grid; gap: 22px;
  animation: subPrefsIn 260ms var(--ease);
}
@keyframes subPrefsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sub-prefs-label {
  display: block; margin-bottom: 12px;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--muted);
}

/* Emoji pill toggles */
.pref-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.pref-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  cursor: pointer; user-select: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
              transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.pref-chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.pref-chip-emoji { font-size: 1.02rem; line-height: 1; }
.pref-chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.pref-chip:active { transform: translateY(0) scale(0.97); }
.pref-chip:has(input:checked) {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(194, 102, 45, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.pref-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub-prefs-hint { margin: 2px 0 0; font-size: 0.8rem; color: var(--faint); }

/* ---------- 30f. SPA navigation (instant page transitions) -------------------------------------------------- */
#oh-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  box-shadow: 0 0 10px var(--accent);
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: width 0.25s var(--ease), opacity 0.25s var(--ease);
}
#oh-progress.active { opacity: 1; }
main { transition: opacity 0.16s var(--ease); }
body.is-navigating main { opacity: 0.5; }

/* ---------- 30g. Admin control bar (on public opportunity page) --------------------------------------------- */
.admin-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 4px; padding: 12px 16px;
  border-radius: var(--r-md); border: 1px dashed var(--border-strong);
}
.admin-bar-label { font-weight: 700; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.02em; }
.admin-bar-status { margin-left: auto; font-size: 0.82rem; color: var(--faint); }
.admin-bar-status b { color: var(--text); }

/* ---------- 30h. Strike system: dots + moderation popup ----------------------------------------------------- */
.strike-dots { display: inline-flex; align-items: center; gap: 5px; }
.strike-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--border-strong);
}
.strike-dot.on { background: var(--danger); border-color: transparent; }

.strike-modal-backdrop {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(20, 12, 6, 0.55); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
.strike-modal {
  max-width: 440px; width: 100%; text-align: center;
  padding: 34px 30px; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: subPrefsIn 0.26s var(--ease);
}
.strike-modal-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 6px; }
.strike-modal h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.2rem; margin-bottom: 8px; }
.strike-modal p { color: var(--muted); line-height: 1.55; margin-bottom: 22px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 30i. Admin of the Month + leaderboard ----------------------------------------------------------- */
.aotm-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 22px 26px; border-radius: var(--r-lg);
  border: 1px solid var(--accent); box-shadow: var(--shadow-md);
  background:
    radial-gradient(420px 140px at 12% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
}
.aotm-badge {
  font-weight: 750; font-size: 0.82rem; letter-spacing: 0.02em;
  color: var(--accent); white-space: nowrap;
}
.aotm-body { display: flex; align-items: center; gap: 14px; }
.aotm-avatar {
  width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 750; font-family: var(--font-display);
  background: linear-gradient(135deg, var(--bg-2), var(--accent-soft)); color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.aotm-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aotm-name { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; }
.aotm-meta { font-size: 0.85rem; color: var(--muted); }

.rank { font-weight: 750; color: var(--muted); width: 28px; }
.rank.gold { color: #d4a017; }
.lead-pts { font-weight: 750; color: var(--accent); }

/* Award-points console */
.points-console-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.points-console-icon {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.points-console-head h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.06rem; }

.points-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.pf-field { display: flex; flex-direction: column; gap: 8px; }
.pf-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--muted);
}

/* Custom select */
.pf-select { position: relative; }
.pf-select select {
  appearance: none; -webkit-appearance: none;
  min-width: 230px; height: 48px; padding: 0 44px 0 16px;
  border-radius: var(--r-md); border: 1.5px solid var(--border-strong);
  background: var(--surface-strong); color: var(--text);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.pf-select select:hover { border-color: var(--accent); }
.pf-select select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pf-chevron {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--muted); transition: color var(--t) var(--ease);
}
.pf-select:hover .pf-chevron { color: var(--accent); }

/* Number stepper */
.pf-stepper {
  display: inline-flex; align-items: center;
  height: 48px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong); background: var(--surface-strong); overflow: hidden;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
/* Glow the pill on focus. The ± buttons don't take focus (see main.js), so this
   only fires when the number field itself is focused, not when tapping ±. */
.pf-stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pf-step {
  width: 42px; align-self: stretch; border: none; background: transparent;
  font-size: 1.35rem; font-weight: 500; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; line-height: 1;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.pf-step:hover { background: var(--accent-soft); color: var(--accent); }
.pf-step:active { transform: scale(0.86); }
.pf-step:focus { outline: none; }
.pf-step:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pf-stepper input {
  width: 56px; text-align: center; border: none; background: none;
  font-size: 1.02rem; font-weight: 750; color: var(--text); outline: none;
  -moz-appearance: textfield;
}
.pf-stepper input::-webkit-outer-spin-button,
.pf-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pf-actions { display: flex; gap: 9px; }
.pf-actions .btn { height: 48px; }
.btn-danger-soft {
  background: var(--danger-soft, rgba(200, 70, 55, 0.12)); color: var(--danger);
  border: 1.5px solid transparent; font-weight: 650;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.btn-danger-soft:hover { background: var(--danger); color: #fff; }

/* ---------- 31. Responsive ---------------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .opp-grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid, .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; max-height: none; }
  .panel-grid, .panel-grid-2 { grid-template-columns: 1fr; }
  .portal-layout { grid-template-columns: 1fr; }
  .portal-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .portal-side .side-label { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .explore-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; display: none; }
  .filters.open { display: flex; }
  .filters-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .section { padding: 60px 0; }
  .opp-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 18px 0; }
  .stat:nth-child(3) { border-left: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .detail-head { margin: -60px 12px 0; padding: 20px; }
  .detail-hero { height: 220px; }
  .stat-cards { grid-template-columns: 1fr; }
  .newsletter { padding: 40px 22px; }
  .auth-card { padding: 30px 22px; }
  main { padding-top: calc(var(--nav-h) + 16px); }

  /* Nav fits a phone: drop text CTAs (they live in the hamburger + account
     menu), tighten spacing, and let the account dropdown open flush-right. */
  .nav { padding-left: 14px; padding-right: 12px; }
  .nav-right { gap: 6px; }
  .nav-right .btn { display: none; }
  .dropdown-menu { right: 0; }
  .points-form { flex-direction: column; align-items: stretch; }
  .pf-select select, .pf-stepper { width: 100%; }
  .aotm-card { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* ---------- Accessibility: keyboard focus & skip link ------------------------ */
/* A visible ring for anyone navigating by keyboard (mouse clicks stay clean). */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible,
[tabindex]:focus-visible, .chip:focus-visible, .cat-tile:focus-visible,
.opp-card a:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
main:focus { outline: none; }
.crop-stage:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10000;
  padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  text-decoration: none; transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 12px; }

.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); text-decoration: underline; }

/* Sign-up consent checkboxes */
.consent-checks { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; }
.consent-checks .check { align-items: flex-start; font-size: 0.88rem; line-height: 1.45; color: var(--muted); }
.consent-checks .check input { margin-top: 2px; flex-shrink: 0; }
.consent-checks a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sub-consent { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); text-align: center; }
.sub-consent a { color: var(--accent); text-decoration: underline; }

/* Profile: account deletion */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone a { color: var(--accent); text-decoration: underline; }
.danger-form { display: flex; flex-direction: column; gap: 6px; }
.danger-row { display: flex; gap: 10px; }
.danger-row .input, .danger-row .pw-wrap { flex: 1; min-width: 0; }
@media (max-width: 640px) { .danger-row { flex-direction: column; } }

/* ---------- Loading & error states ------------------------------------------------ */
/* A button that's waiting on the server: dim it and show a small spinner. */
.btn.is-loading, .is-loading.btn { position: relative; pointer-events: none; opacity: 0.75; }
.btn.is-loading::before {
  content: ""; width: 14px; height: 14px; margin-right: 8px; flex-shrink: 0;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 700ms linear infinite; display: inline-block; vertical-align: -2px;
}
body.is-uploading { cursor: progress; }
.load-error { grid-column: 1 / -1; text-align: center; padding: 40px 20px; color: var(--muted); }
.load-error p { margin-bottom: 12px; }

/* ---------- Phones --------------------------------------------------------------- */
/* Long text must shrink inside its column, never widen the whole page. */
.panel-grid > *, .panel-grid-2 > *, .portal-layout > *, .list-row .grow { min-width: 0; }

.mobile-theme {
  display: none; width: 100%; padding: 12px 16px; border: 0; border-radius: 12px;
  background: none; color: inherit; font: inherit; font-weight: 550; text-align: left; cursor: pointer;
}
.mobile-theme:hover { background: var(--accent-soft); }
/* Short screens and sideways phones can't fit the whole menu, so let it scroll. */
.mobile-menu { max-height: calc(100dvh - 100px); overflow-y: auto; }
/* Solid, so the page behind never shows through the menu's text. */
.mobile-menu.glass, [data-theme] .mobile-menu.glass { background: var(--surface-strong); }

@media (max-width: 640px) {
  /* iPhones zoom the whole page when a box under 16px is tapped. */
  input:not(.editor-title), select, textarea { font-size: 16px !important; }
  .editor-title { font-size: 1.6rem; }
  /* The signed-in bar is too full for a phone, so the theme switch moves to the menu. */
  .icon-btn.hide-on-phone { display: none; }
  .mobile-theme { display: block; }
}
@media (max-width: 350px) {
  .logo > span { display: none; }
}
