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

/* ==== THEME: NAVY + ORANGE ==== */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #555555;

  --primary: #0b3d91;       /* deep navy – links, headings, nav */
  --primary-strong: #082e6d;/* darker hover/focus navy */
  --secondary-bg: #eef2f7;  /* light cool gray-blue for boxes */
  --accent: #f76902;        /* vibrant orange – progress bar, highlights */
  --border: #d7dde6;
  --focus: #ffbf47; /* warm yellow focus ring with strong contrast */
  --user-font-size: 100%;
  --reading-highlight: #ffe08a;
  --reading-highlight-text: #111111;
  --content-width: 1200px;
}


/* === BODY === */
body {
  font-family: 'Work Sans', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* === LINKS === */

/* Never remove outlines; make them consistent and obvious */
:where(a, button, [role="button"], input, textarea, select, summary,
       [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Improve link readability and focus parity */
a {
  color: var(--primary);
  text-decoration-thickness: .08em;
  text-underline-offset: .15em;
  text-decoration-skip-ink: auto;
}
a:focus-visible { text-decoration-line: underline ; }


/* === HEADER === */
header {
  display: grid;
  width: 100%;
  grid-template-rows: auto auto auto;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  background-color: var(--bg);
  position: relative;
  z-index: 10;
  overflow: hidden;
  justify-content: space-around;
  border-bottom: 2px solid var(--primary);
}

.header_logic {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  background-color: rgba(0, 0, 0, 0.8);
  position: absolute;
  left: 50px;
  bottom: 10px;
  border-radius: 10px;
  gap: 25px;
  padding: 15px;
}

.logic_text {
  font-size: 1.5rem;
  color: #fff;
}

.logic_text p {
    color: #fff
}

header #headshot {
  grid-area: 1 / 1 / 2 / 2;
  max-width: 130px;
  height: auto;
  border-radius: 20pt;
}

#banner {
  grid-area: 3 / 1 / 4 / 5;
  width: 100%;
  max-height: 500px;
  display: block;
}

/* === Language Switch Button === */
.lang-switch {
  position: absolute;
  bottom: 15px;
  right: 25px;
  z-index: 20;
}

.lang-btn:hover {
  background-color: var(--primary);
  color: #fff;
  transform: scale(1.05);
}
.lang-btn {
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* === NAVIGATION CONTAINER === */
#top-nav {
  position: sticky;
  top: 0;
  background-color: var(--bg);
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  width: 100%;
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex-direction: column;
}

/* === HAMBURGER BUTTON === */
#nav-toggle {
  display: none; /* hidden on desktop */
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 10px;
  z-index: 1100;
  transition: color 0.3s ease;
}

#nav-toggle:hover {
  color: var(--primary-strong);
}

/* === NAV LINKS (DESKTOP) === */
#nav-links {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  margin: 0;
  padding: 10px 0;
}


#nav-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
#nav-links a:focus-visible { background: var(--secondary-bg); }
#nav-links li {
  display: inline-block;
}

#nav-links a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.3s ease;
}

#nav-links a:hover,
#nav-links a:focus {
  color: var(--primary-strong);
  text-decoration: underline;
}

/* === PROGRESS BAR === */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 5px;
  background-color: var(--accent);
  z-index: 2000;
  transition: width 0.25s ease;
}

html {
  font-size: var(--user-font-size);
  scroll-behavior: smooth;
}

/* === MAIN CONTENT === */
main {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 30px;
  gap: 20px;
}

h2 {
  margin-bottom: 25px;
  font-size: 1.6rem;
  color: var(--primary-strong);
}

p {
  margin-bottom: 10px;
  color: var(--text);
}

#about {
  padding: 20px;
  font-size: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* === SECTIONS === */
#current_project,
#completed,
#completed_class,
#ongoing_class, #publications, #blog {
  padding: 20px;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* === LISTS === */
ul {
  padding: 20px;
}

li {
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* === GRID LAYOUTS === */
.two_by_two,
.two_column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  justify-content: space-around;
  margin-bottom: 20px;
}

/* === PROJECT BOXES === */
.inspire, .k-12, .a11y, .mll, .hci_web, .iSchool_tour, .TTS,
.caption_mask, .graduation, .recruitment, .ISTE_646,
.capstone, .Website, .marketing, .youth_ai, .autism_ai {
  border: 1px solid var(--primary);
  background-color: var(--secondary-bg);
  padding: 20px;
  border-radius: 8px;
  transition: box-shadow 0.3s ease;
}

