﻿/* style.css */
/* ========== 1) Reset & variables ========== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

:root{
  /* LSB Brand Colors */
  --maroon-primary: #73000a;
  --maroon-dark: #5a0008;
  --maroon-light: #95000d;
  --gold-primary: #b59a57;
  --gold-light: #c5af7a;
  --gold-tint: #d4c59e;
  --secondary-orange: #dda510;
  --secondary-teal: #527b82;
  --secondary-green: #788a38;

  /* Application Colors */
  --bg-page: #ffffff;          /* Clean white background */
  --bg-card: #FFFFFF;
  --text: #0f172a;             /* slate-900 */
  --text-muted: #475569;       /* slate-600 */
  --muted-2: #94a3b8;          /* slate-400 */
  --chip-bg: #ffffff;
  --chip-active: #f5ece0;      /* Gold tint for active chips */
  --chip-border: #e0d4c3;      /* Gold-tinted border */
  --primary: #73000a;          /* LSB Maroon */
  --primary-hover: #5a0008;    /* Darker maroon for hover */
  --accent: #b59a57;           /* LSB Gold */
  --link: #73000a;             /* LSB Maroon for links */
  --shadow-1: 0 2px 4px rgba(115,0,10,.08), 0 8px 24px rgba(115,0,10,.06);
  --shadow-2: 0 4px 8px rgba(115,0,10,.12), 0 16px 40px rgba(115,0,10,.12);
  --shadow-hover: 0 8px 32px rgba(115,0,10,.12);
  --shadow-active: 0 4px 16px rgba(115,0,10,.08);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1200px;
  --z-floating: 900;
  --z-modal: 1300;

  /* Animation timing */
  --animation-fast: 0.15s;
  --animation-normal: 0.25s;
  --animation-slow: 0.35s;
  --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Category Color Coding */
  --category-teaching: #73000a;      /* Maroon */
  --category-research: #b59a57;       /* Gold */
  --category-service: #527b82;        /* Teal */
  --category-professional: #788a38;   /* Green */

  /* Category hover tints */
  --category-teaching-tint: rgba(115, 0, 10, 0.04);
  --category-research-tint: rgba(181, 154, 87, 0.04);
  --category-service-tint: rgba(82, 123, 130, 0.04);
  --category-professional-tint: rgba(120, 138, 56, 0.04);
}

/* Utilities */
.container{ max-width: var(--container); margin-inline:auto; padding-inline: clamp(16px, 4vw, 32px); }
.sr-only{ position:absolute!important; width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; }
.skip-link{
  position: absolute; top: -40px; left: 12px; background:#111; color:#fff; padding:8px 12px; border-radius:8px;
}
.skip-link:focus{ top:12px; outline: none; }

/* Focus style */
:where(a, button, [role="tab"]) :focus{ outline: none; }
:where(a, button, [role="tab"], .chip, .card-link, .card-send):focus-visible{
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px;
}

/* Enhanced focus indicators for cards on white background */
.card:focus-visible,
.card-link:focus-visible{
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover), 0 0 0 6px rgba(181, 154, 87, 0.15);
  transform: translate3d(0, -2px, 0) scale(1.02);
  transition: transform var(--animation-normal) var(--easing-smooth),
              box-shadow var(--animation-normal) var(--easing-smooth),
              outline var(--animation-normal) ease;
}

