:root {
  --bg: #0a0612;
  --phosphor: #00e8ff;
  --phosphor-dim: #8b7fa8;
  --neon: #ff2a6d;
  --amber: #ffb000;
  --rule: #2d1b4e;
  --font-mono: ui-monospace, "JetBrains Mono", "IBM Plex Mono", "Cascadia Code",
    Menlo, Consolas, monospace;
  --glow-cyan: rgba(0, 232, 255, 0.35);
  --glow-magenta: rgba(255, 42, 109, 0.3);
  --panel-bg: rgba(45, 27, 78, 0.55);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse 55% 40% at 90% 5%, rgba(255, 42, 109, 0.08), transparent),
    radial-gradient(ellipse 65% 45% at 5% 95%, rgba(0, 232, 255, 0.07), transparent),
    var(--bg);
  color: var(--phosphor);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.6;
}

/* Scanlines statiques cyan/magenta — purement décoratif */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 232, 255, 0.035),
    rgba(0, 232, 255, 0.035) 1px,
    rgba(255, 42, 109, 0.025) 1px,
    rgba(255, 42, 109, 0.025) 2px,
    transparent 2px,
    transparent 3px
  );
}

header,
main,
footer {
  max-width: 72ch;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* --- Utilitaire accessibilité --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- En-tête --- */
.terminal-header {
  padding-top: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(0, 232, 255, 0.06);
}

h1 {
  margin: 0 0 1.5rem;
}

.ascii-name {
  --ascii-form: 1;
  position: relative;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.15;
  color: var(--phosphor);
  text-shadow:
    0 0 calc(4px + 28px * var(--ascii-form)) rgba(0, 232, 255, calc(0.15 + 0.8 * var(--ascii-form))),
    0 0 calc(10px + 40px * var(--ascii-form)) rgba(0, 232, 255, calc(0.08 + 0.45 * var(--ascii-form))),
    calc(-2px * var(--ascii-form)) 0 calc(12px + 24px * var(--ascii-form))
      rgba(255, 42, 109, calc(0.1 + 0.6 * var(--ascii-form)));
  white-space: pre;
  overflow: hidden;
}

.ascii-name::before {
  content: "";
  position: absolute;
  inset: -0.5rem -1rem;
  z-index: -1;
  pointer-events: none;
  opacity: calc(0.15 + 0.85 * var(--ascii-form));
  transform: scale(calc(0.94 + 0.08 * var(--ascii-form)));
  background: radial-gradient(
    ellipse 90% 80% at 50% 50%,
    rgba(0, 232, 255, calc(0.08 + 0.22 * var(--ascii-form))),
    rgba(255, 42, 109, calc(0.04 + 0.14 * var(--ascii-form))) 45%,
    transparent 72%
  );
}

.prompt-line {
  margin: 0 0 1rem;
}

.prompt-line--intro {
  font-size: 1.05rem;
  line-height: 1.5;
}

.prompt-line--intro .tagline {
  color: var(--phosphor);
}

.prompt {
  color: var(--phosphor-dim);
  margin-right: 0.5em;
  user-select: none;
}

.cmd {
  color: var(--neon);
  letter-spacing: 0.02em;
  text-shadow: 0 0 6px var(--glow-magenta);
}

.cursor {
  display: inline-block;
  margin-left: 0.15em;
  color: var(--neon);
  animation: blink 1s steps(1) infinite;
}

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

@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateX(-0.4rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glowSettle {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}

@keyframes bootPanelIn {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes listItemIn {
  from {
    opacity: 0;
    transform: translateX(-0.25rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Sections --- */
main section {
  margin: 0 0 2.5rem;
  padding: 1.75rem 0 0;
}

main section .prompt-line {
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.65rem;
  background: var(--panel-bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: inset 0 0 12px rgba(0, 232, 255, 0.03);
}

.output {
  margin-top: 0;
  padding: 1rem 0 1rem 1.25rem;
  border-left: 2px solid transparent;
  border-image: linear-gradient(to bottom, var(--phosphor), var(--neon)) 1;
  color: var(--phosphor-dim);
}

.output p {
  margin: 0 0 1rem;
}

.output ul,
.output ol {
  margin: 0;
  padding-left: 1.25rem;
}

.output li {
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

.output li::marker {
  color: var(--neon);
}

.output li:last-child {
  margin-bottom: 0;
}

.output strong {
  color: var(--phosphor);
  font-weight: bold;
  text-shadow:
    0 0 6px var(--glow-cyan),
    0 0 10px var(--glow-magenta);
}

/* --- Liens --- */
a {
  color: inherit;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.15s ease, text-shadow 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

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

/* Liens dans le contenu des sections : cyan, distinct du texte atténué */
.output a {
  color: var(--phosphor);
  text-decoration: underline;
  text-decoration-color: rgba(0, 232, 255, 0.35);
  text-underline-offset: 0.18em;
}

.output a:hover {
  text-decoration-color: var(--neon);
  text-shadow: 0 0 8px var(--glow-cyan);
}

.output a:focus-visible {
  outline-color: var(--neon);
}

/* L'ambre est réservé aux éléments cliquables : uniquement le bloc contact */
.contact .prompt-line {
  background: rgba(255, 176, 0, 0.06);
  border-color: rgba(255, 176, 0, 0.3);
  box-shadow: inset 0 0 16px rgba(255, 176, 0, 0.05);
}

.contact .cmd {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.4);
}

.contact .output {
  border-image: linear-gradient(to bottom, var(--amber), rgba(255, 176, 0, 0.4)) 1;
  color: var(--phosphor-dim);
}

.contact-email {
  margin: 0 0 1.5rem;
}

.contact .email,
.contact .links a {
  display: inline-block;
  color: var(--amber);
  font-weight: bold;
  text-decoration: none;
  transition: text-shadow 0.2s ease, transform 0.2s ease;
}

.contact .link-ascii {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  line-height: 1.05;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.35);
  white-space: pre;
  overflow: hidden;
}

.contact .email:hover,
.contact .links a:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.contact .email:hover .link-ascii,
.contact .links a:hover .link-ascii {
  text-shadow:
    0 0 12px rgba(255, 176, 0, 0.65),
    0 0 24px rgba(255, 176, 0, 0.35);
}

.contact .links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem 2rem;
}

.contact .links li {
  margin: 0;
  padding: 0;
}

/* --- Pied de page --- */
footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--phosphor-dim);
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.04em;
  box-shadow: 0 -1px 0 rgba(255, 42, 109, 0.06);
}

footer p {
  margin: 0;
}

footer p::before {
  content: "— ";
  opacity: 0.5;
}

footer p::after {
  content: " —";
  opacity: 0.5;
}

/* --- Séquence de boot --- */
.boot {
  display: none;
}

html.js .boot {
  display: block;
  max-width: 72ch;
  margin: 2rem auto 0;
  padding: 1rem;
  color: var(--phosphor-dim);
  background: var(--panel-bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow:
    0 0 20px rgba(0, 232, 255, 0.06),
    inset 0 0 16px rgba(255, 42, 109, 0.04);
}

html.js .boot p {
  margin: 0 0 0.35em;
}

html.js .boot .boot-cmd {
  color: var(--phosphor);
}

html.js .boot .boot-cmd .prompt {
  color: var(--phosphor-dim);
}

html.js .boot .boot-out {
  color: var(--phosphor-dim);
  margin-left: 1em;
}

html.js:not(.boot-done) header,
html.js:not(.boot-done) main,
html.js:not(.boot-done) footer {
  visibility: hidden;
}

/* --- Animations (désactivées si prefers-reduced-motion) --- */
@media (prefers-reduced-motion: no-preference) {
  html.js .boot {
    animation: bootPanelIn 0.35s ease both;
  }

  html.js .boot .boot-line-in {
    animation: lineIn 0.28s ease both;
  }

  html.boot-done .terminal-header {
    animation: revealIn 0.55s ease both;
  }

  html.boot-done .ascii-name:not(.ascii-animated) {
    animation: glowSettle 0.9s ease both;
  }

  html.boot-done main section {
    animation: revealIn 0.5s ease both;
  }

  html.boot-done main section:nth-child(1) {
    animation-delay: 0.12s;
  }

  html.boot-done main section:nth-child(2) {
    animation-delay: 0.28s;
  }

  html.boot-done main section:nth-child(3) {
    animation-delay: 0.44s;
  }

  html.boot-done footer {
    animation: revealIn 0.45s ease both;
    animation-delay: 0.6s;
  }

  html.boot-done .output li {
    animation: listItemIn 0.35s ease both;
  }

  html.boot-done main section:nth-child(1) .output li:nth-child(1) {
    animation-delay: 0.35s;
  }

  html.boot-done main section:nth-child(1) .output li:nth-child(2) {
    animation-delay: 0.45s;
  }

  html.boot-done main section:nth-child(1) .output li:nth-child(3) {
    animation-delay: 0.55s;
  }

  html.boot-done main section:nth-child(1) .output li:nth-child(4) {
    animation-delay: 0.65s;
  }

  html.boot-done main section:nth-child(2) .output li:nth-child(1) {
    animation-delay: 0.5s;
  }

  html.boot-done main section:nth-child(2) .output li:nth-child(2) {
    animation-delay: 0.6s;
  }

  html.boot-done main section:nth-child(3) .output li:nth-child(3) {
    animation-delay: 0.75s;
  }

  main section .prompt-line {
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  }

  main section:hover .prompt-line {
    border-color: rgba(0, 232, 255, 0.35);
    background: rgba(45, 27, 78, 0.8);
    box-shadow:
      inset 0 0 14px rgba(0, 232, 255, 0.06),
      0 0 12px rgba(255, 42, 109, 0.05);
  }

  .contact:hover .prompt-line {
    border-color: rgba(255, 176, 0, 0.45);
    background: rgba(255, 176, 0, 0.09);
  }
}

/* --- Responsive --- */
@media (max-width: 360px) {
  .ascii-name {
    font-size: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  main section .prompt-line {
    padding: 0.3rem 0.5rem;
  }

  .output {
    padding-left: 0.85rem;
  }

  .contact .link-ascii {
    font-size: 0.38rem;
  }
}

/* --- Préférences de mouvement réduit --- */
@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }

  a,
  .contact .email,
  .contact .links a {
    transition: none;
  }

  html.js:not(.boot-done) header,
  html.js:not(.boot-done) main,
  html.js:not(.boot-done) footer {
    visibility: visible;
  }

  html.js .boot {
    display: none;
  }
}
