/* CASTELIS HOLDING - feuille de style unique. Mobile d'abord, bureau a partir de 1024 px.
   Idee directrice : l'architecture se dessine, puis elle s'habite.
   Tous les etats initiaux caches dependent de html.anim (ajoute par assets/amorce.js). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(assets/fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(assets/fonts/archivo-latin-wdth-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@view-transition { navigation: auto; }

:root {
  --rouge: #EC3013;
  --bouton: #C4240C;
  --bouton-h: #A32209;
  --rouge-texte: #A32209;
  --encre: #201E1D;
  --encre2: #4A4746;
  --gris: #7D7979;
  --gris-clair: #9B9797;
  --filet: #D7D3D3;
  --fond: #F3F2F2;
  --surface: #FFFFFF;
  --marge: 16px;
  --entete: 56px;
  --ancre: 72px;
  --sec: 36px;
  --secv: 72px;
  --gout: 24px;
  --ouv-h: 70vh;
  --rev: cubic-bezier(.16, .84, .2, 1);
  --volet: cubic-bezier(.7, 0, .2, 1);
  --mot-r: 6.25; /* largeur d'encre du mot CASTELIS a 125 % : repli sans JavaScript */
}
@media (min-width: 1024px) {
  :root { --marge: 40px; --entete: 72px; --ancre: 96px; --sec: 60px; --secv: 120px; --ouv-h: 85vh; }
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html.menu-ouvert, html.vis-ouverte, html.menu-ouvert body, html.vis-ouverte body { overflow: hidden; }

body {
  margin: 0;
  padding-top: var(--entete);
  background: var(--fond);
  color: var(--encre);
  font-family: Archivo, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}
@media (min-width: 1024px) { body { font-size: 18px; } }

img, picture { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0 0 1em; max-width: 64ch; }
address { font-style: normal; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

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

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.evitement {
  position: fixed; left: var(--marge); top: -100px; z-index: 500; padding: 12px 16px;
  background: var(--encre); color: #fff; font-weight: 600; text-decoration: none;
}
.evitement:focus { top: 8px; }

/* ---------- grille visible (bureau seulement) : deux traits de bord, 24 px hors du conteneur ---------- */
.trame { display: none; }
@media (min-width: 1024px) {
  .trame { display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
  .trame-c { position: relative; width: 100%; height: 100%; max-width: 1280px; margin: 0 auto; padding-inline: var(--marge); }
  .trame span { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--filet); }
  .trame span:nth-child(1) { left: calc(var(--marge) - 24px); }
  .trame span:nth-child(2) { left: calc(100% - var(--marge) + 23px); }
}

/* ---------- titres, etiquettes ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.012em; }
h1, h2, .bandeau-titre { text-wrap: balance; }
h1 { font-size: 44px; font-stretch: 80%; line-height: 1; }
h2 { font-size: clamp(30px, 4.4vw, 64px); line-height: 1.02; margin-bottom: 24px; max-width: 20ch; }
h3 { font-size: 20px; line-height: 1.2; }
h4 { font-size: 20px; line-height: 1.2; margin: 32px 0 16px; }
@media (min-width: 768px) and (max-width: 1023px) { h1 { font-size: clamp(44px, 7vw, 64px); font-stretch: 90%; } }
@media (min-width: 1024px) {
  h1 { font-size: clamp(44px, min(6.2vw, 9vh), 96px); font-stretch: 100%; line-height: 0.98; letter-spacing: -0.02em; }
  h2 { margin-bottom: 32px; }
  h3 { font-size: 24px; }
  h4 { font-size: 24px; }
}
.etiquette {
  display: block; margin: 0 0 20px; max-width: none;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--encre2);
}

/* mots masques (montee mot a mot) */
.mot { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0 0.14em; margin: -0.1em 0 -0.14em; }
.mot-in { display: inline-block; }

/* ---------- conteneur et grille ---------- */
.conteneur { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: var(--marge); }
.grille { display: block; }
@media (min-width: 1024px) {
  .grille { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gout); }
}
.section { --bg: var(--fond); padding-bottom: var(--secv); scroll-margin-top: var(--entete); }
.section > .conteneur:first-child, .trait + .conteneur { padding-top: var(--secv); }
.trait { display: block; height: 2px; background: var(--encre); }
.chapo { max-width: 64ch; }

/* en-tete de section : rail d'etiquette + titre ; contenu pleine largeur */
.rail { margin: 0 0 16px; }
.sec-titre { padding-bottom: 8px; }
.sec-titre > :last-child { margin-bottom: 0; }
.sec-plein { position: relative; z-index: 1; background: var(--bg); }
@media (min-width: 1024px) {
  .sec-grille { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gout); grid-template-rows: auto auto; }
  .rail { grid-column: 1 / 4; grid-row: 1 / 3; position: sticky; top: var(--ancre); align-self: start; margin: 0; padding-top: 0.9em; }
  .sec-titre { grid-column: 4 / 13; grid-row: 1; padding-bottom: 56px; }
  .sec-plein { grid-column: 1 / 13; grid-row: 2; }
}

