body {
  font-family: "[Font Name]", sans-serif !important;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem 1rem;
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.project-modal[hidden] {
  display: none;
}

.project-modal__panel {
  position: relative;
  width: min(100%, 68rem);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid color-mix(in srgb, var(--brand-surface) 38%, transparent);
  border-radius: 22px;
  color: var(--brand-text);
  background: color-mix(in srgb, var(--brand-bg) 88%, transparent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 28px 90px rgb(0 0 0 / 38%);
  backdrop-filter: blur(28px) saturate(145%);
}

.project-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--brand-surface);
  border-radius: 8px;
  color: var(--brand-heading);
  cursor: pointer;
}

.project-modal__eyebrow {
  padding-right: 3rem;
  color: var(--brand-strong);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.project-modal__title {
  margin-top: 0.75rem;
  padding-right: 3rem;
  color: var(--brand-heading);
  font-family: Times, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.1;
}

.project-modal__description {
  max-width: 48rem;
  margin-top: 1.25rem;
  line-height: 1.75;
}

.project-modal__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.5rem;
}

.project-modal__tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand-surface) 45%, transparent);
  border-radius: 8px;
  color: var(--brand-heading);
  background: color-mix(in srgb, var(--brand-card) 88%, transparent);
  font-size: 0.75rem;
  font-weight: 600;
}

.project-modal__journey {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--brand-surface) 40%, transparent);
}

.project-modal__journey[hidden] {
  display: none;
}

.project-modal__journey-eyebrow {
  color: var(--brand-strong);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.project-modal__journey-title {
  margin-top: 0.6rem;
  color: var(--brand-heading);
  font-family: Times, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  line-height: 1.2;
}

.project-modal__journey-description {
  max-width: 46rem;
  margin-top: 0.75rem;
  line-height: 1.7;
}

.project-modal__images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.project-modal__figure {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand-surface) 35%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--brand-card) 88%, transparent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), 0 16px 44px rgb(0 0 0 / 14%);
  backdrop-filter: blur(18px) saturate(140%);
}

.project-modal__figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.project-modal__figure figcaption {
  padding: 0.75rem 1rem;
  color: var(--brand-text);
  font-size: 0.75rem;
}

.project-modal__figure figcaption strong,
.project-modal__figure figcaption span {
  display: block;
}

.project-modal__figure figcaption strong {
  color: var(--brand-heading);
  font-size: 0.85rem;
}

.project-modal__figure figcaption span {
  margin-top: 0.4rem;
  line-height: 1.55;
}

.project-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.project-modal__links a {
  padding: 0.75rem 1rem;
  border: 1px solid var(--brand-surface);
  border-radius: 5px;
  color: var(--brand-heading);
  font-size: 0.875rem;
}

.portfolio-projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: 1.25rem;
}

.portfolio-projects {
  margin-bottom: clamp(3rem, 7vw, 6rem);
}

.portfolio-project-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 15rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand-surface) 34%, transparent);
  border-radius: 22px;
  color: var(--brand-text);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--brand-card) 92%, white 4%),
    color-mix(in srgb, var(--brand-bg) 86%, transparent)
  );
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), inset 0 -1px 0 rgb(255 255 255 / 5%), 0 18px 48px rgb(0 0 0 / 14%);
  backdrop-filter: blur(24px) saturate(150%);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.portfolio-project-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgb(255 255 255 / 22%), transparent 34%, transparent 68%, color-mix(in srgb, var(--brand-accent) 18%, transparent));
  pointer-events: none;
  content: "";
}

.portfolio-project-card::after {
  position: absolute;
  top: 0;
  left: 12%;
  z-index: 0;
  width: 58%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 72%), transparent);
  pointer-events: none;
  content: "";
}

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

.portfolio-project-card:hover,
.portfolio-project-card:focus-visible {
  border-color: var(--brand-accent);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%), 0 24px 58px rgb(0 0 0 / 19%), 0 0 0 1px color-mix(in srgb, var(--brand-accent) 18%, transparent);
  outline: none;
}

.portfolio-project-card__title {
  padding: 1rem 1.125rem;
  border-bottom: 1px solid color-mix(in srgb, var(--brand-surface) 40%, transparent);
  color: var(--brand-heading);
  font-family: Times, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.portfolio-project-card__body {
  display: grid;
  place-items: center;
  min-height: 11rem;
  overflow: hidden;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--brand-bg) 88%, var(--brand-card));
}

.portfolio-project-card__preview {
  display: block;
  width: 100%;
  height: 12rem;
  object-fit: contain;
  object-position: center;
}

.portfolio-project-card__placeholder {
  display: grid;
  width: 100%;
  min-height: 10rem;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--brand-surface) 42%, transparent);
  border-radius: 9px;
}

.portfolio-project-card__action {
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portfolio-project-card__summary {
  max-width: 34rem;
  font-size: 0.9rem;
  line-height: 1.65;
}

.portfolio-project-card__footer {
  display: flex;
  min-height: 6rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  border-top: 1px solid color-mix(in srgb, var(--brand-surface) 40%, transparent);
}

.portfolio-project-card__technologies {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portfolio-tech-icon {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
  object-fit: contain;
}

ul[aria-label="Tech stack"] li:has(> .portfolio-tech-icon) {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.portfolio-project-card__fallback {
  color: var(--brand-muted);
  font-size: 0.75rem;
}

@media (max-width: 639px) {
  .portfolio-projects__grid {
    grid-template-columns: 1fr;
  }

  .portfolio-project-card {
    min-height: 13rem;
  }
}

/* Keep the complete hero introduction visible across laptop aspect ratios. */
.cinematic-hero {
  height: auto;
  min-height: 100svh;
}

.cinematic-headline {
  font-size: clamp(2.4rem, min(11.5vw, 15svh), 12rem);
}

/* Switch to the compact navigation before the desktop links become crowded. */
@media (min-width: 768px) and (max-width: 1099px) {
  header nav {
    display: none !important;
  }

  header button[aria-controls="mobile-nav"] {
    display: inline-flex !important;
  }

  #mobile-nav {
    display: block !important;
  }
}

@media (max-width: 639px) {
  .cinematic-hero {
    min-height: max(640px, 100svh);
  }

  .cinematic-headline {
    line-height: 0.96;
  }
}
