/* Shimeji Desktop Reloaded — site
   Mise en page : colonne de texte à gauche (~62 caractères), médias larges ; le héros est un écran de bureau
   où les Shimeji vivent pour de vrai. Une seule audace : cet écran. Le reste reste calme. */

@font-face { font-family: "Dela Gothic One"; src: url("fonts/dela-gothic-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("fonts/m-plus-rounded-1c-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("fonts/m-plus-rounded-1c-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("fonts/m-plus-rounded-1c-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
/* titres japonais : seulement les caractères des titres de /ja/ (site-src/police_ja.py) */
@font-face { font-family: "Dela Gothic One"; src: url("fonts/dela-gothic-one-ja-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF; }
@font-face { font-family: "M PLUS 1 Code"; src: url("fonts/m-plus-1-code-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* couleurs */
  --papier: #F4F6FB;          /* fond de page, blanc bleuté */
  --surface: #FFFFFF;         /* cadres, fenêtres */
  --encre: #18213B;           /* texte */
  --encre-douce: #4B5672;     /* texte secondaire */
  --trait: #DCE2EE;           /* filets */
  --bureau: #3E73ED;          /* fond d'écran du bureau, bleu de l'icône */
  --bureau-sombre: #2A5ED8;
  --barre: rgba(14, 22, 44, .78); /* barre des tâches */
  --soleil: #FFD45C;          /* bouton principal, comme le Shimeji Soleil */
  --soleil-fort: #F5C232;
  --encre-bouton: #18213B;
  --lien: #2A5ED8;
  --rose: #FFB3D1; --menthe: #A8F0C6; --ciel: #A9D8FF; --soleil-clair: #FFE08A; --lavande: #D2B8FF;
  --ombre: 0 18px 40px -18px rgba(24, 33, 59, .35);
  /* typo */
  --f-titre: "Dela Gothic One", "Arial Black", "Segoe UI", sans-serif;
  --f-texte: "M PLUS Rounded 1c", "Segoe UI", system-ui, sans-serif;
  --f-code: "M PLUS 1 Code", Consolas, "Cascadia Mono", monospace;
  --largeur: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #0E1424; --surface: #161F35; --encre: #E9EEF8; --encre-douce: #A6B1C9; --trait: #26324D;
    --bureau: #2F5FD0; --bureau-sombre: #244CAE; --barre: rgba(6, 10, 22, .82); --lien: #8FB2FF;
    --ombre: 0 18px 40px -18px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #0E1424; --surface: #161F35; --encre: #E9EEF8; --encre-douce: #A6B1C9; --trait: #26324D;
  --bureau: #2F5FD0; --bureau-sombre: #244CAE; --barre: rgba(6, 10, 22, .82); --lien: #8FB2FF;
  --ombre: 0 18px 40px -18px rgba(0, 0, 0, .7); color-scheme: dark;
}

/* japonais : texte dans les polices du système (rondes si possible), césures au fil des mots */
:lang(ja) {
  --f-titre: "Dela Gothic One", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --f-texte: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-break: strict;
}
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { word-break: auto-phrase; }
:lang(ja) h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.2; }
:lang(ja) .heros h1 { max-width: 13em; }
:lang(ja) .texte { max-width: 40em; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--encre);
  font-family: var(--f-texte); font-size: 1.0625rem; line-height: 1.7; font-weight: 400;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lien); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--soleil-fort); outline-offset: 3px; border-radius: 6px; }
code, .code { font-family: var(--f-code); font-weight: 500; font-size: .9em; }
.enveloppe { max-width: var(--largeur); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.texte { max-width: 62ch; }
.texte > * + * { margin-top: 1em; }
.saut { position: absolute; left: -9999px; }
.saut:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: .5em 1em; }

/* ---------- titres ---------- */
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1, h2 { font-family: var(--f-titre); font-weight: 400; letter-spacing: .005em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); line-height: 1.06; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.35; font-weight: 800; }
p { margin: 0; }
.chapo { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--encre-douce); max-width: 56ch; }
.petit { font-size: .9rem; color: var(--encre-douce); }