/* ---------- boutons ---------- */
.bouton {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: flex-start;
  min-height: 52px; padding: 0 24px; border: 2px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1.2; text-align: left; text-decoration: none; cursor: pointer;
  transition: color 350ms var(--volet), border-color 350ms var(--volet);
}
.bouton::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--encre);
  transform: scaleX(0); transform-origin: left; transition: transform 350ms var(--volet);
}
.bouton:hover::before, .bouton:focus-visible::before { transform: scaleX(1); }
.bouton:active { transform: translateY(1px); }
.bouton-plein { background: var(--bouton); border-color: var(--bouton); color: #fff; }
.bouton-plein:hover, .bouton-plein:focus-visible { border-color: var(--encre); }
.bouton-contour { background: transparent; border-color: var(--encre); color: var(--encre); }
.bouton-contour:hover, .bouton-contour:focus-visible { color: #fff; }
.bouton-blanc { background: #fff; border-color: #fff; color: var(--encre); }
.bouton-blanc:hover, .bouton-blanc:focus-visible { color: #fff; border-color: var(--encre); }
.bouton-large { display: flex; width: 100%; }

/* ---------- liens ---------- */
.lien, .lien-nav { position: relative; display: inline-block; padding-block: 12px; margin-block: -12px; text-decoration: none; }
.lien::before { content: ""; position: absolute; left: 0; right: 0; bottom: 12px; height: 1px; background: currentColor; opacity: 0.45; }
.lien::after, .lien-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 11px; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 350ms var(--volet);
}
.lien:hover::after, .lien:focus-visible::after, .lien-nav:hover::after, .lien-nav:focus-visible::after { transform: scaleX(1); }
.lien-nav.actuel::after, .lien-nav[aria-current]::after { transform: scaleX(1); background: var(--rouge); }
.lien-discret { font-size: 16px; font-weight: 400; color: var(--encre2); }
.lien-nav, .langues, .langues a { white-space: nowrap; }

/* ---------- en-tete ---------- */
.entete {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--entete);
  background: var(--surface); border-bottom: 1px solid var(--filet);
}
html.anim .entete { transition: transform 400ms var(--volet); }
html.anim .entete.cache { transform: translateY(-100%); }
html.anim .entete.cache:focus-within { transform: none; }
.entete-in { display: flex; align-items: center; height: 100%; gap: 8px; }
.logo-lien { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; }
.logo { display: block; height: 36px; width: auto; overflow: visible; }
.bouton-reserver { margin-left: auto; }
.bouton-menu {
  position: relative; min-height: 48px; padding: 0 16px; background: transparent; border: 0; color: var(--encre);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
html:not(.js) .bouton-menu { display: none; }

/* telephone : boutons visuellement hauts de 40 px, zone tactile de 48 px */
@media (max-width: 1023px) {
  .entete .bouton-reserver { border: 0; background: transparent; color: #fff; min-height: 48px; padding: 0 16px; font-size: 12px; overflow: visible; }
  .entete .bouton-reserver::after, .bouton-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; bottom: 4px; z-index: -2; }
  .entete .bouton-reserver::after { background: var(--bouton); }
  .entete .bouton-reserver::before { inset: 4px 0; }
  .bouton-menu { isolation: isolate; }
  .bouton-menu::after { border: 2px solid var(--encre); }
}

.nav { display: none; }
.nav.ouvert {
  display: flex; flex-direction: column; position: fixed; inset: 0; z-index: -1;
  padding: var(--entete) var(--marge) 24px; overflow-y: auto; background: var(--surface);
}
.nav-liens a {
  display: flex; align-items: center; min-height: 56px; margin: 0; padding: 0; border-bottom: 1px solid var(--filet);
  font-size: 22px; font-weight: 800; letter-spacing: -0.012em; text-decoration: none;
}
.nav-liens a::after { display: none; }
.nav-liens a.actuel { color: var(--rouge-texte); }
.langues { margin-top: 24px; font-weight: 600; }
.langues a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; margin: 0; padding: 0;
  color: var(--encre2);
}
.langues a::after { bottom: 10px; left: 8px; right: 8px; }
.langues a[aria-current] { color: var(--encre); font-weight: 800; }

html.anim .nav.ouvert { animation: menu-descend 500ms var(--volet) both; }
html.anim .nav.ouvert .nav-liens li { animation: monte-lien 600ms var(--rev) both; animation-delay: calc(150ms + var(--i, 0) * 60ms); }
@keyframes menu-descend { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes monte-lien { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (min-width: 1024px) {
  .entete-in { gap: 32px; }
  .logo { height: 44px; }
  .nav, .nav.ouvert {
    display: flex; align-items: center; position: static; inset: auto; z-index: auto; padding: 0;
    margin-left: auto; overflow: visible; background: none; flex-direction: row; gap: 32px; animation: none !important;
  }
  .nav-liens { display: flex; gap: 28px; }
  .nav-liens a { display: inline-block; min-height: 0; padding: 12px 0; margin: -12px 0; border: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; }
  .nav-liens a::after { display: block; }
  .nav-liens a.actuel { color: var(--encre); }
  .nav-liens li { animation: none !important; }
  .langues { margin: 0; font-size: 14px; }
  .langues a { min-width: 32px; }
  .bouton-reserver { margin-left: 0; min-height: 48px; padding: 0 24px; }
  .bouton-menu { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .entete-in, .nav { gap: 16px; }
  .nav-liens { gap: 16px; }
  .nav-liens a { font-size: 14px; }
  .bouton-reserver { padding: 0 16px; }
}

/* ---------- heros ---------- */
.heros { display: flex; flex-direction: column; }
.heros-haut { flex: 1; display: grid; align-items: center; position: relative; }
.hero-grille { padding-block: 36px 0; }
.hero-texte { padding-bottom: 24px; }
.hero-texte h1 { margin-bottom: 24px; }
.hero-texte .chapo { margin-bottom: 32px; }
.boutons { display: flex; flex-direction: column; gap: 12px; }
.boutons .bouton { width: 100%; }

.cadre { position: relative; overflow: hidden; background: var(--filet); }
.cadre img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.nb img { filter: grayscale(1); }
.par { position: absolute; left: 0; right: 0; top: 0; height: 100%; transform: translateY(var(--py, 0px)); }
.cadre-hero { margin: 0 var(--marge) var(--sec); aspect-ratio: 4 / 3; }
.hero-fenetre { position: absolute; inset: 0; overflow: hidden; }
/* l'image depasse du cadre : le bas (les voitures de la rue) reste coupe, meme avec le parallaxe */
.hero-par { height: 128%; }
.cadre-hero img { object-position: 60% 40%; }
.rideau { display: none; }

.reperes { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 12px; margin: 0 0 var(--sec); border-top: 2px solid var(--encre); }
.repere { display: block; padding: 16px 0 0; color: inherit; text-decoration: none; }
.repere-valeur { display: block; margin-bottom: 4px; font-size: 22px; font-weight: 800; line-height: 1.15; letter-spacing: -0.012em; }
.repere .etiquette { margin: 0; font-size: 11px; letter-spacing: 0.05em; line-height: 1.4; }
.repere-lien:hover .repere-valeur { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--rouge); }

@media (min-width: 768px) and (max-width: 1023px) {
  .boutons { flex-direction: row; }
  .boutons .bouton { width: auto; }
}
@media (min-width: 1024px) {
  .heros { min-height: calc(100svh - var(--entete)); }
  .hero-grille { padding-block: clamp(32px, 6vh, 72px); }
  .hero-texte { grid-column: 1 / 10; padding-bottom: 0; }
  .hero-texte h1 { margin-bottom: 32px; }
  .hero-texte .chapo, .boutons { width: calc((100% - 192px) / 9 * 6 + 120px); max-width: none; }
  .hero-texte .chapo { font-size: 20px; }
  .boutons { flex-direction: row; }
  .boutons .bouton { width: auto; }
  /* dalle verticale : de la colonne 10 jusqu'au bord droit de la fenetre, sous l'en-tete, jusqu'a la bande de reperes */
  .cadre-hero {
    position: absolute; top: 0; bottom: 0; right: 0; margin: 0; aspect-ratio: auto;
    left: calc(max(0px, (100% - 1280px) / 2) + var(--marge) + (min(100%, 1280px) - 2 * var(--marge)) * 0.75 + 18px);
  }
  /* les trois reperes partent des colonnes 1, 5 et 9 */
  .reperes { grid-template-columns: repeat(12, 1fr); column-gap: var(--gout); margin: 0; }
  .reperes li { grid-column: span 4; }
  .repere { height: 100%; padding: 28px 0; }
  .repere-valeur { font-size: 28px; margin-bottom: 6px; }
  .repere .etiquette { font-size: 12px; letter-spacing: 0.22em; line-height: 1.5; }
}

/* ---------- 01 societe ---------- */
.metiers { position: relative; margin-top: 8px; border-top: 2px solid var(--encre); }
.metiers li { padding: 24px 0; }
.metiers li + li { border-top: 1px solid var(--filet); }
.metiers h3 { margin-bottom: 8px; }
.metiers p { margin: 0; }
@media (min-width: 1024px) {
  .metiers { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gout); margin-top: 0; }
  .metiers li { grid-column: span 4; padding: 32px 0; }
  .metiers li + li { border-top: 0; }
}

/* ---------- bande photo pleine largeur ---------- */
.bande { margin: 0; height: clamp(320px, 62vh, 720px); }
.bande-par { top: -10%; height: 120%; }

/* ---------- 02 la methode (fond encre) ---------- */
.section-methode { background: var(--encre); color: var(--fond); --bg: var(--encre); }
.section-methode .etiquette { color: var(--gris-clair); }
.methode { display: flex; flex-direction: column; margin-top: 8px; }
.methode-fixe { order: 2; margin-top: 32px; }
.grand-chiffre { display: none; }
.methode-cadre { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--encre2); }
.etape-img { display: none; position: absolute; inset: 0; }
.etape-img img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.etape-2 { display: block; }
.etape-plateau { background: var(--rouge); align-items: center; justify-content: center; }
.etape-plateau svg { width: 38%; height: auto; }
.etape-plateau path { fill: var(--fond); }
.etapes { position: relative; padding-left: 0; }
.etapes::before, .etapes::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; }
.etapes::before { background: var(--encre2); }
.etapes::after { background: var(--rouge); transform: scaleY(var(--p, 0)); transform-origin: top; }
html:not(.anim) .etapes::after { display: none; }
.etapes li { display: flex; gap: 16px; padding: 24px 0 24px 24px; }
.etapes .num { flex: none; min-width: 32px; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--rouge); }
.etapes h3 { margin-bottom: 8px; }
.etapes p { margin: 0; }
.appel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; max-width: none;
  margin: var(--sec) 0 0; padding-top: 24px; border-top: 1px solid var(--encre2);
  font-size: 20px; font-weight: 600; line-height: 1.3;
}
.section-methode .appel .lien { color: var(--fond); font-weight: 800; }
.section-methode .lien::before { background: var(--rouge); opacity: 1; }
.section-methode .lien::after { background: var(--rouge); }
@media (min-width: 1024px) {
  .methode { display: grid; margin-top: 0; }
  .methode-fixe { order: 0; grid-column: 1 / 7; margin-top: 0; position: sticky; top: var(--ancre); align-self: start; }
  .etapes { grid-column: 8 / 13; }
  .etapes::before, .etapes::after { left: -13px; }
  .etapes li { display: block; padding: 32px 0; }
  .etapes .num { display: block; margin-bottom: 8px; }
  html.anim .etapes li { min-height: 60vh; }
  html.anim .etapes li:last-child { min-height: 0; }
  html.anim .etapes .num { display: none; }
  html.anim .etapes li > div { color: var(--gris-clair); transition: color 500ms var(--rev); }
  html.anim .etapes li.actif > div { color: var(--fond); }
  html.anim .grand-chiffre {
    --chiffre: min(320px, 34vh);
    display: block; height: var(--chiffre); margin-bottom: 24px; overflow: hidden; color: var(--rouge);
    font-size: var(--chiffre); font-weight: 800; line-height: 1; letter-spacing: -0.05em;
  }
  html.anim .gc-pile { transform: translateY(calc(var(--k, 0) * -1em)); transition: transform 700ms var(--volet); }
  html.anim .gc-pile span { display: block; height: 1em; }
  /* correction optique : l'encre de chaque chiffre part du meme bord gauche */
  html.anim .gc-pile span:nth-child(1) { margin-left: -0.1013em; }
  html.anim .gc-pile span:nth-child(2) { margin-left: -0.0499em; }
  html.anim .gc-pile span:nth-child(3) { margin-left: -0.0429em; }
  html.anim .gc-pile span:nth-child(4) { margin-left: -0.0267em; }
  /* une image par etape, la nouvelle recouvre l'ancienne du bas vers le haut */
  html.anim .etape-img { display: block; }
  html.anim .etape-plateau { display: flex; }
  html.anim .etape-2, html.anim .etape-3, html.anim .etape-plateau { clip-path: inset(100% 0 0 0); transition: clip-path 600ms var(--volet); }
  html.anim .etape-2.vu, html.anim .etape-3.vu, html.anim .etape-plateau.vu { clip-path: inset(0); }
  .appel { font-size: 24px; margin-top: 48px; }
}

