/*
 * fiodor.fr — feuille de style unique.
 *
 * L'écran-titre d'Ocarina of Time, reconstruit avec les fichiers du jeu :
 *  - img/plaine.webp : la plaine d'Hyrule rendue depuis son modèle 3D, caméra
 *    au ras de l'herbe, collines à l'horizon, ciel transparent ; le ciel bleu
 *    lavande brumeux et ses voiles de nuages sont des dégradés ;
 *  - fonts/hylia-dialogue.woff2 : la police de dialogue du jeu, vectorisée ;
 *  - img/panneau-9.png : le cadre doré du menu pause de Majora's Mask ;
 *  - img/objet-*.png : les icônes d'objets du jeu, une par réseau ;
 *  - img/navi-*.png : Navi, rendue depuis son modèle, en curseur ; et sa bulle
 *    « Hey ! Écoute ! » au survol des boutons ;
 *  - img/masque.webp : le Masque de Majora, version 3DS ;
 *  - img/triforce.webp : la Triforce, en filigrane derrière le nom ;
 *  - img/pierre.webp : la Pierre à Potins, qui chuchote au survol ;
 *  - img/horloge.png : l'horloge de Termina, dans le pied de page ;
 *  - img/vendeur.webp : le Vendeur de masques, sur la page 404 ;
 *  - l'aube du premier jour à l'ouverture, l'écran noir du jeu qui s'efface.
 */

@font-face {
  font-family: "Hylia Dialogue";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/hylia-dialogue.woff2") format("woff2");
}

@font-face {
  font-family: "Tinos";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/tinos-400.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* Le ciel de l'écran-titre, du zénith à l'horizon */
  --zenith: #5d6fb6;
  --ciel: #8494cc;
  --brume: #b9c3e3;
  --horizon: #dcd8ea;
  --herbe-sombre: #2f4a2a;

  /* La boîte de dialogue d'Ocarina of Time */
  --boite: rgba(4, 6, 40, 0.78);
  --boite-bord: rgba(255, 255, 255, 0.3);

  /* Le cadre doré et les cases d'objets */
  --or: #cdb45c;
  --or-sombre: #7d6a2a;
  --case: #0c0e2c;

  /* Navi */
  --navi: #9fe6ff;
  --navi-lueur: rgba(140, 220, 255, 0.75);

  --texte: #ffffff;
  --ombre: 0.06em 0.08em 0 rgba(0, 0, 0, 0.9);
  --police: "Tinos", "Times New Roman", Times, serif;
  --police-jeu: "Hylia Dialogue", "Tinos", "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ciel);
  cursor: url("/img/navi-32.png") 16 16, auto;
  cursor: -webkit-image-set(url("/img/navi-32.png") 1x, url("/img/navi-64.png") 2x) 16 16, auto;
}

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--police);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--texte);
  background: var(--ciel);
  overflow-x: hidden;
}

a,
button {
  color: inherit;
  cursor: url("/img/navi-32.png") 16 16, pointer;
  cursor: -webkit-image-set(url("/img/navi-32.png") 1x, url("/img/navi-64.png") 2x) 16 16, pointer;
}

::selection {
  background: var(--navi);
  color: #041018;
}

:focus-visible {
  outline: 2px solid var(--navi);
  outline-offset: 4px;
}

h1,
p {
  margin: 0;
}

img {
  display: block;
}

/* Lien d'évitement, visible au clavier seulement. */
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 8px 14px;
  background: var(--navi);
  color: #041018;
  font-size: 0.95rem;
  text-decoration: none;
  z-index: 30;
}

.skip:focus {
  top: 16px;
}

/* ---------- L'aube du premier jour ---------- */

.aube {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  text-align: center;
  background: #000;
  pointer-events: none;
  animation: aube 2.6s ease-in forwards;
}

.aube-titre {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.04em;
}

.aube-sous {
  margin-top: 10px;
  font-size: clamp(1rem, 3vw, 1.3rem);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}