/* ---------- en-tête ---------- */
.entete { padding-block: 18px; }
.entete .enveloppe { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); font-family: var(--f-titre); font-size: 1.15rem; }
.marque img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; font-weight: 500; }
.nav a { color: var(--encre); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--encre); }
.nav a.bouton { border-bottom: 0; color: var(--encre-bouton); }
/* menu des langues */
.langues { position: relative; }
.langues summary { list-style: none; display: inline-flex; align-items: center; gap: .35em; color: var(--encre-douce); cursor: pointer;
  padding-block: 4px; border-bottom: 2px solid transparent; }
.langues summary::-webkit-details-marker { display: none; }
.langues summary svg { width: 1.05em; height: 1.05em; }
.langues summary::after { content: ""; width: .4em; height: .4em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-.15em) rotate(45deg); margin-left: .2em; }
.langues[open] summary::after { transform: translateY(.1em) rotate(-135deg); }
.langues summary:hover, .langues[open] summary { color: var(--encre); }
.langues ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none; min-width: 10.5em;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre); }
.nav .langues li a { display: block; padding: .42em .8em; border-radius: 8px; border-bottom: 0; }
.nav .langues li a:hover { background: var(--papier); }
.nav .langues li a[aria-current] { font-weight: 800; }

/* proposition d'une autre langue (visiteur dont le navigateur parle une autre langue du site) */
/* proposition de langue : posée par-dessus la page, en bas, pour ne rien décaler */
.suggestion { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 760px; margin-inline: auto; background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; box-shadow: var(--ombre); font-size: .92rem; }
.suggestion .enveloppe { width: auto; padding-inline: 16px; }
.suggestion .enveloppe { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding-block: 10px; }
.suggestion span { flex: 1 1 220px; }
.petit-bouton { padding: .4em .9em; font-size: .88rem; }
.fermer { border: 0; background: transparent; color: var(--encre-douce); font-size: 1rem; cursor: pointer; padding: .3em .5em; border-radius: 8px; }
.fermer:hover { color: var(--encre); }
.nav a.bouton:hover { border-bottom: 0; }

/* ---------- boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; gap: .55em; padding: .72em 1.25em; border-radius: 12px;
  background: var(--soleil); color: var(--encre-bouton); font-weight: 800; text-decoration: none; border: 0;
  box-shadow: inset 0 -3px 0 var(--soleil-fort); font-size: 1rem; line-height: 1.2; cursor: pointer;
}
.bouton:hover { background: var(--soleil-fort); }
.bouton svg { width: 1.15em; height: 1.15em; flex: none; }
.bouton.grand { font-size: 1.12rem; padding: .9em 1.5em; }
.bouton.discret { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--trait); }
.bouton.discret:hover { box-shadow: inset 0 0 0 2px var(--encre-douce); background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- héros ---------- */
.heros { padding-block: clamp(28px, 6vw, 64px) 0; }
.heros .enveloppe { display: grid; gap: 26px; }
.heros h1 { max-width: 15ch; }
.heros .petit { margin-top: -6px; }