/* ---------- 03 conciergerie ---------- */
.section-conc { padding-bottom: 0; }
.zone { margin-bottom: 32px; font-weight: 600; color: var(--encre2); }
.prestations { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--filet); border: 1px solid var(--filet); }
.prestations li { padding: 24px; background: var(--bg); }
.prestations h3 { margin-bottom: 8px; }
.prestations p { margin: 0; }
.cadre-serrure { aspect-ratio: 4 / 5; margin-top: 24px; }
@media (min-width: 1024px) {
  .conc-titre { grid-column: 4 / 13; padding-bottom: 56px; }
  .prestations { grid-template-columns: repeat(3, 1fr); grid-column: 1 / 9; grid-row: 2; position: relative; z-index: 1; }
  .cadre-serrure { grid-column: 9 / 13; grid-row: 2; margin: 0; aspect-ratio: auto; align-self: stretch; }
}

.bandeau { margin-top: var(--secv); background: var(--rouge); color: #fff; padding-block: 56px; }
.bandeau :focus-visible { outline-color: #fff; }
.bandeau-titre { margin: 0 0 24px; font-size: clamp(36px, 5.4vw, 84px); line-height: 1; max-width: none; }
.bandeau-corps p { max-width: 48ch; margin-bottom: 24px; font-size: 20px; font-weight: 700; line-height: 1.45; }
@media (min-width: 1024px) {
  .bandeau { padding-block: 96px; }
  .bandeau-grille { align-items: end; }
  .bandeau-titre { grid-column: 1 / 8; margin: 0; }
  .bandeau-corps { grid-column: 8 / 13; }
}

/* ---------- 04 logements ---------- */
.section-logements { background: #fff; --bg: #fff; padding-bottom: var(--secv); scroll-margin-top: var(--entete); }

/* ouverture pleine page : la photo reste epinglee pendant un ecran de defilement */
.ouverture { position: relative; height: 140vh; }
.ouv-sticky { position: sticky; top: calc(var(--entete) + (100svh - var(--entete) - var(--ouv-h)) / 2); height: var(--ouv-h); }
.ouv-photo { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; overflow: hidden; background: var(--filet); cursor: pointer; }
.ouv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cartouche {
  position: absolute; bottom: 0; left: calc(max(0px, (100% - 1280px) / 2) + var(--marge));
  max-width: calc(100% - 2 * var(--marge)); padding: 24px 28px 20px; background: #fff;
}
.cartouche .etiquette { margin-bottom: 12px; }
.cartouche h2 { margin: 0; max-width: none; font-size: clamp(36px, 5vw, 72px); line-height: 1; }
html:not(.anim) .ouverture { height: auto; }
html:not(.anim) .ouv-sticky { position: relative; top: auto; }
/* epinglee : la photo occupe toute la fenetre (l'en-tete passe dessus), aucune bande blanche quand il se retire */
html.anim .ouv-sticky { top: 0; height: 100svh; }
@media (min-width: 1024px) {
  .ouverture { height: 185vh; }
  .cartouche { padding: 32px 40px 28px; }
}

.fiche-haut { padding-top: var(--secv); }
.fiche-haut .chapo { margin-bottom: 48px; }
.fiche-tete { margin-bottom: 24px; }
.fiche-tete h3 { margin-bottom: 8px; font-size: clamp(26px, 3.2vw, 44px); line-height: 1.05; }
.fiche-tete p { max-width: none; margin: 0 0 4px; }
.fiche-lieu { font-weight: 600; }
.fiche-note .lien { color: var(--rouge-texte); font-weight: 600; }

.fiche-tech {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; margin-bottom: 0;
  background: var(--filet); border: 1px solid var(--filet);
}
.fiche-tech li { grid-column: span 2; min-width: 0; padding: 16px 8px 14px 12px; background: var(--bg); }
.fiche-tech li:nth-child(n + 4) { grid-column: span 3; }
.ft-val { display: block; margin-bottom: 4px; font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -0.012em; white-space: nowrap; }
.fiche-tech .etiquette { margin: 0; font-size: 12px; letter-spacing: 0.14em; overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  .fiche-tech { grid-template-columns: repeat(5, 1fr); }
  .fiche-tech li, .fiche-tech li:nth-child(n + 4) { grid-column: auto; padding: 24px 24px 20px; }
  .ft-val { font-size: 40px; margin-bottom: 8px; }
  .fiche-tech .etiquette { letter-spacing: 0.22em; }
}

/* galerie : rail horizontal, du bord gauche du conteneur au bord droit de la fenetre */
.defile-bloc { margin: 40px 0; }
.defile-tete { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 16px; }
.defile-compteur { margin: 0 16px 0 0; max-width: none; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; }
.carre {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
  background: transparent; border: 2px solid var(--encre); color: var(--encre);
  transition: background-color 250ms var(--volet), color 250ms var(--volet);
}
.carre:hover { background: var(--encre); color: #fff; }
.defile {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: var(--marge); scroll-padding-inline: var(--marge); cursor: grab; -webkit-user-select: none; user-select: none;
}
.defile::-webkit-scrollbar { display: none; }
.defile.glisse { cursor: grabbing; scroll-snap-type: none; }
.tuile {
  position: relative; display: block; flex: 0 0 85%; aspect-ratio: 4 / 5; padding: 0; border: 0;
  overflow: hidden; background: var(--filet); scroll-snap-align: start;
}
.tuile:focus-visible { outline-offset: -4px; }
.tuile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 600ms var(--rev); }
@media (hover: hover) { .tuile:hover img { transform: scale(1.04); } }
@media (min-width: 1024px) {
  .defile-bloc { margin: 72px 0; }
  .defile {
    padding-inline-start: calc(max(0px, (100% - 1280px) / 2) + var(--marge)); scroll-padding-inline-start: calc(max(0px, (100% - 1280px) / 2) + var(--marge));
  }
  .tuile { flex: 0 0 auto; height: 480px; aspect-ratio: 3 / 2; }
  .tuile-p { aspect-ratio: 2 / 3; }
}

.fiche-corps { padding-top: 32px; }
.fiche-description p { margin-bottom: 1em; }
.puces li { position: relative; padding: 0 0 8px 22px; }
.puces li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; background: var(--rouge); }
.puces-2 { columns: 2; column-gap: 16px; }
.puces-2 li { break-inside: avoid; }

/* formulaire de demande */
.demande { margin-top: 8px; padding: 24px 16px; background: var(--surface); border: 2px solid var(--encre); scroll-margin-top: var(--ancre); }
.demande h3 { margin-bottom: 20px; }
.champ { margin-bottom: 16px; min-width: 0; }
.champ .etiquette { margin-bottom: 8px; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.champ-in { position: relative; }
.champ-in::after {
  content: ""; position: absolute; inset: 0; border: 2px solid var(--rouge); pointer-events: none;
  clip-path: inset(0 100% 0 0); transition: clip-path 350ms var(--volet);
}
.champ-in:focus-within::after { clip-path: inset(0); }
.champ-select::before {
  content: ""; position: absolute; right: 14px; top: 50%; z-index: 1; margin-top: -4px; pointer-events: none;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--encre);
}
input, select {
  display: block; width: 100%; min-width: 0; height: 52px; padding: 0 12px; margin: 0;
  background-color: var(--surface); border: 1px solid var(--gris); border-radius: 0;
  font-size: 16px; line-height: 1.2; color: var(--encre);
  -webkit-appearance: none; appearance: none;
}
input[type="date"] { min-height: 52px; text-align: left; }
select { padding-right: 40px; }
input:focus, select:focus { outline: none; box-shadow: none; }
input[aria-invalid="true"] { border-color: var(--rouge-texte); }
.erreur-bloc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 300ms var(--rev); }
.erreur-bloc.ouvert { grid-template-rows: 1fr; }
.erreur-in { min-height: 0; overflow: hidden; }
.erreur { margin: 0 0 16px; max-width: none; color: var(--rouge-texte); font-size: 14px; font-weight: 600; }
.form .bouton-large { margin-top: 8px; }
.form-email { margin: 16px 0 16px; }
.form-email .lien { color: var(--rouge-texte); font-weight: 600; }
.note { margin: 0 0 8px; font-size: 14px; color: var(--encre2); }
html:not(.js) .champs, html:not(.js) .avec-js { display: none; }
html.js .sans-js { display: none; }
@media (min-width: 1024px) {
  .fiche-grille { align-items: start; }
  .fiche-corps { grid-column: 1 / 9; grid-row: 1; padding-top: 0; }
  .demande { grid-column: 9 / 13; grid-row: 1; margin-top: 0; padding: 24px; position: sticky; top: var(--ancre); }
}

.prochainement {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; max-width: none;
  margin: 48px 0 0; padding: 0 0 20px; border-bottom: 1px solid var(--filet);
}
.prochainement .etiquette { display: inline; margin: 0; }

.barre { display: none; }
@media (max-width: 1023px) {
  .barre:not([hidden]) {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: 8px var(--marge) calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--filet);
  }
  .barre .bouton { min-height: 52px; }
}

