/* Police locale : Unbounded, sous licence SIL Open Font License. */
@font-face {
  font-family: "Unbounded";
  src: url("../assets/fonts/unbounded-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

/* Réglages communs à toutes les pages du site */
:root {
  color-scheme: dark;
  --scene-night: #101314;
  --scene-portrait: #1e2426;
  --scene-contact: #171b1d;
  --scene-ink: #f5f6f4;
  --scene-muted: #bfc5c2;
  --ink: var(--scene-ink);
  --muted: var(--scene-muted);
  --line: rgb(201 208 216 / 18%);
  --paper: var(--scene-contact);
  --surface: var(--scene-portrait);
  --accent: #d5dbd7;
  --accent-ink: var(--scene-contact);
  --error: #f5a6a6;
  --white: #fff;
  --night: var(--scene-night);
  --footer-line: rgb(245 246 244 / 20%);
  --on-dark-muted: var(--scene-muted);
  --display-font: "Unbounded", "Arial Black", Arial, sans-serif;
  --width: 1440px;
  --gutter: clamp(24px, 4.5vw, 72px);
  --header-height: 88px;
  --page-space: clamp(48px, 5vw, 80px);
  --page-bottom: clamp(64px, 8vw, 112px);
  --page-title-size: clamp(2rem, 3.5vw, 3rem);
  --ambient-base: #02080f;
  --section-divider-line: rgb(180 213 198 / 22%);
  --section-divider-halo: rgb(46 138 112 / 10%);
  --ambient-background:
    radial-gradient(ellipse 58% 66% at 6% 8%,
      rgb(0 103 195 / 82%) 0%,
      rgb(0 61 116 / 62%) 32%,
      transparent 74%),
    radial-gradient(ellipse 60% 58% at 45% 29%,
      rgb(0 64 110 / 49%) 0%,
      rgb(0 31 56 / 30%) 45%,
      transparent 78%),
    linear-gradient(132deg, #051b2f 0%, #030f1c 40%, #010407 88%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Un même fond bleu nuit sur les pages du portfolio, hors jeux. */
.ambient-page {
  --paper: var(--ambient-base);
  --ambient-shade: rgb(2 8 15 / 38%);
  isolation: isolate;
  background: var(--ambient-base);
}

.ambient-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(var(--ambient-shade), var(--ambient-shade)),
    var(--ambient-background);
}

.ambient-page .site-header {
  background: transparent;
}

.ambient-page .site-footer {
  background: rgb(2 8 15 / 72%);
}

/* La dernière séparation du footer Contact se fond dans le fond. */
.contact-page .footer-bottom {
  position: relative;
  border-top: 1px solid transparent;
}

.contact-page .footer-bottom::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -24px;
  height: 48px;
  pointer-events: none;
  background:
    linear-gradient(to right,
      transparent,
      var(--section-divider-line) 28%,
      var(--section-divider-line) 72%,
      transparent) center / 100% 1px no-repeat,
    radial-gradient(ellipse at center,
      var(--section-divider-halo),
      transparent 70%) center / 100% 100% no-repeat;
}

/* Le formulaire dispose déjà d'un fond sombre pour sa lisibilité. */
.contact-page {
  --ambient-shade: transparent;
}

@media (forced-colors: active) {
  .ambient-page { background: Canvas; }
  .ambient-page::before { display: none; }
  .ambient-page .site-header,
  .ambient-page .site-footer { background: Canvas; }

  .contact-page .footer-bottom {
    border-top-color: CanvasText;
  }

  .contact-page .footer-bottom::before {
    display: none;
  }
}

main {
  flex: 1;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-underline-offset: 5px;
}

img {
  max-width: 100%;
}

button:disabled {
  cursor: wait;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

main:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}

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

/* Navigation : visible même si JavaScript est désactivé */
.site-header {
  position: relative;
  top: 0;
  z-index: 100;
  color: var(--ink);
  flex-shrink: 0;
  background: var(--paper);
}

.header-inner {
  max-width: none;
  margin: auto;
  min-height: var(--header-height);
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.main-navigation {
  margin-left: auto;
}

.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  color: inherit;
  font-family: var(--display-font);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -.025em;
  text-transform: uppercase;
  text-decoration: none;
}

.main-navigation a:hover {
  text-decoration: underline;
}

.main-navigation a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
}

.site-header :focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  margin-left: auto;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  text-decoration: underline;
}

.menu-toggle [data-menu-icon] {
  position: relative;
  width: 18px;
  height: 18px;
}

