/* Refonte visuelle — portfolio BTS SIO SISR */
:root {
  --ref-bg: #f9fafb;
  --ref-surface: #ffffff;
  --ref-ink: #334155;
  --ref-muted: #64748b;
  --ref-line: #e2e8f0;
  --ref-accent: #2d6a4f;
  --ref-accent-dark: #1f513b;
  --ref-accent-soft: #e8f1ec;
  --ref-warm: #b7794b;
  --ref-radius: 10px;
  --ref-shadow: 0 10px 28px rgba(31, 43, 39, 0.07);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

html {
  background: var(--ref-bg);
  color-scheme: light;
}

body {
  min-width: 320px;
  margin: 0;
  border: 0;
  background: var(--ref-bg);
  color: var(--ref-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-sans);
}

main {
  flex: 1;
  min-height: calc(100vh - 76px);
}

.skip-link {
  position: fixed;
  z-index: 3000;
  top: 0.75rem;
  left: 1rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-180%);
  background: var(--ref-ink);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ref-ink);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.7rem, 6vw, 5.7rem);
}

h2 {
  margin: 0;
  border: 0;
  font-size: clamp(2.15rem, 4vw, 3.65rem);
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

p {
  max-width: 68ch;
  color: var(--ref-muted);
}

.content-marker {
  display: inline-block;
  padding: 0.12rem 0.35rem;
  border: 1px solid #c2410c;
  border-radius: 4px;
  background: #fff7ed;
  color: #9a3412;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  font-weight: 700;
}

pre,
.code-block {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--ref-line);
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--ref-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre;
}

figure {
  max-width: 100%;
  margin: 2rem 0;
}

figure img,
figure iframe {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--ref-line);
  border-radius: 6px;
}

figcaption {
  margin-top: 0.65rem;
  color: var(--ref-muted);
  font-size: 0.9rem;
}

table {
  max-width: 100%;
}

th,
td {
  overflow-wrap: anywhere;
}

a {
  color: inherit;
}

.container {
  width: min(100% - 3rem, 1180px);
  padding: 0;
}

.main-content {
  margin-top: 76px;
}

.section {
  padding: clamp(4.5rem, 9vw, 8rem) 0;
  border-bottom: 1px solid var(--ref-line);
  animation: none;
}

.section-header {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 3.5rem;
}

