/* 1. Tokens */
:root {
  color-scheme: dark;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --accent-text: #f97316;
  --bg: #17191b;
  --surface: #1d2023;
  --surface-2: #25282c;
  --surface-3: #191b1e;
  --border: #34383d;
  --border-soft: #2a2d31;
  --text: #f4efe6;
  --muted: #b6b0a8;
  --subtle: #817c75;
  --header: rgba(23, 25, 27, 0.9);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --container: 1200px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3eee5;
  --surface: #fbf7ef;
  --surface-2: #eee7dc;
  --surface-3: #f7f1e8;
  --border: #d7cfc3;
  --border-soft: #e5ddd2;
  --text: #252321;
  --muted: #69635d;
  --subtle: #8f887f;
  --header: rgba(243, 238, 229, 0.92);
  --shadow: 0 18px 55px rgba(45, 37, 30, 0.1);
  --accent-text: #c2410c;
}

/* 2. Reset et base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  transition:
    background 0.2s,
    color 0.2s;
}
body.lightbox-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}
a {
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
button {
  color: inherit;
  font: inherit;
}

/* Robustesse de mise en page : les enfants flex/grid peuvent réellement rétrécir */
main,
section,
article,
.container,
.hero-copy,
.hero-visual,
.project-copy,
.skill-groups,
.skill-group,
.tech-grid,
.tech,
.journey-grid,
.interest-grid,
.interest-grid article,
.contact-card,
.contact-links,
.footer-inner,
.footer-links {
  min-width: 0;
  max-width: 100%;
}

/* 3. Layout */
.container {
  width: min(var(--container), calc(100% - 64px));
  margin-inline: auto;
}
.section {
  padding: 88px 0;
}
.section-heading {
  margin-bottom: 36px;
}
.projects-layout {
  display: grid;
  gap: 18px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.journey-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 64px;
}

/* 4. Composants */
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 0.18s,
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.button svg {
  width: 18px;
}
.button-primary {
  background: var(--orange-500);
  color: #1a0c04;
}
.button-primary:hover {
  background: var(--orange-400);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.18);
}
.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.button-secondary:hover {
  border-color: rgba(249, 115, 22, 0.58);
  background: var(--surface-2);
}
.section-kicker,
.project-type {
  display: inline-flex;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-heading h2,
.journey-grid h2,
.contact-card h2,
.legal-hero h1 {
  margin-top: 7px;
  font:
    800 clamp(32px, 4vw, 46px) / 1.15 Montserrat,
    Arial,
    sans-serif;
  letter-spacing: -0.035em;
}
.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-pills span {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* 5. Sections */
.site-header {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  border-bottom: 1px solid var(--border-soft);
  background: var(--header);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.nav-wrap {
  position: relative;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 64px);
}
.nav-primary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
}
.main-nav {
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(16px, 2vw, 28px);
}
.main-nav a {
  position: relative;
  display: inline-flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding-inline: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s;
}
.main-nav a::after {
  position: absolute;
  right: 2px;
  bottom: 13px;
  left: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--orange-500);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease-out;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
}
.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}
.nav-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.legal-nav-wrap {
  display: flex;
  justify-content: center;
}
.legal-nav-wrap .nav-actions {
  justify-self: auto;
}
.theme-toggle,
.menu-toggle,
.language-toggle {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.18s,
    color 0.18s;
}
.theme-toggle:hover,
.menu-toggle:hover,
.language-toggle:hover {
  border-color: rgba(249, 115, 22, 0.5);
  color: var(--accent-text);
}
.theme-toggle svg,
.menu-toggle svg {
  width: 18px;
}
.language-toggle {
  flex: 0 0 46px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}
.nav-cv {
  height: 46px;
  white-space: nowrap;
}
.theme-icon-sun {
  display: none;
}
html[data-theme="light"] .theme-icon-sun {
  display: block;
}
html[data-theme="light"] .theme-icon-moon {
  display: none;
}
.menu-toggle {
  display: none;
}