/* L'écran de démonstration */
.ecran {
  --s: clamp(46px, 6.6vw, 82px);            /* taille d'un Shimeji */
  --haut-barre: clamp(30px, 3.6vw, 42px);
  position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 16 / 7.2;
  background: var(--bureau); box-shadow: var(--ombre); isolation: isolate; touch-action: manipulation;
  margin-top: clamp(10px, 2vw, 18px); user-select: none; -webkit-user-select: none;
}
.ecran::before {   /* un grand halo doux, comme un fond d'écran */
  content: ""; position: absolute; inset: auto -10% -60% 35%; height: 120%; border-radius: 50%;
  background: var(--bureau-sombre); opacity: .55; z-index: -1;
}
.ecran .barre {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--haut-barre); background: var(--barre);
  display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1vw, 12px); color: #fff;
}
.ecran .barre i { width: calc(var(--haut-barre) * .5); height: calc(var(--haut-barre) * .5); border-radius: 30%; display: block; opacity: .95; }
.ecran .barre i:nth-child(1) { background: #fff; }
.ecran .barre i:nth-child(2) { background: var(--ciel); }
.ecran .barre i:nth-child(3) { background: var(--menthe); }
.ecran .barre i:nth-child(4) { background: var(--rose); }
.ecran .barre i:nth-child(5) { background: var(--soleil-clair); }
.ecran .heure { position: absolute; right: 14px; font-family: var(--f-code); font-size: clamp(.68rem, 1vw, .82rem); opacity: .9; }
.ecran .fenetre {
  position: absolute; left: 57%; top: 20%; width: 30%; height: 44%; background: #fff; color: #18213B;
  border-radius: 10px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.45); overflow: hidden; z-index: 1;
}
.fenetre .titre { height: 28px; display: flex; align-items: center; justify-content: space-between; padding-inline: 10px;
  font-size: .72rem; background: #EEF1F7; color: #4B5672; }
.fenetre .titre span:last-child { letter-spacing: .3em; }
.fenetre .lignes { padding: 10px 12px; font-family: var(--f-code); font-size: clamp(.62rem, 1.05vw, .82rem); line-height: 1.6; }
.ecran .puce {
  position: absolute; left: 14px; top: 14px; z-index: 3; background: rgba(255,255,255,.94); color: #18213B;
  border-radius: 999px; padding: .35em .85em; font-size: clamp(.72rem, 1.2vw, .88rem); font-weight: 500;
  display: flex; gap: .5em; align-items: center; max-width: calc(100% - 28px);
}
.ecran .puce b { font-family: var(--f-code); font-weight: 500; }
.ecran .puce .point { width: .6em; height: .6em; border-radius: 50%; background: #9AA6C0; flex: none; }
.ecran[data-etat="la"] .puce .point { background: #3BC47A; }
.ecran[data-etat="partis"] .puce .point { background: #F5C232; }
.lutin {
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); z-index: 2; cursor: pointer;
  background-repeat: no-repeat; background-size: calc(var(--s) * 21) var(--s); will-change: transform;
}
.legende { font-size: .9rem; color: var(--encre-douce); margin-top: 10px; }
@media (max-width: 600px) {
  .ecran { aspect-ratio: 4 / 3.3; --s: 50px; }
  .ecran .fenetre { left: 44%; top: 30%; width: 50%; height: 36%; }
  .fenetre .titre { height: 22px; font-size: .62rem; }
  .entete .nav { gap: 4px 18px; }
}

/* ---------- sections ---------- */
main section { padding-block: clamp(56px, 8vw, 96px) 0; }
.titre-section { display: grid; gap: 14px; margin-bottom: clamp(26px, 4vw, 40px); }
.deux { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; }
.deux > * { min-width: 0; }
.deux.haut { align-items: start; }
@media (max-width: 860px) { .deux { grid-template-columns: minmax(0, 1fr); } }

/* étapes (une vraie suite) */
.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: clamp(20px, 3vw, 34px); grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: etape; }
.etapes li { counter-increment: etape; display: grid; gap: 8px; align-content: start; }
.etapes li::before {
  content: counter(etape); font-family: var(--f-titre); font-size: 1.1rem; width: 2.1em; height: 2.1em;
  display: grid; place-items: center; border-radius: 50%; background: var(--encre); color: var(--papier);
}
.etapes p { color: var(--encre-douce); }
@media (max-width: 760px) { .etapes { grid-template-columns: minmax(0, 1fr); } }

/* capture de l'appli dans un cadre de fenêtre */
.capture { margin: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--ombre); background: var(--surface); border: 1px solid var(--trait); }
.capture figcaption { padding: 10px 14px; font-size: .85rem; color: var(--encre-douce); border-top: 1px solid var(--trait); }

/* réglages : liste valeur / description */
.reglages { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--trait); }
.reglages > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 20px; padding-block: 14px; border-bottom: 1px solid var(--trait); }
.reglages dt { font-family: var(--f-code); font-weight: 500; font-size: .95rem; }
.reglages dd { margin: 0; color: var(--encre-douce); }
.reglages dd strong { color: var(--encre); font-weight: 800; }
@media (max-width: 520px) { .reglages > div { grid-template-columns: minmax(0, 1fr); } }

