/* =========================================================================
   thomasmartinet.fr — Design system inspired by Ollama
   Pure grayscale · binary radii (12px / 9999px) · zero shadows
   ========================================================================= */

:root {
  /* Colors */
  --black: #000000;
  --near-black: #262626;
  --darkest: #090909;
  --white: #ffffff;
  --snow: #fafafa;
  --light-gray: #e5e5e5;
  --border-light: #d4d4d4;
  --button-text-dark: #404040;
  --mid-gray: #525252;
  --stone: #737373;
  --silver: #a3a3a3;
  --ring: rgba(59, 130, 246, 0.5);

  /* Type */
  --font-display: "SF Pro Rounded", system-ui, -apple-system, system-ui;
  --font-body: ui-sans-serif, system-ui, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  /* Radii */
  --r-container: 12px;
  --r-pill: 9999px;

  /* Spacing */
  --container-max: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--near-black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--black);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: var(--black); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- Layout ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 88px 0;
  background: var(--white);
}
.section-alt { background: var(--snow); }

@media (max-width: 768px) {
  .section { padding: 56px 0; }
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 850px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
}

/* ----- Typography -------------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  margin: 0 0 20px;
  color: var(--black);
}

@media (max-width: 768px) { .display { font-size: 36px; } }
@media (max-width: 480px) { .display { font-size: 30px; } }

.section-heading {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.11;
  margin: 0 0 32px;
  color: var(--black);
  max-width: 28ch;
}
@media (max-width: 768px) { .section-heading { font-size: 28px; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.33;
  color: var(--stone);
  text-transform: lowercase;
  margin: 0 0 12px;
}

.prose p {
  font-size: 18px;
  line-height: 1.56;
  color: var(--mid-gray);
  margin: 0 0 16px;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--near-black); font-weight: 500; }
.prose a { color: var(--black); border-bottom: 1px solid var(--light-gray); }
.prose a:hover { border-bottom-color: var(--black); }

/* ----- Navigation -------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--black);
  border: none;
}
.brand:hover { border: none; }
.brand-mark { width: 24px; height: 24px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--black);
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  font-size: 16px;
  font-weight: 400;
  color: var(--near-black);
  border: none;
}
.nav-links a:hover { color: var(--black); }
.nav-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}
.nav-cta .link {
  font-size: 16px;
  color: var(--near-black);
  border: none;
}
.nav-cta .link:hover { color: var(--black); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--light-gray);
  border-radius: var(--r-pill);
  width: 40px;
  height: 40px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--near-black);
}

@media (max-width: 850px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav.is-open .nav-inner {
    flex-wrap: wrap;
    align-items: center;
    height: auto;
    padding-bottom: 16px;
  }
  .nav.is-open .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-basis: 100%;
    order: 3;
    border-top: 1px solid var(--light-gray);
    margin-top: 12px;
    padding-top: 4px;
  }
  .nav.is-open .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--light-gray);
  }
  .nav.is-open .nav-links a:last-child { border-bottom: none; }
  .nav.is-open .nav-cta {
    display: flex;
    flex-basis: 100%;
    order: 4;
    justify-content: flex-start;
    padding-top: 12px;
  }
}

/* ----- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
}
.btn-gray {
  background: var(--light-gray);
  color: var(--near-black);
  border-color: var(--light-gray);
}
.btn-white {
  background: var(--white);
  color: var(--button-text-dark);
  border-color: var(--border-light);
}
.btn-black {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ----- Hero -------------------------------------------------------------- */

.hero { padding: 88px 0 64px; }
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.mascot {
  margin-bottom: 32px;
  color: var(--black);
}
.mascot img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--light-gray);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: block;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.56;
  color: var(--stone);
  margin: 0 0 32px;
  max-width: 56ch;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 48px;
}

/* ----- Terminal block ---------------------------------------------------- */

.terminal {
  width: 100%;
  max-width: 720px;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--r-container);
  overflow: hidden;
  text-align: left;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--snow);
  border-bottom: 1px solid var(--light-gray);
}
.terminal-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--light-gray);
}
.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--silver);
}
.terminal pre {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
}
.terminal code {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.63;
  color: var(--near-black);
}

/* ----- Cards ------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 850px) { .cards { grid-template-columns: 1fr; } }

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--r-container);
  padding: 28px;
}
.section-alt .card { background: var(--white); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.card-title {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--black);
  margin: 0;
}
.card-org {
  font-size: 14px;
  color: var(--stone);
  margin: 0 0 12px;
}
.card-desc {
  font-size: 16px;
  color: var(--mid-gray);
  margin: 0 0 16px;
  line-height: 1.5;
}
.card-subtitle {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--stone);
  text-transform: lowercase;
  margin: 16px 0 8px;
}
.card-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--mid-gray);
  line-height: 1.6;
}
.card-list li { margin-bottom: 6px; }
.card-list strong { color: var(--near-black); font-weight: 500; }
.card-list em { color: var(--stone); font-style: normal; }
.card a { color: var(--black); border-bottom: 1px solid var(--light-gray); }
.card a:hover { border-bottom-color: var(--black); }

/* Tag (pill on a card head) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--light-gray);
  color: var(--near-black);
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pill rows */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--snow);
  border: 1px solid var(--light-gray);
  color: var(--near-black);
  font-size: 13px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.section-alt .pill { background: var(--white); }

/* ----- Skills grid ------------------------------------------------------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
}
@media (max-width: 640px) { .skills-grid { grid-template-columns: 1fr; gap: 24px; } }

.skill-group { }
.skill-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--stone);
  margin: 0 0 12px;
}

/* ----- Research / Papers ------------------------------------------------- */

.papers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.paper {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--r-container);
  padding: 24px;
}
@media (max-width: 640px) { .paper { grid-template-columns: 1fr; gap: 8px; } }
.paper-year {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--stone);
}
.paper-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
  margin: 0 0 6px;
  line-height: 1.45;
}
.paper-meta {
  font-size: 14px;
  color: var(--stone);
  margin: 0;
  line-height: 1.5;
}
.paper-meta strong { color: var(--near-black); font-weight: 500; }

/* ----- Contact ----------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 850px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-grid-single { grid-template-columns: 1fr; max-width: 480px; }
.contact-grid-two { grid-template-columns: repeat(2, 1fr); max-width: 720px; }
@media (max-width: 640px) { .contact-grid-two { grid-template-columns: 1fr; } }

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--r-container);
  color: var(--near-black);
}
.contact-card:hover { background: var(--snow); border-color: var(--border-light); }
.contact-card-static { cursor: default; }
.contact-card-static:hover { background: var(--white); border-color: var(--light-gray); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--stone);
  text-transform: lowercase;
}
.contact-value {
  font-size: 16px;
  color: var(--black);
  font-weight: 500;
  line-height: 1.4;
}

/* ----- Footer ------------------------------------------------------------ */

.footer {
  background: var(--white);
  border-top: 1px solid var(--light-gray);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer p {
  margin: 0;
  font-size: 14px;
  color: var(--stone);
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 14px;
  color: var(--stone);
  border: none;
}
.footer-links a:hover { color: var(--black); }

/* ----- Selection --------------------------------------------------------- */
::selection { background: var(--near-black); color: var(--white); }

/* ----- A11y: skip link --------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--black);
  color: var(--white);
  border-radius: 9999px;
  text-decoration: none;
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

/* Footer privacy note */
.footer-note {
  opacity: 0.6;
  font-size: 0.9em;
  margin-left: 0.5em;
}

/* Legal page typography */
.prose h2 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-size: 1.25rem;
  font-weight: 600;
}
