/* H@CKERBOY — shared visual system for every route.
   Unifies header, typography, tokens, controls, and mobile drawer across all 22 pages. */
:root {
  --hb-page-bg: #0b0c0f;
  --hb-page-surface: #16181d;
  --hb-page-raised: #1e2128;
  --hb-page-text: #f5f5f7;
  --hb-page-muted: #aeaeb2;
  --hb-page-subtle: #94949a;
  --hb-page-line: rgba(255, 255, 255, 0.10);
  --hb-page-blue: #52a8ff;
  --hb-page-blue-strong: #0066cc;
  --hb-page-blue-hover: #005bb5;
  --hb-page-radius: 14px;
  --hb-page-width: 1120px;
  --hb-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="light"] {
  --hb-page-bg: #fbfbfd;
  --hb-page-surface: #ffffff;
  --hb-page-raised: #f2f2f7;
  --hb-page-text: #1d1d1f;
  --hb-page-muted: #515154;
  --hb-page-subtle: #5e5e63;
  --hb-page-line: rgba(0, 0, 0, 0.09);
  --hb-page-blue: #0066cc;
  --hb-page-blue-strong: #0066cc;
  --hb-page-blue-hover: #004999;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
body.site-redesign {
  min-height: 100vh;
  background: var(--hb-page-bg);
  color: var(--hb-page-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.site-redesign :where(h1, h2, h3, h4, h5, h6) {
  color: var(--hb-page-text);
  font-family: inherit;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
body.site-redesign :where(p, li, dd, figcaption) {
  color: var(--hb-page-muted);
}
body.site-redesign :where(a) {
  text-underline-offset: 4px;
}
body.site-redesign :where(button, input, select, textarea) {
  font: inherit;
}
body.site-redesign :where(img, video, iframe) {
  max-width: 100%;
}
body.site-redesign :where(.container, .shell, .section-shell) {
  width: min(var(--hb-page-width), calc(100% - 48px));
  margin-inline: auto;
}
body.site-redesign :where(.site-header) {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: 68px;
  border-bottom: 1px solid var(--hb-page-line);
  background: color-mix(in srgb, var(--hb-page-bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
body.site-redesign :where(.header-inner) {
  width: min(var(--hb-page-width), calc(100% - 48px));
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
body.site-redesign :where(.brand) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
}
body.site-redesign :where(.brand img) {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 8px;
}
body.site-redesign :where(.brand strong) {
  color: var(--hb-page-text);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}
body.site-redesign :where(.brand small) {
  display: block;
  color: var(--hb-page-subtle);
  font-size: 0.69rem;
  letter-spacing: 0.02em;
}
body.site-redesign :where(.site-nav) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.5vw, 20px);
  margin-left: auto;
}
body.site-redesign :where(.site-nav a) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: var(--hb-page-muted);
  font-size: 0.8125rem;
  font-weight: 540;
  text-decoration: none;
  transition: color 200ms var(--hb-ease-out);
}
body.site-redesign :where(.site-nav a:hover, .site-nav a[aria-current="page"]) {
  color: var(--hb-page-text);
}
body.site-redesign :where(.theme-toggle, .menu-toggle, .menu-button, .icon-button) {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--hb-page-line);
  border-radius: 999px;
  background: transparent;
  color: var(--hb-page-text);
  box-shadow: none;
}
body.site-redesign :where(.theme-toggle:hover, .menu-toggle:hover, .menu-button:hover, .icon-button:hover) {
  border-color: var(--hb-page-blue);
  background: var(--hb-page-raised);
}
body.site-redesign :where(.button, .btn, .button-primary, .button-secondary, .button-ghost, .header-cta) {
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: none;
  transition: color 200ms var(--hb-ease-out), background-color 200ms var(--hb-ease-out), border-color 200ms var(--hb-ease-out), transform 120ms var(--hb-ease-out);
}
body.site-redesign :where(.button-primary, .btn-primary, .header-cta) {
  border-color: var(--hb-page-blue-strong);
  background: var(--hb-page-blue-strong);
  color: #ffffff;
}
body.site-redesign :where(.button-primary:hover, .btn-primary:hover, .header-cta:hover) {
  border-color: var(--hb-page-blue-hover);
  background: var(--hb-page-blue-hover);
  color: #ffffff;
}
body.site-redesign :where(.button-secondary, .button-ghost, .btn-secondary) {
  border: 1px solid var(--hb-page-line);
  background: transparent;
  color: var(--hb-page-text);
}
body.site-redesign :where(.button-secondary:hover, .button-ghost:hover, .btn-secondary:hover) {
  border-color: var(--hb-page-blue);
  background: var(--hb-page-raised);
}
body.site-redesign :where(.page-intro, .page-hero, .case-hero, .article-header, .cv-hero) {
  width: min(var(--hb-page-width), calc(100% - 48px));
  margin-inline: auto;
  padding-block: clamp(48px, 7vw, 84px) 32px;
}
body.site-redesign :where(.page-intro h1, .page-hero h1, .case-hero h1, .article-header h1, .cv-hero h1) {
  max-width: 18ch;
  margin: 8px 0 16px;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.05em;
}
body.site-redesign :where(.page-intro > p, .page-hero > p, .case-hero > p, .article-header > p, .cv-hero > p) {
  max-width: 65ch;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.65;
}
body.site-redesign :where(main > section:not(.hero-studio), .article-page, .case-study-page) {
  scroll-margin-top: 84px;
}
body.site-redesign :where(.section-shell, .section-container, .article-page, .case-study-page) {
  max-width: var(--hb-page-width);
  margin-inline: auto;
}
body.site-redesign :where(.work-section-heading, .section-heading, .section-header) {
  margin-bottom: 28px;
}
body.site-redesign :where(.work-section-heading h2, .section-heading h2, .section-header h2) {
  font-size: clamp(1.85rem, 3.8vw, 2.85rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
body.site-redesign :where(.card, .project-card, .skill-card, .proof-card, .certification-card, .certificate-card, .lab-module, .post-card, .case-aside-card, .case-section, .work-product, .work-feature) {
  border-color: var(--hb-page-line);
  border-radius: var(--hb-page-radius);
}
body.site-redesign :where(.card, .project-card, .skill-card, .proof-card, .certification-card, .certificate-card, .lab-module, .post-card, .case-aside-card, .work-product) {
  background: var(--hb-page-surface);
}
body.site-redesign :where(input, select, textarea) {
  border: 1px solid var(--hb-page-line);
  border-radius: 8px;
  background: var(--hb-page-surface);
  color: var(--hb-page-text);
}
body.site-redesign :where(input:focus, select:focus, textarea:focus) {
  border-color: var(--hb-page-blue);
  outline: 2px solid color-mix(in srgb, var(--hb-page-blue) 22%, transparent);
  outline-offset: 1px;
}
body.site-redesign :where(.site-footer) {
  margin-top: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--hb-page-line);
  background: var(--hb-page-bg);
}
body.site-redesign :where(.footer-inner) {
  width: min(var(--hb-page-width), calc(100% - 48px));
  margin-inline: auto;
  padding-block: 24px;
}
body.site-redesign :where(.footer-nav) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
body.site-redesign :where(.footer-nav a) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hb-page-muted);
  font-size: 0.82rem;
  text-decoration: none;
}
body.site-redesign :where(.footer-nav a:hover) {
  color: var(--hb-page-text);
}
body.site-redesign :focus-visible {
  outline: 2px solid var(--hb-page-blue);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  body.site-redesign :where(.site-nav) {
    gap: 12px;
  }
  body.site-redesign :where(.site-nav a) {
    font-size: 0.78rem;
  }
}

@media (max-width: 980px) {
  body.site-redesign :where(.container, .shell, .section-shell, .header-inner, .footer-inner, .page-intro, .page-hero, .case-hero, .article-header, .cv-hero) {
    width: min(100% - 32px, var(--hb-page-width));
  }
  body.site-redesign :where(.site-header, .header-inner) {
    min-height: 60px;
  }
  body.site-redesign .site-header .site-nav {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 16px !important;
    left: 16px !important;
    z-index: 120 !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px 14px;
    max-height: min(72dvh, 520px);
    overflow-y: auto;
    border: 1px solid var(--hb-page-line);
    border-radius: 14px;
    background: var(--hb-page-surface);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.24);
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
    transition: opacity 280ms var(--hb-ease-out), transform 280ms var(--hb-ease-out), visibility 280ms !important;
  }
  body.site-redesign .site-header .site-nav.is-open,
  body.site-redesign .site-header .site-nav[data-open="true"] {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }
  body.site-redesign .site-header .site-nav a {
    min-height: 44px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--hb-page-line);
    font-size: 0.9rem;
  }
  body.site-redesign .site-header .site-nav a:last-child {
    border-bottom: 0;
  }
  body.site-redesign .site-header .site-nav a[aria-current="page"]::after {
    display: none;
  }
  body.site-redesign :where(.page-intro, .page-hero, .case-hero, .article-header, .cv-hero) {
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body.site-redesign *,
  body.site-redesign *::before,
  body.site-redesign *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Thème sombre permanent : le contrôle de bascule est retiré sur toutes les pages. */
:root { color-scheme: dark !important; }
#theme-toggle, .theme-toggle { display: none !important; }


/* DEATH NOTE — visual direction globale : papier noir, encre et rouge carmin. */
:root,
:root[data-theme="dark"],
:root[data-theme="light"] {
  color-scheme: dark !important;
  --bg: #080707 !important;
  --bg-soft: rgba(13, 10, 10, .88) !important;
  --surface: rgba(17, 13, 13, .88) !important;
  --surface-2: rgba(25, 17, 17, .9) !important;
  --surface-raised: rgba(34, 19, 20, .94) !important;
  --text: #f1ece8 !important;
  --muted: #b8aaa5 !important;
  --subtle: #897a76 !important;
  --line: rgba(224, 205, 195, .13) !important;
  --line-strong: rgba(190, 40, 48, .38) !important;
  --accent: #c32632 !important;
  --accent-strong: #941b25 !important;
  --hb-page-bg: #080707 !important;
  --hb-page-surface: rgba(17, 13, 13, .88) !important;
  --hb-page-raised: rgba(34, 19, 20, .94) !important;
  --hb-page-text: #f1ece8 !important;
  --hb-page-muted: #b8aaa5 !important;
  --hb-page-subtle: #897a76 !important;
  --hb-page-line: rgba(224, 205, 195, .13) !important;
  --hb-page-blue: #d23a43 !important;
  --hb-page-blue-strong: #a51e29 !important;
  --hb-page-blue-hover: #c32632 !important;
}

/* L'image de fond reste présente pendant toute la navigation et le défilement. */
html, body.site-redesign {
  min-height: 100%;
  background: #080707 !important;
}
body.site-redesign {
  position: relative;
  isolation: isolate;
  background-image:
    linear-gradient(180deg, rgba(5, 4, 4, .78) 0%, rgba(7, 5, 5, .84) 48%, rgba(5, 4, 4, .94) 100%),
    url("../images/background.jpeg") !important;
  background-position: center top, center center !important;
  background-repeat: no-repeat, no-repeat !important;
  background-size: cover, cover !important;
  background-attachment: fixed, fixed !important;
}
body.site-redesign::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 18, 25, .16), transparent 58%),
    linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 24%, transparent 76%, rgba(0, 0, 0, .18));
}
body.site-redesign :is(main, .site-footer) {
  background: transparent !important;
}
body.site-redesign :is(.site-header, .site-footer) {
  background: rgba(7, 6, 6, .78) !important;
  border-color: rgba(190, 40, 48, .24) !important;
  backdrop-filter: blur(18px) saturate(75%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(75%) !important;
}
body.site-redesign :is(.work-feature, .work-product, .project-card, .post-card, .skill-card, .proof-card, .certification-card, .certificate-card, .lab-module, .case-aside-card, .case-section, .directory-card, .learning-item, .guided-lab, .contact-page-card, .contact-panel, .about-facts, .hb-gh-stat) {
  background: rgba(12, 9, 9, .78) !important;
  border-color: rgba(224, 205, 195, .15) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.site-redesign :is(h1, h2, h3, h4, .brand strong, .site-nav a[aria-current="page"]) {
  color: #f5eeea !important;
}
body.site-redesign :is(.section-kicker, .work-type, .award-mark, .site-nav a:hover, .site-map-links a:hover strong, .notes-list a > span, .case-kicker a, .project-meta span:first-child) {
  color: #d0444d !important;
}
body.site-redesign :is(.button-primary, .btn-primary, .complete-lesson, .header-cta) {
  color: #fff !important;
  background: linear-gradient(145deg, #bd2934, #79131c) !important;
  border-color: #c13a43 !important;
  box-shadow: 0 8px 26px rgba(151, 20, 31, .24) !important;
}
body.site-redesign :is(a:hover, .work-text-link, .notes-more, .project-links a, .text-link) {
  text-decoration-color: rgba(211, 55, 65, .7);
}
body.site-redesign .hero-studio-portrait {
  border: 1px solid rgba(195, 38, 50, .55);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .48), 0 0 42px rgba(148, 27, 37, .13);
}
body.site-redesign .hero-studio-portrait figcaption {
  background: rgba(8, 6, 6, .82);
  border-top: 1px solid rgba(195, 38, 50, .28);
}
body.site-redesign :is(.site-map-section, .tools-strip, .notes-section, .work-section, .hb-gh) {
  background: transparent !important;
}
body.site-redesign .site-nav a[aria-current="page"] {
  color: #f5eeea !important;
  border-bottom: 1px solid #b92a35;
}
body.site-redesign ::selection {
  color: #fff;
  background: rgba(174, 29, 40, .72);
}
@media (max-width: 980px) {
  body.site-redesign .site-header .site-nav {
    background: rgba(9, 7, 7, .97) !important;
    border-color: rgba(190, 40, 48, .32) !important;
  }
}
@media (max-width: 700px) {
  body.site-redesign {
    background-attachment: scroll, scroll !important;
    background-position: center top, 54% top !important;
  }
}
