@media (min-width: 800px) {
  .mobile {
    display: none;
  }
}

html {
  overflow: hidden;
}

body {
  /* scroll indicator */
  --si-width: 30px;
  /* z-index */
  --z-bg: -3;
  --z-hide: -2;
  --z-flux: -1;
  --z-section: 1;
  --z-si: 10; /* scroll indicator */
  --z-overlay: 300;
}

h1 {
  min-width: max-content;
}

/* #region CONSTANTS  */

#footer {
  padding: 10px 25px;
  border-radius: 50px;
  position: absolute;
  left: 20px;
  translate: 0 calc(-100% - 10px);
}

#definition {
  #binary-pattern > text {
    animation: 2s ease infinite alternate data-opacity;

    &:nth-of-type(2) {
      animation-delay: 0.5s;
    }

    &:nth-of-type(3) {
      animation-delay: 1s;
    }

    &:nth-of-type(4) {
      animation-delay: 1.5s;
    }
  }
}

@keyframes data-opacity {
  to {
    opacity: 0;
  }
}

.flux-svg {
  .physical-path {
    filter: drop-shadow(0 0 4px var(--purple));
  }
}

#main-flux-svg {
  z-index: var(--z-flux);
}

#resize-overlay {
  font-size: 1.5rem;
  background: var(--deep-dark);

  .arrow-rs {
    --width: 10vmin;
  }

  .arrow-bl {
    translate: 0 100%;
    rotate: 45deg;
  }

  .arrow-tr {
    translate: 0 -100%;
    rotate: -135deg;
  }
}

#scroll-indicator {
  --padding-y: 20px;
  --marker-width: calc(var(--si-width) + 5px);
  --marker-margin-right: calc((var(--si-width) - var(--marker-width)) * 0.5); /* = 0 permit change of marker-size */
  overflow: hidden;
  width: auto;
  max-width: var(--si-width);
  min-width: var(--si-width);
  top: 0;
  right: 0%;
  background: linear-gradient(90deg, transparent 0%, var(--deep-dark) 20%, var(--deep-dark) 100%);
  z-index: var(--z-si);
  transition: max-width 0.5s ease;

  .scroll-marker-wrapper {
    --padding-y-centralizer: calc(var(--padding-y) - var(--marker-width) * 0.5);
    white-space: nowrap;
    padding: var(--padding-y-centralizer) 0 var(--padding-y-centralizer) 50px;
    margin-right: var(--marker-margin-right);
  }

  .scroll-marker {
    --stroke: var(--orange);
    --stroke-offset: 100;
    --shadow-stroke: var(--deep-dark);
    --shadow-fill: var(--dark);
    min-width: max-content;
    gap: var(--si-width);

    .marker {
      width: var(--marker-width);
      stroke-width: 2.5px;
      font-size: 0.8rem;

      .circle {
        stroke: var(--stroke);
        stroke-dasharray: 100;
        stroke-dashoffset: var(--stroke-offset);
        transition: stroke-dashoffset 1s ease;
      }

      .circle-shadow {
        stroke: var(--shadow-stroke);
        fill: var(--shadow-fill);
      }
    }

    &:is(.active) {
      --stroke-offset: 0;
    }

    &:has(~ .scroll-marker.active) {
      --shadow-fill: var(--orange);
      --stroke-offset: -100;
    }
  }

  .scroll-bar-wrapper {
    position: absolute;
    z-index: -1;
    width: var(--si-width);
    padding: var(--padding-y) calc(var(--si-width) * 0.25);
    border-radius: 20px;

    .scroll-bar {
      width: 100%;
      background: var(--dark);
      z-index: -1;
      border-radius: 20px;

      .scroll-bar-progress {
        background: var(--orange);
        border-radius: 20px;
      }
    }
  }
}

@media (hover: hover) {
  #scroll-indicator:hover {
    max-width: 500px;
  }
}

#scroll-indicator:is(.open) {
  max-width: 500px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  padding: 10px;
  z-index: var(--z-hide);
  background: var(--deep-dark);
  opacity: 0;
  transition:
    opacity 0.5s ease,
    z-index 0s 0.5s;

  &:is(.open) {
    z-index: var(--z-overlay);
    opacity: 1;
    transition:
      opacity 0.5s ease,
      z-index 0s 0s;
  }

  &:is(.overlay-front) {
    --z-overlay: 1000;
  }

  .close-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    cursor: pointer;
  }
}

