:root {
  --bg: #050505;
  --bg-elevated: #0c0c0c;
  --card: #111111;
  --card-border: rgba(255, 255, 255, 0.07);
  --ink: #f4f0e8;
  --ink-soft: rgba(244, 240, 232, 0.62);
  --ink-muted: rgba(244, 240, 232, 0.42);
  --gold: #c9a66b;
  --gold-soft: #e4c99a;
  --gold-deep: #a8864a;
  --nav-bg: rgba(255, 255, 255, 0.05);
  --nav-border: rgba(255, 255, 255, 0.08);
  --ghost-bg: rgba(255, 255, 255, 0.08);
  --indicator: linear-gradient(135deg, #d4b078 0%, #c9a66b 45%, #a8864a 100%);
  --font: "Outfit", system-ui, -apple-system, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --shadow-card:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.35);
  --glow: 0 0 48px rgba(201, 166, 107, 0.12);
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font: inherit;
  cursor: pointer;
}

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

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

/* ---------- Page shell ---------- */

.page {
  position: relative;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5em 1.5em;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(201, 166, 107, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(201, 166, 107, 0.05), transparent 50%),
    radial-gradient(ellipse 40% 30% at 10% 80%, rgba(255, 255, 255, 0.03), transparent 45%),
    var(--bg);
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.45;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ---------- Bouncy tabs ---------- */

.bouncy-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2.25em;
  width: min(100%, 52em);
}

.bouncy-tabs__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45em;
}

.bouncy-tabs__eyebrow {
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.bouncy-tabs__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-style: italic;
}

/* ---------- Nav ---------- */

.bouncy-tabs__nav {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  padding: 0.4em;
  border-radius: 100em;
  background-color: var(--nav-bg);
  border: 1px solid var(--nav-border);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bouncy-tabs__ghost {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 2em;
  border-radius: 100em;
  background-color: var(--ghost-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bouncy-tabs__indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 3em;
  border-radius: 100em;
  background: var(--indicator);
  box-shadow:
    0 2px 12px rgba(201, 166, 107, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
  will-change: transform, width, height;
}

.bouncy-tabs__button {
  position: relative;
  z-index: 3;
  appearance: none;
  border: none;
  border-radius: 100em;
  padding: 0.7em 1.35em;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.92em;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.bouncy-tabs__button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

[data-bouncy-tabs-button][data-active] {
  color: #1a140c;
}

/* ---------- Content card ---------- */

.bouncy-tabs__collection {
  width: 100%;
  padding: 2.75em;
  border-radius: 1.6em;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
    var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card), var(--glow);
  overflow: hidden;
  will-change: transform;
}

.bouncy-tabs__list {
  position: relative;
  width: 100%;
}

.bouncy-tabs__item {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2.25em;
}

[data-bouncy-tabs-panel]:not([data-active]) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

[data-bouncy-tabs-panel][data-active] {
  pointer-events: auto;
}

.bouncy-tabs__item-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  gap: 0.85em;
  min-width: 0;
}

.bouncy-tabs__meta {
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.bouncy-tabs__heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.bouncy-tabs__para {
  margin: 0;
  font-size: 0.98em;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 32ch;
}

.bouncy-tabs__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-top: 0.5em;
  padding: 0.8em 1.6em;
  border-radius: 100em;
  background: var(--indicator);
  color: #1a140c;
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  box-shadow:
    0 4px 20px rgba(201, 166, 107, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
}

.bouncy-tabs__cta:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 8px 28px rgba(201, 166, 107, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.bouncy-tabs__cta:active {
  transform: scale(0.98);
}

.bouncy-tabs__cta:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

.bouncy-tabs__item-visual {
  position: relative;
  width: 46%;
  flex-shrink: 0;
  aspect-ratio: 1;
  border-radius: 1.15em;
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 16px 40px rgba(0, 0, 0, 0.4);
}

.bouncy-tabs__item-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(201, 166, 107, 0.12) 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.25) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.bouncy-tabs__item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  transform: scale(1.02);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-bouncy-tabs-panel][data-active] .bouncy-tabs__item-img {
  transform: scale(1);
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 767px) {
  .page {
    padding: 2.5em 1.15em 2em;
    align-items: flex-start;
  }

  .bouncy-tabs {
    gap: 1.75em;
  }

  .bouncy-tabs__nav {
    border-radius: 1.35em;
  }

  .bouncy-tabs__button {
    padding: 0.58em 1.05em;
    font-size: 0.88em;
  }

  .bouncy-tabs__collection {
    padding: 1.4em;
    border-radius: 1.25em;
  }

  .bouncy-tabs__item {
    flex-direction: column;
    align-items: stretch;
    gap: 1.4em;
  }

  .bouncy-tabs__item-visual {
    width: 100%;
    order: -1;
    aspect-ratio: 16 / 11;
  }

  .bouncy-tabs__heading {
    font-size: 1.55rem;
  }

  .bouncy-tabs__para {
    max-width: none;
    font-size: 0.95em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bouncy-tabs__button,
  .bouncy-tabs__cta,
  .bouncy-tabs__item-img {
    transition: none;
  }
}
