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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-black);
  background: var(--color-red);
  -webkit-font-smoothing: antialiased;
}

@supports not (overflow: clip) {
  body {
    overflow-x: hidden;
  }
}

main,
.page-wrapper,
.sections-wrapper {
  margin: 0;
  padding: 0;
  gap: 0;
}

main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 0;
  background: transparent;
}

/* overflow-x:hidden on main breaks position:sticky (snapshots scroll-hijack) */
@media (min-width: 769px) {
  main {
    overflow-x: visible;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  main {
    overflow-x: hidden;
  }
}

/* Flex children default to min-width:auto and expand with wide horizontal tracks */
main > * {
  margin-top: 0;
  margin-bottom: 0;
  min-width: 0;
  max-width: 100%;
}

section,
.intro,
.career-section,
.skills-section,
.love-hate,
footer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* snapshots-outer: overflow scoped in snapshots.css (visible on desktop for sticky) */

.footer-spacer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

main > section {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.visually-hidden {
  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;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--color-black);
  color: var(--color-white);
  transform: translateY(-150%);
  transition: transform var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Title reveal animation */
[data-animate-title] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity var(--duration-medium) var(--ease-smooth),
    transform var(--duration-medium) var(--ease-smooth);
}

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

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

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