:root {
  --fg: #18181b;
  --muted: #71717a;
  --border: #dedee0;
  --surface: #fff;
  --font-display: "Unbounded", "Inter", sans-serif;
  --font-text: "Inter", system-ui, sans-serif;
  --shadow-float: 0 2px 8px rgba(0, 0, 0, .06), 0 -6px 12px rgba(0, 0, 0, .03), 0 14px 28px rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 24px;
  background-color: var(--page-bg-color, rgb(231, 212, 175));
  background-image: var(--page-bg, linear-gradient(90deg, rgb(176, 187, 189) 0%, rgb(230, 210, 176) 100%));
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-bg, linear-gradient(90deg, rgb(176, 187, 189) 0%, rgb(230, 210, 176) 100%));
}
.bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.gift-pending { overflow: hidden; }
.gift-pending .page, .gift-pending .fab { opacity: 0; visibility: hidden; }
.gift-opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #1d1712;
  color: #fff;
  opacity: 1;
  transition: opacity .8s ease;
}
.gift-opening[hidden], .gift-opening [hidden] { display: none; }
.gift-opening[data-stage="fading"] { opacity: 0; pointer-events: none; }
.gift-opening__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gift-opening__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: rgb(24 19 15 / .6);
  text-align: center;
}
.gift-opening__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgb(255 255 255 / .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gift-spin .8s linear infinite;
}
.gift-opening__actions {
  position: absolute;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}
.gift-opening__button {
  width: min(100%, 360px);
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 28px;
  background: rgb(24 24 27 / .75);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .2s;
}
.gift-opening__button:hover { opacity: .9; }
.gift-opening__button:disabled { cursor: wait; opacity: .75; }
.gift-opening__skip { border: 0; background: none; color: #fff; text-decoration: underline; padding: 8px; }
.gift-opening__button:focus-visible, .gift-opening__skip:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
@keyframes gift-spin { to { transform: rotate(360deg); } }

p, h1, h2 { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }

.page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 430px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Heading */
.heading { display: flex; flex-direction: column; gap: 16px; }
.heading__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 36px;
  text-transform: uppercase;
}
.heading__subtitle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
}

/* Segment */
.segment {
  position: relative;
  display: flex;
  gap: 2px;
  height: 28px;
  border: 1px solid var(--fg);
  border-radius: 24px;
  overflow: hidden;
}
.segment__thumb {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(50% - 1px);
  border-radius: 24px;
  background: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: transform .4s var(--ease);
}
.segment[data-tab="details"] .segment__thumb { transform: translateX(calc(100% + 2px)); }
.segment__item {
  position: relative;
  flex: 1 1 0;
  height: 26px;
  padding: 0 8px;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 26px;
  white-space: nowrap;
  transition: color .3s;
}
.segment__item.is-active { color: var(--surface); }

/* Card */
.card-scene {
  --holo-pattern: url("assets/glitter.svg");
  --holo-pattern-opacity: .9;
  --holo-texture-opacity: .1;
  --holo-pointer-x: 50%;
  --holo-pointer-y: 50%;
  --holo-bg-x: 50%;
  --holo-bg-y: 50%;
  --holo-opacity: 0;
  perspective: 800px;
  touch-action: pan-y pinch-zoom;
}
.card-tilt {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}
.card {
  position: relative;
  aspect-ratio: 520 / 325;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
}
.card__face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-float);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card__face--front { background: var(--card-bg, #f29272); }
.card__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: var(--card-fit, cover);
}
.card__amount {
  position: absolute;
  left: 16px;
  bottom: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 20px;
  color: var(--card-fg, var(--surface));
  text-transform: uppercase;
}
.card__face--back {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  transform: rotateY(180deg);
}
.card__stripe {
  position: absolute;
  top: 10%;
  left: 0;
  width: 100%;
  height: 15.4%;
  background: #e1e1e1;
}
.card__body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  padding: 16px;
}
.card__number { display: flex; flex-direction: column; }
.card__label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--muted);
}
.card__label--lg { font-size: 16px; line-height: 24px; }
.card__number-value {
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 2.4px;
  white-space: nowrap;
}
.card__value { font-size: 16px; line-height: 24px; }
.card__footer { display: flex; justify-content: space-between; align-items: flex-end; }
.card__footer-end { text-align: right; }