@keyframes aube {
  0%, 62% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.deja-vu .aube {
  display: none;
}

/* ---------- Le ciel et la plaine ---------- */

.ciel {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* Nuages : des voiles clairs, en dégradés */
    radial-gradient(38% 9% at 18% 22%, rgba(255, 240, 246, 0.55), rgba(255, 240, 246, 0) 100%),
    radial-gradient(30% 7% at 66% 12%, rgba(255, 244, 248, 0.5), rgba(255, 244, 248, 0) 100%),
    radial-gradient(46% 10% at 40% 44%, rgba(255, 238, 244, 0.6), rgba(255, 238, 244, 0) 100%),
    radial-gradient(34% 8% at 85% 36%, rgba(255, 240, 246, 0.45), rgba(255, 240, 246, 0) 100%),
    radial-gradient(60% 12% at 55% 58%, rgba(240, 236, 250, 0.7), rgba(240, 236, 250, 0) 100%),
    /* Le ciel lui-même */
    linear-gradient(180deg, var(--zenith) 0%, var(--ciel) 30%, var(--brume) 56%, var(--horizon) 66%, var(--herbe-sombre) 66.5%, #1c2e1a 100%);
}

.plaine {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/img/plaine.webp") center bottom / cover no-repeat;
  pointer-events: none;
}

/* La brume de l'aube sur l'herbe lointaine. */
.plaine::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(220, 216, 234, 0) 58%, rgba(220, 216, 234, 0.45) 66%, rgba(220, 216, 234, 0) 76%),
    linear-gradient(180deg, rgba(40, 50, 90, 0) 70%, rgba(20, 30, 40, 0.35) 100%);
}

main,
footer {
  position: relative;
  z-index: 1;
}

main {
  width: min(100% - 32px, 460px);
  margin: 0 auto;
  padding: clamp(24px, 5vh, 56px) 0 24px;
}

/* ---------- L'en-tête : le Masque, puis la boîte de dialogue ---------- */

.entete {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.masque {
  width: clamp(130px, 36vw, 180px);
  height: auto;
  margin-bottom: -30px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.5));
}

.boite {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 46px 24px 26px;
  border-radius: 14px;
  background: var(--boite);
  box-shadow:
    inset 0 0 0 1.5px var(--boite-bord),
    inset 0 0 0 4px rgba(0, 0, 20, 0.6),
    0 14px 36px rgba(0, 0, 0, 0.4);
  text-align: center;
}

/* La Triforce, en filigrane. */
.boite::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/img/triforce.webp") center 62% / 44% auto no-repeat;
  opacity: 0.14;
  pointer-events: none;
}

.boite > * {
  position: relative;
}

h1 {
  font-family: var(--police-jeu);
  font-weight: 400;
  font-size: clamp(3rem, 15vw, 4.75rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: var(--ombre);
}

.handle {
  margin-top: 10px;
  font-family: var(--police-jeu);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: var(--ombre);
}

/* ---------- Les boutons : panneaux du menu, avec un objet du jeu ---------- */

.reseaux {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.reseau {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr 22px;
  align-items: center;
  column-gap: 16px;
  min-height: 90px;
  padding: 4px 16px 4px 10px;
  border: solid;
  border-width: 18px 18px 9px 18px;
  border-image: url("/img/panneau-9.png") 22 22 11 22 fill / 18px 18px 9px 18px stretch;
  background-color: rgba(2, 4, 24, 0.6);
  text-decoration: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  transition: filter 160ms ease, transform 160ms ease;
}

/* « Hey ! Écoute ! » : la bulle de Navi, au survol. */
.reseau::before {
  content: "Hey ! Écoute !";
  position: absolute;
  right: 14px;
  top: -34px;
  padding: 5px 12px 5px 32px;
  font-family: var(--police-jeu);
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--texte);
  background: rgba(4, 6, 40, 0.94) url("/img/navi-32.png") 6px center / 20px 20px no-repeat;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  box-shadow: 0 0 12px var(--navi-lueur);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  z-index: 2;
}

.reseau:hover::before,
.reseau:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

/* La case d'objet, comme dans le menu du jeu. */
.objet {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, #1d2050, var(--case) 75%);
  box-shadow:
    inset 0 0 0 2px var(--or-sombre),
    inset 0 0 0 3px rgba(0, 0, 0, 0.6),
    inset 0 6px 12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.objet img {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.7));
  transition: transform 180ms ease, filter 180ms ease;
}

.etiquette {
  font-family: var(--police-jeu);
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.05em;
  text-shadow: var(--ombre);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.glyphe {
  width: 22px;
  height: 22px;
  color: rgba(255, 255, 255, 0.55);
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.8));
  transition: color 160ms ease;
}

/* Navi survole le panneau : lueur bleue, l'objet se soulève et brille. */
.reseau:hover,
.reseau:focus-visible {
  transform: translateY(-2px);
  filter:
    drop-shadow(0 0 10px var(--navi-lueur))
    drop-shadow(0 0 22px var(--navi-lueur))
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.reseau:hover .objet,
.reseau:focus-visible .objet {
  box-shadow:
    inset 0 0 0 2px var(--navi),
    inset 0 0 0 3px rgba(0, 0, 0, 0.6),
    inset 0 6px 12px rgba(0, 0, 0, 0.5),
    0 0 14px var(--navi-lueur);
}

.reseau:hover .objet img,
.reseau:focus-visible .objet img {
  transform: translateY(-4px) scale(1.14);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 8px rgba(255, 245, 190, 0.9));
  animation: flotte 1.4s ease-in-out infinite;
}

