/* Hallmark · macrostructure: bespoke single invitation card · tone: soft, personal · anchor hue: wine red
 * theme: custom (shared with sanamin.love) · paper oklch(95.5% 0.02 18) · accent oklch(50% 0.19 18)
 * fonts: Aref Ruqaa + IBM Plex Sans Arabic · axes: light / calligraphic-serif / warm
 */

:root {
  --color-paper: oklch(95.5% 0.02 18);
  --color-paper-glass: oklch(95.5% 0.02 18 / 0.85);
  --color-paper-2: oklch(98.5% 0.008 30);
  --color-ink: oklch(30% 0.09 16);
  --color-ink-soft: oklch(48% 0.06 16);
  --color-accent: oklch(50% 0.19 18);
  --color-blush: oklch(80% 0.09 8);
  --color-blush-soft: oklch(89% 0.05 10);
  --color-shadow: oklch(30% 0.09 16 / 0.1);

  --font-display: "Aref Ruqaa", "Noto Naskh Arabic", serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif;

  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-display: clamp(3.75rem, 2.8rem + 5vw, 6rem);

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html, body { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-paper);
  /* soft blush fade; the doodles live on body::before */
  background-image: linear-gradient(180deg, var(--color-paper) 0%, var(--color-blush-soft) 100%);
  background-attachment: fixed;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* normal arrow over text instead of the typing bar; links still get the hand */
  cursor: default;
}

/* top bar, same as sanamin.love */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .topbar { padding-inline: var(--space-xl); }
}

/* the invitation */

.invite {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

.card {
  position: relative;
  width: min(100%, 440px);
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  text-align: center;
  background: var(--color-paper-2);
  box-shadow: 0 1px 2px var(--color-shadow), 0 18px 40px var(--color-shadow);
}

/* thin printed frame inside the card edge */
.card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--color-blush);
  pointer-events: none;
}

.ring-wrap {
  position: relative;
  display: inline-block;
}

.ring {
  display: block;
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.ring .stone { fill: var(--color-accent); stroke-width: 0.8; }

.title {
  margin: var(--space-sm) 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-display);
  line-height: 1.15;
  color: var(--color-accent);
}

.lead {
  margin: var(--space-sm) 0 0;
  color: var(--color-ink-soft);
}

.wave {
  display: block;
  width: 96px;
  height: 12px;
  margin: var(--space-lg) auto;
}

.wave path {
  fill: none;
  stroke: var(--color-blush);
  stroke-width: 2;
  stroke-linecap: round;
}

.details {
  display: grid;
  gap: var(--space-md);
  margin: 0;
}

.details dt {
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.details dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1.4;
  color: var(--color-ink);
}

.details dd.soon { color: var(--color-ink-soft); font-weight: 400; }

.countdown {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-blush);
}

.countdown[hidden] { display: none; }

.countdown div {
  display: flex;
  flex-direction: column;
  min-width: 3.5rem;
}

.countdown span {
  font-size: var(--text-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
}

.countdown small {
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.story {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--color-blush);
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  transition: text-decoration-color 160ms var(--ease-out);
}

.story:hover { text-decoration-color: var(--color-accent); }

.brand:focus-visible,
.story:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

@media (max-width: 420px) {
  .card { padding-inline: var(--space-lg); }
}

/* hearts drifting up behind everything */

.drift {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.drift svg {
  position: absolute;
  bottom: -40px;
  width: 18px;
  height: 18px;
  fill: var(--color-blush);
  opacity: 0;
  animation: drift 16s linear infinite;
}

.drift svg:nth-child(1) { left: 8%;  animation-delay: 0s;   }
.drift svg:nth-child(2) { left: 22%; animation-delay: -6s;  width: 12px; height: 12px; }
.drift svg:nth-child(3) { left: 38%; animation-delay: -11s; width: 14px; height: 14px; }
.drift svg:nth-child(4) { left: 56%; animation-delay: -3s;  width: 22px; height: 22px; }
.drift svg:nth-child(5) { left: 70%; animation-delay: -9s;  width: 12px; height: 12px; }
.drift svg:nth-child(6) { left: 84%; animation-delay: -14s; }
.drift svg:nth-child(7) { left: 93%; animation-delay: -1s;  width: 14px; height: 14px; }

@keyframes drift {
  0%   { opacity: 0;   transform: translate(0, 0) rotate(-10deg); }
  10%  { opacity: 0.6; }
  50%  { transform: translate(14px, -55vh) rotate(8deg); }
  90%  { opacity: 0.5; }
  100% { opacity: 0;   transform: translate(-6px, -110vh) rotate(-6deg); }
}

.topbar, .invite { position: relative; z-index: 1; }
.topbar { position: sticky; z-index: 10; }

/* the stone catches the light now and then */

.glint {
  display: block;
  position: absolute;
  top: -6px;
  right: -8px;
  width: 16px;
  height: 16px;
  fill: var(--color-accent);
  opacity: 0;
  animation: glint 4s var(--ease-in-out) 1.6s infinite;
}

@keyframes glint {
  0%, 70%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  80% { opacity: 1; transform: scale(1) rotate(45deg); }
  90% { opacity: 0; transform: scale(0.4) rotate(90deg); }
}

/* entrance */

.js .card { animation: rise 900ms var(--ease-out) both; }

.js .ring-wrap { animation: rise 700ms var(--ease-out) 300ms both; }

.js .wave path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1000ms var(--ease-out) 700ms forwards;
}

.js .details,
.js .story {
  animation: fade 800ms var(--ease-out) 900ms both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .drift { display: none; }
  .glint { animation: none; }
  .js .card, .js .ring-wrap, .js .details, .js .story { animation: fade 150ms linear both; }
  .js .wave path { animation: none; stroke-dashoffset: 0; }
}

/* the doodle pattern sits on its own layer so it can drift slowly */
body::before {
  content: "";
  position: fixed;
  inset: -280px;
  z-index: -1;
  background: url("shared/pattern.svg") 0 0 / 280px 280px;
  animation: pan 60s linear infinite;
  will-change: transform;
  pointer-events: none;
}

@keyframes pan {
  to { transform: translate(-280px, -280px); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
