/* invity.tn coming-soon site.
   Brand tokens of libs/ui/src/tokens.css. Logical properties, so Arabic (RTL) needs no overrides.
   Every animation ends in the normal state of the element and is switched off for prefers-reduced-motion. */
:root {
  --color-ink: #17132b;
  --color-coral: #ff6b4a;
  --color-iris: #5b3df5;
  --color-mist: #f6f5fa;
  --color-blush: #ffede7;
  --color-lilac: #eeeafe;
  --color-white: #ffffff;
  --color-muted: #55516a;
  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --tap-target: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-ink);
  background-color: var(--color-mist);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Living background: three soft colour fields drifting slowly */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.o1 {
  inline-size: 38rem;
  block-size: 38rem;
  inset-block-start: -14rem;
  inset-inline-end: -10rem;
  background: rgb(255 107 74 / 24%);
  animation: drift-a 24s ease-in-out infinite alternate;
}
.o2 {
  inline-size: 34rem;
  block-size: 34rem;
  inset-block-start: 8rem;
  inset-inline-start: -14rem;
  background: rgb(91 61 245 / 16%);
  animation: drift-b 28s ease-in-out infinite alternate;
}
.o3 {
  inline-size: 30rem;
  block-size: 30rem;
  inset-block-end: -12rem;
  inset-inline-start: 30%;
  background: rgb(238 234 254 / 90%);
  animation: drift-c 26s ease-in-out infinite alternate;
}
@keyframes drift-a {
  to {
    transform: translate3d(-6rem, 5rem, 0) scale(1.12);
  }
}
@keyframes drift-b {
  to {
    transform: translate3d(7rem, -3rem, 0) scale(1.08);
  }
}
@keyframes drift-c {
  to {
    transform: translate3d(-5rem, -5rem, 0) scale(1.15);
  }
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  background: var(--color-ink);
  color: var(--color-white);
  text-decoration: none;
}
.skip:focus {
  inset-block-start: 1rem;
}

:focus-visible {
  outline: 3px solid var(--color-iris);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Reading progress on the legal pages (browsers with scroll-driven animations only) */
.progress {
  display: none;
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 30;
  block-size: 3px;
  background: linear-gradient(90deg, var(--color-coral), var(--color-iris));
  transform: scaleX(0);
  transform-origin: 0 50%;
}
html[dir='rtl'] .progress {
  transform-origin: 100% 50%;
}
@supports (animation-timeline: scroll()) {
  body.legal .progress {
    display: block;
    animation: grow linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes grow {
  to {
    transform: scaleX(1);
  }
}

/* Header: glass bar */
.top {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem max(1.25rem, calc((100vw - 72rem) / 2));
  background: rgb(246 245 250 / 68%);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-block-end: 1px solid rgb(23 19 43 / 6%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: var(--tap-target);
  color: inherit;
  text-decoration: none;
  direction: ltr;
}
.brand .mark {
  inline-size: 32px;
  block-size: 32px;
}
.brand .wordmark {
  font-size: 1.25rem;
}

.wordmark {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  unicode-bidi: isolate;
}
.coral {
  color: var(--color-coral);
}

.langs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--color-white);
  box-shadow: 0 1px 2px rgb(23 19 43 / 8%), 0 4px 14px -6px rgb(23 19 43 / 14%);
  direction: ltr;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: var(--tap-target);
  min-block-size: var(--tap-target);
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--color-ink);
  font: 600 0.9rem/1 var(--font-heading);
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease-spring);
}
.lang-btn:hover {
  background: var(--color-lilac);
}
.lang-btn:active {
  transform: scale(0.95);
}
.lang-btn[aria-current='page'] {
  background: var(--color-ink);
  color: var(--color-white);
}

/* ---------- Landing ---------- */
.hero {
  flex: 1;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  inline-size: 100%;
  max-inline-size: 72rem;
  margin-inline: auto;
  padding: 2rem 1.25rem 3.5rem;
  --px: 0;
  --py: 0;
}
.hero.single {
  max-inline-size: 46rem;
  text-align: center;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
@media (min-width: 62rem) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    padding-block: 3rem 4rem;
  }
  .hero:not(.single) .hero-copy {
    align-items: flex-start;
    text-align: start;
  }
  .hero:not(.single) .chips {
    justify-content: flex-start;
  }
}

