/* charles-v4. journal / terminal. surcharge du kit. tokens du socle seulement. */

html,
body {
  margin: 0;
  background: var(--bg-mute);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-mono);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.saut {
  position: absolute;
  left: var(--gutter);
  top: 0.5rem;
  z-index: 80;
  transform: translateY(-200%);
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.6rem 0.9rem;
}

.saut:focus {
  transform: none;
}

.tete {
  position: sticky;
  top: var(--safe-top, 0px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  height: var(--header-h);
  max-height: var(--header-h);
  padding: 0 max(var(--gutter), var(--safe-right)) 0 max(var(--gutter), var(--safe-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-mono);
}

.tete__marque,
.tete__nav a,
.tete a {
  color: inherit;
  text-decoration: none;
  font-family: var(--font-mono);
}

.tete__marque {
  flex: 0 0 auto;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
}

.tete__nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.tete__nav a {
  color: var(--fg-mute);
}

.tete__nav a[aria-current="page"],
.tete__nav a:hover,
.tete__nav a:focus-visible {
  color: var(--fg);
}

.tete__cta {
  margin-inline-start: auto;
  font-family: var(--font-mono);
}

.btn,
.btn--ghost,
.btn--accent {
  font-family: var(--font-mono);
  border-radius: 0;
  letter-spacing: 0.02em;
}

.chapitre-journal {
  height: 460vh;
  background: var(--bg-mute);
}

.chapitre-journal--travail {
  height: 420vh;
}

.chapitre-pin {
  position: sticky;
  top: var(--header-h);
  height: calc(100svh - var(--header-h));
  min-height: 0;
  overflow: hidden;
}

.ecran {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 0.85rem;
  height: 100%;
  padding: 1rem max(var(--gutter), var(--safe-right)) 1.1rem max(var(--gutter), var(--safe-left));
}

.ecran--page {
  min-height: calc(100svh - var(--header-h) - 2rem);
  grid-template-columns: 1fr;
  max-width: 46rem;
  margin: 0 auto;
}

.ecran__p {
  position: relative;
  align-self: stretch;
  width: 2px;
  background: var(--line);
  overflow: hidden;
}

.ecran__p i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--p, 0) * 100%);
  background: var(--accent);
}

.ecran__cadre {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-width: 62ch;
  padding: 1.1rem 1.15rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
}

.masthead {
  flex: 0 0 auto;
  padding-bottom: 0.85rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.masthead__kicker {
  margin: 0 0 0.35rem;
  color: var(--fg-mute);
  font-size: max(14px, var(--fs-sm));
  letter-spacing: 0.12em;
}

.masthead h1 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  letter-spacing: 0.01em;
  color: var(--fg);
}

.masthead__chapo {
  margin: 0.45rem 0 0;
  max-width: none;
  color: var(--fg-mute);
  font-size: max(14px, var(--fs-sm));
  line-height: var(--lh-body);
  hyphens: none;
}

.journal-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.journal {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: max(16px, var(--fs-md));
  line-height: 1.55;
}

.journal p,
.journal li {
  margin: 0;
  max-width: none;
  color: var(--fg);
  hyphens: none;
  -webkit-hyphens: none;
}

.journal a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.journal a.btn,
.journal a.btn--ghost {
  border-bottom: 0;
}

html.socle-defilement:not(.socle-reduit) .journal [data-beat]:not(.is-on) {
  opacity: 0;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(0.35em);
}

html.socle-defilement .journal [data-beat].is-on {
  opacity: 1;
  max-height: 8em;
  pointer-events: auto;
  transform: none;
  transition:
    opacity var(--dur-appear) var(--ease-appear),
    transform var(--dur-appear) var(--ease-appear);
}

.journal [data-beat].is-on {
  margin-bottom: 0.28rem;
}

.journal__blanc.is-on,
.journal__blanc {
  min-height: 0.55rem;
}

.journal [data-beat].is-courant {
  color: var(--fg);
}

.journal__actes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.7rem;
}

html.socle-defilement .journal .journal__actes.is-on {
  max-height: 8rem;
}

.curseur {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.2em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: clignote 1.05s steps(1) infinite;
}

@keyframes clignote {
  50% {
    opacity: 0;
  }
}

.ecran__bas {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  color: var(--fg-mute);
  font-size: max(14px, var(--fs-sm));
  letter-spacing: 0.06em;
}

.ecran__bas b {
  font-weight: var(--fw-medium);
  color: var(--fg);
}

.suite {
  padding: 3.5rem var(--gutter) 5rem;
  max-width: 46rem;
  margin: 0 auto;
}

.suite--404 {
  padding-top: 1.5rem;
}

.suite h2 {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  color: var(--fg);
}

.notes {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

@media (min-width: 800px) {
  .notes {
    grid-template-columns: 1fr 1fr;
  }
}

.note {
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
}

.note h2 {
  margin: 0.2rem 0 0.45rem;
}

.note p {
  margin: 0 0 0.3rem;
  color: var(--fg-mute);
  max-width: none;
}

.formulaire {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.formulaire .t-meta,
.note .t-meta {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
}

.champ__label,
.champ__ctrl {
  font-family: var(--font-mono);
}

.champ__ctrl {
  border-radius: 0;
  background: var(--bg);
}

[data-form-ok]:not(:empty) {
  margin-top: 0.8rem;
  color: var(--ok);
}

.pied {
  padding: 1.5rem var(--gutter) 2.2rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: max(14px, var(--fs-sm));
}

.pied p {
  margin: 0 0 0.4rem;
  max-width: none;
}

.pied a {
  color: var(--fg);
  text-decoration: none;
  margin-right: 1rem;
}

.pied a:hover,
.pied a:focus-visible {
  color: var(--accent);
}

.pied__legal {
  margin-top: 0.8rem;
  color: var(--fg-faint);
}

html.socle-reduit .journal [data-beat] {
  opacity: 1;
  max-height: none;
  transform: none;
  pointer-events: auto;
  overflow: visible;
  margin-bottom: 0.28rem;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  html.socle-defilement .journal [data-beat],
  html.socle-reduit .journal [data-beat],
  .journal [data-beat] {
    opacity: 1;
    max-height: none;
    transform: none;
    pointer-events: auto;
    overflow: visible;
    margin-bottom: 0.28rem;
    transition: none;
  }

  .curseur {
    animation: none;
    opacity: 1;
  }

  .ecran__p i {
    transition: none;
  }
}
