/* Nicolas Nèble — portfolio
   Minimal, monospace, black on white. Inspired by cosmonotes.xyz. */

:root {
  --fg: #000;
  --bg: #fff;
  --muted: #666;
  --rule: #e6e6e6;
  --tint: #f5f5f5;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  font-family: Consolas, Menlo, "DejaVu Sans Mono", "Liberation Mono", "Lucida Console", monospace;
  font-size: 16px;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 96px;
  color: var(--fg);
  background: var(--bg);
}
@media (max-width: 520px) {
  body { font-size: 15px; padding: 18px 16px 72px; }
}

/* ---- Navigation ---- */
nav { margin-bottom: 44px; }
nav a { color: var(--fg); text-decoration: none; margin-right: 20px; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Typography ---- */
h1 { font-size: 2em; line-height: 1.2; margin: 0 0 20px; }
h2 { font-size: 1.25em; margin: 44px 0 12px; }
h3 { font-size: 1em; margin: 24px 0 6px; }
h2 + h3 { margin-top: 12px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 4px; }
strong { font-weight: 700; }
small, .muted { color: var(--muted); }
small { font-size: 0.875em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

code { font-family: inherit; background: var(--tint); padding: 0 4px; border-radius: 2px; font-size: 0.95em; }
pre {
  font-family: inherit; font-size: 0.8em; line-height: 1.45;
  background: var(--tint); border: 1px solid var(--rule);
  padding: 12px 14px; overflow-x: auto; margin: 16px 0;
}

.tagline { color: var(--muted); margin: -12px 0 24px; }
.lede p { margin-bottom: 14px; }

/* LLM-style cursor */
.cursor {
  display: inline-block; width: 0.55em; height: 1.05em;
  background: var(--fg); vertical-align: text-bottom; margin-left: 1px;
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ---- Rows: image left, short text right ---- */
.rows { list-style: none; padding: 0; margin: 0; }
.row {
  display: grid;
  grid-template-columns: 184px 1fr;
  gap: 22px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.row:last-child { border-bottom: none; }
.row .thumb { display: block; margin: 0; }
.row .thumb img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  background: var(--tint);
}
.row .thumb img.logo { object-fit: contain; padding: 0; border: 0; background: #fff; }
.row.logo-row { grid-template-columns: 220px 1fr; }
.row h3 { margin: 0 0 4px; font-size: 1em; }
.row p { margin: 0 0 4px; }
.row ul { list-style: disc; margin: 4px 0 6px; padding-left: 18px; }
.row ul ul { list-style: circle; margin: 2px 0 4px; }
.row li { margin-bottom: 2px; }
.row .when { color: var(--muted); font-size: 0.875em; display: block; margin-bottom: 2px; }
.row .tags { color: var(--muted); font-size: 0.85em; }
.subroles {
  list-style: none; margin: 14px 0 0; padding: 0 0 0 16px;
  border-left: 2px solid var(--rule);
}
.subroles > li { position: relative; margin-bottom: 14px; }
.subroles > li:last-child { margin-bottom: 0; }
.subroles > li::before {
  content: ""; position: absolute; left: -21px; top: 0.45em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--fg);
}
.subroles h4 { margin: 0 0 2px; font-size: 1em; }
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; gap: 12px; }
}

/* ---- Key/value facts ---- */
dl.facts { margin: 12px 0 20px; }
dl.facts div {
  display: grid; grid-template-columns: 8.5em 1fr; gap: 0 12px;
  padding: 5px 0; border-bottom: 1px solid var(--rule);
}
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
@media (max-width: 520px) { dl.facts div { grid-template-columns: 1fr; gap: 0; } }

/* ---- Tables ---- */
.tablewrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
th, td { text-align: left; vertical-align: top; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; border-bottom: 1px solid var(--fg); }
td.num, th.num { text-align: right; padding-right: 0; white-space: nowrap; }
td:last-child, th:last-child { padding-right: 0; }

/* ---- Media ---- */
figure { margin: 24px 0; }
figure img, figure video {
  display: block; width: 100%; height: auto; background: var(--tint);
}
figcaption { font-size: 0.85em; color: var(--muted); margin-top: 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; }
.grid figure { margin: 0; }
.grid figure img { aspect-ratio: 3 / 2; object-fit: cover; }
.grid.wide figure img { aspect-ratio: 16 / 9; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

/* ---- Home lists ---- */
.plain { list-style: none; padding: 0; }
.plain li { margin-bottom: 6px; }

/* ---- Footer ---- */
footer { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85em; }
footer a { color: var(--muted); }

.back { display: inline-block; margin-top: 40px; }
.nowrap { white-space: nowrap; }

/* ---- Print ---- */
@media print {
  :root { --muted: #444; --rule: #bbb; --tint: #fff; }
  body { max-width: none; padding: 0; font-size: 10.5pt; line-height: 1.45; }
  nav, footer, .no-print, figure, video, .cursor, .back { display: none !important; }
  h1 { font-size: 18pt; margin-bottom: 4pt; }
  h2 { font-size: 12.5pt; margin: 12pt 0 4pt; page-break-after: avoid; }
  h3 { margin: 8pt 0 2pt; }
  a { text-decoration: none; color: #000; }
  .print-url::after { content: " " attr(href); color: #444; }
}
