/* Components. Exact values come from docs/design/maquette-hifi.html. */

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-ui);
  padding: 16px 38px;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.btn--primary {
  background: var(--color-rose);
  color: var(--color-canvas);
  border: none;
}

.btn--primary:hover {
  background: var(--color-rose-deep);
  color: var(--color-canvas);
  box-shadow: 0 10px 24px rgba(185, 106, 122, 0.25);
}

.btn--primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn--ghost {
  border: 1.5px solid var(--color-champagne);
  color: var(--color-ink);
  background: transparent;
  padding: 15px 38px;
}

.btn--ghost:hover {
  border-color: var(--color-rose-deep);
  color: var(--color-rose-deep);
}

.btn--ghost:active {
  transform: translateY(1px);
}

.btn--small {
  padding: 10px 26px;
  font-size: var(--text-small);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* ---------- Text helpers ---------- */

.eyebrow {
  font-weight: 500;
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-rose-deep);
  margin-bottom: 18px;
}

.script-accent {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--color-rose);
}

.section-title {
  font-size: var(--text-h2);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

.hero__script {
  font-size: var(--text-script);
  margin-left: 6px;
}

.contact__script {
  font-size: var(--text-script-lg);
  color: var(--color-rose-deep);
}

/* Underline-draw hover for inline links */
.link-draw {
  color: var(--color-rose-deep);
  border-bottom: 1px solid var(--color-champagne);
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size 250ms var(--ease-soft), color var(--duration-fast) ease;
}

.link-draw:hover {
  background-size: 100% 1px;
}

.link-draw--strong {
  color: var(--color-ink);
  font-weight: 400;
  font-size: 18px;
  border-bottom: 1.5px solid var(--color-rose);
  padding-bottom: 3px;
  background: linear-gradient(var(--color-rose-deep), var(--color-rose-deep)) left bottom / 0 1.5px no-repeat;
}

.link-draw--strong:hover {
  color: var(--color-rose-deep);
  background-size: 100% 1.5px;
}

/* ---------- Polaroids ---------- */

.polaroid {
  position: absolute;
  margin: 0;
  /* Shrink-to-fit of absolute positioning must never squeeze the photo */
  width: max-content;
  background: var(--color-white);
  padding: 14px 14px 52px;
  border-radius: var(--radius-polaroid);
  box-shadow: var(--shadow-polaroid);
  /* --rot is set per load by JS (seeded jitter); --dx/--dy/--drot/--s while dragging */
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(calc(var(--rot, 0deg) + var(--drot, 0deg))) scale(var(--s, 1));
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.polaroid.is-dragging {
  cursor: grabbing;
  z-index: 30;
  box-shadow: 0 30px 60px rgba(185, 106, 122, 0.28);
}

.polaroid__photo {
  width: 325px;
  height: 395px;
  max-width: none;
  border-radius: var(--radius-photo);
  object-fit: cover;
  pointer-events: none;
}

.polaroid__caption {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--color-muted);
  text-align: center;
  margin-top: 14px;
  line-height: 1.2;
}

.polaroid--hero-1 {
  right: 140px;
  top: 10px;
  --rot: -3deg;
  z-index: 2;
}

.polaroid--hero-2 {
  right: 0;
  top: 210px;
  padding: 12px 12px 44px;
  box-shadow: var(--shadow-polaroid-2);
  --rot: 2.5deg;
}

.polaroid--hero-2 .polaroid__photo {
  width: 255px;
  height: 300px;
}

.polaroid--hero-2 .polaroid__caption {
  font-size: 20px;
  margin-top: 12px;
}

/* Gentle float on the first polaroid, applied to an inner wrapper so it
   composes with drag translation on the frame itself. */
.polaroid__float {
  animation: floaty var(--float-period) ease-in-out infinite;
}

/* ---------- À propos arch ---------- */

.arch {
  margin: 0;
  position: relative;
}

.arch__photo {
  width: 380px;
  height: 490px;
  border-radius: var(--radius-arch) var(--radius-arch) var(--radius-arch-foot) var(--radius-arch-foot);
  object-fit: cover;
  object-position: 50% 30%;
  box-shadow: var(--shadow-arch);
}

.arch__caption {
  position: absolute;
  bottom: -16px;
  left: -34px;
  font-family: var(--font-script);
  font-size: 28px;
  color: var(--color-rose-deep);
  transform: rotate(-6deg);
  line-height: 1;
}

/* ---------- Brand names ---------- */

.brands__label {
  font-weight: 500;
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-muted);
  flex: none;
}

.brand--serif {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.06em;
}