.go-to {
  cursor: pointer;
}

.home-section {
  overflow: auto;

  .handle-z {
    z-index: var(--z-hide);
    pointer-events: none;
  }

  &:is(.current) .handle-z {
    z-index: var(--z-section);
    pointer-events: all;
  }

  .home-section-title {
    display: flex;
    top: 60px;
    left: 0;
    padding: 0 20px;
    position: fixed;
  }

  .home-section-wrapper {
    max-width: min(calc(100vw - 60px), 1500px);
    max-height: calc(100vh - 50px);
    width: max-content;
    height: max-content;
    top: calc(50% + 25px);
  }
}

/* #region hety */

.image-wrapper {
  --background-color: var(--deep-dark);
  width: clamp(150px, 18vw, 250px);
  position: relative;
  background: var(--background-color);
  box-shadow:
    0 0 8px 4px var(--background-color),
    0 0 8px 4px var(--purple);
  border-radius: 50%;
  aspect-ratio: 1 / 1;

  .image {
    width: 100%;
  }

  /* background  */
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--background-color);
    z-index: -1;
  }
}

.pulse-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pulse {
  --color: var(--purple);
  position: absolute;
  width: calc(100% - 5px);
  height: calc(100% - 5px);
  border-radius: 50%;
  box-shadow:
    0px 0px 5px 4px var(--color),
    inset 0px 0px 5px 4px var(--color);
  transform: scale(0.9);
  opacity: 0;
  z-index: -2;
}

.explore-overlay {
  --min-root-column: 120px;
  padding: 20px;

  .explore-root {
    max-width: 1500px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--min-root-column), 1fr));
    place-items: center;
    gap: 30px 20px;
  }

  .htmx-indicator {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
  }

  .flux-svg {
    z-index: -1;
  }
}

/* #region opening section */

.opening-section-wrapper {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  grid-template-rows: repeat(2, auto);
  grid-template-areas:
    'image title'
    'image sub-title';
  align-items: center;
  gap: 20px 30px;
}

.me-image {
  --background-color: var(--black);
  grid-area: image;

  .image {
    border-radius: 50%;
  }
}

.opening-title {
  grid-area: title;
  width: max-content;
  padding: 8px 16px;
  align-self: end;
}

.opening-sub-title {
  grid-area: sub-title;
  margin-left: 1.5rem;
  padding: 8px 16px;
  align-self: start;
}

.action-suggest {
  padding: 10px 50px;
  border-radius: 6px 6px 0 0 !important;
  bottom: -2px;
}

.scroll-suggest {
  max-width: 60ch;
  left: 50%;
  translate: -50%;
  /* margin-inline: auto; */
}

.navigue-suggest {
  right: 60px;

  .animate-arrow {
    rotate: 90deg;
  }
}

/* #region about me */

.about-content {
  width: min(100%, 60ch);
}

.about-image-wrapper {
  --rotate: -20deg;
  z-index: -1;
}

.server-image-wrapper {
  transform-origin: 200% 50%;
}

.coffee-image-wrapper {
  transform-origin: -100% 50%;
}
/* #region technology */

.technology-section-wrapper {
  /* --item-number: in template */
  --max-diameter: 750px;
  --circle-diameter: 70vmin;
  --item-width: calc(var(--circle-diameter) * 0.2);
  --circle-radius: calc(var(--circle-diameter) * 0.5);
  --degree-item: calc(360deg / var(--item-number));
}

.technology-item {
  --rotate: 90deg;
  --initial-rotate: calc(var(--item-index) * var(--degree-item));
  --computed-rotate: calc(var(--initial-rotate) + var(--rotate));
  position: absolute;
  width: var(--item-width);
  transform-origin: calc(var(--circle-radius) + var(--item-width) * 0.5) 50%;
  translate: calc(-1 * var(--circle-radius));
  rotate: var(--computed-rotate);

  .technology-item-rotate-wrapper {
    rotate: calc(-1 * var(--computed-rotate));
  }
}

.technology-item-name {
  min-width: max-content;
  order: 2;
  z-index: 10;
  margin-top: min(10%, 20px);
}

.technology-item-image {
  order: 1;
  width: 100%;
  padding: min(20%, 25px);
  border-radius: 50%;
}

/* #region project  */

