@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --radius: 16px;
  --block-gap: 24px;
  letter-spacing: -5%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  margin: 0;
  padding-left: 16px;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.page {
  padding: 32px 0 64px;
}

.hero,
.project-header {
  margin-bottom: 28px;
}

.hero h1,
.project-header h1 {
  margin-bottom: 8px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 8px 30px rgba(31, 41, 55, 0.06);
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.secondary {
  background: #eef2ff;
  color: var(--primary);
}

.button.secondary:hover {
  background: #dbeafe;
}

.button.danger {
  background: var(--danger);
}

.button.danger:hover {
  background: var(--danger-dark);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form label {
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: white;
}

textarea {
  resize: vertical;
}

small,
.muted {
  color: var(--muted);
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.flash.error {
  background: #fee2e2;
  border-color: #fecaca;
}

.flash.success {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.error-page {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: start;
  gap: 12px;
}

.error-code {
  margin: 0;
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
}

.error-page h1 {
  margin: 0;
}

.error-page p {
  max-width: 560px;
}

.error-actions {
  margin-top: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions form {
  margin: 0;
}

.content-block img {
  max-width: 100%;
  height: auto;
  border-radius: var(--media-radius, 12px);
  display: block;
}

.content-block video {
  width: 100%;
  max-width: 100%;
  border-radius: var(--media-radius, 12px);
  display: block;
}

.text-content {
  white-space: normal;
  overflow-wrap: anywhere;
}

.text-content ul {
  margin: 0;
  padding-left: 0;
}

.text-content li {
  margin: 0;
}

.text-content {
  margin: 0;
  line-height: 112%;
}

.is-bold {
  font-weight: 800;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.checkbox-label input {
  width: auto;
}

/* Alignement interne du contenu des blocs.
   Le champ layout doit maintenant contenir : left, center ou right. */
.layout-left {
  text-align: left;
}

.layout-center {
  text-align: center;
}

.layout-right {
  text-align: right;
}

.layout-left img,
.layout-left video {
  margin-left: 0;
  margin-right: auto;
}

.layout-center img,
.layout-center video {
  margin-left: auto;
  margin-right: auto;
}

.layout-right img,
.layout-right video {
  margin-left: auto;
  margin-right: 0;
}

/* Affichage public : les blocs se fondent dans la page, sans contours ni cartes. */
.content-blocks,
.nested-content-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--block-gap);
  align-items: flex-start;
  width: 100%;
}

.content-block {
  --block-width: 100%;
  --block-gap-offset: 0px;
  --block-margin-top: 0px;
  --block-margin-right: 0px;
  --block-margin-bottom: 0px;
  --block-margin-left: 0px;
  flex: 0 1 max(0px, calc(var(--block-width) - var(--block-gap-offset) - var(--block-margin-left) - var(--block-margin-right)));
  max-width: calc(100% - var(--block-margin-left) - var(--block-margin-right));
  min-width: 0;
  margin: var(--block-margin-top) var(--block-margin-right) var(--block-margin-bottom) var(--block-margin-left);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.content-block.block-empty {
  min-height: 1px;
}

.block-main,
.nested-content-blocks {
  min-width: 0;
}

.nested-content-blocks {
  --block-gap: inherit;
}

.content-block.children-fill > .nested-content-blocks {
  align-items: stretch;
}

.content-block.children-fill > .nested-content-blocks > .content-block {
  display: flex;
}

.content-block.children-fill > .nested-content-blocks > .content-block > .block-main {
  display: flex;
  width: 100%;
}

.content-block.children-fill > .nested-content-blocks > .content-block.block-image img,
.content-block.children-fill > .nested-content-blocks > .content-block.block-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--surface);
  text-align: center;
}

/* Navigation publique inspirée d’un portfolio avec panneau latéral. */
.portfolio-public {
  background: #ffffff;
  height: 100vh;
  overflow: hidden;
}

.portfolio-public .site-header {
  display: none;
}

.portfolio-public .page {
  width: 100%;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

.portfolio-shell {
  display: grid;
  grid-template-columns: clamp(240px, 23vw, 380px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  height: 100vh;
  min-height: 0;
}

.portfolio-menu-toggle {
  display: none;
}

.portfolio-sidebar {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px) clamp(18px, 2.4vw, 34px);
  background: #f3f3f3;
  color: #050505;
}

.portfolio-logo {
  display: block;
  margin-bottom: 24px;
  line-height: 1;
  color: #050505;
  text-decoration: none;
}

.portfolio-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.portfolio-logo strong {
  display: block;
  font-size: clamp(3rem, 9vw, 5.25rem);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portfolio-logo span {
  display: block;
  margin-top: -18px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 500;
  letter-spacing: 0;
  text-align: right;
}

.portfolio-logo:hover {
  text-decoration: none;
}

.portfolio-nav-group {
  display: grid;
  gap: 8px;
}

.portfolio-about-nav {
  margin-top: auto;
}

.portfolio-nav-label {
  justify-self: start;
  padding: 4px 10.5px 4px 7px;
  border-radius: 999px;
  background: #050505;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
}

.project-nav-list {
  display: grid;
  gap: 0;
}

.project-nav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 0 2px;
  border-bottom: 1px solid #050505;
  color: #050505;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.project-nav-link:hover {
  text-decoration: none;
  opacity: 0.7;
}

.project-nav-link.is-active {
  font-weight: 800;
}

.nav-arrow {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #050505;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.nav-arrow::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 9px;
  background: #ffffff;
  -webkit-mask: url("../img/nav-arrow.svg") calc(50% + 1px) calc(50% + 0.5px) / 4px 7px no-repeat;
  mask: url("../img/nav-arrow.svg") calc(50% + 1px) calc(50% + 0.5px) / 4px 7px no-repeat;
}


.project-nav-link:hover .nav-arrow {
  background: #ffffff;
}

.project-nav-link:hover .nav-arrow::before {
  background: #050505;
}

.portfolio-empty-panel {
  min-height: 100%;
}

.project-hero {
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #f4f4f2;
}

.project-hero img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  display: block;
}

.project-hero h1 {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: clamp(32px, 5vw, 72px);
  color: #ffffff;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: 0;
}

.project-hero-empty h1 {
  color: #050505;
}

.project-title-panel {
  margin-bottom: 28px;
  color: #050505;
}

.project-title-panel h1 {
  max-width: 900px;
  margin: 12px 0 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.back-link {
  color: #050505;
  font-weight: 800;
}

.project-page {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  color: var(--text);
}

.project-page > .content-blocks,
.project-page > p {
  padding: clamp(24px, 4vw, 64px);
}

.portfolio-public .project-page .text-content,
.portfolio-public .project-page > p {
  color: #050505;
}

.contact-page {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  background: #050505;
  color: #ffffff;
}

.contact-form {
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: clamp(16px, 2vw, 24px);
  padding: clamp(42px, 7vw, 78px) clamp(32px, 6vw, 70px) 36px;
}

.contact-form h1 {
  margin: 0 0 clamp(26px, 4vw, 54px);
  color: #ffffff;
  font-size: clamp(3rem, 6.7vw, 5.35rem);
  font-weight: 900;
  line-height: 0.92;
  text-align: center;
}

.contact-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 14px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #050505;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  line-height: 1;
}

.contact-form input {
  min-height: 54px;
  padding: 0 28px;
}

.contact-form textarea {
  min-height: 190px;
  padding: 22px 28px;
  border-radius: 24px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #a3a3a3;
}

.contact-form-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: -8px;
  color: #ffffff;
}

.contact-form-footer small {
  color: #ffffff;
}

.contact-form button {
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #050505;
  font: inherit;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.contact-form button:hover {
  opacity: 0.82;
}

.contact-soon {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
  text-align: center;
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 1120px);
  }

  .page {
    padding: 22px 0 44px;
  }

  .portfolio-public .page {
    height: 100vh;
    padding: 0;
  }

  .portfolio-shell {
    grid-template-columns: 1fr;
    height: 100vh;
    min-height: 0;
  }

  .portfolio-menu-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 120;
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #050505;
    border-radius: 999px;
    background: #ffffff;
    cursor: pointer;
  }

  .portfolio-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #050505;
  }

  .portfolio-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 110;
    width: min(360px, 88vw);
    height: 100vh;
    min-height: 0;
    padding: 52px 30px 34px;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.2s ease;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.16);
  }

  .portfolio-shell.is-nav-open .portfolio-sidebar {
    transform: translateX(0);
  }

  .portfolio-logo {
    margin-bottom: 24px;
  }

  .portfolio-logo strong {
    font-size: clamp(3.15rem, 16vw, 4.8rem);
  }

  .portfolio-logo span {
    margin-top: -14px;
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .portfolio-nav-label {
    font-size: 0.95rem;
  }

  .portfolio-empty-panel {
    display: none;
  }

  .project-page {
    height: 100vh;
  }

  .contact-page {
    height: 100vh;
    overflow-y: auto;
  }

  .contact-form {
    padding: 76px 16px 32px;
  }

  .contact-form h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

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

  .contact-form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-form button {
    width: 100%;
  }

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

  .nav {
    align-items: flex-start;
    padding: 14px 0;
  }

  .nav-links {
    width: 100%;
  }

  .content-blocks,
  .nested-content-blocks {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--block-gap);
  }

  .content-block {
    width: auto;
    display: block;
  }

  .actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .actions form,
  .actions form button {
    width: 100%;
  }

  .card {
    padding: 18px;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  video {
    width: 100%;
    max-width: 100%;
  }

  .project-nav-link {
    font-size: 1.15rem;
  }
}