/* ---------- 05 contact ---------- */
.contact-lignes { margin-top: 40px; border-top: 1px solid var(--filet); }
.contact-lignes li { padding: 20px 0; border-bottom: 1px solid var(--filet); }
.contact-lignes .etiquette { margin-bottom: 6px; }
.contact-val { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 24px; }
.contact-lignes .lien:not(.lien-discret), .contact-texte { font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.contact-texte { display: inline-block; }
.contact-lignes .lien:not(.lien-discret):hover { color: var(--rouge-texte); }
@media (min-width: 1024px) {
  .contact-lignes { margin-top: 0; }
  .contact-lignes li { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gout); align-items: baseline; padding: 20px 0; }
  .contact-lignes .etiquette { grid-column: 1 / 4; margin: 0; }
  .contact-val { grid-column: 4 / 13; }
  .contact-lignes .lien:not(.lien-discret), .contact-texte { font-size: 24px; }
}

/* ---------- pied de page (fond encre) ---------- */
.pied { padding: var(--secv) 0 24px; font-size: 16px; background: var(--encre); color: var(--filet); }
.pied .etiquette { color: var(--gris-clair); }
.pied .logo text { fill: var(--fond); }
.pied .logo text + text { fill: var(--gris-clair); }
.pied a { color: var(--fond); }
.pied-mot { margin: 0 0 var(--sec); max-width: none; line-height: 0.82; overflow: hidden; }
#pied-mot {
  display: inline-block; white-space: nowrap; font-weight: 800; font-stretch: 125%; letter-spacing: -0.012em; color: var(--fond);
  font-size: calc((100vw - 2 * var(--marge)) / var(--mot-r));
}
#pied-mot { margin-left: -0.055em; }
/* le C est une fenetre sur le duplex, en couleur : la page finit comme elle a commence */
.pied-mot .c-fenetre {
  background-image: url(assets/photos/terrasse-soir-960.jpg); background-size: cover; background-position: 50% 60%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
@media (min-width: 1360px) { #pied-mot { font-size: calc(1200px / var(--mot-r)); } }
.pied-haut { row-gap: 32px; }
.pied-marque { margin-bottom: 32px; }
.pied-marque .etiquette { margin: 12px 0 0; }
.pied-legal { margin: 0; max-width: none; font-size: 14px; color: var(--filet); }
.pied-legal strong { color: var(--fond); font-weight: 800; }
.pied-bas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--encre2); font-size: 14px; }
.pied-bas p { margin: 0; }
.pied-bas a { font-weight: 600; }
@media (min-width: 1024px) {
  .pied-marque { grid-column: 1 / 6; margin-bottom: 0; }
  .pied-legal { grid-column: 8 / 13; }
}