.inspire:hover, .k-12:hover, .a11y:hover, .mll:hover, .hci_web:hover,
.iSchool_tour:hover, .TTS:hover, .caption_mask:hover, .graduation:hover,
.recruitment:hover, .ISTE_646:hover, .capstone:hover, .Website:hover, .marketing:hover, .youth_ai:hover, .autism_ai:hover {
  box-shadow: 0 4px 10px rgba(91, 42, 134, 0.2);
}

.inspire h3 a, .a11y h3 a, .hci_web h3 a, .iSchool_tour h3 a, .ISTE_646 h3 a {
  color: var(--primary);
}

.inspire h3 a:hover, .a11y h3 a:hover, .hci_web h3 a:hover,
.iSchool_tour h3 a:hover, .ISTE_646 h3 a:hover {
  text-decoration: underline;
  transition: ease 0.3s;
}

/* Overlay */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;                  /* above progress bar */
  background: rgba(0,0,0,.6);
  align-items: center;            /* center when open */
  justify-content: center;
  padding: 5vh 2vw;               /* gutter for small screens */
}
.modal.open { display: flex; }    /* toggled by JS */

/* Dialog */
.modal-content {
  position: relative;
  width: min(92vw, 800px);
  max-height: 90vh;               /* allow scrolling */
  overflow: auto;                 /* internal scroll */
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,.35);
  padding: 20px;
}

/* PDF/iframe area gets its own viewport */
.modal-content embed,
.modal-content iframe {
  display: block;
  width: 100%;
  height: 80vh;                   /* big, but still inside 90vh box */
  border: 0;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  z-index: 1;                     /* above embed */
}
.close-btn:hover { color: var(--primary); }
.close-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Keep the progress bar below the modal */
#progress-bar { z-index: 1990; }

/* === IMAGES & IFRAMES === */
.inspire img, .k-12 img, .a11y img, .mll img, .hci_web img, .TTS img,
.recruitment img, .ISTE_646 img, .capstone img, .Website img, .marketing img, .youth_ai img, .autism_ai img {
  width: 100%;
  border-radius: 5px;
}

iframe {
  max-width: 600px;
  width: 100%;
  height: 350px;
  border-radius: 5px;
}