/* Logo intro: the tile pops in, the V is drawn, the dot drops, the name slides in */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-block-end: 2rem;
  direction: ltr;
}
.lockup .mark {
  inline-size: 76px;
  block-size: 76px;
  filter: drop-shadow(0 14px 26px rgb(23 19 43 / 24%));
}
.lockup .wordmark {
  font-size: clamp(2.3rem, 8vw, 3.4rem);
  animation: name-in 0.9s 0.35s var(--ease-out) both;
}
.m-bg {
  transform-box: fill-box;
  transform-origin: center;
  animation: tile-in 0.7s var(--ease-spring) both;
}
.m-v {
  stroke-dasharray: 1;
  animation: draw 0.7s 0.45s var(--ease-out) both;
}
.m-dot {
  animation: drop 0.8s 0.95s var(--ease-spring) both;
}
@keyframes tile-in {
  from {
    opacity: 0;
    transform: scale(0.55) rotate(-10deg);
  }
}
@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-34px);
  }
}
@keyframes name-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
    letter-spacing: 0.06em;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}
@keyframes focus-in {
  from {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(10px);
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  background: var(--color-blush);
  box-shadow: 0 0 0 1px rgb(255 107 74 / 22%) inset;
  font: 600 0.9rem/1.4 var(--font-heading);
  animation: rise 0.8s 0.9s var(--ease-out) both;
}
.pulse {
  position: relative;
  inline-size: 0.6rem;
  block-size: 0.6rem;
  border-radius: 50%;
  background: var(--color-coral);
}
.pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-coral);
  animation: ping 2.2s ease-out infinite;
}
@keyframes ping {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(3.4);
  }
}

h1 {
  margin: 0 0 1.1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 6.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero h1 {
  animation: focus-in 1s 1.05s var(--ease-out) both;
}

.lead {
  margin: 0 0 1.75rem;
  max-inline-size: 36rem;
  font-size: 1.1rem;
  color: var(--color-muted);
  text-wrap: pretty;
  animation: rise 0.9s 1.25s var(--ease-out) both;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 0 0 1px rgb(91 61 245 / 14%) inset;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.3s var(--ease-spring), background-color 0.3s, box-shadow 0.3s;
  animation: rise 0.7s var(--ease-out) both;
}
.chips li:hover {
  transform: translateY(-3px);
  background: var(--color-white);
  box-shadow: 0 0 0 1px rgb(91 61 245 / 30%) inset, 0 8px 18px -8px rgb(91 61 245 / 35%);
}
.chips li:nth-child(1) { animation-delay: 1.4s; }
.chips li:nth-child(2) { animation-delay: 1.47s; }
.chips li:nth-child(3) { animation-delay: 1.54s; }
.chips li:nth-child(4) { animation-delay: 1.61s; }
.chips li:nth-child(5) { animation-delay: 1.68s; }
.chips li:nth-child(6) { animation-delay: 1.75s; }

.status {
  margin: 0;
  font: 600 1.05rem/1.4 var(--font-heading);
  animation: rise 0.8s 1.85s var(--ease-out) both;
}

/* The invitation card: a sample of what the service makes */
.visual {
  position: relative;
  display: grid;
  place-items: center;
  min-block-size: 27rem;
  perspective: 1100px;
  animation: card-in 1.2s 0.8s var(--ease-out) both;
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.94);
  }
}
.tilt {
  transform-style: preserve-3d;
  transform: translate3d(calc(var(--px) * 12px), calc(var(--py) * 10px), 0) rotateY(calc(var(--px) * 7deg))
    rotateX(calc(var(--py) * -7deg));
  transition: transform 0.35s ease-out;
}
.float {
  position: relative;
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-14px) rotate(0.6deg);
  }
}

.card-back,
.card {
  inline-size: min(18.5rem, 76vw);
  aspect-ratio: 3 / 4.15;
  border-radius: 28px;
}
.card-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--color-blush), #ffd9cc);
  transform: rotate(7deg) translate(1.4rem, 0.6rem);
  box-shadow: 0 30px 50px -24px rgb(255 107 74 / 45%);
}
.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: var(--color-white);
  background: linear-gradient(165deg, #2a2250 0%, var(--color-ink) 62%);
  box-shadow: 0 50px 80px -28px rgb(23 19 43 / 60%), 0 0 0 1px rgb(255 255 255 / 7%) inset;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 0%, rgb(255 107 74 / 38%), transparent 55%),
    radial-gradient(circle at 100% 100%, rgb(91 61 245 / 35%), transparent 50%);
}
.card::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(112deg, transparent 42%, rgb(255 255 255 / 16%) 50%, transparent 58%);
  transform: translateX(-130%);
  animation: shimmer 7s 3s ease-in-out infinite;
}
@keyframes shimmer {
  45%,
  100% {
    transform: translateX(130%);
  }
}
.card > * {
  position: relative;
  z-index: 1;
}
.card .mark {
  inline-size: 44px;
  block-size: 44px;
  margin-block-end: 0.75rem;
}
.card .m-bg {
  fill: var(--color-white);
  animation: none;
}
.card .m-v {
  stroke: var(--color-ink);
  animation: none;
}
.card .m-dot {
  animation: none;
}
.c-kicker {
  margin: 0;
  font: 600 0.72rem/1.4 var(--font-heading);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 72%);
}
.c-names {
  margin: 0.4rem 0 0;
  font: italic 600 2.1rem/1.15 var(--font-serif);
}
.c-names span {
  color: var(--color-coral);
}
.c-rule {
  inline-size: 3rem;
  block-size: 2px;
  margin-block: 0.7rem;
  border-radius: 2px;
  background: var(--color-coral);
}
.c-date {
  margin: 0;
  font: 600 1.05rem/1.4 var(--font-heading);
  letter-spacing: 0.14em;
}
.c-rsvp {
  margin-block-start: 1.3rem;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  background: var(--color-coral);
  color: var(--color-ink);
  font: 600 0.85rem/1 var(--font-heading);
}

