/* ============================================================
   remilaisne.com — thème "terminal sombre"
   100% CSS, aucune dépendance externe, aucune font téléchargée
   ============================================================ */

:root {
  --bg:        #0a0e14;
  --bg-panel:  #111720;
  --bg-code:   #0d1117;
  --border:    #21262d;
  --text:      #c9d1d9;
  --text-dim:  #7d8590;
  --green:     #3fb950;
  --green-hi:  #56d364;
  --amber:     #d29922;
  --blue:      #58a6ff;
  --magenta:   #d2a8ff;
  --red:       #f85149;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "Fira Code",
          Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.7;
  /* scanlines très discrètes, purement décoratif */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--green);
  color: var(--bg);
}

/* ---------- structure ---------- */

.wrap {
  width: 780px;        /* largeur fixe de la "fenêtre" */
  max-width: 100%;     /* ne déborde jamais sur un petit écran */
  margin: 0 auto;
  padding: 0 20px;
}

main.wrap {
  flex: 1 0 auto;      /* seul le contenu pousse le footer vers le bas */
}

/* ---------- fenêtre "terminal" ---------- */

.term {
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 16px 48px rgba(0,0,0,.5);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-code);
  user-select: none;
}

.term-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.term-bar .dot.r { background: var(--red);    opacity: .8; }
.term-bar .dot.y { background: var(--amber);   opacity: .8; }
.term-bar .dot.g { background: var(--green);   opacity: .8; }

.term-bar .title {
  margin-left: 8px;
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.term-body {
  padding: 26px 26px 32px;
}

/* ---------- typographie ---------- */

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--green-hi);
}

h1 { font-size: 1.55rem; margin-bottom: 1rem; }
h1::before { content: "# "; color: var(--green); }

h2 { font-size: 1.2rem; margin: 2rem 0 .8rem; }
h2::before { content: "## "; color: var(--green); }

h3 { font-size: 1.02rem; margin: 1.4rem 0 .6rem; color: var(--magenta); }
h3::before { content: "### "; color: var(--green); }

p { margin-bottom: 1rem; }

/* ---------- prompt & curseur ---------- */

.prompt { color: var(--green); user-select: none; }
.prompt::before { content: "$ "; }

.cursor {
  display: inline-block;
  width: .58em;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--green-hi);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%, 55%   { opacity: 1; }
  56%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- liens ---------- */

a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px dotted var(--blue);
  transition: background-color .12s ease, color .12s ease;
}

a:hover, a:focus-visible {
  background: var(--blue);
  color: var(--bg);
  border-bottom-color: transparent;
  outline: none;
}

/* ---------- navigation ---------- */

nav.site-nav {
  flex: none;               /* la barre garde sa hauteur naturelle, jamais étirable */
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  padding: 14px 19px;
  display: flex;
  flex-wrap: nowrap;        /* une seule ligne : la barre ne grandit jamais en hauteur */
  white-space: nowrap;
  overflow-x: auto;         /* si l'écran est trop étroit : scroll horizontal */
  gap: 6px 22px;
  font-size: .92rem;
}

nav.site-nav .nav-label { color: var(--text-dim); user-select: none; }
nav.site-nav .nav-label::before { content: "$ ls ~/"; color: var(--green); margin-right: 10px; }

nav.site-nav a {
  border-bottom: none;
  color: var(--text);
  padding: 2px 7px;
  border-radius: 4px;
}
nav.site-nav a::after { content: "/"; color: var(--green); margin-left: 2px; }
nav.site-nav a.file::after { content: ""; }
nav.site-nav a:hover, nav.site-nav a:focus-visible {
  background: var(--green);
  color: var(--bg);
}
nav.site-nav a:hover::after, nav.site-nav a:focus-visible::after { color: var(--bg); }
nav.site-nav a[aria-current="page"] { color: var(--green-hi); }
nav.site-nav a[aria-current="page"]:hover { color: var(--bg); }

/* ---------- accueil : liste façon arborescence ---------- */

