:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111111;
  background: #f6ede2;
  --ink: #111111;
  --muted: #695f58;
  --paper: #fffafa;
  --line: #ead9cf;
  --rose: #f3c8d3;
  --rose-strong: #c65f79;
  --sand: #e8d1b8;
  --white: #fffafa;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 250, 250, 0.82), rgba(246, 237, 226, 0.92)),
    url("/assets/nous-fond.jpg") center / cover;
}

button {
  font: inherit;
}

.hero {
  min-height: 46vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: 28px;
  padding: 48px 24px 32px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose-strong);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 920px;
  margin: 0;
  color: var(--ink);
  font-size: 6.2rem;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.intro {
  max-width: 58ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  border: 10px solid var(--white);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sand);
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.14);
}

.hero-photo img,
.photo-strip img,
.card-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-strip {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.photo-strip img {
  aspect-ratio: 1;
  border: 8px solid var(--white);
  border-radius: 8px;
  background: var(--sand);
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.1);
}

.card-zone {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  perspective: 1000px;
}

.flip-card {
  min-height: 560px;
  perspective: 900px;
}

.card-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  transform-style: preserve-3d;
  transition: transform 420ms ease;
  will-change: transform;
}

.flip-card.is-flipped .card-shell {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(23, 33, 31, 0.18);
  border-radius: 8px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 18px 46px rgba(17, 17, 17, 0.14);
}

.card-front {
  background:
    linear-gradient(160deg, rgba(255, 250, 250, 0.98), rgba(246, 237, 226, 0.95)),
    var(--paper);
}

.card-front::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 8px solid var(--accent, var(--rose));
  pointer-events: none;
}

.flip-card:nth-child(1) {
  --accent: var(--rose-strong);
}

.flip-card:nth-child(2) {
  --accent: var(--sand);
}

.flip-card:nth-child(3) {
  --accent: var(--ink);
}

.card-back {
  transform: rotateY(180deg);
  color: #ffffff;
  background-size: cover;
  background-position: center;
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(12, 24, 21, 0.18), rgba(12, 24, 21, 0.7));
}

.photo-wish {
  background-image: url("/assets/nous-dos-1.jpg");
}

.photo-memory {
  background-image: url("/assets/nous-dos-2.jpg");
}

.photo-promise {
  background-image: url("/assets/nous-dos-3.jpg");
}

.card-kicker,
.card-face h2,
.card-face p,
.flip-button {
  position: relative;
  z-index: 1;
}

.card-kicker {
  color: var(--accent, var(--rose-strong));
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-face h2 {
  margin: 0;
  font-size: 3rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.card-face p {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
  overflow: auto;
  overflow-wrap: anywhere;
}

.card-photo {
  height: 170px;
  border: 6px solid var(--white);
  border-radius: 8px;
  background: var(--sand);
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.1);
}

.card-back p {
  align-self: end;
  grid-row: 4;
  color: #ffffff;
  font-size: 1.28rem;
  font-weight: 800;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

[contenteditable="true"] {
  outline: 2px solid transparent;
  outline-offset: 5px;
  border-radius: 6px;
}

[contenteditable="true"]:focus {
  outline-color: currentColor;
  background: rgba(255, 255, 255, 0.42);
}

.flip-button,
#reset-texts {
  justify-self: start;
  align-self: end;
  grid-row: 5;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.card-back .flip-button {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(23, 33, 31, 0.42);
}

.flip-button:hover,
#reset-texts:hover {
  transform: translateY(-2px);
}

.note {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

  h1 {
    font-size: 4.5rem;
  }

  .photo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-zone {
    grid-template-columns: 1fr;
  }

  .flip-card,
  .card-shell {
    min-height: 540px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 36px 16px 24px;
  }

  .card-zone,
  .photo-strip,
  .note {
    width: calc(100% - 24px);
  }

  .card-face {
    gap: 12px;
    padding: 18px;
  }

  h1 {
    font-size: 3rem;
  }

  .card-face h2 {
    font-size: 2rem;
  }

  .card-face p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .card-photo {
    height: 132px;
    border-width: 4px;
  }

  .flip-card,
  .card-shell {
    min-height: 520px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card-shell,
  .flip-button,
  #reset-texts {
    transition: none;
  }
}
