/* ==========================================================
   Johann Monpas · Journal de bord (thème carte marine)
   ========================================================== */

:root {
  --papier: #f3ead6;
  --papier-clair: #f8f2e4;
  --papier-fonce: #e6d9bb;
  --encre: #1c2e4a;
  --encre-douce: #4a5a72;
  --rouge: #a63d28;
  --mer: #9cc3d5;
  --mer-fonce: #2e6886;
  --or: #c8962e;
  --console: #14213a;

  --police-titre: 'Fraunces', Georgia, serif;
  --police-texte: 'Outfit', system-ui, sans-serif;
  --police-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --largeur: 1120px;
  --gouttiere: clamp(16px, 4vw, 40px);
  --trait: 1.5px solid var(--encre);
}

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

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

body {
  margin: 0;
  font-family: var(--police-texte);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--encre);
  /* Papier de carte marine et son quadrillage */
  background:
    radial-gradient(ellipse at 50% 30%, transparent 55%, rgba(120, 90, 40, .12)),
    linear-gradient(rgba(28, 46, 74, .06) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(90deg, rgba(28, 46, 74, .06) 1px, transparent 1px) 0 0 / 96px 96px,
    var(--papier);
  background-attachment: fixed, scroll, scroll, scroll;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.mono { font-family: var(--police-mono); }

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 var(--gouttiere);
}

.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section + .section { border-top: 1px dashed rgba(28, 46, 74, .25); }

.surtitre {
  margin: 0 0 .5rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rouge);
}

.titre-section {
  margin: 0 0 1.2rem;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}

.section__intro { max-width: 38rem; margin: 0 0 2rem; color: var(--encre-douce); }

.bouton {
  display: inline-block;
  padding: .85rem 1.5rem;
  border: var(--trait);
  border-radius: 4px;
  background: var(--encre);
  color: var(--papier-clair);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--rouge);
  transition: transform .2s ease, box-shadow .2s ease;
}
.bouton:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--rouge); }
.bouton:focus-visible { outline: 3px solid var(--rouge); outline-offset: 3px; }
.bouton--contour { background: transparent; color: var(--encre); box-shadow: 4px 4px 0 var(--encre); }
.bouton--contour:hover { box-shadow: 6px 6px 0 var(--encre); }