.dir-list {
  list-style: none;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.dir-list li {
  border-bottom: 1px solid var(--border);
}
.dir-list li:last-child { border-bottom: none; }

.dir-list a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: none;
  color: var(--text);
}
.dir-list a:hover, .dir-list a:focus-visible {
  background: var(--green);
  color: var(--bg);
}
.dir-list a:hover .meta, .dir-list a:focus-visible .meta { color: var(--bg); }

.dir-list .name { color: var(--green-hi); font-weight: 600; white-space: nowrap; }
.dir-list a:hover .name, .dir-list a:focus-visible .name { color: var(--bg); }
.dir-list .name::before { content: "~/"; color: var(--green); font-weight: 400; }
.dir-list a:hover .name::before, .dir-list a:focus-visible .name::before { color: var(--bg); }
.dir-list .meta { color: var(--text-dim); font-size: .85rem; margin-left: auto; text-align: right; }

/* ---------- hero ---------- */

.hero .whoami {
  font-size: .95rem;
  color: var(--text-dim);
}

.hero h1.tagline {
  font-size: 2.1rem;   /* taille fixe, indépendante de la largeur du viewport */
  margin: .6rem 0 1rem;
  color: var(--text);
}
.hero h1.tagline::before { content: ""; }
.hero h1.tagline .hl { color: var(--green-hi); }

.hero p.lead { color: var(--text-dim); max-width: 60ch; }

/* ---------- liens sociaux ---------- */

.socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 26px;
  font-size: .9rem;
}

.socials a { border-bottom: none; color: var(--text-dim); padding: 2px 6px; border-radius: 4px; }
.socials a::before { content: "[ "; color: var(--green); }
.socials a::after  { content: " ]"; color: var(--green); }
.socials a:hover, .socials a:focus-visible { background: var(--green); color: var(--bg); }
.socials a:hover::before, .socials a:hover::after,
.socials a:focus-visible::before, .socials a:focus-visible::after { color: var(--bg); }

/* ---------- articles ---------- */

.post-list { list-style: none; margin-top: 19px; }

.post-list li {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 19px;
  margin-bottom: 16px;
  background: var(--bg-panel);
  transition: border-color .15s ease;
}
.post-list li:hover { border-color: var(--green); }

.post-list time {
  color: var(--amber);
  font-size: .8rem;
  letter-spacing: .05em;
}
.post-list time::before { content: "["; }
.post-list time::after  { content: "] "; }

.post-list .post-title {
  display: inline;
  border-bottom: none;
  color: var(--green-hi);
  font-size: 1.05rem;
  font-weight: 600;
}
.post-list a:hover .post-title, .post-list a:focus-visible .post-title { color: var(--bg); }

.post-list .excerpt {
  display: block;
  margin-top: .4rem;
  color: var(--text-dim);
  font-size: .88rem;
}

article .post-meta {
  color: var(--amber);
  font-size: .82rem;
  margin-bottom: 1.6rem;
  letter-spacing: .05em;
}
article .post-meta::before { content: "# date: "; color: var(--text-dim); }

article p { max-width: 68ch; }

/* les images d'article ne débordent jamais du conteneur (780px) ;
   une taille explicite (50%, 300px) posée en style inline reste prioritaire */
article img, .comment-text img {
  max-width: 100%;
  height: auto;
}

article ul, article ol { margin: 0 0 1rem 1.4rem; }
article li { margin-bottom: .35rem; }
article li::marker { color: var(--green); }

blockquote {
  border-left: 3px solid var(--green);
  background: var(--bg-code);
  padding: 11px 16px;
  margin: 19px 0;
  color: var(--text-dim);
}
blockquote::before { content: "> "; color: var(--green); }

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 19px 0;
  font-size: .86rem;
  line-height: 1.55;
}
pre::before {
  content: "```\A";
  color: var(--text-dim);
  display: block;
}
pre::after {
  content: "\A```";
  color: var(--text-dim);
  display: block;
}

code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .08em .38em;
  font-size: .88em;
  color: var(--amber);
}

/* ---------- images & figures ---------- */

figure {
  margin: 26px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-code);
  padding: 10px;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