/* ---------- visionneuse ---------- */
.visionneuse {
  position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--encre); color: #fff;
}
.visionneuse[hidden] { display: none; }
.visionneuse :focus-visible { outline-color: #fff; }
.vis-haut, .vis-bas { display: flex; align-items: center; gap: 16px; padding: 12px var(--marge); }
.vis-haut { justify-content: space-between; }
.vis-compteur { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.12em; }
.vis-milieu { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 var(--marge); touch-action: pan-y; overflow: hidden; }
.vis-milieu img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.vis-bas { justify-content: space-between; }
.vis-legende { flex: 1; margin: 0; max-width: none; font-size: 14px; line-height: 1.4; }
.vis-bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px; padding: 0 16px; background: transparent; border: 1px solid #fff; color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color 250ms var(--volet), color 250ms var(--volet);
}
.vis-fleche { padding: 0; }
.vis-bouton:hover { background: #fff; color: var(--encre); }
.chev { display: block; width: 12px; height: 12px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; }
.chev-g { transform: translateX(2px) rotate(-45deg); }
.chev-d { transform: translateX(-2px) rotate(135deg); }

/* =====================================================================
   MOUVEMENT - uniquement sous html.anim ; sans JS ou en mouvement reduit,
   tout est visible, statique, en place, et les photos du logement en couleur.
   Sept moments : fenetre du C, filets, titres mot a mot, rideaux et volet rouge,
   methode collante, arrivee de la couleur, mot CASTELIS qui s'etire.
   ===================================================================== */

/* grille : les traits se tracent de haut en bas */
html.anim .trame span { transform: scaleY(0); transform-origin: top; }
html.anim.hero-go .trame span { transform: none; transition: transform 900ms var(--volet) calc(var(--i, 0) * 120ms); }

/* titres : mots qui montent derriere un masque */
html.anim .mot-in { transform: translateY(118%); }
html.anim .est-visible .mot-in { transform: none; transition: transform 800ms var(--rev) calc(var(--base, 0ms) + var(--i, 0) * 40ms); }
html.anim.hero-go .hero-mots .mot-in { transform: none; transition: transform 750ms var(--rev) calc(150ms + var(--i, 0) * 45ms); }

/* hero : ouverture (volet rouge 380 ms, pause 250 ms, ouverture 750 ms) */
html.anim .cadre-hero::before { content: ""; position: absolute; inset: 0; background: var(--rouge); clip-path: inset(100% 0 0 0); }
html.anim.hero-go .cadre-hero::before { animation: volet-monte 380ms var(--volet) both; }
html.anim .hero-fenetre { opacity: 0; }
html.anim .hero-fenetre img { transform: scale(1.12); }
html.anim.hero-go .hero-fenetre { animation: fenetre-visible 1ms linear 380ms both; }
html.anim.hero-go .hero-fenetre img { animation: dezoom 750ms var(--volet) 630ms both; }
@keyframes volet-monte { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes fenetre-visible { from { opacity: 0; } to { opacity: 1; } }
@keyframes dezoom { from { transform: scale(1.12); } to { transform: scale(1); } }

/* hero : le filet des reperes se trace */
html.anim .reperes { border-top-color: transparent; }
html.anim .reperes::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--encre);
  transform: scaleX(0); transform-origin: left;
}
html.anim.hero-go .reperes::before { transform: none; transition: transform 700ms var(--volet) 600ms; }

