/* Free University Tools, unified design system */

:root {
  --bg: #fafafa;
  --bg-muted: #f4f4f5;
  --surface: #ffffff;
  --text: #09090b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --header-h: 52px;
  --content-max: 1080px;
  --narrow-max: 640px;
  --directory-max: 1200px;
  --font:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* legacy aliases */
  --bg-white: var(--bg);
  --bg-light: var(--bg-muted);
  --bg-page: var(--bg);
  --text-primary: var(--text);
  --accent-blue: var(--accent);
  --border-gray: var(--border);
  --hover-gray: var(--bg-muted);
}

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

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

html.page-student-scroll {
  scroll-behavior: auto;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
}

/* Buttons */
.btn-primary,
.btn-contact-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover,
.btn-contact-dark:hover {
  background: #27272a;
}

.btn-secondary,
.btn-contact-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.btn-secondary:hover,
.btn-contact-outline:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Eyebrows & section titles */
.section-eyebrow,
.tools-eyebrow,
.cta-eyebrow,
.hero-eyebrow,
.about-eyebrow,
.page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.section-title,
.tools-preview .section-title,
.cta-title,
.main-title,
.about-hero-title,
.page-hero-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.section-lead,
.tools-subtitle,
.cta-text,
.main-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Homepage hero */
.hero {
  padding: calc(var(--header-h) + 72px) 20px 80px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--narrow-max);
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.hero .subheadline {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.hero-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Value section */
.value-section {
  padding: 72px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.value-container {
  max-width: var(--content-max);
  margin: 0 auto;
}

.value-header {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 40px;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.value-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.value-card:hover {
  border-color: var(--border-strong);
}

.value-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  margin-bottom: 14px;
}

.value-card h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}

.value-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Tools preview */
.tools-preview {
  padding: 72px 20px;
  background: var(--bg);
}

.tools-container {
  max-width: var(--content-max);
  margin: 0 auto;
}

.tools-header {
  text-align: center;
  margin-bottom: 36px;
}

.tools-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.tool-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.tool-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.tool-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Contact strip */
.contact-strip {
  padding: 64px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-strip-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.contact-strip-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 12px;
}

.contact-strip-badge svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  fill: none;
}

.contact-strip-title {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}

.contact-strip-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 48ch;
}

.contact-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* CTA */
.cta-section {
  padding: 72px 20px;
  background: var(--bg-muted);
}

.cta-content {
  max-width: var(--content-max);
  margin: 0 auto;
}

.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

/* Footer */
.footer {
  padding: 36px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.footer-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--text);
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-muted);
}

/* Student tools page */
body:has(.header--tools) main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 48px) 20px 48px;
}

.main-title {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.main-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 42rem;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.content-container {
  max-width: var(--directory-max);
  margin: 0 auto;
  padding: 0 0 48px;
}

.tools-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  align-items: start;
}

.tool-category {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
  contain: layout style paint;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.tool-category:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.tool-category.is-hidden {
  display: none;
}

.tool-category.is-deferred .category-tools {
  min-height: 48px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.category-load-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
  visibility: hidden;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  background: var(--bg-muted);
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.25;
}

.category-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-muted);
  flex-shrink: 0;
}

.tool-category[data-category="must-try"] .category-title {
  background: rgba(37, 99, 235, 0.06);
  color: var(--accent);
}

.tool-category[data-category="must-try"] .category-title::before {
  background: var(--accent);
}

.tool-category[data-category="github-powerhouses"] .category-title {
  background: rgba(24, 24, 27, 0.05);
  color: var(--text);
}

.tool-category[data-category="github-powerhouses"] .category-title::before {
  background: var(--text);
}

.category-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  overflow: hidden;
}

.tool-category.is-collapsed .category-tools,
.tool-category.is-expanded .category-tools {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-see-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.category-see-more:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.28);
}

.category-see-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.category-see-more[hidden] {
  display: none;
}

.category-see-more::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
}

.tool-category.is-expanded .category-see-more::after {
  transform: rotate(-135deg) translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .category-tools {
    transition: none;
  }

  .category-see-more::after {
    transition: none;
  }
}

.tool-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.tool-link:hover {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--accent);
}

.tool-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-link-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-link-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  object-position: center;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
  display: block;
  box-sizing: border-box;
  aspect-ratio: 1;
}

img.tool-link-icon {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
}

.tool-pricing-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-left: auto;
}

.tool-pricing-label[data-label="free"] {
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
}

.tool-pricing-label[data-label="free-tier"] {
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
}

.tool-pricing-label[data-label="limited"] {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.1);
}

.tool-pricing-label[data-label="paid"] {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

body[data-mode="paid"] .tool-pricing-label {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.category-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 12px;
  font-style: italic;
}

.secret-disclaimer,
.legal-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 auto 24px;
  padding: 0 20px;
  max-width: var(--content-max);
  line-height: 1.55;
}

