/* ===========================================================
   Paul Murat — CV interactif
   Palette épurée : papier / marine / accent bleu électrique
   =========================================================== */

:root {
  --paper:      #FBFAF7;
  --paper-2:    #F2F0EA;
  --ink:        #14253F;
  --ink-soft:   #4A5A72;
  --line:       #E3DFD5;
  --navy:       #14253F;
  --accent:     #2F5BEA;
  --accent-rgb: 47, 91, 234;
  --accent-2:   #19C5C0;
  --card:       #FFFFFF;
  --shadow:     0 1px 2px rgba(20,37,63,.04), 0 8px 30px rgba(20,37,63,.06);
  --node:       20, 37, 63;        /* rgb of neural nodes */
  --maxw:       1080px;
  --ease:       cubic-bezier(.22,.61,.36,1);
}

html[data-theme="dark"] {
  --paper:      #0B1422;
  --paper-2:    #111E32;
  --ink:        #EAF0FA;
  --ink-soft:   #93A4BE;
  --line:       #213251;
  --navy:       #EAF0FA;
  --accent:     #6E8DFF;
  --accent-rgb: 110, 141, 255;
  --accent-2:   #2FE0DA;
  --card:       #111E32;
  --shadow:     0 1px 2px rgba(0,0,0,.3), 0 12px 40px rgba(0,0,0,.35);
  --node:       150, 180, 230;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

#neural {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

nav, main, header, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

/* ---------- NAV ---------- */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 5vw, 3.5rem);
  z-index: 50;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
}
#nav.scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.brand-mark {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: .5px;
  border: 1.5px solid var(--ink);
  padding: .15rem .5rem;
  border-radius: 7px;
  transition: .3s var(--ease);
}
.brand:hover .brand-mark { background: var(--ink); color: var(--paper); }

.nav-links {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.2rem);
  list-style: none;
}
.nav-links a {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-soft);
  position: relative;
  padding: .2rem 0;
  transition: color .25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-controls { display: flex; gap: .5rem; align-items: center; }
.ctrl-btn {
  font-family: 'JetBrains Mono', monospace;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: .4rem .6rem;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .15rem;
  transition: .25s var(--ease);
}
.ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn { padding: .4rem; }
.lang-sep { opacity: .4; }
.lang-off { opacity: .4; }
.icon-btn .ico-moon { display: none; }
html[data-theme="dark"] .icon-btn .ico-sun { display: none; }
html[data-theme="dark"] .icon-btn .ico-moon { display: block; }

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem clamp(1.2rem, 5vw, 3.5rem) 4rem;
}
.hero-inner { max-width: 760px; }
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: fadeUp .8s var(--ease) .1s forwards;
}
.hero-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(3rem, 11vw, 6.5rem);
  line-height: .98;
  letter-spacing: -.01em;
  margin-bottom: 1.1rem;
  opacity: 0;
  animation: fadeUp .9s var(--ease) .22s forwards;
}
.hero-title {
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp .9s var(--ease) .34s forwards;
}
.hero-title .sep { color: var(--accent); margin: 0 .55rem; }
.hero-tagline {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto 2.4rem;
  opacity: 0;
  animation: fadeUp .9s var(--ease) .46s forwards;
}
.hero-cta {
  display: flex;
  gap: .9rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .9s var(--ease) .58s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 500;
  padding: .8rem 1.5rem;
  border-radius: 10px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: .28s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: var(--accent); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.scroll-cue {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 38px;
  border: 1.5px solid var(--ink-soft);
  border-radius: 14px;
  opacity: .5;
}
.scroll-cue span {
  position: absolute;
  top: 7px; left: 50%;
  width: 3px; height: 7px;
  background: var(--ink-soft);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.7s var(--ease) infinite;
}

/* ---------- SECTIONS ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem clamp(1.2rem, 5vw, 3.5rem);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  color: var(--accent);
  font-weight: 500;
}
.section-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -.01em;
}
.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  line-height: 1.6;
  font-weight: 400;
  max-width: 760px;
  color: var(--ink);
  font-family: 'Fraunces', serif;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.8rem;
  margin-top: 3rem;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: .85rem;
  color: var(--ink-soft);
  margin-top: .5rem;
  max-width: 200px;
}

/* ---------- TIMELINE ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 2rem;
  padding: 2.2rem 0;
}
.tl-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: var(--ink-soft);
  padding-top: .35rem;
}
.tl-company {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
}
.tl-role {
  font-weight: 600;
  font-size: 1.02rem;
  margin: .15rem 0 .9rem;
}
.tl-bullets { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.tl-bullets li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: .95rem;
}
.tl-bullets li::before {
  content: '';
  position: absolute;
  left: 0; top: .65em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}
.tl-bullets strong { color: var(--ink); font-weight: 600; }

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.skill-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.skill-col-ai { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.skill-col-title {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
}
.skill-col-title .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: .2rem .45rem;
  border-radius: 6px;
}
.skill-list { list-style: none; display: flex; flex-direction: column; gap: .2rem; }
.skill-list li {
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: .25s var(--ease);
}
.skill-list li:last-child { border-bottom: none; }
.skill-list li::before {
  content: '›';
  color: var(--accent);
  font-weight: 700;
}
.skill-list li:hover { padding-left: .4rem; color: var(--accent); }

/* ---------- EDUCATION ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.edu-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.edu-list { list-style: none; display: flex; flex-direction: column; gap: 1.3rem; }
.edu-list li .e-title { font-weight: 600; font-size: 1.02rem; }
.edu-list li .e-meta { color: var(--ink-soft); font-size: .9rem; font-style: italic; }
.edu-list li .e-year { font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--ink-soft); }

/* ---------- CONTACT ---------- */
.section-contact { padding-bottom: 4rem; }
.contact-lead {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  max-width: 640px;
  margin-bottom: 2.5rem;
  line-height: 1.4;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: .28s var(--ease);
}
a.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-value { font-weight: 600; font-size: 1rem; }

/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  padding: 2.5rem;
  color: var(--ink-soft);
  font-size: .82rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: .7rem;
  justify-content: center;
  align-items: center;
}
.footer-dot { opacity: .5; }

