/* ====== Karam Bilami — CV · thème CRT ambre rétro ====== */
:root {
  --bg: #0d0905;
  --panel: #15100a;
  --panel-2: #100c07;
  --border: #3a2c14;
  --text: #f2d7a7;
  --muted: #a98e5f;
  --accent: #ffb000;        /* phosphore ambre */
  --accent-2: #ffd27d;      /* ambre clair */
  --glow: rgba(255, 176, 0, 0.38);
  --glow-soft: rgba(255, 176, 0, 0.14);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #1a1206; }

/* Écran CRT : scanlines + vignette */
.grid-bg {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px,
    rgba(0, 0, 0, 0) 4px
  );
}
.grid-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 95% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
}

.accent { color: var(--accent); }
.muted { color: var(--muted); }
.status-ok { color: var(--accent); text-shadow: 0 0 10px var(--glow); }
.prompt { color: var(--accent-2); }

/* ====== Header ====== */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(13, 9, 5, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700; font-size: 1.05rem;
  color: var(--text); text-decoration: none; letter-spacing: 0.02em;
  text-shadow: 0 0 14px var(--glow-soft);
}
.site-header nav { display: flex; gap: clamp(0.7rem, 2vw, 1.4rem); }
.site-header nav a {
  font-size: 0.88rem;
  color: var(--muted); text-decoration: none; padding: 0.2rem 0.1rem;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s, text-shadow .2s;
}
.site-header nav a:hover, .site-header nav a:focus-visible {
  color: var(--accent); border-color: var(--accent); text-shadow: 0 0 10px var(--glow);
}

/* ====== Layout ====== */
main { max-width: 860px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.section { padding: 2.6rem 0 0.4rem; }
.section h2 {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: var(--accent-2); margin: 0 0 1.2rem;
  text-shadow: 0 0 16px var(--glow-soft);
}
.section p { margin: 0 0 1rem; }
.section-meta { margin: -0.9rem 0 1.1rem !important; font-size: 0.85rem; color: var(--muted); }

/* ====== Fenêtre terminal ====== */
.hero { padding: clamp(2rem, 6vh, 4rem) 0 0.5rem; }
.terminal {
  background: linear-gradient(180deg, rgba(255, 176, 0, 0.03), transparent 30%), var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 176, 0, 0.07),
    0 0 48px rgba(255, 176, 0, 0.08),
    inset 0 0 110px rgba(255, 176, 0, 0.035);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 0.6rem 0.9rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(255, 176, 0, 0.4); }
.dot.red { background: #7a4a08; }
.dot.yellow { background: #b97c10; }
.dot.green { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.terminal-title { margin-left: 0.7rem; font-size: 0.8rem; color: var(--muted); }
.terminal-body { padding: clamp(1.1rem, 3.5vw, 1.8rem); }

.line { margin: 0 0 0.55rem; }
.line .output, .line.output { color: var(--text); }
.output.big {
  font-size: clamp(1.55rem, 5.5vw, 2.4rem);
  font-weight: 700; letter-spacing: 0.01em; margin: 0.1rem 0 1.1rem;
  text-shadow: 0 0 24px var(--glow-soft);
}
.output.big strong { color: var(--accent); text-shadow: 0 0 26px var(--glow), 0 0 4px rgba(255, 176, 0, 0.55); }

.output a, .cta a { color: var(--accent); text-decoration: none; }
.output a:hover, .output a:focus-visible, .cta a:hover, .cta a:focus-visible {
  text-decoration: underline; text-shadow: 0 0 10px var(--glow);
}

.cursor::after {
  content: "▊"; color: var(--accent);
  text-shadow: 0 0 10px var(--glow);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

[data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].visible { opacity: 1; transform: none; }

/* ====== Teaching ====== */
.teach-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem;
  margin: 0 0 1rem;
}
.teach-col h3 {
  margin: 0 0 0.7rem; font-size: 1rem;
  color: var(--accent); text-shadow: 0 0 12px var(--glow-soft);
}
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  padding: 0.22rem 0 0.22rem 1.1rem;
  position: relative;
  font-size: 0.92rem;
}
.plain-list li::before {
  content: "›"; position: absolute; left: 0.1rem;
  color: var(--accent); text-shadow: 0 0 8px var(--glow);
}
.card-note { margin: 0.7rem 0 0; font-size: 0.82rem; color: var(--muted); font-style: italic; }
.cta { margin-top: 0.4rem; }

/* ====== Hard skills ====== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.skills-grid h3 {
  margin: 0 0 0.7rem; font-size: 1rem;
  color: var(--accent); text-shadow: 0 0 12px var(--glow-soft);
}
.tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.tags span {
  font-size: 0.8rem; color: var(--text); line-height: 1.5;
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 0.25rem 0.6rem; border-radius: 5px;
}

/* ====== Cartes (skills, research) ====== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 1rem 1.2rem;
  transition: border-color .25s, box-shadow .25s;
}
.card:hover { border-color: rgba(255, 176, 0, 0.5); box-shadow: 0 6px 30px rgba(255, 176, 0, 0.1); }

/* ====== Research ====== */
.thesis { margin-bottom: 1rem; }
.thesis-title { margin: 0; color: var(--text); }
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.pub-title { margin: 0 0 0.3rem; font-weight: 600; color: var(--accent-2); }
.pub-meta { margin: 0 0 0.4rem; font-size: 0.88rem; color: var(--muted); }
.pub-link { font-size: 0.86rem; color: var(--accent); text-decoration: none; }
.pub-link:hover { text-decoration: underline; text-shadow: 0 0 10px var(--glow); }

/* ====== Contact / footer ====== */
.contact-box .terminal-body a { text-decoration: none; }
.contact-box .terminal-body a:hover { text-decoration: underline; }
.site-footer {
  margin-top: 3rem; padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 0.8rem; color: var(--muted);
}

/* ====== Responsive ====== */
@media (max-width: 620px) {
  .teach-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wide-only { display: none; }
  body { font-size: 15px; }
}

/* ====== Préférences de mouvement ====== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .cursor::after { animation: none; }
  .card { transition: none; }
}