/* changement de langue : le hero s'affiche directement dans son etat final */
html.hero-saute .trame span, html.hero-saute .mot-in, html.hero-saute .reperes::before { transform: none !important; transition: none !important; }
html.hero-saute .cadre-hero::before { display: none; }
html.hero-saute .hero-fenetre { opacity: 1 !important; animation: none !important; }
html.hero-saute .hero-fenetre img { transform: none !important; animation: none !important; }

/* filets de section qui se tracent */
html.anim .trait { transform: scaleX(0); transform-origin: left; }
html.anim .trait.est-visible { transform: none; transition: transform 900ms var(--volet); }
html.anim .metiers { border-top-color: transparent; }
html.anim .metiers::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--encre);
  transform: scaleX(0); transform-origin: left;
}
html.anim .metiers.est-visible::before { transform: none; transition: transform 900ms var(--volet); }

/* photos noir et blanc : rideau en deux temps */
html.anim .cadre:not(.cadre-hero) .rideau {
  display: block; position: absolute; inset: 0; z-index: 2; background: var(--rouge); pointer-events: none;
  clip-path: inset(0 100% 0 0);
}
html.anim .cadre:not(.cadre-hero) img { opacity: 0; transform: scale(1.12); }
html.anim .cadre.est-visible .rideau { animation: rideau 1000ms var(--volet) both; }
html.anim .cadre.est-visible img { animation: photo-revele 1000ms var(--volet) both; }
@keyframes rideau { 0% { clip-path: inset(0 100% 0 0); } 50% { clip-path: inset(0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes photo-revele {
  0% { opacity: 0; transform: scale(1.12); }
  49.99% { opacity: 0; transform: scale(1.12); }
  50% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

/* bandeau rouge : volet de gauche a droite, puis titre */
html.anim .bandeau { --bg: var(--fond); --base: 700ms; position: relative; overflow: hidden; }
html.anim .bandeau::after {
  content: ""; position: absolute; inset: -1px; z-index: 5; background: var(--bg);
  transform-origin: right; pointer-events: none;
}
html.anim .bandeau.est-visible::after { transform: scaleX(0); transition: transform 900ms var(--volet); }

/* section 04 : la couleur arrive avec la vie (au rythme du defilement) */
html.anim .ouv-photo img { filter: grayscale(var(--g, 1)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
