/* ==========================================================================
   policy.fi — "The Policy Folio"
   An editorial, typographically-rich academic website
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --bg: #fafaf8;
  --bg-pure: #ffffff;
  --text: #1c1c1c;
  --text-secondary: #5a5a58;
  --text-tertiary: #8a8a86;
  --accent: #0b525b;
  --accent-hover: #127681;
  --accent-pale: #e4f0f1;
  --accent-faint: #f2f8f8;
  --gold: #c9a84c;
  --gold-pale: #faf5e8;
  --gold-border: #e0d5a8;
  --neutral: #f4f4f0;
  --border: #ddddd8;
  --border-light: #eaeae6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --radius: 3px;
  --radius-lg: 6px;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Newsreader', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --font-label: 'Plus Jakarta Sans', sans-serif;
  --max-width: 920px;
  --max-width-wide: 1040px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Subtle paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* Top accent strip */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 70%, var(--gold) 100%);
  z-index: 1000;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 600;
}

em {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.02em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--neutral);
  padding: 0.15em 0.4em;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
  border-bottom: 1px solid transparent;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* --- Header & Navigation --- */
.site-header {
  position: sticky;
  top: 3px; /* below accent strip */
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.nav-site-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  letter-spacing: -0.02em;
  transition: color var(--transition);
}

.nav-site-title:hover {
  color: var(--accent);
  border-bottom: none;
}

/* Decorative dot before site title */
.nav-site-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
  margin-bottom: 2px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.15rem;
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: none;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-faint);
  border-bottom: none;
}

.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 0.8rem;
  right: 0.8rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: var(--neutral);
}

.site-footer .container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin: 0;
  letter-spacing: 0.01em;
}

/* --- Section Labels (small caps editorial style) --- */
.section-label {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--text);
  display: inline-block;
}

/* --- Hero Grid (Home page) --- */
/* Float-based hero: text wraps around photo */
.hero-float {
  margin-bottom: 1.5rem;
}

.hero-float::after {
  content: '';
  display: table;
  clear: both;
}

.profile-photo {
  float: left;
  width: 190px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--bg-pure);
  outline: 1px solid var(--border-light);
  margin: 0.2rem 1.75rem 0.75rem 0;
}

/* Keep old grid for any page that uses it */
.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.hero-content h1 {
  margin-top: 0.25rem;
}

.hero-content .subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* --- Info Grid (Affiliations, Education) --- */
.info-section {
  margin-top: 1.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.info-grid-3col {
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 0.88rem;
}

.info-block h3 {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.info-block h3:first-child {
  margin-top: 0;
}

.info-list {
  list-style: none;
  padding: 0;
}

.info-list li {
  padding: 0.4rem 0;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border-light);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list .degree {
  font-weight: 600;
  font-size: 0.88rem;
}

.info-list .institution {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Compact sections (capacity dev, conferences, media, links at bottom) */
.compact-section {
  font-size: 0.84rem;
  line-height: 1.6;
}

.compact-section p {
  margin-bottom: 0.6rem;
}

.compact-section ul {
  margin-bottom: 0.6rem;
}

.compact-section li {
  margin-bottom: 0.2rem;
}

.compact-section .section-label {
  font-size: 0.68rem;
}

.compact-section h3 {
  font-size: 0.88rem;
}

.compact-section .info-list li {
  font-size: 0.84rem;
  padding: 0.3rem 0;
}

/* --- Datawrapper Map --- */
.datawrapper-map {
  margin: 0.75rem 0 0;
  overflow: hidden;
}

.datawrapper-map iframe {
  display: block;
}

@media (max-width: 768px) {
  .datawrapper-map {
    max-height: 350px;
    overflow: hidden;
    margin: 0.5rem 0 0;
  }
}

@media (max-width: 480px) {
  .datawrapper-map {
    max-height: 280px;
  }
}

/* --- Accordion --- */
.accordion-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0.85rem;
  overflow: hidden;
  background: var(--bg-pure);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.accordion-section:hover {
  box-shadow: var(--shadow-md);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background var(--transition);
  line-height: 1.3;
}

.accordion-header:hover {
  background: var(--accent-faint);
}

.accordion-count {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--neutral);
  padding: 0.15em 0.6em;
  border-radius: 10px;
  margin-left: 0.6rem;
}

.accordion-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--neutral);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform var(--transition), background var(--transition);
}

.accordion-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(-45deg);
  margin-top: -2px;
  transition: transform var(--transition);
}

.accordion-header[aria-expanded="true"] .accordion-indicator {
  background: var(--accent-pale);
}

.accordion-header[aria-expanded="true"] .accordion-indicator::before {
  transform: rotate(45deg);
  margin-top: 2px;
  border-color: var(--accent);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content.open {
  max-height: none;
}

.accordion-body {
  padding: 0.25rem 1.25rem 1.25rem;
}

/* --- Resource Cards (AI-econ page) --- */
.resource-card {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 0.65rem;
  transition: all var(--transition);
  position: relative;
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent-hover);
  transform: translateX(2px);
}