/* === ACCORDION === */
.accordion-btn {
  background-color: var(--primary);
  color: #fff;
  cursor: pointer;
  padding: 15px 20px;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

/* Add a visual “open/close” glyph that screen-reader users will also hear if you set aria-expanded in JS */
.accordion-btn::after {
  content: "+";
  float: right;
  font-weight: 700;
}
.accordion-btn.active::after { content: "−"; }

/* Keep focus clear even on colored backgrounds */
.accordion-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.accordion-btn:hover,
.accordion-btn.active {
  background-color: var(--primary-strong);
}

.accordion-panel {
  display: none;
  padding: 0 20px 15px 20px;
  background-color: var(--bg);
  border-left: 4px solid var(--primary);
  border-radius: 5px;
  margin-bottom: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-btn.active + .accordion-panel {
  display: block;
  max-height: 1000px;
}

/* === BLOG SECTION === */
.blog-card {
  display: flex;
  gap: 20px;
  background-color: #f9fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid #ddd;
  align-items: center;
}

.blog-card img {
  width: 250px;
  height: auto;
  border-radius: 8px;
}

.blog-card .blog-content {
  flex: 1;
}

.blog-card h3 a {
  color: var(--primary); 
  text-decoration: none;
}

.blog-card h3 a:hover {
  color: var(--primary-strong); 
  text-decoration: underline;
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  color: var(--primary); 
  text-decoration: none;
}

.read-more:hover {
  color: var(--primary-strong); 
  text-decoration: underline;
}

/* === FOOTER === */
footer {
  background-color: #041e54; /* deep navy for high contrast */
  color: #ffffff;
  text-align: center;
  padding: 25px 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

footer p {
  color: #ffffff;                 /* make all footer text white */
  margin: 4px 0;
}

footer p:first-of-type {
  color: #f2f2f2;                 /* slightly lighter gray-white for © line */
  font-weight: 500;
}

/* Footer links (email + social) */
footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: var(--accent); /* bright orange hover */
  text-decoration: underline;
} 

/* Social icons container */
footer .social-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* Icon sizing + alignment */
footer img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  border: 0;
  background: transparent;
}

/* Optional: make all logos visually cohesive */
footer img[alt*="LinkedIn"],
footer img[alt*="ORCID"] {
  border-radius: 4px;
}

.photos-page {
  box-sizing: border-box;
}

.photos-introduction {
  margin-bottom: 30px;
}

.photos-introduction h2 {
  margin-bottom: 10px;
}

.photos-introduction p {
  max-width: 70ch;
  color: var(--muted);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.photo-card {
  min-width: 0;
  overflow: hidden;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.photo-card:hover {
  box-shadow: 0 6px 18px rgba(11, 61, 145, 0.18);
  transform: translateY(-2px);
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.photo-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-button:hover img {
  transform: scale(1.025);
}

.photo-card figcaption {
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}

/* Enlarged photo viewer */

.photo-lightbox {
  width: min(94vw, 1100px);
  max-width: 1100px;
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.photo-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.photo-lightbox-content {
  position: relative;
  max-height: 94vh;
  padding: 20px;
  overflow: auto;
}

.photo-lightbox img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 5px;
}

.photo-lightbox p {
  max-width: 75ch;
  margin: 14px auto 0;
  color: var(--text);
  text-align: center;
}

.photo-lightbox-close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 0 10px auto;
  color: var(--text);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.photo-lightbox-close:hover {
  color: #fff;
  background: var(--primary);
}

/* Highlight the current navigation page */

#nav-links a[aria-current="page"] {
  color: var(--primary-strong);
  text-decoration: underline;
  text-decoration-thickness: 0.14em;
}
/* =====================================================
   ACCESSIBILITY PANEL
   ===================================================== */

.accessibility-panel {
  /* Compact while closed */
  width: fit-content;
  max-width: calc(100% - 30px);
  margin: 12px auto;

  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(11, 61, 145, 0.1);
  font-size: 16px;
}

/* Match the main section only when expanded */
.accessibility-panel[open] {
  width: calc(100% - 40px);
  max-width: 1140px;
}

.accessibility-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.accessibility-panel summary::-webkit-details-marker {
  display: none;
}

.accessibility-panel summary::marker {
  content: "";
}

.accessibility-panel summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.25rem;
  line-height: 1;
}

.accessibility-panel[open] summary::after {
  content: "−";
}

.accessibility-panel summary:hover {
  color: var(--primary-strong);
  background: var(--secondary-bg);
}

.accessibility-panel-content {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.75fr)
    minmax(220px, 0.9fr)
    minmax(440px, 2fr);
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.accessibility-group {
  min-width: 0;
  padding: 16px;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.accessibility-group legend {
  float: left;
  width: 100%;
  margin-bottom: 14px;
  color: var(--primary-strong);
  font-size: 1rem;
  font-weight: 700;
}

.accessibility-group legend + * {
  clear: both;
}

.accessibility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accessibility-actions button,
.switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--primary);
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: 6px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.accessibility-actions button:hover:not(:disabled),
.accessibility-actions button[aria-pressed="true"],
.switch-button:hover {
  color: #fff;
  background: var(--primary);
}

.accessibility-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.text-size-actions,
.speech-main-actions,
.sentence-actions {
  flex-wrap: nowrap;
}

.read-aloud-group {
  display: flex;
  flex-direction: column;
}

.accessibility-help {
  max-width: none;
  margin: 12px 0 0;
  padding-top: 10px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Dark-mode switch */

.switch-button {
  justify-content: flex-start;
  white-space: nowrap;
}

.switch-track {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  background: var(--muted);
  border: 2px solid var(--border);
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.switch-button[aria-checked="true"] .switch-track {
  background: var(--primary);
}

.switch-button[aria-checked="true"] .switch-thumb {
  transform: translateX(18px);
}

/* Reading speed */

.speech-speed-control {
  width: 100%;
  margin-bottom: 14px;
}

.speech-speed-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.speech-speed-heading label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

#speech-rate-value {
  min-width: 2.5em;
  padding: 2px 8px;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  text-align: center;
}

#speech-rate {
  display: block;
  width: 100%;
  min-height: 32px;
  accent-color: var(--primary);
  cursor: pointer;
}

.speech-rate-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Speech buttons */

.speech-control-rows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.speech-main-actions {
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

/* Spoken-text highlighting */

.speech-word {
  border-radius: 3px;
  transition:
    color 0.25s ease,
    background-color 0.25s ease;
}

.speech-highlight {
  color: var(--reading-highlight-text);
  background: var(--reading-highlight);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* =====================================================
   USER-CONTROLLED DARK MODE
   ===================================================== */

html.dark-mode {
  color-scheme: dark;

  --bg: #0b0f14;
  --text: #e8edf6;
  --muted: #c0c9d8;
  --primary: #9cc2ff;
  --primary-strong: #cfe0ff;
  --secondary-bg: #121826;
  --accent: #ff8f3d;
  --border: #526173;
  --focus: #ffd166;
  --reading-highlight: #ffd166;
  --reading-highlight-text: #101318;
}

html.dark-mode .blog-card {
  background: var(--secondary-bg);
  border-color: var(--border);
}

html.dark-mode .accordion-btn {
  color: var(--text);
  background: #1a2340;
}

html.dark-mode .accordion-btn:hover,
html.dark-mode .accordion-btn.active {
  background: #223064;
}

html.dark-mode footer {
  background: #0d1422;
  border-top: 1px solid var(--border);
}

/* =====================================================
   RESPONSIVE LAYOUT
   ===================================================== */

/* Compact desktop and tablet */

@media (max-width: 1024px) {
  main {
    width: 100%;
    max-width: 800px;
    padding: 20px;
  }

  .two_by_two,
  .two_column {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .accessibility-panel-content {
    grid-template-columns: 1fr 1fr;
  }

  .read-aloud-group {
    grid-column: 1 / -1;
  }
}

/* Desktop navigation */

@media (min-width: 769px) {
  #nav-toggle {
    display: none !important;
  }

  #nav-links {
    display: flex !important;
  }
}

/* Tablet and mobile navigation */

@media (max-width: 768px) {
  .header_logic {
    left: 10px;
    bottom: 15px;
    width: 85%;
    gap: 10px;
    padding: 12px;
  }

  header #headshot {
    max-width: 90px;
  }

  .logic_text {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  #top-nav {
    min-height: 56px;
  }

  .nav-container {
    width: 100%;
    min-height: 56px;
    align-items: stretch;
  }

  #nav-toggle {
    position: absolute;
    top: 6px;
    right: 12px;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
  }

  #nav-links {
    position: static;
    display: none;
    width: 100%;
    margin: 56px 0 0;
    padding: 0;
    flex-direction: column;
    align-items: center;
    background: var(--bg);
    border-top: 2px solid var(--primary);
  }

  #nav-links.open {
    display: flex;
    animation: nav-fade-in 0.3s ease;
  }

  #nav-links li {
    width: 100%;
    text-align: center;
  }

  #nav-links a {
    display: block;
    padding: 12px;
    font-size: 1.1rem;
  }

  #nav-links a:hover {
    color: var(--primary-strong);
    background: var(--secondary-bg);
  }

  main {
    width: 100%;
    max-width: 100%;
    padding: 20px;
  }

  h2 {
    font-size: 1.4rem;
    text-align: center;
  }

  iframe {
    width: 100%;
    height: 260px;
  }

  .blog-card {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .blog-card img {
    width: 100%;
    margin-bottom: 10px;
  }

  footer {
    padding: 15px;
    font-size: 0.85rem;
  }

  @keyframes nav-fade-in {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Narrow screens */

@media (max-width: 600px) {
  .photo-gallery {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .photo-card:hover {
    transform: none;
  }

  .photo-lightbox-content {
    padding: 12px;
  }

  .accessibility-panel {
    width: calc(100% - 24px);
  }

  .accessibility-panel-content {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .read-aloud-group {
    grid-column: auto;
  }

  .speech-control-rows {
    align-items: stretch;
    flex-direction: column;
  }

  .speech-main-actions {
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .speech-rate-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  }

  .speech-main-actions,
  .sentence-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .accessibility-actions button {
    width: 100%;
  }
}

/* Small phones */

@media (max-width: 480px) {
  main {
    padding: 15px;
  }

  h2 {
    font-size: 1.25rem;
  }

  p,
  li {
    font-size: 1rem;
  }

  .header_logic {
    display: flex;
    width: 85%;
    left: 10px;
    bottom: 10px;
    padding: 10px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }

  header #headshot {
    max-width: 65px;
  }

  .logic_text {
    font-size: 1rem;
  }

  #nav-links a {
    padding: 10px;
    font-size: 1rem;
  }

  .speech-main-actions,
  .sentence-actions {
    grid-template-columns: 1fr;
  }

  .blog-card {
    padding: 12px;
  }

  footer {
    padding: 10px;
    font-size: 0.8rem;
  }
}

/* =====================================================
   USER ACCESSIBILITY PREFERENCES
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .lang-btn:hover,
  .photo-card:hover,
  .photo-button:hover img {
    transform: none;
  }

  #nav-links.open {
    animation: none;
  }
}

@media (forced-colors: active) {
  a {
    text-decoration: underline;
  }

  .accessibility-panel,
  .accessibility-panel-content,
  .accessibility-group,
  .accordion-btn {
    border-color: CanvasText;
  }

  .accessibility-actions button,
  .switch-button {
    color: ButtonText;
    background: ButtonFace;
    border-color: ButtonText;
  }

  .speech-highlight {
    color: HighlightText;
    background: Highlight;
  }

  .modal {
    outline: 2px solid CanvasText;
  }
}