/* Accessibility (WCAG 2.1/2.2 AA) overrides — load after the main stylesheet */

:root {
  /* Brand color for backgrounds (buttons, nav hover, scrollbar, etc.): same blue-violet hue as the text color,
     dark enough for white text at 5.1:1 */
  --brand-color: #525fe6;

  /* Lighter, bluer brand purple for text on the dark background: 6.3:1 on #070614 (the background brand color is only 4.0:1, too dark for text) */
  --brand-text: #7a85ff;
}

/* Screen-reader-only text */
.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;
}

/* Skip link: hidden until focused */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000000;
  padding: 12px 20px;
  border-radius: 12px;
  background: #ffffff;
  color: #070614;
  font-weight: 500;
}

.skip-link:focus {
  top: 16px;
}

main:focus {
  outline: none;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
iframe:focus-visible,
video:focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--brand-color) !important;
}

/* Text contrast */
a,
span,
.love {
  color: var(--brand-text);
}

#cv h4,
#cv .h4 {
  color: var(--brand-text);
}

#cv h4.h5,
#cv h4.h6 {
  color: #ffffff;
}

.first {
  background-color: #7d6a40;
}

.second {
  background-color: #707070;
}

/* Links inside running text must not rely on color alone */
p a:not([class]),
li a:not([class]) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

#nav li a {
  text-decoration: none;
}

/* Section progress dots are never displayed (zero-height on mobile, display:none on desktop) but their empty links were still focusable */
#project-progressbar-container {
  display: none !important;
}

/* Icon buttons that were previously divs: strip native button chrome */
#navTrigger,
.scrollUpButton,
.leftArrow,
.rightArrow,
.video-toggle {
  border: 0;
  padding: 0;
  background-color: transparent;
  font: inherit;
  cursor: pointer;
}

.leftArrow,
.rightArrow {
  background-repeat: no-repeat;
  background-position: center;
}

@media only screen and (max-width: 800px) {
  /* Off-canvas menu: keep hidden links out of the tab order until it opens */
  #navWrapper {
    visibility: hidden;
  }

  #navWrapper.active {
    visibility: visible;
  }

  .scrollUpButton {
    display: none !important;
  }
}

/* Heading-level utility classes: let a heading keep its original look after its level is corrected */
:where(.h1, .h2, .h3, .h4, .h5, .h6) {
  font-family: 'Barlow', sans-serif;
  line-height: 110%;
}

.h1 { font-size: 3rem;    margin: 2.1rem 0 1.68rem;   font-weight: 100; }
.h2 { font-size: 2.25rem; margin: 1.78rem 0 1.424rem; font-weight: 100; }
.h3 { font-size: 2rem;    margin: 1.46rem 0 1.168rem; font-weight: 100; }
.h4 { font-size: 2.28rem; margin: 1.14rem 0 .912rem;  font-weight: 100; }
.h5 { font-size: 1.64rem; margin: .82rem 0 .656rem;   font-weight: 300; }
.h6 { font-size: 18px;    margin: .5rem 0 .4rem;      font-weight: 300; }

/* CV award badges that used to be h6 */
p.h6.first {
  margin-bottom: 20px;
}

.h1:not(.left-align):not(.right-align),
.h2:not(.left-align):not(.right-align),
.h3:not(.left-align):not(.right-align) {
  text-align: center;
}

:is(h1, h2, h3):is(.h4, .h5, .h6):not(.center-align):not(.right-align) {
  text-align: inherit;
}

p.h1, p.h2, p.h3, p.h4, p.h5, p.h6 {
  color: #ffffff;
}

/* Pause control added to autoplaying videos by main.js */
.has-video-toggle {
  position: relative;
}

.video-toggle {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(7, 6, 20, 0.7);
  color: #ffffff;
  font-size: 14px;
  line-height: 40px;
  text-align: center;
}

.video-toggle:hover {
  background-color: var(--brand-color);
}

/* Honor the OS "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

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

  [style*="background-attachment: fixed"] {
    background-attachment: scroll !important;
  }
}

/* Bio hobby tiles and overlay close control (previously clickable divs) */
button.tertiary {
  border: 0;
  text-align: left;
}

.exitHobbyOverlay {
  border: 0;
  padding: 0;
  background-color: transparent;
}

/* Design page filters: real buttons inside the list items, styled by the li */
.filter-button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: inherit;
}

/* Secondary buttons turn brand-colored on hover; full white text keeps 5:1 contrast (70% white was 3.3:1) */
.secondary:hover,
.tertiary:hover,
.tertiary:focus-visible {
  color: #ffffff;
}