.hero {
  padding-top: 128px;
  padding-bottom: 64px;
}
.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: 72px;
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: none;
}
.hello {
  color: var(--muted);
  font-size: 18px;
}
.hero h1 {
  max-width: 760px;
  font:
    800 clamp(46px, 5.3vw, 72px) / 1.03 Montserrat,
    Arial,
    sans-serif;
  letter-spacing: -0.045em;
}
.hero h1 span {
  color: var(--accent-text);
}
.hero-role {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 600;
}
.hero-text {
  max-width: 720px;
  margin-top: 10px;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.social-links {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.social-links a {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s;
}
.social-links a:hover {
  border-color: rgba(249, 115, 22, 0.5);
  background: var(--surface-2);
  color: var(--accent-text);
}
.social-links svg {
  width: 18px;
}
.hero-visual {
  display: flex;
  justify-content: center;
}
.portrait-frame {
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.portrait-frame picture,
.portrait-frame img {
  width: 100%;
  height: 100%;
}
.portrait-frame img {
  object-fit: cover;
  object-position: center top;
}

.featured-project {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 34px;
  padding: 30px;
  border: 1px solid rgba(249, 115, 22, 0.42);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.featured-project h3,
.project-card h3 {
  margin-top: 5px;
  font:
    800 25px Montserrat,
    Arial,
    sans-serif;
}
.featured-project-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.project-star {
  color: var(--accent-text);
  font-size: 15px;
  line-height: 1;
}
.project-copy > p {
  margin: 14px 0;
  color: var(--muted);
}
.feature-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  list-style: none;
}
.feature-list li {
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.feature-list svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--accent-text);
}
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.project-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s;
}
.project-card:hover {
  border-color: rgba(249, 115, 22, 0.58);
}
.project-card > p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.project-image {
  position: relative;
  aspect-ratio: 1919 / 910;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: #0d1118;
  cursor: zoom-in;
}
.featured-slider {
  align-self: center;
  margin-bottom: 0;
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
}
.project-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.project-image img.active {
  opacity: 1;
}
.slider button {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(7, 9, 11, 0.82);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
}
.slider-prev {
  left: 8px;
}
.slider-next {
  right: 8px;
}
.slider svg {
  width: 17px;
}
.slider-counter {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(7, 9, 11, 0.8);
  color: #f4efe6;
  font-size: 12px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.text-link svg {
  width: 15px;
}

.skill-group,
.interest-grid article,
.legal-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s;
}
.skill-group {
  display: grid;
  height: 100%;
  grid-template-rows: auto 1fr;
}
.skill-group:hover,
.interest-grid article:hover {
  border-color: rgba(249, 115, 22, 0.58);
}
.skill-group h3 {
  margin-bottom: 18px;
  font:
    700 18px Montserrat,
    Arial,
    sans-serif;
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  grid-auto-rows: minmax(104px, auto);
  align-content: center;
  gap: 12px;
}
.tech {
  display: grid;
  min-width: 0;
  min-height: 104px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #191b1e;
  text-align: center;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.tech:hover {
  border-color: rgba(249, 115, 22, 0.42);
  background: #25282c;
}
.tech i,
.tech .colored,
.tech .devicon-github-original.colored,
.tech .devicon-symfony-original.colored {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  font-size: 38px;
  line-height: 1;
  filter: brightness(0) invert(1);
}
.tech .lucide,
.tech-concept svg {
  width: 38px;
  height: 38px;
  color: #fff !important;
  stroke-width: 1.8;
}
.tech-logo {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.tech-logo-wide {
  width: 64px;
  height: 30px;
}
.tech-symbol {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tech-symbol text {
  fill: currentColor;
  stroke: none;
  font:
    800 7px Montserrat,
    Arial,
    sans-serif;
  text-anchor: middle;
}
.tech-symbol text[x="20"] {
  font-size: 6px;
}
.tech-symbol .solid {
  fill: currentColor;
  stroke: currentColor;
}
.tech span {
  display: block;
  max-width: 100%;
  color: #b6b0a8;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
#journey {
  padding-bottom: 56px;
}
.timeline {
  margin: 34px 0 0 14px;
  padding-left: 28px;
  border-left: 1px solid rgba(249, 115, 22, 0.5);
}
.timeline-item {
  position: relative;
  padding: 0 0 38px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  top: 5px;
  left: -35px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.08);
}
.timeline-item small {
  color: var(--muted);
}
.timeline-item h3 {
  margin: 4px 0;
  font:
    700 21px Montserrat,
    Arial,
    sans-serif;
}
.timeline-item p {
  color: var(--muted);
  font-size: 14px;
}
.timeline-secondary {
  margin-top: 8px;
  color: var(--subtle) !important;
}
.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}
.interest-title {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 10px;
}
.interest-title svg {
  width: 25px;
  flex: 0 0 24px;
  color: var(--accent-text);
}
.chess-icon {
  width: 24px;
  flex: 0 0 24px;
  color: var(--accent-text);
  font-size: 28px;
  line-height: 1;
}
.interest-title h3 {
  margin: 0;
  font:
    700 18px Montserrat,
    Arial,
    sans-serif;
}
.interest-grid article > p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}
.interest-grid .interest-metric {
  display: block;
  margin-top: 16px;
  color: var(--accent-text);
  font-size: 12px;
}

#contact {
  padding-top: 48px;
}
.contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.contact-card > div > p {
  margin-top: 15px;
  color: var(--muted);
}
.contact-links {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.contact-links a {
  display: grid;
  min-width: 0;
  min-height: 56px;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.18s;
}
.contact-links a:hover {
  border-color: rgba(249, 115, 22, 0.58);
}
.contact-links a > svg:first-child {
  width: 20px;
  justify-self: center;
  color: var(--accent-text);
}
.contact-links a > svg:last-child {
  width: 20px;
  color: var(--accent-text);
}
.contact-links span {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.contact-links small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  color: var(--subtle);
  font-size: 12px;
}
.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}
.footer-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.18s;
}
.footer-links a:hover {
  color: var(--accent-text);
}
.footer-links a + a::before {
  margin-inline: 10px;
  color: var(--subtle);
  content: "-";
}
.footer-bottom {
  width: 100%;
  margin-top: 30px;
  border-top: 1px solid var(--border-soft);
  color: var(--subtle);
  font-size: 12px;
}
.footer-bottom-inner {
  padding: 18px 0 22px;
  text-align: center;
}
.scroll-top {
  position: fixed;
  z-index: 999;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.25);
  color: #1a0c04;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top:hover {
  background: var(--orange-400);
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.38);
}
.scroll-top svg {
  width: 21px;
}
body.lightbox-open .scroll-top {
  display: none;
}

