/* =========================================================
   Nicolas Tuor — Style global
   Fichier : public/style.css
   ========================================================= */

/* -----------------------------
   Reset / Base
--------------------------------*/
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", "Liberation Sans", "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
}

/* -----------------------------
   Thèmes
--------------------------------*/
:root {
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);

  /* Couleurs par défaut (fallback) */
  --bg: #0b1421;
  --surface: rgba(255,255,255,.04);
  --card: rgba(255,255,255,.045);
  --border: rgba(255,255,255,.08);
  --text: #eaf2ff;
  --muted: #a6b3c9;
  --accent: #26b3f0;
  --accent-2: #6ce1ff;
  --link: #70d6ff;
}

html[data-theme="dark"] {
  --bg: radial-gradient(1200px 800px at 15% -10%, #123155 0%, transparent 65%),
        radial-gradient(800px 600px at 90% -20%, #0a2442 0%, transparent 55%),
        #0b1421;
  --surface: rgba(255,255,255,.04);
  --card: rgba(255,255,255,.045);
  --border: rgba(255,255,255,.09);
  --text: #eaf2ff;
  --muted: #9fb0c8;
  --accent: #29b6f6;
  --accent-2: #89e3ff;
  --link: #80e8ff;
}

html[data-theme="light"] {
  --bg: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
  --surface: #ffffff;
  --card: #ffffff;
  --border: rgba(0,0,0,.10);
  --text: #0e1726;
  --muted: #4c5a71;
  --accent: #1769aa;
  --accent-2: #2196f3;
  --link: #0d6efd;
}

/* -----------------------------
   Liens / Textes utilitaires
--------------------------------*/
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.title {
  font-size: clamp(1.8rem, 2.5vw + 1rem, 3rem);
  letter-spacing: .2px;
  margin: 8px 0 6px;
}
.lead { color: var(--muted); margin: 8px 0 16px; }
.h3 { font-size: 1.35rem; margin: 0 0 6px; }

kbd {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}

/* -----------------------------
   Layout / Container
--------------------------------*/
.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 14px 10px;
}

.section { padding: 10px 0 24px; }

.row {
  display: flex;
  align-items: center;
}
.row.gap { gap: 12px; flex-wrap: wrap; }

.stack { display: grid; gap: 12px; }

/* Séparateur léger */
.soft {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 26px 0 18px;
}

/* -----------------------------
   Navigation
--------------------------------*/
.nav {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(140%) blur(8px);
  background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.10));
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-badge {
  width: 36px; height: 36px; border-radius: 99px;
  display: grid; place-items: center;
  font-weight: 800;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #04121e;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.brand-text { font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-links a { color: var(--text); opacity: .92; }
.nav-links a:hover { opacity: 1; }

/* -----------------------------
   Boutons
--------------------------------*/
.btn {
  --btn-bg: var(--surface);
  --btn-bd: var(--border);
  --btn-fg: var(--text);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  --btn-bg: linear-gradient(180deg, var(--accent-2), var(--accent));
  --btn-bd: transparent;
  --btn-fg: #07121b;
  font-weight: 700;
}

.btn.linkish {
  --btn-bg: transparent;
  --btn-bd: var(--border);
  box-shadow: none;
}

.btn.chip {
  --btn-bg: rgba(255,255,255,.06);
  --btn-bd: rgba(255,255,255,.10);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .92rem;
}

/* Spinner pour .is-busy */
.btn.is-busy {
  position: relative;
  pointer-events: none;
}
.btn.is-busy::after {
  content: "";
  width: 16px; height: 16px;
  border-radius: 99px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: transparent;
  display: inline-block;
  animation: spin 720ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -----------------------------
   Formulaires
--------------------------------*/
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}
input::placeholder, textarea::placeholder { color: rgba(175,190,210,.75); }
textarea { resize: vertical; }

label { color: var(--muted); font-size: .95rem; display: grid; gap: 6px; }
.select { min-width: 200px; }

/* -----------------------------
   Cartes / panneaux
--------------------------------*/
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 16px; }

/* PDF */
.pdf-frame { width: 100%; height: min(80vh, 1000px); border: 0; }

/* Zone output (ex: feedback IA) */
.output {
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 42px;
}

/* -----------------------------
   Grilles utilitaires
--------------------------------*/
.grid {
  display: grid;
  gap: 12px;
}

/* -----------------------------
   Flip-cards (recto/verso)
--------------------------------*/
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.card3d {
  position: relative;
  height: 180px;
  perspective: 1000px;
  outline: none;
  cursor: pointer;
}
.card3d .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 420ms ease;
  transform-style: preserve-3d;
}
.card3d .face {
  position: absolute;
  inset: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: grid;
  place-items: center;
  text-align: center;
  backface-visibility: hidden;
}
.card3d .front .emoji {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 6px;
}
.card3d .front .card-title {
  font-weight: 800;
  letter-spacing: .2px;
}
.card3d .back {
  padding: 16px 18px;
  text-align: left;
  transform: rotateY(180deg);
}
.card3d .bullets {
  margin: 0;
  padding-left: 18px;
  line-height: 1.35;
}
.card3d.is-flipped .inner {
  transform: rotateY(180deg);
}
.card3d:focus-visible {
  box-shadow: 0 0 0 3px var(--accent);
  border-radius: 18px;
}

/* -----------------------------
   Timeline (CV Story)
--------------------------------*/
.timeline {
  list-style: none;
  margin: 0;
  padding: 10px 0 0 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 0;
}
.tl-dot {
  width: 12px; height: 12px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,182,246,.25);
  margin: 2px 0 0 9px;
}
.tl-body { padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.tl-when { color: var(--muted); font-size: .95rem; }
.tl-what { font-weight: 700; }
.tl-where { color: var(--muted); }

/* -----------------------------
   Footer
--------------------------------*/
.footer .foot { color: var(--muted); }

/* -----------------------------
   Utilitaires / Responsif
--------------------------------*/
.hidden { display: none !important; }
.center { text-align: center; }
.right  { text-align: right; }

@media (max-width: 960px) {
  .nav .container { flex-wrap: wrap; }
  .nav-links { width: 100%; justify-content: flex-end; }
}

@media (max-width: 640px) {
  .title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  .nav-links { gap: 8px; }
  .btn { padding: 9px 14px; }
  .card3d { height: 170px; }
}

/* -----------------------------
   Accent focus pour inputs
--------------------------------*/
input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
/* Chat input emphasis */
.chat .row input#q {
  outline: 2px solid color-mix(in oklab, var(--brand), transparent 70%);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 85%);
}
.chat .row input#q::placeholder { opacity: .8; }

