/* ============================================================
   Happy Birthday, Bilal — Xpin AI
   ============================================================ */

:root {
  --ivory: #fbf7ef;
  --ivory-deep: #f3ead9;
  --paper: #fffdf9;
  --ink: #191830;
  --ink-soft: #4d4c68;
  --ink-faint: #8685a0;
  --line: rgba(25, 24, 48, 0.09);

  --blue: #2454f0;
  --blue-deep: #0c2a95;
  --blue-pale: #e7edff;

  --gold: #cf9a37;
  --gold-bright: #eabd5f;
  --gold-pale: #f7e9c9;

  --coral: #ee6c53;
  --teal: #1f9c81;
  --violet: #6a5cf0;

  --shadow-sm: 0 2px 10px rgba(25, 24, 48, 0.06);
  --shadow-md: 0 16px 40px rgba(25, 24, 48, 0.10);
  --shadow-lg: 0 30px 80px rgba(20, 30, 90, 0.16);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;

  --container: 1600px;
  --edge: clamp(1.5rem, 5vw, 5rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

p { margin: 0; }

::selection {
  background: var(--blue);
  color: var(--ivory);
}

/* grain texture overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
   Sparkle / paper interaction layer
   ============================================================ */
.sparkle-layer {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  opacity: 0;
  transform: scale(0) rotate(0deg);
  will-change: transform, opacity;
}

.sparkle.is-active {
  animation: sparkle-pop var(--sp-duration, 1200ms) cubic-bezier(.22,1,.36,1) forwards;
}

.sparkle.is-paper {
  border-radius: 2px;
}

@keyframes sparkle-pop {
  0% { transform: translate(0, 0) scale(0) rotate(var(--sp-rot-from, 0deg)); opacity: 0; }
  22% { transform: translate(calc(var(--sp-dx, 0px) * 0.25), calc(var(--sp-dy, -30px) * 0.25)) scale(1) rotate(var(--sp-rot-mid, 90deg)); opacity: 1; }
  100% { transform: translate(var(--sp-dx, 0px), var(--sp-dy, -60px)) scale(0.35) rotate(var(--sp-rot-to, 200deg)); opacity: 0; }
}

/* ============================================================
   Progress bar
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--gold-bright), var(--coral));
  z-index: 1001;
  transition: width 80ms linear;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--edge);
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.scrolled {
  padding: 0.85rem var(--edge);
  background: rgba(251, 247, 239, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--line), var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.celebrate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  padding: 0.6rem 1.3rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.celebrate-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(36, 84, 240, 0.30);
}

.celebrate-btn:active { transform: translateY(0) scale(0.98); }

.celebrate-btn .emoji {
  display: inline-block;
  transform-origin: 70% 70%;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--edge) 4rem;
  overflow: hidden;
}

.hero-blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.blob-blue {
  width: 46vw;
  height: 46vw;
  max-width: 700px;
  max-height: 700px;
  top: -14%;
  left: -12%;
  background: radial-gradient(circle at 40% 40%, rgba(36, 84, 240, 0.40), rgba(36, 84, 240, 0));
  animation: drift1 16s ease-in-out infinite alternate;
}

.blob-gold {
  width: 38vw;
  height: 38vw;
  max-width: 580px;
  max-height: 580px;
  bottom: -16%;
  right: -8%;
  background: radial-gradient(circle at 60% 60%, rgba(234, 189, 95, 0.45), rgba(234, 189, 95, 0));
  animation: drift2 20s ease-in-out infinite alternate;
}

.blob-coral {
  width: 22vw;
  height: 22vw;
  max-width: 340px;
  max-height: 340px;
  top: 38%;
  right: 22%;
  background: radial-gradient(circle at 50% 50%, rgba(238, 108, 83, 0.28), rgba(238, 108, 83, 0));
  animation: drift3 14s ease-in-out infinite alternate;
}

@keyframes drift1 {
  to { transform: translate(4%, 6%) scale(1.08); }
}
@keyframes drift2 {
  to { transform: translate(-5%, -4%) scale(1.1); }
}
@keyframes drift3 {
  to { transform: translate(-8%, 8%) scale(0.94); }
}

.deco-spark {
  position: absolute;
  color: var(--gold);
  opacity: 0.55;
  animation: floaty 7s ease-in-out infinite;
}
.deco-spark.s1 { top: 16%; right: 14%; width: 26px; animation-delay: 0s; color: var(--blue); }
.deco-spark.s2 { top: 66%; left: 6%; width: 18px; animation-delay: 1.4s; color: var(--coral); }
.deco-spark.s3 { top: 8%; left: 42%; width: 14px; animation-delay: 2.6s; color: var(--gold); }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(14deg); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: 1.4rem;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(238, 108, 83, 0.18);
}

.hero-title {
  line-height: 0.98;
}

.hero-title-line {
  display: block;
  font-size: clamp(1.9rem, 3.4vw, 3.1rem);
  font-weight: 500;
  font-style: italic;
  color: var(--ink-soft);
  overflow: hidden;
}

.hero-title-name {
  display: block;
  font-size: clamp(4.2rem, 10.5vw, 9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--blue-deep) 10%, var(--blue) 38%, var(--gold) 68%, var(--coral) 96%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: sheen 9s ease-in-out infinite;
  overflow: hidden;
  padding-bottom: 0.06em;
}

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-role {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--ink);
  font-weight: 700;
}

.hero-role span { color: var(--blue); }

.hero-sub {
  margin-top: 1.4rem;
  max-width: 40ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.hero-cta {
  margin-top: 2.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--ink);
  transition: gap 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.hero-cta:hover {
  gap: 1.05rem;
  color: var(--blue);
  border-color: var(--blue);
}

.hero-cta svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.hero-cta:hover svg { transform: translateX(3px); }

/* portrait */
.hero-portrait {
  position: relative;
  justify-self: center;
  width: clamp(240px, 26vw, 400px);
  aspect-ratio: 1;
}

.portrait-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--blue), var(--gold-bright), var(--coral), var(--violet), var(--blue));
  animation: spin 14s linear infinite;
  filter: blur(0.3px);
}

