:root {
  --accent: #b6541c;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Jost', sans-serif;
  color: #2f2e2e;
  background: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

#portfolio,
#about,
#contact {
  scroll-margin-top: 96px;
}

button[type="submit"] {
  transition: filter 0.2s ease, transform 0.15s ease;
}

button[type="submit"]:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.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;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: #ffffff;
  color: #2f2e2e;
  padding: 10px 18px;
  border-radius: 6px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  z-index: 100;
  transition: top 0.15s ease;
  border: 2px solid var(--accent);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.proj-tile {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.proj-card {
  position: relative;
}

.proj-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0);
  transition: background-color 0.25s ease;
  pointer-events: none;
}

.proj-card:hover::after,
.proj-card:focus-within::after {
  background-color: rgba(255, 255, 255, 0.55);
}

ul.results li {
  margin-bottom: 10px;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid #eee;
}

figcaption {
  font-size: 13px;
  color: #8a8a8a;
  margin-top: 6px;
  line-height: 1.4;
}

.gal {
  display: grid;
  gap: 16px;
  margin: 24px 0;
  align-items: start;
}

.gal-2 {
  grid-template-columns: 1fr 1fr;
}

.gal-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.baLabel {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 6px;
}

.media-row {
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 28px 0;
}

.media-row.reverse {
  flex-direction: row-reverse;
}

.media-row .media-text {
  flex: 1 1 320px;
}

.media-row .media-figure {
  flex: 1 1 360px;
  margin: 0 auto;
}

.media-row .media-figure img {
  width: 100%;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #eee;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 860px) {
  .split,
  .gal-2,
  .gal-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .media-row {
    flex-direction: column !important;
    gap: 20px;
  }
}

/* Portfolio tiles are wider than the shared 860px breakpoint above, so they
   need their own, more generous breakpoint to avoid overflowing on
   medium-width windows before stacking. */
@media (max-width: 1040px) {
  .proj-grid {
    align-items: stretch !important;
  }

  .proj-row {
    flex-direction: column !important;
  }

  .proj-row .proj-tile {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* Keep the primary nav (Portfolio / About / Contact / Resume) on a single
   line on phone-width screens instead of wrapping item-by-item. The header
   and nav are inline-styled (shared markup repeated per page), so these
   overrides use !important and target the stable aria-label/element. */
@media (max-width: 600px) {
  header {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  nav[aria-label="Primary"] {
    gap: 6px 16px !important;
  }

  nav[aria-label="Primary"] a {
    font-size: 14px !important;
    padding: 10px 2px !important;
  }
}