/* ========== 2) Sticky Navigation ========== */
.sticky-nav{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(115, 0, 10, 0.1);
  box-shadow: 0 2px 8px rgba(115, 0, 10, 0.04);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.sticky-nav.scrolled{
  box-shadow: 0 4px 16px rgba(115, 0, 10, 0.08);
  border-bottom-color: rgba(115, 0, 10, 0.15);
}

.sticky-nav-inner{
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
  padding-top: clamp(12px, 2vw, 16px);
  padding-bottom: clamp(12px, 2vw, 16px);
}

.nav-logo-section{
  display: flex;
  align-items: center;
}

.logo-link{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-radius: 8px;
}

.logo-link:hover{
  opacity: 0.85;
  transform: translateY(-1px);
}

.logo-link:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site-logo{
  display: block;
  max-width: clamp(160px, 18vw, 200px);
  height: auto;
}

.nav-filters-section{
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-filters-section .chips{
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 8px;
  margin: 0;
  width: auto;
  backdrop-filter: none;
}

.nav-search-section{
  display: flex;
  justify-content: flex-end;
  min-width: 240px;
}

/* ========== 3) Main layout ========== */
.site-main{ padding-top: 0; }

/* Hero */
.hero{
  padding: clamp(40px, 8vw, 80px) 0 clamp(32px, 6vw, 60px);
  position: relative;
}
.hero-inner{ display:grid; grid-template-columns: 1fr; align-items:center; gap: 24px; }
.hero-title{
  font-size: clamp(2rem, 2.8vw + 1rem, 3.2rem);
  line-height: 1.1;
  margin:0 0 16px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 16px;
}
.hero-title::after{
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  border-radius: 2px;
}
.hero-subtitle{
  margin:0;
  max-width: 60ch;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1.1vw + .8rem, 1.2rem);
  line-height: 1.6;
}
.hero-highlight{
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15em;
}
.hero-art{ position:relative; height:0; }
.art{ display:none; }

@media (min-width: 900px){
  .hero-inner{ grid-template-columns: 1fr 1fr; }
  .hero-art{ height:160px; }
  .art{ display:block; position:absolute; top:-24px; width:220px; height:160px; border-radius: 20px; opacity:.15; }
  .art-left{ left:-8px; background: linear-gradient(135deg, var(--maroon-primary), var(--gold-tint)); }
  .art-right{ right:0; background: linear-gradient(135deg, var(--gold-light), var(--gold-tint)); }
}

/* ========== 4) Chips (filters) ========== */
.chips{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip{
  appearance: none;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--text);
  border-radius: 9999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

.chip:hover{
  background: #faf8f5;
  transform: translateY(-1px);
}

.chip.is-active,
.chip[aria-selected="true"]{
  background: var(--chip-active);
  border-color: var(--gold-primary);
}

/* Enhanced focus for chips on white background */
.chip:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(181, 154, 87, 0.15);
  transform: translateY(-1px);
}

/* Responsive: Tablet */
@media (max-width: 1024px){
  .sticky-nav-inner{
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .nav-logo-section{
    grid-column: 1;
    grid-row: 1;
  }

  .nav-search-section{
    grid-column: 2;
    grid-row: 1;
  }

  .nav-filters-section{
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .site-logo{
    max-width: 140px;
  }
}

/* Responsive: Mobile */
@media (max-width: 640px){
  .sticky-nav-inner{
    gap: 10px;
  }

  .site-logo{
    max-width: 120px;
  }

  .nav-search-section{
    min-width: auto;
    flex: 1;
  }

  .chip{
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

.scroll-top{
  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: max(16px, calc(16px + env(safe-area-inset-bottom, 0px)));
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: var(--bg-card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease, background .25s ease;
  z-index: calc(var(--z-floating) + 5);
}

.scroll-top svg{
  display: block;
}

.scroll-top:hover,
.scroll-top:focus-visible{
  box-shadow: var(--shadow-2);
  background: #f8fbfb;
}

.scroll-top.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 480px){
  .scroll-top{
    width: 44px;
    height: 44px;
  }
}

/* ========== 5) Cards grid ========== */
.cards-section{ padding: 20px 0 80px; }
.results-count{ color: var(--text-muted); margin: 0 0 10px; text-align: center; }
.search-container{
  margin: 0;
  width: 100%;
  max-width: 320px;
}
.search-wrapper{
  position: relative;
  display: flex;
  align-items: center;
}
.search-label{
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.search-input{
  width: 100%;
  padding: 12px 44px;
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-input::placeholder{
  color: var(--muted-2);
}
.search-input:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,154,87,.2);
}
.search-container.is-active .search-input{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,154,87,.12);
}
.search-container.is-active .search-icon{
  color: var(--accent);
}
.search-icon{
  position: absolute;
  left: 16px;
  color: var(--muted-2);
  display: inline-flex;
  pointer-events: none;
}
.search-clear{
  position: absolute;
  right: 8px;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--muted-2);
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.search-clear:hover,
.search-clear:focus-visible{
  color: var(--text);
  background: rgba(15,23,42,.06);
}
.search-help:not(.sr-only){
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: .9rem;
  text-align: center;
}
.cards-grid{
  display:grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.no-results{
  width: 100%;
  padding: 36px clamp(16px, 5vw, 40px);
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: var(--shadow-1);
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.no-results-icon{
  font-size: 2rem;
  margin: 0 0 12px;
}
.no-results-title{
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: var(--text);
}
.no-results-message{
  margin: 0;
  margin-inline: auto;
  max-width: 48ch;
}
.no-results .btn{
  margin-top: 16px;
}

@media (max-width: 600px){
  .search-container{
    margin: 20px 0 24px;
  }
  .search-input{
    padding: 12px 40px;
    font-size: 1rem;
  }
  .search-icon{
    left: 14px;
  }
  .no-results{
    padding: 28px 16px;
  }
}
@media (min-width: 640px){
  .cards-grid{ gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (min-width: 1024px){
  .cards-grid{ gap: 20px; }
}

/* Card */
.card{
  position: relative; background: var(--bg-card); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow-1); border: 1px solid rgba(15, 23, 42, .10);
  border-left: 4px solid var(--muted-2);
  transition: transform var(--animation-normal) var(--easing-smooth),
              box-shadow var(--animation-normal) var(--easing-smooth),
              background-color var(--animation-normal) ease,
              border-color var(--animation-normal) ease;
  transform: translate3d(0, 0, 0);
}
.card:hover{ 
  box-shadow: var(--shadow-hover);
  transform: translate3d(0, -2px, 0) scale(1.02);
  will-change: transform, box-shadow;
}

/* Active/Click state animations */
.card:active{
  transform: translate3d(0, -1px, 0) scale(0.98);
  box-shadow: var(--shadow-active);
  transition: transform var(--animation-fast) var(--easing-smooth),
              box-shadow var(--animation-fast) var(--easing-smooth);
}

/* Ensure smooth transition from hover to active */
.card:hover:active{
  transform: translate3d(0, -1px, 0) scale(0.98);
}

/* Animation cleanup - remove will-change when not hovering */
.card:not(:hover){
  will-change: auto;
}

/* Category-specific border colors */
.card[data-category="teaching"]{
  border-left-color: var(--category-teaching);
}
.card[data-category="research"]{
  border-left-color: var(--category-research);
}
.card[data-category="service"]{
  border-left-color: var(--category-service);
}
.card[data-category="professional"]{
  border-left-color: var(--category-professional);
}

/* Category-specific hover tints */
.card[data-category="teaching"]:hover{
  background: linear-gradient(to right, var(--category-teaching-tint) 0%, var(--bg-card) 15%);
}
.card[data-category="research"]:hover{
  background: linear-gradient(to right, var(--category-research-tint) 0%, var(--bg-card) 15%);
}
.card[data-category="service"]:hover{
  background: linear-gradient(to right, var(--category-service-tint) 0%, var(--bg-card) 15%);
}
.card[data-category="professional"]:hover{
  background: linear-gradient(to right, var(--category-professional-tint) 0%, var(--bg-card) 15%);
}
.card-link{ display:block; color: inherit; text-decoration: none; }
.card-title{ margin:0 0 8px; font-size: 1.05rem; line-height: 1.25; }
.card-desc{ margin:0; color: var(--text-muted); }
.attachments{
  list-style:none; margin: 12px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:8px;
}
.file-pill{
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px;
  background: #fff; border: 1px dashed #cbd5e1; color: var(--text-muted);
  border-radius: 10px; font-size: .85rem;
}
.file-icon{ font-size: 1rem; }

/* Quick action button (hover) */
.card-send{
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 9999px;
  display: grid; place-items:center; border:1px solid rgba(115,0,10,.12);
  background: var(--primary); color:#fff; box-shadow: 0 6px 16px rgba(115,0,10,.16);
  opacity: 0; transform: translateY(4px); 
  transition: opacity .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.card:hover .card-send, .card:focus-within .card-send{ opacity: 1; transform: translateY(0); }
.card-send:hover{ background: var(--primary-hover); }
.card-send:active{
  transform: translateY(0) scale(0.95);
  box-shadow: 0 3px 8px rgba(115,0,10,.2);
  transition: transform var(--animation-fast) var(--easing-smooth),
              box-shadow var(--animation-fast) var(--easing-smooth);
}

/* Enhanced focus for card-send button */
.card-send:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 6px 16px rgba(115,0,10,.16), 0 0 0 4px rgba(181, 154, 87, 0.2);
}

/* No-JS fallback */
.nojs{
  padding: 14px 16px; border:1px solid rgba(15,23,42,.12); border-radius: var(--radius-sm);
  background:#fff; color: var(--text-muted);
}

/* ========== 6) Footer ========== */
.site-footer{
  padding: 32px 0 64px; border-top: 1px solid rgba(15,23,42,.12);
  background: #fafafa;
}
.footer-inner{
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-description{
  margin: 0;
}
.footer-credit{
  margin: 0;
  font-size: 0.95rem;
}
.footer-link{
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
.footer-link:hover,
.footer-link:focus-visible{
  color: var(--accent);
  text-decoration: underline;
}
.link-underline{ text-decoration: underline; }

/* ========== 7) Modal ========== */
.modal-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  padding: clamp(16px, 4vw, 32px);
}

.modal-overlay.is-open{
  opacity: 1;
  visibility: visible;
}

.modal-container{
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  width: min(600px, 92vw);
  max-height: min(640px, 90vh);
  display: flex;
  flex-direction: column;
  transform: translateY(24px);
  transition: transform .3s ease;
}

.modal-overlay.is-open .modal-container{
  transform: translateY(0);
}

.modal-header,
.modal-footer{
  padding: 20px clamp(20px, 5vw, 28px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-header{
  justify-content: space-between;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.modal-title{
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--text);
}

.modal-close{
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover,
.modal-close:focus-visible{
  background: rgba(226, 232, 240, .6);
  color: var(--text);
}

.modal-body{
  padding: 0 clamp(20px, 5vw, 28px) 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-description{
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.modal-instructions{
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: .9rem;
}

.placeholder-form{
  display: grid;
  gap: 16px;
}

.placeholder-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.placeholder-label{
  font-weight: 600;
  color: var(--text);
}

.placeholder-required{
  color: #e11d48;
  font-size: .95em;
}

.placeholder-input,
.placeholder-textarea,
.prompt-textarea{
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, .7);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.placeholder-input:focus-visible,
.placeholder-textarea:focus-visible,
.prompt-textarea:focus-visible{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 154, 87, .2);
  outline: none;
}

.placeholder-hint{
  margin: 0;
  font-size: .875rem;
  color: var(--muted-2);
}

.prompt-preview{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-preview-label{
  font-weight: 600;
  color: var(--text);
}

.prompt-textarea{
  min-height: 180px;
  resize: vertical;
}

.modal-footer{
  justify-content: flex-end;
  border-top: 1px solid rgba(15, 23, 42, .08);
  gap: 12px;
}

.btn{
  appearance: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.btn-primary{
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus-visible{
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 10px 24px rgba(115, 0, 10, .28);
}

.btn-primary:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 10px 24px rgba(115, 0, 10, .28), 0 0 0 4px rgba(181, 154, 87, 0.2);
}

.btn-secondary{
  background: #fff;
  color: var(--text);
  border-color: rgba(15, 23, 42, .18);
}

.btn-secondary:hover,
.btn-secondary:focus-visible{
  background: rgba(226, 232, 240, .5);
}

.btn-secondary:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(181, 154, 87, 0.15);
}

@media (max-width: 640px){
  .modal-container{
    width: min(520px, 96vw);
    max-height: 92vh;
    border-radius: calc(var(--radius) - 6px);
    margin-inline: auto;
  }

  .modal-header,
  .modal-body,
  .modal-footer{
    padding-inline: clamp(16px, 6vw, 24px);
  }
}

@media (max-width: 480px){
  .modal-container{
    width: 100%;
    max-height: none;
    height: calc(100vh - 40px);
  }

  @supports (height: 100dvh) {
    .modal-container{
      height: calc(100dvh - 40px);
    }
  }

  .modal-overlay{
    align-items: flex-start;
  }

  .modal-footer{
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ========== 7) Helpers ========== */
[aria-busy="true"]{ opacity: .7; }

/* Card entrance animation */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card.card-enter {
  opacity: 0;
  animation: cardEnter 0.5s ease-out forwards;
}

/* Reduce motion preference - Comprehensive accessibility support */
@media (prefers-reduced-motion: reduce){
  /* Disable all transitions and animations */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Card animations - provide alternative visual feedback */
  .card {
    transition: none;
    transform: none;
  }
  
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-2); /* Enhanced shadow instead of transform */
    border-left-width: 6px; /* Thicker border for visual feedback */
  }
  
  .card:active {
    transform: none;
    box-shadow: var(--shadow-1); /* Reduced shadow for press feedback */
    border-left-width: 8px; /* Even thicker border for active state */
  }

  /* Card send button - static positioning with color feedback */
  .card-send {
    transition: none;
    transform: none;
    opacity: 1; /* Always visible for reduced motion users */
    position: static;
    margin-top: 12px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
  }
  
  .card-send:hover {
    background: var(--primary-hover);
    transform: none;
  }
  
  .card-send:active {
    background: var(--maroon-dark);
    transform: none;
  }

  /* Focus indicators - enhanced for reduced motion */
  .card:focus-visible,
  .card-link:focus-visible {
    transform: none;
    outline: 4px solid var(--accent);
    outline-offset: 4px;
    box-shadow: var(--shadow-2), 0 0 0 8px rgba(181, 154, 87, 0.25);
  }

  /* Navigation and UI elements */
  .chip, .btn, .modal-overlay, .modal-container,
  .search-input, .search-clear, .search-wrapper,
  .logo-link, .scroll-top {
    transition: none;
    transform: none;
  }
  
  /* Alternative hover feedback for chips */
  .chip:hover {
    background: var(--chip-active);
    border-color: var(--gold-primary);
    transform: none;
  }
  
  /* Alternative hover feedback for buttons */
  .btn:hover {
    transform: none;
  }
  
  /* Logo hover - remove transform, keep opacity change */
  .logo-link:hover {
    transform: none;
    opacity: 0.85;
  }

  /* Disable card entrance animation for accessibility */
  .card.card-enter {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  /* Modal animations - instant appearance */
  .modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }
  
  .modal-overlay.is-open .modal-container {
    transform: none;
  }
  
  /* Scroll behavior */
  html {
    scroll-behavior: auto;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Touch-specific card interactions */
  .card {
    /* Reduce hover effects on touch devices */
    transition: transform var(--animation-fast) var(--easing-smooth),
                box-shadow var(--animation-fast) var(--easing-smooth),
                background-color var(--animation-fast) ease,
                border-color var(--animation-fast) ease;
  }
  
  .card:hover {
    /* Lighter hover effect for touch devices */
    transform: translate3d(0, -1px, 0) scale(1.01);
    box-shadow: var(--shadow-2);
  }
  
  .card:active {
    /* Enhanced active feedback for touch */
    transform: translate3d(0, 0, 0) scale(0.97);
    box-shadow: var(--shadow-1);
    transition: transform 0.1s var(--easing-smooth),
                box-shadow 0.1s var(--easing-smooth);
  }
  
  /* Touch-optimized card send button */
  .card-send {
    width: 44px;
    height: 44px;
    right: 12px;
    bottom: 12px;
    opacity: 1; /* Always visible on touch devices */
    transform: none;
    font-size: 1.1rem;
  }
  
  .card-send:active {
    transform: scale(0.9);
    transition: transform 0.1s var(--easing-smooth);
  }
}

/* Ensure minimum 44px touch targets across all interactive elements */
@media (max-width: 768px) {
  /* Chips - ensure adequate touch targets */
  .chip {
    min-height: 44px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Search clear button */
  .search-clear {
    min-width: 44px;
    min-height: 44px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Modal close button */
  .modal-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Buttons in modal footer */
  .btn {
    min-height: 44px;
    padding: 12px 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Scroll to top button */
  .scroll-top {
    width: 48px;
    height: 48px;
  }
  
  /* Logo link - ensure adequate touch area */
  .logo-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 4px;
  }
}

/* Mobile performance optimizations */
@media (max-width: 640px) {
  /* Optimize animations for mobile performance */
  .card {
    /* Use more efficient transforms on mobile */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
  }
  
  .card:hover {
    /* Lighter animations for mobile performance */
    transform: translate3d(0, -1px, 0);
    will-change: transform, box-shadow;
  }
  
  /* Reduce animation complexity on very small screens */
  .card[data-category="teaching"]:hover,
  .card[data-category="research"]:hover,
  .card[data-category="service"]:hover,
  .card[data-category="professional"]:hover {
    background: var(--bg-card); /* Remove gradient on mobile for performance */
  }
  
  /* Optimize modal animations for mobile */
  .modal-container {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
  }
}

/* Small typography tweaks on very narrow screens */
@media (max-width: 380px){
  .card-title{ font-size: 1rem; }
  
  /* Ensure chips remain touch-friendly even on very small screens */
  .chip{ 
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.85rem;
  }
  
  /* Adjust card send button for very small screens */
  .card-send {
    width: 44px;
    height: 44px;
    right: 8px;
    bottom: 8px;
  }
}