.portrait-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--ivory);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.portrait-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 84, 240, 0.22), transparent 70%);
  z-index: -1;
}

.portrait-img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--paper);
  box-shadow: var(--shadow-lg);
}

.portrait-badge {
  position: absolute;
  bottom: 2%;
  left: -8%;
  background: var(--paper);
  border-radius: 100px;
  padding: 0.6rem 1.1rem 0.6rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  transform: rotate(-6deg);
  animation: bob 5s ease-in-out infinite;
}

.portrait-badge .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-pale);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

@keyframes bob {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-8px); }
}

.scroll-cue {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.scroll-cue span {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: scrolldown 1.8s ease-in-out infinite;
}

@keyframes scrolldown {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  60% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ============================================================
   Marquee ribbon
   ============================================================ */
.ribbon {
  position: relative;
  transform: rotate(-1.4deg);
  margin: -1.6rem 0 -0.5rem;
  z-index: 3;
}

.ribbon-track {
  background: var(--ink);
  padding: 0.85rem 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(25, 24, 48, 0.18);
}

.ribbon-inner {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.ribbon-inner span {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ivory);
  padding: 0 1.4rem;
  white-space: nowrap;
}

.ribbon-inner span::after {
  content: "✦";
  color: var(--gold-bright);
  font-style: normal;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   Tribute quote
   ============================================================ */
.tribute {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 8rem) var(--edge) clamp(3rem, 6vw, 5rem);
  text-align: center;
}

.tribute-mark {
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--blue-pale);
  line-height: 0;
  position: relative;
  top: 1.2rem;
}

.tribute-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.4;
  color: var(--ink);
}