/* Holo: слои как у HeroUI HoloCard (pattern / shine / shine-pattern) */
.card__art { z-index: 0; pointer-events: none; user-select: none; }
.card__pattern {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background-image: var(--holo-pattern);
  background-repeat: repeat;
  mix-blend-mode: overlay;
  opacity: var(--holo-texture-opacity);
}
.card__shine {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  filter: brightness(1.25) contrast(1.1) saturate(1.2);
  mix-blend-mode: color-dodge;
  opacity: var(--holo-opacity);
}
.card__shine > * { grid-area: 1 / 1; }
.card__shine::before, .card__shine::after {
  content: "";
  grid-area: 1 / 1;
  border-radius: inherit;
}
.card__shine::before {
  background: rgb(255, 255, 255);
  background-blend-mode: screen;
  filter: brightness(0) contrast(1.1);
  mix-blend-mode: hard-light;
}
.card__shine::after {
  background-image: radial-gradient(farthest-corner circle at var(--holo-pointer-x) var(--holo-pointer-y), #b8b8b8 0%, #c7c7c730 25%, #000 90%);
  background-position: 50% center;
  background-size: cover;
  mix-blend-mode: luminosity;
  filter: brightness(.5) contrast(2);
}
.card__shine-pattern {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background-image: var(--holo-pattern);
  background-repeat: repeat;
  background-position: calc((50% - var(--holo-bg-x)) * 2.6 + 50%) calc((50% - var(--holo-bg-y)) * 3.5 + 50%);
  mix-blend-mode: soft-light;
  opacity: var(--holo-pattern-opacity);
}
.card__face--front .card__amount { z-index: 20; transform: translate(var(--parallax-x, 0px), var(--parallax-y, 0px)); }

/* Entrance animation */
.card-scene.is-intro { animation: card-in 1s var(--ease) backwards; }
.card-scene.is-intro .card__amount { animation: fade-up .6s .5s var(--ease) backwards; }
.greeting.is-intro .greeting__box { animation: fade-up .8s .3s var(--ease) both; }

@keyframes card-in {
  0% { opacity: 0; transform: perspective(900px) translateY(40px) rotateX(35deg) rotateZ(-4deg) scale(.92); }
  100% { opacity: 1; transform: none; }
}
@keyframes fade-up {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: none; }
}

/* Greeting */
.greeting { padding-top: 8px; }
.greeting__box {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px 20px 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow-float);
  text-align: center;
}
.greeting__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
}
.greeting__from { font-size: 18px; line-height: 28px; font-weight: 600; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 16px; padding-top: 32px; }
.faq__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  text-transform: uppercase;
}
.accordion__trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 12px 40px 12px 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
}
.accordion__icon {
  position: absolute;
  right: 16px;
  top: calc(50% - 8px);
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("assets/chevron-down.svg") center / contain no-repeat;
  -webkit-mask: url("assets/chevron-down.svg") center / contain no-repeat;
  transition: transform .3s var(--ease);
}
.accordion__trigger[aria-expanded="true"] .accordion__icon { transform: rotate(180deg); }
.accordion__trigger { transition: opacity .2s; }
.accordion__trigger:hover, .segment__item:hover, .fab__button:hover { opacity: .9; }
.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease);
}
.accordion__panel > div { overflow: hidden; }
.accordion__panel p {
  padding: 0 24px 12px 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--fg);
}
.accordion__trigger[aria-expanded="true"] + .accordion__panel { grid-template-rows: 1fr; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-top: 8px;
  padding: 0 16px;
  border-radius: 24px;
  background: var(--fg);
  color: var(--surface);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: transform .2s var(--ease), opacity .2s;
}
.button:hover { opacity: .9; }
.button:active { transform: scale(.98); }

/* Floating menu */
.fab {
  position: fixed;
  z-index: 10;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.fab__button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 28.8px;
  background: rgba(24, 24, 27, .7);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: transform .2s var(--ease), opacity .2s;
}
.fab__button:active { transform: scale(.94); }
.fab__icon { grid-area: 1 / 1; width: 19.2px; height: 19.2px; }
.fab__icon--h { display: none; }

.menu {
  order: 2;
  width: 240px;
  padding: 4px;
  border-radius: 24px;
  background: rgba(24, 24, 27, .7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow-float);
  transform-origin: top right;
  animation: menu-in .25s var(--ease);
}
.menu[hidden] { display: none; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 20px;
  background: none;
  color: var(--surface);
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: background .2s;
}
.menu__item:hover, .menu__item:focus-visible { background: rgba(255, 255, 255, .12); outline: 0; }

@keyframes menu-in {
  0% { opacity: 0; transform: scale(.92) translateY(-6px); }
  100% { opacity: 1; transform: none; }
}

/* Desktop */
@media (min-width: 768px) {
  .card-scene { perspective: 1000px; }
  .page { max-width: 560px; gap: 32px; padding: 80px 20px; }
  .heading { gap: 24px; align-items: center; text-align: center; }
  .heading__title { font-size: 48px; line-height: 60px; white-space: nowrap; }
  .heading__subtitle { font-size: 30px; line-height: 36px; }

  .card__amount { left: 24px; bottom: 24px; font-size: 20px; }
  .card__body { padding: 24px; gap: 64px; }
  .card__label { font-size: 14px; line-height: 20px; }
  .card__label--lg { font-size: 20px; line-height: 28px; }
  .card__number-value { font-size: 24px; line-height: 32px; letter-spacing: 2.88px; }

  .greeting__box { gap: 32px; }
  .faq { padding-top: 48px; }
  .faq__title { font-size: 30px; line-height: 36px; }
  .accordion__trigger { padding: 16px 40px 16px 0; font-size: 20px; }
  .accordion__panel p { padding-bottom: 16px; }
  .button { margin-top: 16px; }

  .fab {
    top: auto;
    right: 30px;
    bottom: 30px;
  }
  .fab__button { width: 64px; height: 64px; border-radius: 38.4px; }
  .fab__icon { width: 25.6px; height: 25.6px; }
  .fab__icon--h { display: block; }
  .fab__icon--v { display: none; }
  .menu { order: 0; transform-origin: bottom right; animation-name: menu-in-up; }
}

@keyframes menu-in-up {
  0% { opacity: 0; transform: scale(.92) translateY(6px); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