.brand--caps {
  font-weight: 300;
  font-size: var(--text-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.brand--italic {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
}

.brand--caps-tight {
  font-weight: 400;
  font-size: var(--text-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Offer cards ---------- */

.offer-card {
  flex: 1;
  background: var(--color-canvas);
  border-radius: var(--radius-card);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 250ms var(--ease-soft), box-shadow 250ms var(--ease-soft);
}

.offer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-featured);
}

.offer-card__number {
  font-family: var(--font-display);
  font-size: var(--text-small);
  color: var(--color-champagne);
  letter-spacing: 0.1em;
}

.offer-card__title {
  font-family: var(--font-display);
  font-size: var(--text-card-title);
}

.offer-card__text {
  font-weight: 300;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--color-muted);
}

.offer-card--featured {
  flex: 1.08;
  border: 1.5px solid var(--color-rose);
  padding: 52px 36px;
  box-shadow: var(--shadow-card-featured);
  position: relative;
}

.offer-card__badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-rose);
  color: var(--color-canvas);
  border-radius: var(--radius-pill);
  padding: 5px 18px;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---------- Feed tiles ---------- */

.feed-tile {
  position: relative;
  border-radius: var(--radius-tile);
  overflow: hidden;
  margin: 0;
  /* Seeded per-load jitter, set by JS */
  transform: rotate(var(--rot, 0deg));
}

/* Static fallback rotations so the grid never renders perfectly straight
   (no-JS, JS error) — the seeded values overwrite these inline. */
.feed__col .feed-tile:nth-child(1) { --rot: -1.9deg; }
.feed__col .feed-tile:nth-child(2) { --rot: 2.3deg; }
.feed__col .feed-tile:nth-child(3) { --rot: -2.5deg; }
.feed__col:nth-child(2) .feed-tile:nth-child(1) { --rot: 2.1deg; }
.feed__col:nth-child(2) .feed-tile:nth-child(2) { --rot: -1.7deg; }
.feed__col:nth-child(2) .feed-tile:nth-child(3) { --rot: 2.6deg; }

.feed-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Unifying grade: pulls every tile toward the page's warm palette */
  filter: sepia(0.08) saturate(0.92) brightness(1.02);
  transition: transform 600ms var(--ease-soft);
}

.feed-tile:hover img {
  transform: scale(1.035);
}

.feed-tile--h330 { height: 330px; }
.feed-tile--h290 { height: 290px; }
.feed-tile--h250 { height: 250px; }

.feed-tile--crop-high img { object-position: 50% 35%; }

/* The deliberate grid-breaker: one tile escapes its column */
.feed-tile--breaker {
  width: calc(100% + 56px);
  margin-left: -28px;
  z-index: 2;
  box-shadow: var(--shadow-tile);
}

.feed-tile__note {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-family: var(--font-script);
  font-size: 24px;
  color: var(--color-canvas);
  text-shadow: 0 2px 12px rgba(62, 51, 56, 0.45);
  transform: rotate(-4deg);
  pointer-events: none;
}

/* ---------- Testimonial cards ---------- */

.testimonial {
  flex: 1;
  background: var(--color-canvas);
  border-radius: var(--radius-card);
  padding: 44px 44px 38px;
  box-shadow: var(--shadow-testimonial);
  margin: 0;
}

.testimonial__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-quote);
  line-height: 1.6;
  margin: 0 0 26px;
}

.testimonial__author {
  display: flex;
  gap: 14px;
  align-items: center;
}

.testimonial__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
}

.testimonial__avatar--1 {
  background: linear-gradient(150deg, var(--color-rose-pale), var(--color-champagne));
}

.testimonial__avatar--2 {
  background: linear-gradient(150deg, #EDE3D2, #D9C0B0);
}

.testimonial__name {
  font-weight: 500;
  font-size: var(--text-small);
  font-style: normal;
}

.testimonial__role {
  font-weight: 300;
  font-size: var(--text-caption);
  color: var(--color-muted);
  font-style: normal;
}

/* ---------- Contact form ---------- */

.contact-form {
  flex: 1;
  background: var(--color-canvas);
  border-radius: var(--radius-card);
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-form);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.field input,
.field textarea {
  border: 1px solid var(--color-rose-pale);
  border-radius: var(--radius-input);
  padding: 14px 18px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-ui);
  color: var(--color-ink);
  background: var(--color-canvas);
  outline: none;
  resize: none;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--color-rose);
  box-shadow: 0 0 0 3px rgba(222, 126, 150, 0.15);
}

.contact-form__success {
  display: none;
  text-align: center;
  padding: 36px 12px;
}