.tribute-attr {
  margin-top: 1.6rem;
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

/* ============================================================
   Wishes
   ============================================================ */
.wishes {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: 2rem var(--edge) 6rem;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(3rem, 6vw, 4.5rem);
}

.section-head .eyebrow {
  justify-content: center;
  width: 100%;
}

.section-head h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 600;
}

.section-sub {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.wishes-grid {
  columns: 3 380px;
  column-gap: 2.25rem;
}

.wish-card {
  break-inside: avoid;
  margin-bottom: 2.25rem;
  background: var(--paper);
  border-radius: 28px;
  padding: 2.6rem 2.4rem 2.5rem;
  border: 1px solid var(--line);
  position: relative;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(28px);
  transition: transform 0.5s cubic-bezier(.22,1,.36,1), box-shadow 0.45s ease, border-color 0.45s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.wish-card.in-view {
  animation: cardIn 0.7s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: var(--d, 0ms);
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.wish-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(36, 84, 240, 0.18);
}

.wish-card::before {
  content: "\201C";
  position: absolute;
  top: 0.6rem;
  right: 1.5rem;
  font-family: var(--font-display);
  font-size: 4.6rem;
  color: var(--blue-pale);
  z-index: 0;
  line-height: 1;
}

.wish-person {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 1;
}

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  font-size: 1.6rem;
  box-shadow: 0 6px 18px rgba(20, 20, 50, 0.18);
  border: 3px solid var(--paper);
  outline: 1px solid var(--line);
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wish-name {
  font-weight: 700;
  font-size: 1.22rem;
  color: var(--ink);
  font-family: var(--font-display);
}

.wish-text {
  position: relative;
  z-index: 1;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.72;
  white-space: pre-line;
}

.wish-card:nth-child(6n+1) .wish-text::selection,
.wish-text::selection {
  background: var(--gold-pale);
}

/* ============================================================
   Closing
   ============================================================ */
.closing {
  position: relative;
  text-align: center;
  padding: clamp(5rem, 10vw, 8rem) var(--edge);
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(234, 189, 95, 0.28), transparent 70%),
    radial-gradient(50% 60% at 20% 100%, rgba(36, 84, 240, 0.14), transparent 70%),
    var(--ivory-deep);
  overflow: hidden;
}

.closing-mark {
  width: 46px;
  margin: 0 auto 1.6rem;
  opacity: 0.9;
}

.closing h2 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-style: italic;
  font-weight: 500;
  max-width: 16ch;
  margin: 0 auto;
  line-height: 1.2;
}

.closing p {
  margin-top: 1.6rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.closing p strong {
  color: var(--ink);
  font-size: 1.2rem;
  font-family: var(--font-display);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 1.8rem var(--edge) 2.2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-portrait { order: -1; margin-bottom: 1rem; width: clamp(200px, 50vw, 300px); }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { margin-left: auto; margin-right: auto; }
  .portrait-badge { left: 50%; transform: translateX(-50%) rotate(-6deg); }
  @keyframes bob {
    0%, 100% { transform: translateX(-50%) rotate(-6deg) translateY(0); }
    50% { transform: translateX(-50%) rotate(-4deg) translateY(-8px); }
  }
  .wishes-grid { columns: 2 340px; }
}

@media (max-width: 620px) {
  .brand-word { display: none; }
  .celebrate-btn span:not(.emoji) { display: none; }
  .celebrate-btn { padding: 0.65rem; }
  .hero { padding-top: 6.5rem; }
  .wishes-grid { columns: 1; }
  .wish-card { padding: 2.1rem 1.8rem 2rem; }
  .avatar { width: 64px; height: 64px; font-size: 1.35rem; }
  .ribbon { transform: rotate(-2.2deg); }
}

@media (min-width: 1800px) {
  :root { --edge: clamp(2rem, 8vw, 9rem); }
}