/* ---------- REVEAL ON SCROLL ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes scrollDot { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80%,100% { opacity: 0; transform: translate(-50%, 14px); } }

/* ---------- ASK · AI CONSOLE ---------- */
.ask-sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 2rem;
  margin-top: -1.4rem;
}
.console {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 760px;
}
.console-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 60%, transparent);
}
.console-dots { display: flex; gap: .35rem; }
.console-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.console-dots i:nth-child(1) { background: #ff5f57; }
.console-dots i:nth-child(2) { background: #febc2e; }
.console-dots i:nth-child(3) { background: #28c840; }
.console-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  letter-spacing: .05em;
  color: var(--ink-soft);
}
.console-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--ink-soft);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 70%, transparent);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.console-body {
  padding: 1.4rem;
  min-height: 200px;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}
.msg { display: flex; gap: .7rem; max-width: 88%; animation: msgIn .4s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
.msg .avatar {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  font-weight: 600;
}
.msg-bot .avatar { background: var(--accent); color: #fff; }
.msg-bot .bubble {
  background: var(--paper-2);
  border-radius: 4px 14px 14px 14px;
  padding: .75rem 1rem;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--ink);
}
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-user .avatar { background: var(--ink); color: var(--paper); }
.msg-user .bubble {
  background: var(--accent);
  color: #fff;
  border-radius: 14px 4px 14px 14px;
  padding: .75rem 1rem;
  font-size: .95rem;
}
.typing-dots { display: inline-flex; gap: 4px; padding: .35rem 0; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-soft);
  animation: typing 1.3s var(--ease) infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .18s; }
.typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes typing { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 0 1.4rem 1rem;
}
.chip {
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  padding: .45rem .85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: .22s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.console-input {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.1rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 50%, transparent);
}
.input-prompt { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-weight: 600; }
#ask-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: .95rem;
  outline: none;
}
#ask-input::placeholder { color: var(--ink-soft); opacity: .7; }
.ask-send {
  border: none;
  background: var(--ink);
  color: var(--paper);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: .22s var(--ease);
}
.ask-send:hover { background: var(--accent); transform: translateX(2px); }

/* ---------- CURSOR GLOW + DEPTH ---------- */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 65%);
  opacity: 0;
  transition: opacity .6s var(--ease);
  mix-blend-mode: multiply;
  will-change: transform;
}
html[data-theme="dark"] #cursor-glow { mix-blend-mode: screen; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 65%); }
body.glow-on #cursor-glow { opacity: 1; }

/* soft depth orbs behind everything */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: .5;
}
body::before { width: 46vw; height: 46vw; top: -12vw; right: -10vw; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
body::after  { width: 40vw; height: 40vw; bottom: -10vw; left: -8vw; background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%); }

/* ---------- SCROLL PROGRESS ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2.5px;
  width: 0%;
  z-index: 100;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .08s linear;
}

/* ---------- HERO SYSTEM LINE + CARET ---------- */
.sys-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
  min-height: 1.2em;
}
.sys-prompt { color: var(--accent); }
.caret, .rot-caret {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1.05s steps(1) infinite;
}
.rot-caret { height: .95em; width: .5em; opacity: .7; }
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

.hero-name { position: relative; }
.hero-name.decoding { color: var(--accent); }

/* rotating tagline keeps a stable height */
.hero-tagline { min-height: 2.9em; }

/* ---------- TIMELINE — living spine ---------- */
.timeline { position: relative; }
.tl-item { position: relative; opacity: 0; transform: translateY(26px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.tl-item.in { opacity: 1; transform: none; }
/* the vertical spine sits under the period column */
.tl-item::before {
  content: '';
  position: absolute;
  left: 6px; top: 2.9rem; bottom: -2.2rem;
  width: 1.5px;
  background: linear-gradient(var(--accent), transparent);
  opacity: .35;
}
.tl-item:last-child::before { display: none; }
.tl-item::after {
  content: '';
  position: absolute;
  left: 0; top: 2.5rem;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
  transition: box-shadow .5s var(--ease), background .5s var(--ease);
}
.tl-item.in::after {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent);
}
.tl-item { padding-left: 2rem; }
.tl-bullets li { opacity: 0; transform: translateX(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.tl-item.in .tl-bullets li { opacity: 1; transform: none; }
.tl-item.in .tl-bullets li:nth-child(1) { transition-delay: .12s; }
.tl-item.in .tl-bullets li:nth-child(2) { transition-delay: .20s; }
.tl-item.in .tl-bullets li:nth-child(3) { transition-delay: .28s; }
.tl-item.in .tl-bullets li:nth-child(4) { transition-delay: .36s; }
.tl-item.in .tl-bullets li:nth-child(5) { transition-delay: .44s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .tl-item { grid-template-columns: 1fr; gap: .6rem; }
  .tl-period { padding-top: 0; }
  .skills-grid, .edu-grid { grid-template-columns: 1fr; }
  .stats { gap: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