/* Apparition douce */
.revele { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.revele.visible { opacity: 1; transform: none; }

/* ==========================================================
   En-tête
   ========================================================== */
.entete {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gouttiere);
  transition: background .35s ease, padding .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.entete--defile {
  padding-block: .6rem;
  background: rgba(243, 234, 214, .9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: rgba(28, 46, 74, .2);
}
.entete__logo {
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}
.entete__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--police-mono);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.entete__nav a { text-decoration: none; }
.entete__nav a:hover { color: var(--rouge); }
.entete__cta { padding: .35rem .8rem; border: var(--trait); border-radius: 4px; }

/* Sélecteur de langue */
.langues { display: flex; align-items: center; gap: .35rem; }
.langues a { padding: .1rem .2rem; color: var(--encre-douce); }
.langues a[aria-current] { color: var(--rouge); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.langues span { color: rgba(28, 46, 74, .35); }

@media (max-width: 680px) {
  .entete__nav > a:not(.entete__cta) { display: none; }
  .entete__nav { gap: 1rem; }
}

/* ==========================================================
   Page de garde
   ========================================================== */
.garde {
  /* La page de garde prend la hauteur de son contenu : pas de vide sous les boutons sur grand écran */
  padding: clamp(6rem, 12vh, 8rem) 0 1rem;
}
.garde__grille {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
/* Sans min-width: 0, les longues lignes de la console élargiraient la grille sur mobile */
.garde__texte { min-width: 0; }
.garde__numero {
  margin: 0 0 .8rem;
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rouge);
}
.garde__titre {
  margin: 0;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: .95;
  letter-spacing: -.02em;
}
.garde__sous-titre {
  margin: 1rem 0 2rem;
  font-family: var(--police-titre);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  color: var(--encre-douce);
}

/* La console façon terminal */
.console {
  max-width: 34rem;
  overflow: hidden;
  border: var(--trait);
  border-radius: 6px;
  background: var(--console);
  box-shadow: 6px 6px 0 rgba(28, 46, 74, .25);
}
.console__barre {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .45rem .7rem;
  background: #22314f;
}
.console__barre span { width: 9px; height: 9px; border-radius: 50%; background: #4a5a72; }
.console__barre em {
  margin-left: auto;
  font-family: var(--police-mono);
  font-size: .72rem;
  font-style: normal;
  color: #a3afc2;
}
.console__texte {
  min-height: 7.6em;
  margin: 0;
  padding: .9rem 1rem 1rem;
  overflow-x: auto;
  font-size: .78rem;
  line-height: 1.75;
  color: #d6dde8;
  white-space: pre;
}
@media (max-width: 600px) {
  .console__texte { white-space: pre-wrap; }
}
.console__date { color: #8796ad; }
.console__niveau { font-weight: 600; }
.console__niveau--info { color: var(--mer); }
.console__niveau--ok { color: #8fd18a; }
.console__curseur { color: var(--or); animation: clignoter 1s steps(1) infinite; }
@keyframes clignoter { 50% { opacity: 0; } }

.garde__actions { display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; margin-top: 2rem; }

/* Rose des vents */
.garde__rose { display: flex; justify-content: center; }
.rose { width: min(100%, 420px); height: auto; overflow: visible; transition: transform .2s linear; }
.rose__cercle { fill: none; stroke: var(--encre); stroke-width: 1.5; }
.rose__cercle--fin { stroke-width: .8; stroke-dasharray: 2 4; }
#rose-graduations line { stroke: var(--encre); stroke-width: 1; }
.rose__plein { fill: var(--encre); }
.rose__plein--rouge { fill: var(--rouge); }
.rose__vide { fill: var(--papier-clair); stroke: var(--encre); stroke-width: 1; }
.rose__centre { fill: var(--papier-clair); stroke: var(--encre); stroke-width: 2; }
.rose__lettre {
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 22px;
  text-anchor: middle;
  fill: var(--rouge);
}

@media (max-width: 860px) {
  .garde__grille { grid-template-columns: 1fr; }
  .garde__rose { order: -1; }
  .rose { width: 180px; }
}

/* ==========================================================
   Ports d'attache
   ========================================================== */
.ports__grille {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.ports p { max-width: 38rem; }

.fiche {
  margin: 0;
  padding: 1.4rem 1.6rem;
  border: var(--trait);
  background: var(--papier-clair);
  box-shadow: 6px 6px 0 var(--papier-fonce);
}
.fiche > div { padding: .7rem 0; border-bottom: 1px dashed rgba(28, 46, 74, .25); }
.fiche > div:first-child { padding-top: 0; }
.fiche > div:last-child { padding-bottom: 0; border-bottom: 0; }
.fiche dt { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rouge); }
.fiche dd { margin: .15rem 0 0; font-family: var(--police-titre); font-size: 1.15rem; font-weight: 600; }

.carte-marine {
  margin: 2rem 0 0;
  padding: clamp(.6rem, 2vw, 1.2rem);
  border: var(--trait);
  outline: 1px solid var(--encre);
  outline-offset: 5px;
  background: rgba(156, 195, 213, .22);
}
.carte-marine svg { width: 100%; height: auto; }

/* Sur petit écran, la carte réduite rendrait ses textes illisibles (5 à 9 px) :
   elle garde une largeur minimale et se parcourt en glissant le doigt */
@media (max-width: 760px) {
  .carte-marine { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .carte-marine svg { min-width: 720px; }
  .carte-marine::after {
    position: sticky;
    left: 0;
    display: block;
    padding-top: .5rem;
    font-family: var(--police-mono);
    font-size: .75rem;
    color: var(--encre-douce);
  }
  .carte-marine:lang(fr)::after { content: '← Faites glisser pour parcourir la carte →'; }
  .carte-marine:lang(en)::after { content: '← Swipe to explore the map →'; }
}
.carte-marine__graticule { fill: none; stroke: rgba(28, 46, 74, .12); stroke-width: 1; }
.carte-marine__ocean {
  font-family: var(--police-titre);
  font-style: italic;
  font-size: 17px;
  letter-spacing: .2em;
  fill: var(--mer-fonce);
}
.carte-marine__ocean--petit { font-size: 12px; letter-spacing: .12em; }
.carte-marine__continent {
  font-family: var(--police-mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  fill: var(--encre-douce);
}
.carte-marine__terre { fill: var(--papier-fonce); stroke: var(--encre); stroke-width: .7; stroke-linejoin: round; fill-rule: evenodd; }
.carte-marine__terre--france { fill: #dcc79a; }
.carte-marine__voisins { fill: var(--papier-clair); stroke: rgba(28, 46, 74, .45); stroke-width: .6; stroke-linejoin: round; }
.carte-marine__emprise { fill: none; stroke: var(--rouge); stroke-width: 1.2; }
.carte-marine__renvoi { fill: none; stroke: var(--rouge); stroke-width: .8; stroke-dasharray: 3 3; }
.carte-marine__cartouche { fill: #dce9ee; }
.carte-marine__cadre { fill: none; stroke: var(--encre); stroke-width: 1.5; }
.carte-marine__titre-cartouche {
  font-family: var(--police-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  fill: var(--rouge);
}
.carte-marine__hachure { stroke: rgba(28, 46, 74, .18); stroke-width: 1; }
.carte-marine__hachure-zone { fill: url(#hachures); pointer-events: none; }
.carte-marine__route {
  fill: none;
  stroke: var(--rouge);
  stroke-width: 2.2;
  stroke-dasharray: 8 7;
  animation: cheminer 1.6s linear infinite;
}
@keyframes cheminer { to { stroke-dashoffset: -15; } }
.carte-marine__echelle { font-family: var(--police-mono); font-size: 11px; fill: var(--encre-douce); }

.port__repere { fill: var(--papier-clair); stroke: var(--encre); stroke-width: 2.5; }
.port--actuel .port__repere { fill: var(--rouge); stroke: var(--rouge); }
.port__onde { fill: none; stroke: var(--rouge); stroke-width: 1.5; transform-origin: 0 0; animation: onde 2.4s ease-out infinite; }
@keyframes onde {
  from { transform: scale(.5); opacity: 1; }
  to   { transform: scale(1.8); opacity: 0; }
}
.port__nom { font-family: var(--police-titre); font-size: 21px; font-weight: 800; fill: var(--encre); }
.port__info { font-family: var(--police-mono); font-size: 11.5px; fill: var(--encre-douce); }
/* Liseré couleur papier : les étiquettes restent lisibles par-dessus les tracés */
.port__nom, .port__info, .carte-marine__ocean, .carte-marine__continent {
  paint-order: stroke;
  stroke: var(--papier-clair);
  stroke-width: 4px;
  stroke-linejoin: round;
}

@media (max-width: 820px) {
  .ports__grille { grid-template-columns: 1fr; }
}

/* ==========================================================
   Entrées du journal
   ========================================================== */
.fil { position: relative; padding-left: 4.5rem; }
.fil__ligne {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.6rem;
  width: 2px;
  background: repeating-linear-gradient(rgba(28, 46, 74, .35) 0 6px, transparent 6px 12px);
}
.fil__progression { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: var(--rouge); }
.fil__navire {
  position: absolute;
  top: 0;
  left: calc(1.6rem + 1px);
  z-index: 2;
  width: 22px;
  height: 26px;
  transform: translate(-50%, -16px);
}
.fil__coque { fill: var(--papier-clair); stroke: var(--encre); stroke-width: 1.6; }
.fil__mat { stroke: var(--rouge); stroke-width: 2.4; stroke-linecap: round; }

.entrees { margin: 0; padding: 0; list-style: none; }
.entree { position: relative; }
.entree + .entree { margin-top: 1.75rem; }
.entree__repere {
  position: absolute;
  top: 1.2rem;
  left: -4.5rem;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: var(--trait);
  border-radius: 50%;
  background: var(--papier-clair);
  font-size: .9rem;
  font-weight: 600;
  transition: background .4s, color .4s, border-color .4s;
}
.entree--atteinte .entree__repere { background: var(--rouge); border-color: var(--rouge); color: var(--papier-clair); }

.entree__page {
  max-width: 46rem;
  padding: 1.4rem 1.6rem 1.5rem;
  border: var(--trait);
  background: var(--papier-clair);
  box-shadow: 6px 6px 0 var(--papier-fonce);
}
.entree__entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1rem;
  margin: 0 0 .6rem;
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--encre-douce);
}
.entree__badge { padding: .1rem .5rem; border: 1px solid var(--mer-fonce); color: var(--mer-fonce); }
.entree__badge--poste { border-color: var(--rouge); color: var(--rouge); }
.entree__date { margin-left: auto; color: var(--rouge); }
.entree__titre { margin: 0; font-family: var(--police-titre); font-size: 1.6rem; line-height: 1.2; }
.entree__lieu { margin: .2rem 0 .8rem; font-family: var(--police-titre); font-style: italic; color: var(--mer-fonce); }
.entree__texte { margin: 0; }
.entree__points { padding: 0; list-style: none; }
.entree__points li { position: relative; padding-left: 1.2rem; }
.entree__points li + li { margin-top: .35rem; }
.entree__points li::before { content: '›'; position: absolute; left: .2rem; color: var(--rouge); font-weight: 600; }
.entree__tags { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: .8rem; color: var(--encre-douce); }
.entree__tags li::before { content: '#'; color: var(--rouge); }

@media (max-width: 600px) {
  .fil { padding-left: 3.2rem; }
  .fil__ligne { left: 1.1rem; }
  .fil__navire { left: calc(1.1rem + 1px); }
  .entree__repere { left: -3.2rem; width: 2.3rem; height: 2.3rem; font-size: .78rem; }
  .entree__page { padding: 1.1rem 1.1rem 1.2rem; }
  .entree__titre { font-size: 1.3rem; }
  .entree__date { margin-left: 0; }
}

/* ==========================================================
   Instruments de bord
   ========================================================== */
.instruments__grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.instrument {
  padding: 1.4rem 1.5rem 1.5rem;
  border: var(--trait);
  background: var(--papier-clair);
  box-shadow: 6px 6px 0 var(--papier-fonce);
}
.instrument__icone {
  width: 48px;
  height: 48px;
  margin-bottom: .8rem;
  fill: none;
  stroke: var(--encre);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.instrument__icone .plein { fill: var(--rouge); stroke: var(--rouge); }
.instrument__titre { margin: 0 0 .8rem; font-family: var(--police-titre); font-size: 1.3rem; }
.instrument__liste { margin: 0; padding: 0; list-style: none; font-family: var(--police-mono); font-size: .86rem; }
.instrument__liste li { padding: .3rem 0; border-bottom: 1px dotted rgba(28, 46, 74, .25); }
.instrument__liste li:last-child { border-bottom: 0; }
.instrument__liste li::before { content: '› '; color: var(--rouge); font-weight: 600; }

/* ==========================================================
   Contact
   ========================================================== */
.contact { text-align: center; }
.contact__contenu p { max-width: 32rem; margin: 0 auto 2rem; }

/* Adresse e-mail visible et copiable, pour ceux qui n'ont pas de messagerie configurée */
.contact__contenu .adresse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem .8rem;
  margin: 1.4rem auto 0;
  font-size: .9rem;
  color: var(--encre-douce);
}
.adresse__copier {
  min-width: 5.5rem;
  padding: .25rem .7rem;
  border: 1px solid var(--encre);
  border-radius: 4px;
  background: var(--papier-clair);
  color: var(--encre);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.adresse__copier:hover { background: var(--encre); color: var(--papier-clair); }
.adresse__copier:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
.adresse__copier.est-copie { border-color: #2f6f32; background: #2f6f32; color: var(--papier-clair); }

.visuellement-masque {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.contact__liens {
  display: flex;
  justify-content: center;
  gap: 1.8rem;
  margin: 2.2rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.contact__liens a { text-decoration-color: var(--rouge); text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* ==========================================================
   Pied de page
   ========================================================== */
.pied {
  padding: 2rem var(--gouttiere) 2.4rem;
  border-top: var(--trait);
  background: var(--papier-fonce);
  text-align: center;
  font-size: .8rem;
  color: var(--encre-douce);
}
.pied p { margin: 0; }
.pied p:first-child { margin-bottom: .4rem; font-weight: 600; letter-spacing: .2em; color: var(--rouge); }

/* ==========================================================
   Accessibilité : mouvement réduit
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