/* Confetti */
.dot {
  position: absolute;
  inline-size: 0.8rem;
  block-size: 0.8rem;
  border-radius: 50%;
  animation: bob 6s ease-in-out infinite;
}
.d1 { inset-block-start: 8%; inset-inline-start: 12%; background: var(--color-coral); animation-duration: 5.5s; }
.d2 { inset-block-start: 20%; inset-inline-end: 8%; inline-size: 1.1rem; block-size: 1.1rem; background: var(--color-iris); animation-duration: 7s; animation-delay: -2s; }
.d3 { inset-block-end: 18%; inset-inline-start: 4%; inline-size: 0.55rem; block-size: 0.55rem; background: var(--color-iris); animation-duration: 6.4s; animation-delay: -1s; }
.d4 { inset-block-end: 8%; inset-inline-end: 16%; background: var(--color-coral); inline-size: 0.6rem; block-size: 0.6rem; animation-duration: 5.8s; animation-delay: -3s; }
.d5 { inset-block-start: 46%; inset-inline-end: 0; inline-size: 0.5rem; block-size: 0.5rem; background: var(--color-ink); animation-duration: 8s; animation-delay: -4s; }
@keyframes bob {
  50% {
    transform: translateY(-18px) scale(1.15);
  }
}

/* ---------- Legal pages ---------- */
.legal-page {
  flex: 1;
  inline-size: 100%;
  max-inline-size: 48rem;
  margin-inline: auto;
  padding: 1.25rem 1.25rem 3.5rem;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: var(--tap-target);
  color: var(--color-iris);
  font-weight: 500;
  text-decoration: none;
}
.back:hover {
  text-decoration: underline;
}
.arrow::before {
  content: '←';
  display: inline-block;
  transition: transform 0.25s var(--ease-out);
}
.back:hover .arrow::before {
  transform: translateX(-4px);
}
html[dir='rtl'] .arrow::before {
  content: '→';
}
html[dir='rtl'] .back:hover .arrow::before {
  transform: translateX(4px);
}

.doc {
  animation: rise 0.8s 0.1s var(--ease-out) both;
}
.doc h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin-block: 0.5rem 0.25rem;
}
.updated {
  margin: 0 0 2rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.doc section {
  padding: 1.1rem 1.25rem;
  border-radius: 18px;
}
.doc section + section {
  margin-block-start: 0.5rem;
}
.doc section:hover {
  background: rgb(255 255 255 / 70%);
}
.doc h2 {
  margin: 0 0 0.25rem;
  font: 600 1.2rem/1.4 var(--font-heading);
}
.doc p {
  margin: 0;
  text-wrap: pretty;
}
.doc .updated {
  margin-block-end: 1.5rem;
}
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out), background-color 0.3s;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  inline-size: 100%;
  max-inline-size: 72rem;
  margin-inline: auto;
  padding: 1.25rem;
  border-block-start: 1px solid rgb(23 19 43 / 10%);
  font-size: 0.9rem;
  color: var(--color-muted);
}
.foot p {
  margin: 0;
}
.copy {
  direction: ltr;
  unicode-bidi: isolate;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}
.legal-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap-target);
  color: var(--color-ink);
  text-decoration-color: rgb(23 19 43 / 30%);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.legal-links a:hover {
  color: var(--color-iris);
  text-decoration-color: currentcolor;
}

/* Arabic: a touch more air for the script */
html[lang='ar'] body {
  line-height: 1.85;
}
html[lang='ar'] h1,
html[lang='ar'] h2 {
  letter-spacing: 0;
  line-height: 1.4;
}
html[lang='ar'] .c-kicker {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.85rem;
}

/* Reduced motion: everything is shown at once, nothing moves */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