.resource-card .card-type-icon {
  position: absolute;
  top: 1.1rem;
  right: 1.35rem;
  font-size: 0.85rem;
  opacity: 0.5;
}

.resource-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  padding-right: 2rem;
}

.resource-card .card-title a {
  color: var(--text);
  border-bottom: none;
}

.resource-card .card-title a:hover {
  color: var(--accent);
}

.resource-card .card-meta {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 0.45rem;
}

.resource-card .card-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.resource-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Featured cards */
.resource-card.featured {
  border-left-color: var(--gold);
  background: linear-gradient(135deg, var(--bg-pure) 0%, var(--gold-pale) 100%);
}

.resource-card.featured:hover {
  border-left-color: var(--gold);
}

/* Category-specific left borders */
.resource-card[data-category="Research Papers"] { border-left-color: #0b525b; }
.resource-card[data-category="Courses & Learning"] { border-left-color: #2a7f62; }
.resource-card[data-category="AI Tools for Research"] { border-left-color: #5b4a8a; }
.resource-card[data-category="Coding with AI"] { border-left-color: #c05746; }
.resource-card[data-category="Talks & Videos"] { border-left-color: #b08c3e; }
.resource-card[data-category="Policy & Governance"] { border-left-color: #3a6ea5; }
.resource-card[data-category="Prompt Engineering"] { border-left-color: #7a5230; }
.resource-card[data-category="Commentary & Analysis"] { border-left-color: #6b7280; }
.resource-card[data-category="International Organizations"] { border-left-color: #2563eb; }
.resource-card[data-category="Simulation & Data"] { border-left-color: #7c3aed; }

/* --- Publication Entries (Research page) --- */
.pub-entry {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-light);
}

.pub-entry:last-child {
  border-bottom: none;
}

/* Toggleable publication header */
.pub-toggle {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color var(--transition);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
}

.pub-toggle:hover {
  color: var(--accent);
}

.pub-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--text-tertiary);
  transition: transform var(--transition), color var(--transition);
  margin-top: 0.05rem;
}

.pub-toggle-icon::before {
  content: '▸';
}

.pub-toggle[aria-expanded="true"] .pub-toggle-icon {
  color: var(--accent);
}

.pub-toggle[aria-expanded="true"] .pub-toggle-icon::before {
  content: '▾';
}

.pub-entry .pub-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
}

.pub-entry .pub-title a {
  color: var(--text);
  border-bottom: none;
}

.pub-entry .pub-title a:hover {
  color: var(--accent);
}

/* Collapsible publication details */
.pub-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 1.5rem;
}

.pub-details.open {
  max-height: none;
}

.pub-details-inner {
  padding: 0.5rem 0 0.25rem;
}

.pub-entry .pub-authors {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.pub-entry .pub-venue {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.84rem;
  color: var(--text-tertiary);
  margin-top: 0.1rem;
}

.pub-entry .pub-description {
  font-size: 0.84rem;
  margin-top: 0.35rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Lists inside publication details — match description font */
.pub-details-inner ul {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
  padding-left: 1.25rem;
}

.pub-details-inner ul li {
  margin-bottom: 0.2rem;
}

/* --- Highlight Tabs --- */
.highlight-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.highlight-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  padding-bottom: 0.5rem;
  margin-bottom: 0;
  transition: all var(--transition);
  opacity: 0.45;
}

.highlight-tab:hover {
  opacity: 0.7;
}

.highlight-tab.active {
  border-bottom-color: var(--text);
  opacity: 1;
}

/* --- Highlights Grid (AI-econ page) --- */
.highlights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.highlight-card {
  background: var(--bg-pure);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.highlight-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.highlight-card .highlight-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.highlight-card .highlight-title a {
  color: var(--text);
  border-bottom: none;
}

.highlight-card .highlight-title a:hover {
  color: var(--accent);
}

.highlight-card .highlight-meta {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 0.4rem;
}

.highlight-card .highlight-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

@media (max-width: 768px) {
  .highlights-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Citation Box --- */
.citation-box {
  background: var(--neutral);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  margin-top: 0.5rem;
}

.citation-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
  user-select: all;
}

.citation-buttons {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.citation-copy {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3em 0.7em;
  background: var(--bg-pure);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 28px;
}

.citation-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.citation-copy.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Tags / Pills --- */
.tag {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.6em;
  background: var(--neutral);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.tag.featured-badge {
  background: var(--gold-pale);
  border-color: var(--gold-border);
  color: #856404;
}

.tag.featured-badge::before {
  content: '★ ';
}

/* --- Filter Pills --- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-pill {
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35em 0.95em;
  background: var(--bg-pure);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-faint);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(11, 82, 91, 0.2);
}

/* --- Search Input --- */
.search-wrapper {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-pure);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 82, 91, 0.08), var(--shadow-sm);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* --- Results Counter --- */
.results-count {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* --- No Results --- */
.no-results {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-tertiary);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
}

/* --- Page Intro (editorial style) --- */
.page-intro {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 640px;
}

/* --- Divider (decorative) --- */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Lists --- */
.inline-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
}

.inline-list li {
  font-size: 0.92rem;
}

.inline-list li:not(:last-child)::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--text-tertiary);
}

ul:not(.nav-links):not(.inline-list):not(.filter-pills):not(.info-list) {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

ul:not(.nav-links):not(.inline-list):not(.filter-pills):not(.info-list) li {
  margin-bottom: 0.4rem;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 0.6rem 1.2rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--accent);
  color: #fff;
  z-index: 10000;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
}

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-small { font-size: 0.85rem; }

/* --- Focus Ring (accessibility + polish) --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* --- Selection --- */
::selection {
  background: var(--accent-pale);
  color: var(--accent);
}

/* --- Smooth Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--neutral);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* --- Page Load Animation --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main.container {
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

main.container h1 {
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
}

main.container .hero-float,
main.container .hero-grid,
main.container .page-intro {
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.12s both;
}

/* --- Responsive: Tablet landscape (≤1024px) --- */
@media (max-width: 1024px) {
  .container,
  .nav-container {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }

  .hero-grid {
    gap: 2rem;
  }

  .resource-card {
    padding: 1rem 1.15rem;
  }
}

/* --- Responsive: Tablet portrait & small screens (≤768px) --- */
@media (max-width: 768px) {
  :root {
    --max-width: 100%;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.3rem; margin-top: 2rem; }
  h3 { font-size: 1.05rem; }

  /* Nav collapses to hamburger */
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 3.75rem;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 250, 248, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  /* Touch-friendly tap targets (min 44px) */
  .nav-links a {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-links a.active::after {
    display: none;
  }

  /* Hero float: keep float on mobile, just smaller */
  .profile-photo {
    width: 120px;
    margin: 0.2rem 1.25rem 0.5rem 0;
  }

  /* Hero grid fallback */
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-content .subtitle {
    font-size: 1rem;
  }

  /* Info grid stacks */
  .info-grid,
  .info-grid-3col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .container {
    padding: 1.75rem 1.25rem;
  }

  /* Disable hover effects that don't work on touch */
  .resource-card:hover {
    transform: none;
  }

  .pub-entry:hover {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    background: transparent;
  }

  /* Accordion touch targets */
  .accordion-header {
    padding: 1rem 1.1rem;
    min-height: 48px;
  }

  /* Filter pills scroll horizontally on mobile */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  /* Search input larger tap target */
  .search-input {
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-size: 1rem;
    min-height: 48px;
  }

  /* Cards: full bleed feel */
  .resource-card {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: var(--radius);
  }

  /* Footer stacks */
  .site-footer .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Page intro slightly smaller */
  .page-intro {
    font-size: 1.02rem;
  }

  /* Inline list wraps gracefully */
  .inline-list {
    gap: 0.25rem 0.5rem;
  }
}

/* --- Responsive: Small phone (≤480px) --- */
@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }

  .container {
    padding: 1.25rem 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .profile-photo {
    width: 100px;
    margin-right: 1rem;
  }

  /* Accordion body tighter */
  .accordion-body {
    padding: 0.5rem 0.85rem 1rem;
  }

  .resource-card {
    padding: 0.85rem 1rem;
  }

  .resource-card .card-title {
    font-size: 0.98rem;
    padding-right: 1.5rem;
  }

  .resource-card .card-description {
    font-size: 0.85rem;
  }

  .resource-card .card-type-icon {
    display: none;
  }

  .section-label {
    font-size: 0.68rem;
  }

  .info-list li {
    font-size: 0.88rem;
  }

  /* Tags smaller */
  .tag {
    font-size: 0.65rem;
    padding: 0.1em 0.45em;
  }
}

/* --- Touch device adjustments --- */
@media (hover: none) and (pointer: coarse) {
  /* Disable all hover-dependent transforms/effects on touch devices */
  .resource-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .pub-entry:hover {
    background: transparent;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .accordion-section:hover {
    box-shadow: var(--shadow-sm);
  }

  /* Ensure tap targets are large enough */
  .nav-links a,
  .filter-pill,
  .accordion-header {
    min-height: 44px;
  }
}

/* --- Print --- */
@media print {
  body::before,
  body::after {
    display: none;
  }

  .site-header,
  .nav-toggle,
  .site-footer,
  .search-wrapper,
  .filter-pills {
    display: none;
  }

  .accordion-content {
    max-height: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .resource-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  a { color: var(--text); }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
    word-break: break-all;
  }
}
