:root {
  --bg: #0c0c0d;
  --panel: #141416;
  --text: #f1efe9;
  --muted: #89898f;
  --line: #2a2a2e;
  --accent: #d8ff54;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.035), transparent 28rem),
    var(--bg);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header,
.site-footer {
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 66px;
  border-bottom: 1px solid var(--line);
}

.artist {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.header-label,
.artwork-number,
.site-footer,
.artwork-meta dt {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-label {
  color: var(--muted);
  font-size: 0.66rem;
}

.artwork-page {
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.72fr);
  gap: clamp(44px, 6vw, 88px);
  align-items: center;
}

.artwork-visual {
  min-width: 0;
}

.canvas-frame {
  width: min(100%, 640px, calc(100vh - 176px));
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0f0f10;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.canvas-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.artwork-info {
  align-self: center;
  padding-top: 0;
}

.artwork-number {
  color: var(--accent);
  font-size: 0.64rem;
  margin-bottom: 34px;
}

.title-block {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  max-width: 8ch;
  font-size: clamp(2.8rem, 4.25vw, 4.7rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
  font-weight: 400;
}

.description {
  margin: 24px 0 28px;
  max-width: 44ch;
  color: #b9b8b5;
  font-size: 0.9rem;
  line-height: 1.62;
}

.artwork-meta {
  margin: 0;
  border-top: 1px solid var(--line);
}

.artwork-meta div {
  display: grid;
  grid-template-columns: 106px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.artwork-meta dt {
  color: var(--muted);
  font-size: 0.58rem;
}

.artwork-meta dd {
  margin: 0;
  font-size: 0.74rem;
  color: #d4d2cd;
}

.regenerate {
  width: 100%;
  margin-top: 20px;
  padding: 13px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--text);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}

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

.regenerate:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.site-footer {
  min-height: 50px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.58rem;
}

@media (min-width: 901px) and (max-height: 780px) {
  .site-header {
    min-height: 58px;
  }

  .artwork-page {
    padding: 20px 0 22px;
  }

  .canvas-frame {
    width: min(100%, 590px, calc(100vh - 150px));
  }

  .artwork-number {
    margin-bottom: 24px;
  }

  h1 {
    font-size: clamp(2.6rem, 4vw, 4.2rem);
  }

  .description {
    margin: 19px 0 22px;
    line-height: 1.5;
  }

  .artwork-meta div {
    padding: 9px 0;
  }

  .regenerate {
    margin-top: 14px;
    padding: 10px 0;
  }

  .site-footer {
    min-height: 42px;
  }
}

@media (max-width: 900px) {
  .site-header,
  .site-footer,
  .artwork-page {
    width: min(100% - 36px, 720px);
  }

  .site-header {
    min-height: 70px;
  }

  .artwork-page {
    grid-template-columns: 1fr;
    gap: 46px;
    padding: 30px 0 50px;
  }

  /* Sur mobile, le cartel précède l’œuvre. */
  .artwork-info {
    order: -1;
  }

  .canvas-frame {
    width: min(100%, 640px);
  }

  .artwork-number {
    margin-bottom: 28px;
  }

  h1 {
    max-width: none;
    font-size: clamp(3rem, 13vw, 5.2rem);
  }

  .description {
    max-width: 56ch;
  }
}

@media (max-width: 520px) {
  .header-label {
    display: none;
  }

  .artwork-meta div {
    grid-template-columns: 88px 1fr;
  }
}