/* personnages */
.persos { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px 12px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.persos li { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; }
.persos .portrait { width: 100%; max-width: 96px; height: auto; aspect-ratio: 1; }
.persos b { font-weight: 800; font-size: .95rem; }
.persos span { font-size: .8rem; color: var(--encre-douce); line-height: 1.35; }
@media (max-width: 760px) { .persos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .persos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* appel final */
.appel { margin-top: clamp(56px, 8vw, 96px); background: var(--bureau-sombre); color: #fff; border-radius: 22px; padding: clamp(28px, 5vw, 56px); display: grid; gap: 18px; position: relative; overflow: hidden; }
.appel h2 { max-width: 18ch; }
.appel p { max-width: 54ch; opacity: .92; }
.appel a:not(.bouton) { color: #fff; }
.appel .lutin-deco { position: absolute; right: clamp(10px, 5vw, 60px); bottom: 0; width: clamp(70px, 11vw, 128px); aspect-ratio: 1; background-repeat: no-repeat; background-size: 2100% 100%; background-position: calc(100% / 20 * 4) 0; }

/* pages de contenu */
.page-titre { padding-block: clamp(32px, 6vw, 64px) 0; display: grid; gap: 14px; }
.contenu { padding-block: clamp(28px, 4vw, 44px) 0; }
.contenu h2 { margin-top: clamp(40px, 6vw, 64px); margin-bottom: 14px; font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
.contenu h3 { margin-top: 28px; margin-bottom: 6px; }
.contenu ul, .contenu ol { padding-left: 1.3em; }
.contenu li + li { margin-top: .4em; }
.contenu .capture { margin-block: 24px; max-width: 760px; }
.encadre { border-left: 4px solid var(--soleil); padding: 2px 0 2px 16px; color: var(--encre-douce); }
.a-completer { background: var(--soleil-clair); color: #18213B; padding: 0 .3em; border-radius: 4px; font-weight: 500; }

/* téléchargement */
.telecharger { display: grid; gap: 22px; padding: clamp(22px, 4vw, 40px); border-radius: 20px; background: var(--surface); border: 1px solid var(--trait); box-shadow: var(--ombre); margin-top: 28px; }
.fiche { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 22px; }
.fiche dt { color: var(--encre-douce); }
.fiche dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .fiche { grid-template-columns: minmax(0, 1fr); gap: 2px; } .fiche dd { margin-bottom: 10px; } }
.empreinte { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.empreinte code { overflow-wrap: anywhere; min-width: 0; flex: 1 1 260px; }
.copier { font: inherit; font-size: .8rem; font-weight: 500; padding: .2em .7em; border-radius: 8px; border: 1px solid var(--trait); background: transparent; color: var(--encre); cursor: pointer; }

/* FAQ */
.faq { display: grid; gap: 0; border-top: 1px solid var(--trait); max-width: 760px; }
.faq details { border-bottom: 1px solid var(--trait); padding-block: 4px; }
.faq summary { cursor: pointer; font-weight: 800; padding-block: 14px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-code); font-size: 1.2rem; line-height: 1.2; color: var(--encre-douce); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding-bottom: 18px; color: var(--encre-douce); max-width: 64ch; }
.faq details > div > * + * { margin-top: .8em; }

/* emplacement publicitaire : un seul par page, loin du bouton de téléchargement */
.pub { margin-top: clamp(56px, 8vw, 88px); display: grid; justify-items: center; gap: 6px; }
.pub .etiquette { font-size: .72rem; color: var(--encre-douce); letter-spacing: .06em; }
.pub .zone { width: 100%; max-width: 728px; min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--trait); border-radius: 10px; color: var(--encre-douce); font-size: .85rem; }
.pub .zone:has(ins) { border: 0; }

/* pied de page */
.pied { margin-top: clamp(56px, 8vw, 88px); padding-block: 32px 40px; border-top: 1px solid var(--trait); font-size: .9rem; color: var(--encre-douce); }
.pied .enveloppe { display: grid; gap: 18px; }
.pied nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.pied a { color: var(--encre); }

/* le Shimeji compagnon : il se promène sur les blocs de la page (assets/compagnon.js) */
.compagnon {
  position: absolute; left: 0; top: 0; z-index: 25; width: 64px; height: 64px; cursor: grab; touch-action: none;
  background-repeat: no-repeat; background-size: 2100% 100%; will-change: transform; display: none;
  -webkit-user-select: none; user-select: none;
}
.compagnon.tenu { cursor: grabbing; }
.bouton.appuye { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--soleil-fort); transition: transform .08s; }

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

/* texte lu par les lecteurs d'écran seulement */
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