.lightbox {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  place-items: center;
  padding: 24px 32px;
  background: rgba(10, 11, 12, 0.95);
}
.lightbox.open {
  display: grid;
}
.lightbox-stage {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 12px;
}
.lightbox-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1200px, 82vw);
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: #111;
}
.lightbox-counter {
  margin: 0;
  color: #d6d0c8;
  font-size: 13px;
  text-align: center;
}
.lightbox-nav,
.lightbox-close {
  display: grid;
  place-items: center;
  border: 1px solid #444;
  background: #17191b;
  color: #f4efe6;
  cursor: pointer;
  transition:
    border-color 0.18s,
    color 0.18s;
}
.lightbox-nav {
  position: static;
  width: 48px;
  height: 48px;
  align-self: center;
  border-radius: 50%;
}
.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.lightbox-nav:hover,
.lightbox-close:hover {
  border-color: var(--orange-500);
  color: var(--accent-text);
}
.lightbox-nav[hidden] {
  display: none;
}
.lightbox-nav svg,
.lightbox-close svg {
  width: 20px;
  height: 20px;
}

.legal-main {
  min-height: auto;
  padding-top: 120px;
}
.legal-hero {
  padding: 36px 0 26px;
}
.legal-hero p {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
}
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 80px;
}
.legal-card h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font:
    700 19px Montserrat,
    Arial,
    sans-serif;
}
.legal-footer {
  padding-top: 0;
}
.legal-footer .footer-bottom {
  margin-top: 0;
  border-top: 0;
}
.legal-card h2 svg {
  width: 20px;
  color: var(--accent-text);
}
.legal-card p,
.legal-card li {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.legal-card ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
}
.legal-card a {
  color: var(--accent-text);
}