.menu-toggle [data-menu-icon]::before,
.menu-toggle [data-menu-icon]::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 180ms;
}

.menu-toggle [data-menu-icon]::before {
  transform: translateY(-3px);
}

.menu-toggle [data-menu-icon]::after {
  transform: translateY(3px);
}

.menu-toggle[aria-expanded="true"] [data-menu-icon]::before {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] [data-menu-icon]::after {
  transform: rotate(-45deg);
}

.project-link {
  display: inline-block;
  min-height: 44px;
  padding-block: 8px;
  font-size: 15px;
}

.project-link:hover {
  text-decoration-thickness: 2px;
}

/* Même cadre et même hiérarchie sur les trois pages intérieures. */
.page-main {
  width: min(100%, var(--width));
  margin-inline: auto;
  padding: var(--page-space) var(--gutter) var(--page-bottom);
}

.page-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: var(--page-title-size);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.page-intro {
  max-width: 60ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

/* Pied de page commun et copie de l'adresse e-mail */
.site-footer {
  --ink: var(--white);
  --muted: var(--on-dark-muted);
  --footer-social-surface: #1b2028;
  color: var(--ink);
  background: var(--paper);
}

.footer-inner {
  width: min(100%, var(--width));
  margin-inline: auto;
  padding: 56px var(--gutter) 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.9fr) minmax(0, 1.5fr) minmax(0, 0.8fr);
  align-items: start;
  gap: clamp(24px, 4vw, 64px);
}

.footer-brand,
.footer-column {
  min-width: 0;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.footer-monogram {
  flex-shrink: 0;
  font-family: var(--display-font);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
}

.footer-brand p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.site-footer h2 {
  margin: 12px 0 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase; /* taste-skill-ignore: petits titres de colonnes de la référence fournie. */
}

.footer-navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-navigation a,
.contact-email,
.footer-form-link,
.copy-button {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
}

.footer-details {
  font-style: normal;
}

.contact-email {
  overflow-wrap: anywhere;
}

.copy-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.copy-status:empty {
  margin: 0;
}

.copy-fallback {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 2px solid var(--muted);
  border-radius: 0;
  background: var(--ink);
  color: var(--night);
  font-size: 16px;
}

.footer-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 16px;
}

.footer-social-link {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 44px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
}

.footer-social-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: var(--footer-social-surface);
  color: var(--ink);
}

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--footer-line); /* taste-skill-ignore: séparation présente dans la référence demandée. */
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer-bottom p {
  margin: 0;
}

.site-footer a:hover,
.copy-button:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-social-link:hover {
  text-decoration: none;
}

.footer-social-link:hover .footer-social-icon {
  background: var(--footer-line);
}

.site-footer a:active,
.copy-button:active {
  opacity: 0.7;
}

.copy-button:disabled {
  opacity: 0.6;
}

.site-footer :focus-visible {
  outline-color: var(--ink);
}

@media (max-width: 1000px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 760px) {
  .footer-inner {
    padding-block: 40px 24px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
  }

  .site-footer h2 {
    margin-top: 0;
    margin-bottom: 16px;
  }

  .footer-social-links {
    gap: 12px;
  }

  .footer-bottom {
    margin-top: 32px;
  }
}

/* Tablette et téléphone */
@media (max-width: 760px) {
  :root {
    --header-height: 76px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0 16px;
    padding-block: 12px;
  }

  .has-menu .menu-toggle {
    display: flex;
  }

  .main-navigation {
    flex-basis: 100%;
    margin-top: 12px;
    padding-block: 16px 4px;
    border-top: 1px solid var(--line); /* taste-skill-ignore: limite du menu mobile ouvert. */
    max-height: calc(100svh - var(--header-height) - 24px);
    overflow-y: auto;
  }

  .main-navigation ul {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
  }

  .main-navigation a {
    display: flex;
    justify-content: flex-start;
    padding: 12px 18px;
  }

  .has-menu .main-navigation {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 0;
    padding-inline: var(--gutter);
    color: var(--ink);
    background: var(--paper);
    border-bottom: 1px solid var(--line); /* taste-skill-ignore: limite du menu mobile ouvert. */
  }

  .has-menu .main-navigation.is-open {
    display: block;
  }

}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Retours discrets à la souris et au clavier. */
.main-navigation a {
  text-decoration-color: transparent;
  text-underline-offset: 6px;
}

.main-navigation a:hover,
.main-navigation a[aria-current="page"] {
  text-decoration-color: currentColor;
}

.project-link:active,
.main-navigation a:active {
  opacity: 0.72;
}