.reseau:hover .etiquette,
.reseau:focus-visible .etiquette {
  color: #e6f8ff;
  text-shadow: var(--ombre), 0 0 12px var(--navi);
}

.reseau:hover .glyphe,
.reseau:focus-visible .glyphe {
  color: var(--texte);
}

.reseau:active {
  transform: translateY(0);
}

@keyframes flotte {
  0%, 100% { transform: translateY(-4px) scale(1.14); }
  50% { transform: translateY(-7px) scale(1.14) rotate(-3deg); }
}

/* ---------- Pied de page : l'horloge de Termina, la Pierre à Potins ---------- */

footer {
  margin-top: auto;
  padding: 20px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6);
}

.horloge {
  width: 104px;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.ligne-pied {
  display: flex;
  align-items: center;
  gap: 14px;
}

.copyright {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
}

.potins {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
}

.potins img {
  width: 44px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
  transition: transform 160ms ease;
}

.potins:hover img,
.potins:focus-visible img {
  transform: translateY(-2px);
}

/* La rumeur : une petite boîte de dialogue au-dessus de la pierre. */
.rumeur {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  width: min(300px, 80vw);
  padding: 10px 14px;
  transform: translate(-50%, 6px);
  font-family: var(--police-jeu);
  font-size: 0.95rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: none;
  color: var(--texte);
  background: rgba(4, 6, 40, 0.94);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.rumeur::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(4, 6, 40, 0.94);
  border-right: 1.5px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
}

.potins:hover .rumeur,
.potins:focus-visible .rumeur {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- La page 404 : le Vendeur de masques ---------- */

.perdu {
  background: #000;
  justify-content: center;
}

.perdu-scene {
  width: min(100% - 32px, 520px);
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vendeur {
  width: clamp(180px, 50vw, 260px);
  height: auto;
  margin-bottom: -22px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.8));
}

.boite-dialogue::before {
  display: none;
}

.replique {
  font-family: var(--police-jeu);
  font-size: clamp(1.25rem, 4.4vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-shadow: var(--ombre);
}

.perdu-explication {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
}

.retour {
  display: inline-block;
  margin-top: 22px;
  padding: 6px 18px;
  border: solid;
  border-width: 14px 14px 7px 14px;
  border-image: url("/img/panneau-9.png") 22 22 11 22 fill / 14px 14px 7px 14px stretch;
  background-color: rgba(2, 4, 24, 0.6);
  font-family: var(--police-jeu);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: var(--ombre);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  transition: filter 160ms ease;
}

.retour:hover,
.retour:focus-visible {
  filter: drop-shadow(0 0 10px var(--navi-lueur)) drop-shadow(0 0 22px var(--navi-lueur));
}

/* ---------- Réglages ---------- */

@media (prefers-reduced-motion: reduce) {
  .aube {
    display: none;
  }

  .reseau,
  .reseau::before,
  .etiquette,
  .objet img,
  .glyphe,
  .potins img,
  .rumeur {
    transition: none;
    animation: none;
  }

  .reseau:hover,
  .reseau:focus-visible {
    transform: none;
  }

  .reseau:hover .objet img,
  .reseau:focus-visible .objet img {
    animation: none;
  }
}

/* Fond personnalise */
.ciel { display: none; }
.plaine { background: url("/img/fond.jpg") center center / cover no-repeat; }
.plaine::after { display: none; }

/* Bouton contact */
.contact { margin-top: 24px; }
.objet .enveloppe { width: 42px; height: 42px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .7)); transition: transform 180ms ease, filter 180ms ease; }
.reseau:hover .enveloppe,
.reseau:focus-visible .enveloppe { transform: translateY(-4px) scale(1.14); filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .6)) drop-shadow(0 0 8px rgba(255, 245, 190, .9)); animation: flotte 1.4s ease-in-out infinite; }

/* Adresse sous le mot Contact */
.etiquette-contact { display: flex; flex-direction: column; gap: 6px; }
.adresse { font-size: 1rem; letter-spacing: .02em; color: rgba(255, 255, 255, .82); }
@media (max-width: 420px) { .adresse { font-size: .85rem; } }

/* Adresse sous le mot Contact */
.etiquette-contact { display: flex; flex-direction: column; gap: 6px; }
.adresse { font-size: 1rem; letter-spacing: .02em; color: rgba(255,255,255,.82); }