.legal-disclaimer {
  font-size: 11px;
  max-width: 52rem;
}

.legal-disclaimer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-disclaimer a:hover {
  color: var(--text);
}

.terms-notice {
  max-width: var(--directory-max);
  margin: 0 auto 28px;
  padding: 16px 18px;
  border: 1px solid #f0c2c2;
  border-radius: var(--radius);
  background: #fff8f8;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.terms-notice-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b42318;
}

.terms-notice p {
  margin: 0 0 8px;
}

.terms-notice p:last-child {
  margin-bottom: 0;
}

.terms-notice a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-notice a:hover {
  color: var(--accent);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  max-width: 420px;
  width: 100%;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-card--legal {
  max-width: 520px;
}

.modal-card--legal a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-safety-tips {
  margin: 14px 0 12px;
  padding: 14px 16px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-safety-tips p {
  margin-bottom: 8px;
}

.modal-safety-tips p:last-child {
  margin-bottom: 0;
}

.modal-safety-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.modal-safety-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text) !important;
  text-decoration: none !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.modal-safety-link:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

.modal-card h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.modal-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-btn {
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease;
}

.modal-btn:hover {
  background: var(--bg-muted);
}

.modal-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.modal-btn--primary:hover {
  background: var(--accent-hover);
}

/* Inner pages (about, contact, report, donate) */
.main-content {
  max-width: var(--narrow-max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 56px) 20px 64px;
}

.about-hero-title,
.page-hero-title {
  margin-bottom: 40px;
}

.about-section,
.page-section {
  margin-bottom: 0;
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--border);
}

.about-section-title,
.page-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.about-section-body,
.page-section-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.about-section-body p + p,
.page-section-body p + p {
  margin-top: 12px;
}

.about-profile {
  margin-top: 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.about-profile-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.about-profile-image-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-strong);
}

.about-profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-profile-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.about-profile-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}

.about-profile-verified {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.about-profile-role {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.about-profile-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-qr {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.about-inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-inline-link:hover {
  color: var(--accent-hover);
}

/* Donate page */
main:not(.main-content) {
  max-width: var(--narrow-max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 56px) 20px 64px;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
}

.donate-content {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.donate-content h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.donate-content > p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}

.donation-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.donation-option {
  padding: 20px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.donation-option h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.donation-option p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.btn-donation {
  display: inline-flex;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--text);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-donation:hover {
  background: #27272a;
}

/* Responsive */
@media (max-width: 900px) {
  .value-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: calc(var(--header-h) + 48px) 20px 56px;
  }

  .contact-strip-inner {
    grid-template-columns: 1fr;
  }

  .contact-strip-actions {
    width: 100%;
  }

  .contact-strip-actions a {
    flex: 1;
    justify-content: center;
  }

  .cta-panel {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }

  .tools-directory {
    grid-template-columns: 1fr;
  }

  .donation-options {
    grid-template-columns: 1fr;
  }

  .about-profile {
    padding: 20px;
  }

  .about-profile-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-actions {
    justify-content: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .value-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .value-grid .value-card:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
    width: 100%;
  }
}

/* Policy page */
.policy-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin: -28px 0 20px;
}

.policy-alert {
  margin: 0 0 36px;
  padding: 18px 20px;
  border: 1px solid #f0c2c2;
  border-radius: var(--radius);
  background: #fff8f8;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.policy-alert-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #b42318;
}

.policy-alert p {
  margin: 0 0 10px;
}

.policy-alert p:last-child {
  margin-bottom: 0;
}

.policy-alert a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-list {
  margin: 12px 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.policy-list li + li {
  margin-top: 6px;
}

.policy-section--last {
  border-bottom: none;
}

.policy-note {
  margin-top: 16px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Fixed legal badge (all pages via common.js) */
.legal-badge {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 1050;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  text-decoration: none;
  opacity: 0.9;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.legal-badge:hover {
  opacity: 1;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

@media (max-width: 768px) {
  .legal-badge {
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    left: auto;
    font-size: 9px;
    padding: 5px 7px;
    max-width: min(46vw, 160px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
  }

  /* Avoid overlap with homepage floating CTA (bottom-right) */
  body:has(#floatingStartBrowsing) .legal-badge {
    right: auto;
    left: max(12px, env(safe-area-inset-left, 0px));
  }

  /* Student page: keep clear of TOC FAB (bottom-left) */
  body:has(.page-toc:not([hidden])) .legal-badge {
    left: auto;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .main-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    padding: 0 4px;
  }

  .main-subtitle {
    font-size: 0.9375rem;
    margin-bottom: 28px;
    padding: 0 4px;
  }

  .content-container {
    padding-bottom: 32px;
  }

  body:has(.header--tools) main {
    padding-bottom: max(72px, calc(48px + env(safe-area-inset-bottom, 0px)));
  }
}