.project-wrapper {
  gap: min(5vw, 100px);
}

.project-btn {
  position: relative;
  bottom: 3lh;
}

.project-item {
  --item-width: min(28vw, 500px);
  --main-item-width: calc(var(--item-width) * 0.6);
  --technology-width: calc(var(--item-width) * 0.13);
  --rotate-item-offset: calc(var(--item-width) * 0.5 - 50%);
  --job-width: calc(var(--item-width) * 0.2);
  width: var(--item-width);
}

@media (hover: hover) {
  .project-item {
    .project-item-circular::before {
      content: 'Découvrir';
      color: var(--blue);
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: color-mix(in srgb, var(--dark) 30%, transparent);
      backdrop-filter: blur(6px);
      z-index: 5;
      border-radius: 50%;
      opacity: 0;
      transition: opacity ease 0.4s;
    }

    &:hover .project-item-circular::before {
      opacity: 1;
    }
  }
}

.project-item-circular {
  width: var(--main-item-width);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 0;
  border: 1px var(--blue);
  box-shadow: 0 0 4px var(--blue);

  .slider {
    .image {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      object-position: center;
      border-radius: 50%;
    }
  }

  .project-item-technology {
    --initial-rotate: calc(35deg + -25deg * var(--item-index));
    position: absolute;
    width: var(--technology-width);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    translate: calc(var(--rotate-item-offset) * -1);
    padding: 3%;
    transform-origin: calc(var(--rotate-item-offset) + 50%) 50%;

    .image {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      border-radius: 0%;
    }

    .overflow-count {
      font-size: 1.2rem;
      font-weight: 500;
    }
  }

  .project-item-job {
    width: var(--job-width);
    position: absolute;
    top: 10%;
    right: -20%;
    translate: 50% -50%;
    padding: 0;
    padding: 5%;

    .image {
      width: 100%;
      aspect-ratio: 1 / 1;
    }
  }
}

/* all project overlay */
#all-projects-overlay {
  --min-root-column: 500px;
}

.all-projects-item {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  grid-template-areas:
    'slider title'
    'slider resume'
    'slider techno'
    'slider link';

  .title {
    grid-area: title;
    place-self: stretch;
  }

  .slider {
    grid-area: slider;
    align-self: stretch;
    background: var(--dark);
    border-radius: 4px;
  }

  .resume {
    grid-area: resume;
  }

  .technologies {
    grid-area: techno;
    width: max-content;
    max-width: 100%;
    background: var(--dark);
    padding: 5px;
    margin: 0 auto;
    scrollbar-width: thin;
  }

  .link {
    grid-area: link;
    align-self: end;
    margin: 0 auto;
  }
}

.explore-project-technology {
  width: 30px;
}

/* #region job */
.job-link-timeline {
  position: relative;
  bottom: 3lh;
}

.job-wrapper {
  max-width: 100%;
  table-layout: fixed;
  display: grid;
  grid-template-columns: auto repeat(2, 1fr);
  grid-template-areas:
    'logo name .'
    'logo resume resume'
    'logo date button';
  gap: 20px 30px;
}

.job-logo {
  grid-area: logo;
  padding: 15%;
}

.job-name {
  grid-area: name;
  position: relative;
  left: -30px;
  align-self: end;
}

.job-resume {
  max-width: 60ch;
  grid-area: resume;
}

.job-date {
  grid-area: date;
  position: relative;
  align-self: start;
  left: 30px;
}

.job-link {
  grid-area: button;
  align-self: center;
  justify-self: end;
}

.contact-me {
  /* position: absolute; */
  width: max-content;
  max-width: 100%;
  bottom: 0;
  left: 50%;
  translate: -50%;
  border-radius: 6px 6px 0px 0px !important;
}

/* #region contact */

.contact-section-wrapper {
  width: clamp(600px, 100%, 1200px) !important;
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  grid-template-areas:
    'info form'
    'image form';
  place-items: start;
  gap: 30px;
}

.contact-info {
  grid-area: info;

  .icon {
    width: 2rem;
    height: 2rem;
  }
}

.contact-message {
  line-height: 1.4;

  .icon {
    float: inline-start;
    margin: 0.25lh 10px auto 0;
  }
}

.contact-image {
  grid-area: image;
  place-self: center;
}

#contact-form-mobile-overlay {
  display: contents;
}

