header {
    display: flex;
    align-items: center;                 /* fixed: use a valid alignment */
    gap: 50px;
    background-color: rgb(20, 20, 20);
    width: 100%;
    padding: 12px 20px;
    box-sizing: border-box;

    position: fixed;                     /* keep header visible at top */
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
}

/* ensure the page content sits below the fixed header; header height set by JS into --header-height */
body {
    font-family: "Cascadia Code", sans-serif;
    background-color: rgb(40, 40, 40);
    color: white;
    margin: 0;
    min-height: 100vh;
    padding-top: var(--header-height, 72px); /* fallback header height */
}

h1 {
    margin: 0;
    font-family: "Cascadia Code", sans-serif;
    font-size: 40px;
    text-align: left;
}
h2 {
  padding-left: 20px;
  font-size: clamp(24px, 4vw + 1rem, 60px);
  font-family: inherit; /* Or specify a different font for headers */
}
h3, h4, h5, h6 {
  padding-left: 20px;
  font-family: inherit; /* Or specify a different font for headers */
}

ul {
    list-style-type: none;
    gap: 16px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

nav a {
    margin-right: 40px;
    font-size: 24px;
}

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

a:hover, a:focus {
    text-decoration: underline;
}

p {
    padding-left: 25px;
}

.projects {
  max-width: 900px;
  margin: 36px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.project {
  position: relative;
  overflow: hidden;
  min-height: 420px;               /* larger cards if desired */
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  color: white;
  background: transparent;
  will-change: transform, opacity;
  transition:
    transform 480ms cubic-bezier(.16,.84,.24,1) var(--delay, 0ms),
    opacity 420ms ease var(--delay, 0ms);
}

.project::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg);     /* set per-card using style="--bg:url(...)" */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(100%) contrast(0.9) brightness(0.55);
  transform-origin: center;
  transition: filter 320ms ease, transform 420ms cubic-bezier(.2,.9,.2,1);
  z-index: 0;
}

.project > * {
  position: relative;
  z-index: 1;
}

.project:hover::before,
.project:focus-within::before {
  filter: none;
  transform: scale(1.03);
}

/* lift card on hover to emphasize */
.project:hover,
.project:focus-within {
  transform: translateY(-8px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.7);
  z-index: 2;
}

/* optional: make text area more readable with a subtle backdrop */
.project .project-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  padding: 20px 28px;                 /* inner spacing */
  background: rgba(0, 0, 0, 0.76);     /* more opaque — increase value toward 1 to darken */
  backdrop-filter: blur(4px);          /* optional soft blur behind the panel */
  color: #fff;
  z-index: 2;                          /* sit above the background image */
  border-bottom-left-radius: 12px;     /* match card rounding */
  border-bottom-right-radius: 12px;
  box-sizing: border-box;
}

/* full-card link that sits above the card so the whole card is clickable */
.project-link {
  position: absolute;
  inset: 0;
  z-index: 3;                 /* above .project-content and background */
  display: block;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

/* visible focus for keyboard users */
.project-link:focus {
  outline: 3px solid rgba(255,255,255,0.9);
  outline-offset: 4px;
  border-radius: inherit;
}

/* optional: lighten the overlay on hover so the image shows more color */
.project:hover .project-content,
.project:focus-within .project-content {
  background: rgba(0, 0, 0, 0.58);
  transition: background 220ms ease;
}

/* if you previously limited .project-content width, remove/override it */
.project .project-content { max-width: none; }

/* Optional overlapping stack variant — add class "overlap" to .project-list to enable */
.project-list.overlap .project + .project {
  margin-top: -140px; /* negative gap to overlap cards */
}

.project-list.overlap .project {
  transition: margin-top 300ms ease, transform 260ms ease;
}

.project-list.overlap .project:hover {
  margin-top: 0; /* bring hovered card forward */
}

/* accessibility: reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .project, .project::before, .project:hover, .project:focus-within {
    transition: none;
    transform: none;
    box-shadow: none;
  }
}

/* Hidden initial state */
.project.hidden {
  opacity: 0;
  transform: translateY(28px) scale(0.995);
  pointer-events: none;
}

/* Visible state when scrolled into view */
.project.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .project,
  .project.hidden,
  .project.visible {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* letter — take the full remaining viewport height under the header */
.letter {
  margin: 0 auto 28px;                         /* no top margin so it fills from under header */
  padding: 24px;
  background: rgba(0, 0, 0, 0.62); /* dark, semi-transparent box */
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  box-sizing: border-box;

  /* make letter fill the viewport minus header */
  min-height: calc(100vh - var(--header-height, 72px));
  display: flex;
  flex-direction: column;
  justify-content: center;       /* center letter content vertically */
  opacity: 0;
  transform: translateY(10px);
  animation: letter-fade 640ms cubic-bezier(.16,.84,.24,1) 120ms forwards;
}

.letter h3 {
  margin-top: 0; /* keep heading flush in the box */
}

/* fade/slide keyframes */
@keyframes letter-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* respect user reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .letter {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.color-shift {
  display: inline-block;
  --color: #ff5a5a;   /* set per-element with style="--color:..." */
  color: #ffffff;     /* start fully white */
  transition: color 160ms linear; /* JS will update color to the interpolated value */
}

/* accessibility: if user prefers reduced motion, disable smoothing */
@media (prefers-reduced-motion: reduce) {
  .color-shift { transition: none; }
}

/* keep the logo pinned to the right of the header */
header img {
  margin-left: auto;    /* pushes the image to the far right in a flex container */
  width: 50px;          /* adjust size as needed */
  height: auto;
  display: block;
}

/* responsive tweak */
@media (max-width: 480px) {
  header img { width: 40px; }
}

.contact-footer {
  background: rgba(20, 20, 20, 0.95);
  padding: 48px 0 32px 0;
  margin-top: 48px;
  color: #fff;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
}

.contact-section {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
}

.contact-section h2 {
  font-size: 2rem;
  margin-bottom: 18px;
  padding-left: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form label {
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-form input,
.contact-form textarea {
  background: #222;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  font-size: 1rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid #f18c07;
  border-color: #f18c07;
}

.contact-form button {
  align-self: flex-end;
  background: #f18c07;
  color: #222;
  border: none;
  border-radius: 6px;
  padding: 10px 28px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 180ms;
}

.contact-form button:hover,
.contact-form button:focus {
  background: #ffb347;
}

.contact-note {
  margin-top: 18px;
  font-size: 1rem;
  color: #ccc;
}

.contact-note a {
  color: #f18c07;
  text-decoration: underline;
}