:root {
  --bg: #0a0e14;
  --panel: #0d1117;
  --line: #21262d;
  --text: #c9d1d9;
  --dim: #6e7681;
  --green: #39d353;
  --amber: #e3b341;
  --cyan: #58a6ff;
  --red: #f85149;
}

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

body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.dim { color: var(--dim); }
.g { color: var(--green); }

/* barres haut / bas */
.topbar, .bottombar {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
}
.bottombar { border-bottom: 0; border-top: 1px solid var(--line); margin-top: auto; }
.host { color: var(--text); }

/* grille principale */
.grid {
  width: 100%; max-width: 1100px;
  margin: 48px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
}
.panel + .panel { border-left: 0; }

.panel-title {
  display: flex; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  text-transform: lowercase;
}

/* identité */
.id { padding-bottom: 0; }
.id > *:not(.panel-title):not(.status):not(.photo) { margin-left: 20px; margin-right: 20px; }

.photo {
  display: block;
  width: 100%; height: auto; aspect-ratio: 1 / 1;
  object-fit: cover; object-position: center 20%;
  margin: 0;
  border: 0; border-bottom: 1px solid var(--line);
  filter: grayscale(1) contrast(1.1);
  transition: filter .3s;
}
.photo:hover { filter: none; }
.photo-fallback {
  display: grid; place-items: center;
  font-size: 48px; font-weight: 800; color: var(--green);
  background: var(--bg);
}

h1 {
  margin-top: 20px;
  font-size: clamp(26px, 7.5vw, 32px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em;
  white-space: nowrap;
  color: #fff;
}
.role { margin-top: 12px; color: var(--cyan); font-size: 13px; }
.loc { margin-top: 6px; color: var(--dim); font-size: 12px; }

.status { margin-top: 24px; border-top: 1px solid var(--line); }
.status div {
  display: flex; justify-content: space-between;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.status div:last-child { border-bottom: 0; }
.status .k { color: var(--dim); }
.status .warn::before { content: "▲ "; }

/* terminal */
.term { display: flex; flex-direction: column; min-width: 0; }
.screen {
  flex: 1;
  padding: 18px 20px;
  min-height: 600px;
  font-family: inherit;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.screen .p { color: var(--green); }
.screen .c { color: #fff; }
.screen .k { color: var(--cyan); }
.screen .w { color: var(--amber); }
.screen .d { color: var(--dim); }
.screen .cur {
  display: inline-block; width: 8px; height: 15px;
  background: var(--green); vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* contacts */
.contact { border-top: 1px solid var(--line); opacity: 0; transition: opacity .4s; }
.contact.show { opacity: 1; }
.row {
  display: grid;
  grid-template-columns: 110px 1fr 24px;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.row:last-child { border-bottom: 0; }
.row .lbl { color: var(--dim); font-size: 11px; letter-spacing: .08em; }
.row .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .arr { color: var(--dim); text-align: right; }
.row:hover, .row:focus-visible { background: var(--green); color: var(--bg); outline: none; }
.row:hover .lbl, .row:hover .arr,
.row:focus-visible .lbl, .row:focus-visible .arr { color: var(--bg); }
.copy .val { color: var(--dim); }

/* articles Medium */
.articles { grid-column: 1 / -1; border-top: 0; min-width: 0; }
.panel + .panel.articles { border-left: 1px solid var(--line); }
.articles .more:hover { color: var(--green); }
.row.art .lbl { color: var(--amber); }
.row.art .val { white-space: normal; }

/* activité GitLab */
.activity { grid-column: 1 / -1; border-top: 0; min-width: 0; }
.panel + .panel.activity { border-left: 1px solid var(--line); }
.heat-wrap { padding: 20px 20px 12px; overflow-x: auto; }
.heat { display: flex; gap: 3px; width: max-content; margin: 0 auto; }
.wk { display: flex; flex-direction: column; gap: 3px; }
.wk .mo { height: 16px; font-size: 10px; color: var(--dim); white-space: nowrap; width: 14px; overflow: visible; }
.heat i, .legend i { display: block; width: 14px; height: 14px; }
.heat i { animation: pop .4s both; }
.heat i:hover { outline: 1px solid #fff; }
@keyframes pop { from { opacity: 0; } }
.l0 { background: #161b22; }
.l1 { background: #0e4429; }
.l2 { background: #006d32; }
.l3 { background: #26a641; }
.l4 { background: #39d353; }
.heat-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; border-top: 1px solid var(--line); font-size: 11px;
}
.legend { display: inline-flex; align-items: center; gap: 3px; }
.legend i { width: 10px; height: 10px; }
.legend .dim:first-child { margin-right: 4px; }
.legend .dim:last-child { margin-left: 4px; }

/* responsive */
@media (max-width: 820px) {
  .grid { grid-template-columns: minmax(0, 1fr); margin: 24px auto; }
  .panel + .panel { border-left: 1px solid var(--line); border-top: 0; }
  .screen { min-height: 0; }
}
@media (max-width: 420px) {
  .row { grid-template-columns: 84px 1fr 18px; padding: 12px 14px; }
  .id > *:not(.panel-title):not(.status):not(.photo) { margin-left: 14px; margin-right: 14px; }
  .status div { padding: 8px 14px; }
  .screen { padding: 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