.section-label,
.hero-label {
  margin: 0;
  color: var(--ref-accent);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.section-label::before {
  display: none;
}

.gradient-text {
  color: var(--ref-accent);
  font-family: inherit;
  font-style: normal;
  -webkit-text-fill-color: currentColor;
}

/* Navigation */
.nav-header {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  padding: 0;
  border-bottom: 1px solid var(--ref-line);
  background: rgba(245, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.nav-container {
  width: min(100% - 3rem, 1180px);
  min-height: 76px;
  margin: 0 auto;
}

.nav-brand {
  color: var(--ref-ink) !important;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  text-transform: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-btn {
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  color: var(--ref-muted);
  font-size: 0.87rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
}

.nav-btn.active::after {
  display: none;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--ref-line);
  border-radius: 6px;
  background: var(--ref-surface);
}

/* Accueil */
.hero-content {
  width: min(100% - 3rem, 1180px);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 5rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}

.hero-text {
  display: block;
  padding: 0;
  border: 0;
}

.hero-label {
  margin-bottom: 1.5rem;
}

.hero-title {
  margin: 0;
}

.hero-description {
  max-width: 58ch;
  margin: 2rem 0 0;
  font-size: 1.08rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.3rem;
}

.btn-primary,
.btn-outline {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ref-accent);
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-primary {
  background: var(--ref-accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  border-color: var(--ref-accent-dark);
  background: var(--ref-accent-dark);
}

.btn-outline {
  border-color: var(--ref-line);
  background: transparent;
  color: var(--ref-ink);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--ref-accent);
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
}

.hero-stack {
  display: flex;
  gap: 0.6rem;
  margin-top: 3.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ref-line);
  color: var(--ref-muted);
  font-size: 0.9rem;
}

.stack-label {
  color: var(--ref-ink);
  font-weight: 700;
}

.hero-image-container {
  min-height: 440px;
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background-color: #dfe9e3;
  background-image: url('/assets/img/branding/hero-infrastructure.jpg');
  background-position: center;
  background-size: cover;
  box-shadow: var(--ref-shadow);
}

.hero-image-container::after {
  right: 1rem;
  bottom: 1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ref-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Projets, formations et contenus */
.projects-grid,
.oc-grid,
.bts-objectifs-grid,
.skills-logo-grid,
.missions-grid {
  gap: 1rem;
}

.project-card,
.cert-card,
.formation-card,
.bts-intro-card,
.bts-objectif-card,
.cert-timeline-content,
.mission-card {
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
  box-shadow: none;
}

.project-card,
.cert-card,
.formation-card {
  padding: 1.5rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.project-card:hover,
.cert-card:hover,
.formation-card:hover,
.bts-objectif-card:hover,
.mission-card:hover {
  border-color: #a9c2b8;
  box-shadow: var(--ref-shadow);
  transform: translateY(-2px);
}

.project-card-header {
  margin-bottom: 1.25rem;
}

.project-icon {
  border: 0;
  background: var(--ref-accent-soft);
  border-radius: 8px;
  box-shadow: none;
}

.project-view-badge {
  border: 0;
  color: var(--ref-accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
}

.project-card-title,
.project-title,
.formation-title {
  margin-bottom: 0.65rem;
  font-size: 1.4rem;
}

.project-card-desc {
  margin-bottom: 0.75rem;
}

.project-tech {
  gap: 0.35rem;
  margin-top: 1rem;
}

.project-tech-tag,
.tech-tag {
  border: 0;
  border-radius: 4px;
  background: var(--ref-bg);
  color: var(--ref-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
}

.project-refs {
  padding-top: 0.9rem;
  border-top: 1px solid var(--ref-line);
}

.ref-tag {
  border-radius: 4px;
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
}

.skills-logo-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.skill-logo-card {
  min-height: 120px;
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
  box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.skill-logo-card:hover {
  border-color: #a9c2b8;
  background: var(--ref-accent-soft);
  box-shadow: none;
  transform: none;
}

.skill-logo-name {
  color: var(--ref-ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
}

.tech-logo {
  display: block;
  width: 44px;
  height: 44px;
}

.skill-logo-icon .tech-logo {
  width: 44px;
  height: 44px;
}

.contact-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 2rem;
  align-items: center;
  margin-top: 2.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
}

.contact-panel-label {
  margin-bottom: 0.5rem;
  color: var(--ref-accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.contact-panel-intro h3 {
  max-width: 18ch;
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.contact-panel-intro p:last-child {
  max-width: 34ch;
  margin: 0;
  color: var(--ref-muted);
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0;
}

.contact-action {
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--ref-line);
  border-radius: 8px;
  background: var(--ref-bg);
  color: var(--ref-ink);
  text-decoration: none;
}

.contact-action:hover,
.contact-action:focus-visible {
  border-color: #a9c2b8;
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
}

.contact-action-primary {
  border-color: var(--ref-accent);
  background: var(--ref-accent);
  color: #fff;
}

.contact-action-primary:hover,
.contact-action-primary:focus-visible {
  border-color: var(--ref-accent-dark);
  background: var(--ref-accent-dark);
  color: #fff;
}

.contact-action-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 6px;
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.contact-action-icon svg {
  width: 19px;
  height: 19px;
}

.contact-action-primary .contact-action-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.contact-action strong,
.contact-action small {
  display: block;
}

.contact-action strong {
  font-size: 0.9rem;
}

.contact-action small {
  margin-top: 0.25rem;
  color: var(--ref-muted);
  font-size: 0.72rem;
}

.contact-action-primary small {
  color: #e8f3ed;
}

.veille-feed,
.veille-feed-header {
  border-color: var(--ref-line);
}

.veille-live-indicator,
.veille-source.alertes,
.veille-item-date {
  color: var(--ref-accent);
}

.veille-live-dot {
  width: 8px;
  height: 8px;
  background: var(--ref-accent);
  animation: none;
}

.veille-item,
.veille-card {
  border-color: var(--ref-line);
  background: var(--ref-surface);
  box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.veille-item:hover,
.veille-card:hover {
  background: var(--ref-accent-soft);
  box-shadow: none;
  transform: none;
}

.stage-layout {
  gap: 3rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
  box-shadow: none;
}

.stage-map-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--ref-accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.stage-map-frame {
  display: block;
  width: 100%;
  height: 300px;
  min-height: 300px;
  margin-top: 0.75rem;
  border: 0;
  border-radius: 8px;
}

/* Formations Layout */
.formations-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.column-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ref-line);
}
.column-title {
  margin: 0;
  font-size: 1.25rem;
}
.cert-image-preview img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.cert-grid-pro {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cert-tree-container .project-icon svg {
  width: 44px;
  height: 44px;
}

/* OpenClassrooms Cards & Filters */
.oc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.oc-card {
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.oc-card:hover {
  border-color: #a9c2b8;
  box-shadow: var(--ref-shadow);
  transform: translateY(-2px);
}

.oc-card-image-container {
  width: 100%;
  height: 140px;
  background: #f1f5f3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--ref-line);
}

.oc-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.oc-card-content {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.oc-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ref-text);
  line-height: 1.35;
}

.oc-filter-btn {
  font-size: 0.82rem;
  padding: 0.45rem 0.95rem;
  border-radius: 20px;
  cursor: pointer;
  background: var(--ref-surface);
  border: 1px solid var(--ref-line);
  color: var(--ref-text);
  transition: all 0.15s ease;
}

.oc-filter-btn:hover {
  border-color: var(--ref-accent, #10b981);
}

.oc-filter-btn.active {
  background: var(--ref-accent, #10b981);
  color: #fff;
  border-color: var(--ref-accent, #10b981);
}

@media (max-width: 900px) {
  .formations-split-layout {
    grid-template-columns: 1fr;
  }
}

.stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 3rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
  box-shadow: none;
}

@media (max-width: 900px) {
  .stage-layout {
    grid-template-columns: 1fr;
  }
}

.stage-map-card {
  padding: 1.25rem;
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-bg);
}
.stage-info-grid {
  border-color: var(--ref-line);
}
.stage-info-label {
  color: var(--ref-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* Fix Contact SVGs explicitly */
.mission-icon svg,
.contact-title-icon svg {
  width: 28px;
  height: 28px;
}
.contact-action-icon svg {
  width: 24px;
  height: 24px;
}

/* Tableaux et modales */
.comp-table-wrapper {
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
}

.comp-table th,
.comp-table td {
  border-color: var(--ref-line);
}

.comp-table th {
  background: var(--ref-ink);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.comp-table td {
  color: var(--ref-muted);
  vertical-align: top;
}

.modal {
  background: rgba(31, 43, 39, 0.46);
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}

.modal-content {
  width: min(92%, 1100px);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius);
  background: var(--ref-surface);
  box-shadow: 0 20px 60px rgba(31, 43, 39, 0.2);
}

.modal-close {
  top: 1.25rem;
  right: 1.25rem;
  border: 1px solid var(--ref-line);
  border-radius: 6px;
  background: var(--ref-surface);
  color: var(--ref-ink);
  font-size: 0.85rem;
  text-transform: none;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
}

.project-modal-sidebar,
.project-modal-pdf {
  border-color: var(--ref-line);
  background: var(--ref-bg);
}

.pdf-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.pdf-btn:hover,
.pdf-btn.active {
  border-color: #a9c2b8;
  background: var(--ref-accent-soft);
  color: var(--ref-accent-dark);
}

.modal-evidence-note {
  border-left-color: var(--ref-accent);
  border-radius: 4px;
  background: var(--ref-accent-soft);
  color: var(--ref-muted);
}

.footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--ref-line);
  background: var(--ref-ink);
  color: #dce7e1;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

@media print {
  @page {
    margin: 16mm;
  }

  .nav-header,
  .nav-toggle,
  .hero-buttons,
  .modal,
  .skip-link {
    display: none !important;
  }

  body,
  main,
  .section {
    background: #fff !important;
    color: #000 !important;
  }

  .main-content {
    margin-top: 0;
  }

  .section {
    min-height: 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid #999;
  }

  .project-card,
  .stage-layout,
  .comp-table-wrapper,
  .cert-timeline-content {
    break-inside: avoid;
    box-shadow: none !important;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

:focus-visible {
  outline: 3px solid #d28a51;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-image-container {
    min-height: 320px;
  }

  .section-header {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2.25rem;
  }
}

@media (max-width: 768px) {
  .container,
  .hero-content,
  .nav-container {
    width: min(100% - 2rem, 1180px);
  }

  .nav-container {
    min-height: 68px;
  }

  .main-content {
    margin-top: 68px;
  }

  .contact-panel {
    grid-template-columns: 1fr;
  }

  .contact-panel-intro h3 {
    max-width: none;
  }

  .contact-buttons {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
    width: 42px;
    height: 38px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
  }

  .nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ref-ink);
  }

  .nav-links {
    position: absolute;
    top: 68px;
    right: 0;
    left: 0;
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--ref-line);
    background: var(--ref-bg);
  }

  .nav-links.is-open {
    display: block;
  }

  .nav-menu {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .nav-btn {
    display: block;
    padding: 0.8rem 0.7rem;
  }

  .hero-content {
    padding: 4rem 0;
  }

  .hero-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
  }

  .hero-stack {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-modal-content {
    width: calc(100% - 1rem);
    height: calc(100dvh - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