.contact-form__success-script {
  font-family: var(--font-script);
  font-size: 34px;
  color: var(--color-rose);
  margin-bottom: 12px;
}

.contact-form__success p {
  color: var(--color-muted);
  max-width: 320px;
  margin: 0 auto;
}

.contact-form.is-sent .field,
.contact-form.is-sent button {
  display: none;
}

.contact-form.is-sent .contact-form__success {
  display: block;
}

/* ---------- Burger + mobile menu ---------- */

.burger {
  /* Shown via layout.css media query at <=900px; hidden on desktop.
     Kept as visibility-neutral default here so the later-loaded sheet
     doesn't override the breakpoint rule. */
  flex-direction: column;
  gap: 5px;
  padding: 10px 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.burger span {
  width: 22px;
  height: 1.5px;
  background: var(--color-ink);
  transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

.burger[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.burger[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(255, 253, 251, 0.97);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms var(--ease-soft), visibility 250ms;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-ink);
}

.mobile-menu a.btn {
  font-family: var(--font-body);
  font-size: var(--text-ui);
  color: var(--color-canvas);
  margin-top: 8px;
}

.mobile-menu__close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--color-ink);
  cursor: pointer;
  padding: 10px;
}

/* ---------- Grain overlay ---------- */

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Scroll reveals ----------
   Gated behind .js (set by an inline script in <head>): if the script
   ever fails to load, every section stays fully visible. */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--duration-reveal) var(--ease-soft),
    transform var(--duration-reveal) var(--ease-soft);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible,
.js.no-observer .reveal {
  opacity: 1;
  transform: none;
}

/* Feed tiles keep their jitter rotation through the reveal */
.js .feed-tile.reveal {
  transform: translateY(18px) rotate(var(--rot, 0deg));
}

.js .feed-tile.reveal.is-visible,
.js.no-observer .feed-tile.reveal {
  transform: rotate(var(--rot, 0deg));
}

/* ---------- Mobile overrides ---------- */

/* Between the two mockup frames the hero column narrows: scale the
   polaroids down so they never overlap the text column. */
@media (max-width: 1180px) and (min-width: 901px) {
  .polaroid--hero-1 { right: 90px; }
  .polaroid--hero-1 .polaroid__photo { width: 250px; height: 305px; }
  .polaroid--hero-2 { top: 200px; }
  .polaroid--hero-2 .polaroid__photo { width: 200px; height: 240px; }
  .hero__visual { height: 560px; }
  .arch__photo { width: 320px; height: 410px; }
}

@media (max-width: 900px) {
  .polaroid {
    position: static;
    display: inline-block;
    --rot: -2deg;
  }

  .polaroid--hero-2 { display: none; }

  .polaroid--hero-1 {
    padding: 10px 10px 38px;
  }

  .polaroid--hero-1 .polaroid__photo {
    width: 230px;
    height: 280px;
  }

  .polaroid--hero-1 .polaroid__caption {
    font-size: 19px;
    margin-top: 12px;
  }

  .arch__photo {
    width: 200px;
    height: 250px;
    border-radius: 100px 100px 14px 14px;
  }

  .arch {
    display: inline-block;
    margin-bottom: 22px;
  }

  .arch__caption {
    left: -20px;
    font-size: 24px;
  }

  .offer-card--featured { flex: 1; }

  .testimonial { padding: 28px; }

  .contact-form { padding: 28px; }

  .feed-tile--breaker {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .hero__actions .btn {
    padding: 14px 28px;
    font-size: var(--text-small);
  }

  .hero__actions .btn--ghost {
    padding: 13px 28px;
  }

  .feed-tile,
  .feed-tile--h330,
  .feed-tile--h290,
  .feed-tile--h250 {
    height: auto;
    aspect-ratio: 1;
    border-radius: var(--radius-tile-sm);
  }

  .feed-tile__note { display: none; }

  .offers__grid { gap: 18px; }

  .offer-card { padding: 28px; }

  .offer-card--featured { padding: 34px 28px 28px; }

  .offer-card__badge {
    position: static;
    align-self: flex-start;
    transform: none;
    font-size: 11px;
    padding: 4px 14px;
  }
}

/* ---------- Reduced motion ---------- */

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

  .polaroid__float { animation: none; }

  .polaroid { cursor: default; touch-action: auto; }

  .js .reveal,
  .js .feed-tile.reveal {
    opacity: 1;
    transform: rotate(var(--rot, 0deg));
    transition: none;
  }

  .js .reveal:not(.feed-tile) { transform: none; }

  .feed-tile img,
  .offer-card {
    transition: none;
  }
}