.contact-form {
  max-width: 750px;
  grid-area: form;

  .field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .field-input {
    width: 100%;
    background: var(--dark);
    padding: 5px;
    border-radius: 5px;
    color: var(--text);
    border: solid 1px var(--dark);
    transition: 0.2s ease;

    &:focus {
      border-color: var(--blue);
    }
  }

  .field-message {
    flex-grow: 1;
    resize: horizontal;
  }

  .field:has(.field-input[name='zip']) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
}

.field:has(.field-input:required) label::after {
  content: '*';
  color: var(--danger);
  margin-left: 5px;
}

.asterisk {
  font-size: initial;
  color: var(--danger);
  margin-right: 5px;
}

/* #region --- MOBILE --- */

@media (max-width: 799px) {
  body {
    --si-width: 20px;
  }

  #header {
    top: 5px;
  }

  #scroll-indicator {
    translate: calc(var(--si-width) * 0.5);
  }

  .home-section {
    .home-section-title {
      top: 65px;
      justify-content: center;
    }
  }

  /* #region opening */
  .opening-section-wrapper {
    width: max-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .opening-text {
    width: auto;
    text-align: center;
    align-self: unset;
  }

  .opening-sub-title {
    margin-left: unset;
  }

  /* #region about me  */
  .about-section-wrapper {
    flex-direction: column;
  }

  .action-suggest {
    padding: 10px 10px;
  }

  .about-content {
    width: min(100%, 40ch);
    position: relative;
    top: 20px;
  }

  .about-image-wrapper {
    --rotate: 0;
    rotate: none;
    position: relative;
    bottom: unset;
    transform-origin: center;
  }

  .server-image-wrapper {
    display: none;
  }

  .coffee-image-wrapper {
    top: 15px;
  }

  /* #region technology */

  .technology-section-wrapper {
    --max-diameter: 500px;
  }

  /* #region project */
  .project-section-wrapper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, max-content));
    grid-template-areas:
      '. link .'
      '. slider .'
      'prev controls next';
    gap: 10px 20px;
    place-items: center;
  }

  .project-btn {
    grid-area: link;
    justify-self: center;
    align-self: end;
    bottom: 2lh;
  }

  .project-wrapper {
    --wrapper-width: min(calc(100vw - var(--si-width) * 2), 40ch);
    grid-area: slider;
    width: var(--wrapper-width);
    height: var(--wrapper-width);
    padding: 40px;
    overflow-y: hidden;
    overflow-x: visible;
  }

  .project-item {
    --item-width: var(--wrapper-width);
    justify-content: start !important;
  }

  .project-mobile-slider-previous {
    grid-area: prev;
    place-self: right;
    font-size: 2rem;
  }

  .project-mobile-slider-next {
    grid-area: next;
    place-self: left;
    font-size: 2rem;
  }

  .project-mobile-slider-control {
    grid-area: controls;
    justify-self: center;
  }

  /* all project overlay */
  #all-projects-overlay {
    .explore-root {
      --min-root-column: 300px;
    }
  }

  .all-projects-item {
    display: flex;
    flex-direction: column;

    .slider {
      width: min(400px, 100%);
      aspect-ratio: 16 / 9;
      margin: 0 auto;
    }
  }

  /* #region job */
  .job-link-timeline {
    bottom: 2lh;
  }

  .job-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'logo logo'
      'name name'
      'resume resume'
      'date button';
    place-items: center;
    gap: 20px 2%;
  }

  .job-logo {
    padding: 20px;
  }

  .job-name {
    left: unset;
  }

  .job-date {
    left: unset;
    align-self: center;
  }

  .job-link {
    justify-self: unset;
  }

  /* #region contact */
  .contact-section-wrapper {
    --common-gap: 20px;
    /* full layout for inset form overlay */
    max-width: unset !important;
    max-height: unset !important;
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    translate: 0 !important;
    /* --- */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--common-gap);

    &:has(#contact-form-mobile-overlay.open) {
      z-index: var(--z-overlay);
    }
  }

  /* in front scroll indicator */

  .contact-info {
    max-width: 40ch;
    gap: var(--common-gap);
  }

  #contact-form-mobile-overlay {
    display: flex;
    isolation: isolate;
  }

  .contact-form {
    max-width: max-content;
    max-height: max-content;

    .field {
      max-width: 500px;
    }
  }
}