figure figcaption {
  padding: 10px 5px 3px;
  color: var(--text-dim);
  font-size: .8rem;
}
figure figcaption::before {
  content: "# ";
  color: var(--green);
}
pre code { background: none; border: none; padding: 0; color: var(--text); }

hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 2rem 0;
}

/* ---------- CV ---------- */

.cv-download {
  display: inline-block;
  margin: 19px 0;
  padding: 13px 21px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green-hi);
  border-bottom: 1px solid var(--green);
  font-weight: 600;
}
.cv-download::before { content: "$ wget "; color: var(--green); font-weight: 400; }
.cv-download:hover, .cv-download:focus-visible {
  background: var(--green);
  color: var(--bg);
}
.cv-download:hover::before, .cv-download:focus-visible::before { color: var(--bg); }

.cv-note { color: var(--text-dim); font-size: .85rem; }

/* ---------- footer ---------- */

footer {
  flex: none;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding: 22px 0 32px;
  color: var(--text-dim);
  font-size: .78rem;
  text-align: center;
}
footer .prompt::before { content: "$ "; }
footer a { color: var(--text-dim); border-bottom-color: var(--text-dim); }
footer a:hover { background: var(--text-dim); color: var(--bg); }

/* ---------- moteur de recherche ---------- */

nav.site-nav .search-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

nav.site-nav .search-form input {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: .85rem;
  padding: 4px 9px;
  width: 180px;
}
nav.site-nav .search-form input::placeholder { color: var(--text-dim); }
nav.site-nav .search-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

nav.site-nav .search-form button {
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .85rem;
  padding: 4px 12px;
  cursor: pointer;
}
nav.site-nav .search-form button:hover,
nav.site-nav .search-form button:focus-visible { background: var(--green-hi); }

.search-summary {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--green-hi);
  margin: 1.2rem 0;
}
.search-summary::before { content: "> "; color: var(--green); }

.hit-count {
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 4px;
  font-size: .78rem;
  padding: 1px 7px;
  margin-left: 8px;
  white-space: nowrap;
}

.search-404 { text-align: center; }
.search-404 img { border-radius: 4px; }

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .88rem;
}

.page-info { color: var(--text-dim); margin-right: 10px; }
.page-info::before { content: "[ "; color: var(--green); }
.page-info::after  { content: " ]"; color: var(--green); }

.page-link {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.page-link:hover, .page-link:focus-visible {
  background: var(--green);
  color: var(--bg);
}
.page-link.current {
  background: var(--bg-code);
  color: var(--green-hi);
  border-color: var(--green);
  cursor: default;
}

/* ---------- commentaires ---------- */

.comments {
  margin-top: 2.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

.comment-list {
  list-style: none;
  margin: 1.2rem 0 2rem;
}

.comment {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-code);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.comment-meta {
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.comment-author { color: var(--green-hi); font-weight: 600; }
.comment-meta time::before { content: "· "; }
.comment-text { font-size: .92rem; }

.no-comments { color: var(--text-dim); font-size: .9rem; }

.form-error {
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .88rem;
  margin-bottom: 1rem;
}

.form-note { color: var(--text-dim); font-size: .8rem; margin-bottom: 1rem; }

.comment-form label {
  display: block;
  font-size: .85rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.comment-form input,
.comment-form textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: .92rem;
  padding: 9px 12px;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.comment-form textarea { resize: vertical; min-height: 110px; }

.comment-form button {
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .92rem;
  padding: 10px 22px;
  cursor: pointer;
}
.comment-form button:hover, .comment-form button:focus-visible {
  background: var(--green-hi);
}

/* honeypot anti-bot : invisible pour les humains, visible pour les bots naïfs */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

/* ---------- retour ---------- */

.back-link {
  display: inline-block;
  margin-top: 32px;
  font-size: .88rem;
}
.back-link::before { content: "$ cd ..  # "; color: var(--green); }

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .term { margin-top: 20px; }
  .term-body { padding: 19px 16px 24px; }
  nav.site-nav { flex-wrap: wrap; white-space: normal; }
  .dir-list .meta { display: none; }
  html { font-size: 15px; }
}
