/* ============================================================
   Tristan Faucher — portfolio
   Site statique, sans dépendance ni build.
   ============================================================ */

:root {
  --bg: #0b1120;
  --bg-soft: #111c31;
  --bg-card: #121e33;
  --line: #23334d;
  --text: #e8eefb;
  --muted: #93a4c0;
  --accent: #38bdf8;
  --accent-2: #fbbf24;
  --radius: 14px;
  --max: 1140px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #04101f;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.9rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover { color: var(--text); }

.lang-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-toggle:hover { border-color: var(--accent); color: var(--text); }
.lang-toggle .lang-current { color: var(--accent); }
.lang-sep { opacity: 0.4; margin: 0 2px; }

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

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 11vw, 132px) clamp(16px, 4vw, 40px) clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
}

.hero-glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.18), transparent 62%);
  filter: blur(10px);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(35, 51, 77, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 51, 77, 0.5) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 30% 20%, black, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 30% 20%, black, transparent 72%);
  opacity: 0.5;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 4rem);
  max-width: 22ch;
  font-weight: 650;
}

.lead {
  max-width: 62ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-2px); border-color: var(--accent); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2f8fe0);
  border-color: transparent;
  color: #04101f;
}

.btn-primary:hover { border-color: transparent; }

.btn svg { width: 16px; height: 16px; fill: currentColor; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 5vw, 56px);
  margin: 46px 0 0;
  padding: 0;
  list-style: none;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-stats strong {
  font-family: var(--mono);
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.03em;
}

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

.section {
  padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 40px);
}

.section-alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: var(--max);
  margin: 0 auto 34px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 640;
}

.section-head p {
  max-width: 68ch;
  margin: 12px 0 0;
  color: var(--muted);
}

/* ---------------- galerie ---------------- */

.bench {
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(8px, 2vw, 20px);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: var(--max);
  margin: 0 auto;
}

.gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery figure:hover img { transform: scale(1.04); }

.gallery figcaption {
  padding: 10px 13px 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
}

/* ---------------- filters ---------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--max);
  margin: 0 auto 26px;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { color: var(--text); border-color: var(--accent); }

.chip.is-active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------- cards ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  max-width: var(--max);
  margin: 0 auto;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-card), #0f1a2c);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 18px 40px -24px rgba(56, 189, 248, 0.5);
}

.card.is-hidden { display: none; }

.card-top { margin-bottom: 10px; }

.tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card h3 {
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 16px;
  padding: 0;
  list-style: none;
}

.stack li {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.card-link {
  align-self: flex-start;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 550;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.card-link:hover { border-color: var(--accent); }

/* ---------------- skills ---------------- */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
  max-width: var(--max);
  margin: 0 auto;
}

.skill-col h3 {
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.skill-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-col li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.bar {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 4px;
  margin-left: auto;
  border-radius: 999px;
  background: #1b2a42;
  overflow: hidden;
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2563eb);
}

/* ---------------- timeline ---------------- */

.timeline {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  padding: 0 0 32px 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.timeline .when {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 2px;
}

.timeline h3 { font-size: 1.05rem; margin-bottom: 6px; }

.timeline p { margin: 0; color: var(--muted); font-size: 0.92rem; max-width: 64ch; }

/* ---------------- contact ---------------- */

.contact {
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12), transparent 58%),
    var(--bg);
}

.contact h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }

.contact p {
  max-width: 58ch;
  margin: 14px auto 0;
  color: var(--muted);
}

.contact .hero-actions { justify-content: center; }

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

.footer {
  padding: 26px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer p { margin: 4px 0; }

.footer-note { opacity: 0.65; }

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

@media (max-width: 820px) {
  .nav { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
}

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