/* Fluid page tracks: every section grows with the viewport, with edge spacing only. */
body {
  --page-gutter: 2rem;
  --page-gutter: clamp(2rem, 2.5vw, 4rem);
  grid-template-columns:
    [full-start] var(--page-gutter) [center-start]
    repeat(8, [col-start] minmax(0, 1fr) [col-end])
    [center-end] var(--page-gutter) [full-end];
}

/* Independent section tracks also work in mobile browsers without subgrid. */
.header,
.about,
.projects,
.courses,
.writing {
  grid-template-columns:
    [full-start] var(--page-gutter) [center-start] minmax(0, 1fr)
    [center-end] var(--page-gutter) [full-end];
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
iframe {
  max-width: 100%;
}

.project,
.project__info,
.project__name,
.experience__item,
.experience__meta,
.experience__details,
.experience__media > *,
.contact__details {
  min-width: 0;
}

.project__name > span,
.experience__meta,
.course__title,
.skills__item {
  overflow-wrap: anywhere;
}

.project__name svg {
  flex-shrink: 0;
}

body > header,
body > section {
  min-width: 0;
}

.header__intro {
  grid-column: center-start / center-end;
  min-width: 0;
  margin-bottom: 3rem;
  color: var(--color-text-primary);
  font-size: clamp(1.8rem, 1.5vw, 2.2rem);
  line-height: 1.7;
}

.header__intro p + p {
  margin-top: 1.6rem;
}

.header > .heading__primary {
  margin-top: 3rem;
}

.about__container,
.experience__list,
.projects__container,
.courses__list {
  grid-column: center-start / center-end;
  min-width: 0;
  padding-inline: 0;
}

.projects {
  padding-inline: 0;
}

.project__name--static {
  cursor: default;
}

.project__name--static svg {
  display: none;
}

.about__container {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about__img {
  max-width: calc(100% - 2rem);
}

.courses__list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(1.6rem, 2vw, 3rem);
}

.courses .cours {
  min-width: 0;
  padding: 0;
  box-shadow: none;
}

.courses .cours__view {
  aspect-ratio: 16 / 9;
  padding-top: 56.25%;
  border: 0.1rem dashed var(--color-highlight);
  background: #080b10;
  box-shadow: 0 1rem 3rem #0003;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

@supports (aspect-ratio: 16 / 9) {
  .courses .cours__view {
    padding-top: 0;
  }
}

.courses .cours__view:hover,
.courses .cours__view:focus-within {
  border-color: var(--color-highlight);
  box-shadow: 0 1rem 3rem #00ffcc0c;
}

.courses .cours .course__title {
  margin-top: 1.8rem;
  font-size: clamp(1.6rem, 1.3vw, 2rem);
  line-height: 1.55;
  text-align: left;
  cursor: default;
}

.player button,
.player input {
  -webkit-tap-highlight-color: transparent;
}

.player button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.player button[hidden] {
  display: none;
}

.player button:focus-visible,
.player input:focus-visible,
.player a:focus-visible {
  outline: 2px solid var(--color-highlight);
  outline-offset: 3px;
}

.player svg {
  width: 2rem;
  height: 2rem;
  pointer-events: none;
}

.player__overlay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: linear-gradient(180deg, #080b1038, #080b108c);
}

.player__play-badge {
  display: inline-flex;
  align-items: center;
  padding: 1.4rem;
  border-radius: 5rem;
  color: var(--color-secondary);
  background: var(--color-highlight);
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 0 0 0.6rem #00ffcc20, 0 0.6rem 3rem #0006;
  transition: transform 180ms ease;
}

.player__overlay:hover .player__play-badge {
  transform: scale(1.05);
}

.player__overlay svg {
  width: 2.8rem;
  height: 2.8rem;
}

.player__controls {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 0.8rem 0.7rem;
  color: #fff;
  background: linear-gradient(transparent, #080b10ed);
}

.player__button {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 0.6rem;
  background: transparent;
  color: #fff;
}

.player__button:hover {
  color: var(--color-highlight);
  background: #ffffff12;
}

.player__time {
  flex: 0 0 auto;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player__seek {
  --progress: 0%;
  flex: 1;
  min-width: 2rem;
  width: 100%;
  height: 2.8rem;
  margin: 0 0.6rem;
  appearance: none;
  background: transparent;
  accent-color: var(--color-highlight);
  cursor: pointer;
}

.player__seek::-webkit-slider-runnable-track {
  height: 0.4rem;
  border-radius: 1rem;
  background: linear-gradient(to right, var(--color-highlight) var(--progress), #ffffff50 var(--progress));
}

.player__seek::-webkit-slider-thumb {
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: -0.4rem;
  border-radius: 50%;
  background: var(--color-highlight);
}

.player__seek::-moz-range-track {
  height: 0.4rem;
  border-radius: 1rem;
  background: #ffffff50;
}

.player__seek::-moz-range-progress {
  height: 0.4rem;
  background: var(--color-highlight);
}

.player__seek::-moz-range-thumb {
  width: 1.2rem;
  height: 1.2rem;
  border: 0;
  border-radius: 50%;
  background: var(--color-highlight);
}

.player__seek:disabled {
  cursor: default;
  opacity: 0.5;
}

.player__status {
  position: absolute;
  inset: 1rem 1rem auto;
  width: fit-content;
  padding: 0.6rem 1rem;
  border-radius: 0.4rem;
  color: #fff;
  background: #080b10e8;
  font-size: 1.2rem;
}

.player__status:empty {
  display: none;
}

.player__status a {
  color: var(--color-highlight);
}

.player .player__collapse {
  display: none;
  position: absolute;
  inset: 1rem 1rem auto auto;
  padding: 0.8rem 1.2rem;
  border: 1px solid #ffffff40;
  border-radius: 0.6rem;
  background: #080b10e8;
  color: #fff;
  font-size: 1.2rem;
}

.player .player__collapse:hover {
  color: var(--color-highlight);
  border-color: var(--color-highlight);
}

@media (min-width: 56.251em) {
  .courses__list.has-featured {
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
  }

  .courses__list.has-featured > .cours {
    grid-column: 2;
  }

  .courses__list.has-featured > .cours.is-featured {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .is-featured .player .player__collapse {
    display: inline-flex;
  }

  .courses__list.has-featured > .cours:not(.is-featured) .course__title {
    font-size: clamp(1.3rem, 1vw, 1.7rem);
    margin-top: 1rem;
  }

  .courses__list.has-featured > .cours:not(.is-featured) .player__time {
    display: none;
  }
}

.courses .player:fullscreen {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
}

.social {
  top: auto;
  bottom: 1.5rem;
  right: 1.5rem;
  width: auto;
  height: auto;
  flex-direction: row;
  gap: 1.2rem;
  padding: 1rem !important;
  border-radius: 1rem;
  background: #0d1117ed;
}

.social__icon {
  margin-bottom: 0;
  width: 2.4rem;
  height: 2.4rem;
}

.social__line {
  display: none;
}

@media (max-width: 56.25em) {
  body {
    --page-gutter: 1.6rem;
  }

  .header .heading__primary--main {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .about .heading__secondary,
  .courses .heading__secondary,
  .projects .heading__secondary,
  .writing .heading__secondary,
  .contact .heading__secondary {
    font-size: clamp(2.6rem, 7.5vw, 4rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
    margin-bottom: 3rem;
  }

  .project__info {
    width: 100%;
  }

  .project__img {
    object-fit: cover;
  }

  .project__desc {
    width: 100%;
    padding: 2.4rem 1.6rem;
    overflow-wrap: anywhere;
  }

  .experience__item,
  .experience__item--featured {
    grid-template-columns: minmax(0, 1fr);
    padding: 2rem 1.4rem;
  }

  .experience__media {
    grid-template-columns: minmax(0, 1fr);
  }

  .experience__media img {
    height: clamp(18rem, 55vw, 34rem);
  }

  .experience__video iframe {
    height: 18rem;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .contact {
    padding-inline: var(--page-gutter);
  }

  .contact__details {
    width: 100%;
    padding-inline: 0;
  }

  .contact p {
    width: 100%;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .contact p a {
    min-width: 0;
  }

  .player__button {
    width: 4.4rem;
    height: 4.4rem;
  }

  .player__controls {
    flex-wrap: wrap;
    gap: 0.2rem;
    padding-inline: 0.4rem;
  }

  .player__seek {
    flex-basis: 5rem;
    height: 4.4rem;
    margin-inline: 0.3rem;
  }
  .about__container,
  .courses__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .about__container {
    padding-block: 4rem;
  }

  .courses__list {
    padding-block: 0;
    gap: 3.5rem;
  }

  .project__visual {
    width: 100%;
    min-width: 0;
  }

  .heading__primary--main {
    font-size: clamp(3.4rem, 8vw, 6rem);
  }
}

@media (hover: none), (pointer: coarse) {
  #glow {
    display: none;
  }

  .contact p:hover,
  .experience__item:hover,
  .topic-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player__play-badge,
  .courses .cours__view {
    transition: none;
  }
}
