/* =========================================================================
   Gaëtan Costa-Mula — personal site
   Palette: porcelain / graphite ink / copper (the conductor of the energy
   transition) / slate. The chat card is the only dark object on the page.
   Type: Archivo (display, semi-expanded) · IBM Plex Sans (body)
         · IBM Plex Mono (metrics, dates, labels — the engineering register)
   ========================================================================= */

:root {
  --porcelain: #f6f7f5;
  --ink: #1b1d1f;
  --slate: #5c6470;
  --copper: #b26b2b;
  --copper-soft: #d99a5b;
  --console: #14161a;
  --console-line: #2a2e35;
  --console-text: #e8e6e1;
  --radius: 14px;
  --max: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
}

h1, h2, h3 {
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 110;
  line-height: 1.08;
  margin: 0;
}

button { font: inherit; cursor: pointer; }

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

/* ---------- top bar ---------------------------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px;
}

.topbar-name { font-size: 12px; color: var(--slate); }

.lang { display: flex; gap: 4px; }

.lang button {
  border: 1px solid transparent;
  background: none;
  color: var(--slate);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
}

.lang button[aria-pressed="true"] {
  color: var(--copper);
  border-color: var(--copper);
}

/* ---------- hero -------------------------------------------------------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px 24px 28px;
  text-align: center;
}

.eyebrow {
  font-size: 12px;
  color: var(--copper);
  margin: 0 0 20px;
}

.portrait {
  display: block;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--copper);
}

.personal-note {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 24px 56px;
  text-align: center;
}

.personal-note p {
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

.quote-mark {
  color: var(--copper);
  font-style: normal;
  font-family: "Archivo", system-ui, sans-serif;
}

.note-attr {
  margin-top: 10px !important;
  font-size: 12px !important;
  font-style: normal !important;
  color: var(--slate) !important;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 800;
}

.hero h1 .accent { color: var(--copper); }

.hero-sub {
  max-width: 620px;
  margin: 18px auto 26px;
  color: var(--slate);
  font-size: 18px;
}

/* ---------- chat card (the signature element) --------------------------- */

.chat-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--console);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 18px 50px rgba(20, 22, 26, 0.22);
  text-align: left;
}

.chat-messages {
  display: none;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
  transition: max-height 0.45s ease;
}

.chat-card.is-active .chat-messages {
  display: flex;
  max-height: 420px;
  padding: 12px 8px 14px;
}

.chat-bubble {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-user {
  align-self: flex-end;
  background: var(--copper);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-assistant {
  align-self: flex-start;
  background: var(--console-line);
  color: var(--console-text);
  border-bottom-left-radius: 4px;
}

.chat-typing { opacity: 0.6; font-style: italic; }

.chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1d2026;
  border: 1px solid var(--console-line);
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
}

.chat-caret { color: var(--copper-soft); font-size: 15px; }

.chat-form input {
  flex: 1;
  border: none;
  background: none;
  color: var(--console-text);
  font-size: 16px;
  outline: none;
  min-width: 0;
}

.chat-form input::placeholder { color: #7a8290; }

.chat-send {
  border: none;
  background: var(--copper);
  color: #fff;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
}

.chat-send:hover { background: var(--copper-soft); }

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 4px 4px;
}

.chip {
  border: 1px solid var(--console-line);
  background: none;
  color: #aab2bd;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}

.chip:hover { color: var(--copper-soft); border-color: var(--copper); }

.chat-card.is-active .chat-chips { display: none; }

/* ---------- metrics strip ----------------------------------------------- */

.metrics {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 24px auto 0;
  padding: 0;
  font-size: 13px;
  color: var(--copper);
}

.metrics li::before { content: "▪ "; color: var(--slate); }

.scroll-hint {
  display: block;
  text-align: center;
  margin: 22px auto 0;
  font-size: 12px;
  color: var(--slate);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s, color 0.15s;
}

.scroll-hint:hover {
  opacity: 1;
  color: var(--copper);
}

/* ---------- sections ----------------------------------------------------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px;
  border-top: 1px solid #e3e2dd;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.section-note { color: var(--slate); margin: 0 0 28px; }

/* pillars */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 28px;
}

.pillar h3 {
  font-size: 1.1rem;
  padding-top: 12px;
  border-top: 3px solid var(--copper);
}

.pillar p { color: var(--slate); font-size: 15px; }

.ask-link {
  border: none;
  background: none;
  color: var(--copper);
  font-weight: 600;
  font-size: 14px;
  padding: 0;
}

.ask-link:hover { color: var(--copper-soft); }

/* timeline */

.timeline {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.timeline li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
}

.tl-dates { color: var(--copper); font-size: 13px; padding-top: 3px; }

.tl-tag {
  font-size: 11px;
  color: var(--slate);
  letter-spacing: 0.08em;
}

.timeline h3 { font-size: 1.05rem; }

.timeline p { color: var(--slate); font-size: 15px; margin: 6px 0 0; }

.edu {
  margin-top: 34px;
  font-size: 13px;
  color: var(--slate);
}

/* projects */

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 28px;
}

.project {
  background: #fff;
  border: 1px solid #e3e2dd;
  border-radius: var(--radius);
  padding: 24px;
}

.project h3 { font-size: 1.1rem; margin-bottom: 8px; }

.project p { color: var(--slate); font-size: 15px; }

/* ---------- footer -------------------------------------------------------- */

.footer {
  border-top: 1px solid #e3e2dd;
  text-align: center;
  padding: 40px 24px 56px;
  color: var(--slate);
  font-size: 14px;
}

.footer .mono { font-size: 12px; }

/* ---------- responsive ----------------------------------------------------- */

@media (max-width: 760px) {
  .pillars, .projects { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .hero { padding-top: 36px; }
  .chat-card.is-active .chat-messages { max-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
