/* ── Editorial ───────────────────────────────────────────── */

:root {
  color-scheme: light;
  --bg: #f5f0eb;
  --text: #1a1a1a;
  --text-muted: #7a7067;
  --gold: #c9a96e;
  --gold-dim: rgba(201, 169, 110, 0.18);
  --card-bg: rgba(255, 255, 255, 0.62);
  --card-border: rgba(201, 169, 110, 0.28);
  --card-rotate-x: 0deg;
  --card-rotate-y: 0deg;
  --card-translate-x: 0px;
  --card-translate-y: 0px;
  --pointer-x: 50%;
  --pointer-y: 50%;
  --shine-shift: 50%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.04;
  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)'/%3E%3C/svg%3E");
  background-size: 256px;
}

a { color: inherit; }

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

/* ── Vertical Watermark ─────────────────────────────────── */
.watermark {
  position: fixed;
  top: 50%;
  left: 6%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center center;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(8rem, 20vw, 18rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.03);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* ── Gold Ring ──────────────────────────────────────────── */
.gold-ring {
  position: fixed;
  top: 50%;
  left: 56%;
  width: clamp(28rem, 42vw, 38rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  animation: ring-rotate 120s linear infinite;
}

.gold-ring::before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  opacity: 0.4;
}

.gold-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--gold);
  border-radius: 50%;
  opacity: 0.3;
  animation: ring-rotate 80s linear infinite reverse;
}

/* ── Corner Label ───────────────────────────────────────── */
.corner-label {
  position: fixed;
  top: 2rem;
  right: 2.5rem;
  z-index: 10;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Bottom Line ────────────────────────────────────────── */
.bottom-line {
  position: fixed;
  bottom: 2rem;
  left: 2.5rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.bottom-line .separator {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

/* ── Card Stage ─────────────────────────────────────────── */
.card-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  /* Offset card to the right — not dead center */
  padding-left: 18%;
}

/* ── Glass Card ─────────────────────────────────────────── */
.glass-card {
  position: relative;
  width: min(100%, 25rem);
  min-height: 30rem;
  border-radius: 1.6rem;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38)),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1.5rem 4rem rgba(120, 100, 70, 0.08),
    0 3rem 6rem rgba(120, 100, 70, 0.06);
  overflow: hidden;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  transform:
    perspective(1200px)
    rotateX(var(--card-rotate-x))
    rotateY(var(--card-rotate-y))
    translate(var(--card-translate-x), var(--card-translate-y))
    translateZ(0);
  transform-style: preserve-3d;
  transition:
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  animation: card-entrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Soft inner glow */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201, 169, 110, 0.08), transparent 50%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.5), transparent 40%);
  pointer-events: none;
}

.glass-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: calc(1.6rem - 1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.08) 20%, transparent);
  pointer-events: none;
}

/* ── Animated Border ────────────────────────────────────── */
.glass-card__border {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    conic-gradient(
      from 0deg,
      rgba(201, 169, 110, 0.08) 0deg,
      rgba(201, 169, 110, 0.6) 60deg,
      rgba(218, 195, 150, 0.7) 140deg,
      rgba(201, 169, 110, 0.5) 220deg,
      rgba(201, 169, 110, 0.06) 360deg
    );
  opacity: 0.7;
  pointer-events: none;
  animation: border-spin 12s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}

/* ── Shine ──────────────────────────────────────────────── */
.glass-card__shine {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -18%;
  width: 55%;
  border-radius: 40%;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.08) 28%,
      rgba(255, 255, 255, 0.5) 48%,
      rgba(201, 169, 110, 0.08) 60%,
      rgba(255, 255, 255, 0) 100%
    );
  opacity: 0.6;
  pointer-events: none;
  transform:
    translateX(calc(var(--shine-shift) - 50%))
    rotate(14deg)
    translateZ(2rem);
  filter: blur(1px);
  mix-blend-mode: overlay;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Card Content ───────────────────────────────────────── */
.glass-card__content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.6rem;
  padding: 2rem;
  transform: translateZ(2.5rem);
  transform-style: preserve-3d;
}

.profile-block {
  display: grid;
  gap: 1.2rem;
  transform: translateZ(2rem);
}

.avatar {
  display: grid;
  place-items: center;
  width: 4.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold);
  border: 1.5px solid var(--gold);
  background: rgba(201, 169, 110, 0.06);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.profile-copy {
  display: grid;
  gap: 0.5rem;
}

.profile-copy h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.profile-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.profile-summary {
  margin: 0;
  max-width: 22rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── Stats ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  transform: translateZ(2.8rem);
}

.stat-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 0.8rem;
  border: 1px solid rgba(201, 169, 110, 0.16);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.4);
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms ease;
}

.glass-card:hover .stat-card { transform: translateY(-0.15rem); }
.glass-card:hover .stat-card:nth-child(2) { transform: translateY(-0.28rem); }
.glass-card:hover .stat-card:nth-child(3) { transform: translateY(-0.1rem); }

.stat-value {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

/* ── Footer ─────────────────────────────────────────────── */
.card-footer {
  display: grid;
  gap: 0.8rem;
  transform: translateZ(2.2rem);
}

.footer-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.8rem 1.4rem;
  border: 1.5px solid var(--gold);
  border-radius: 0;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  transition:
    background 200ms ease,
    color 200ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cta-button:hover,
.cta-button:focus-visible {
  background: var(--gold);
  color: #fff;
  transform: translateY(-1px);
}

.cta-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── Active state ───────────────────────────────────────── */
.glass-card.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2rem 5rem rgba(120, 100, 70, 0.12),
    0 4rem 8rem rgba(120, 100, 70, 0.08);
}

.glass-card.is-active .avatar {
  transform: translateY(-2px) scale(1.03);
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes card-entrance {
  from {
    opacity: 0;
    transform:
      perspective(1200px)
      rotateX(0deg) rotateY(0deg)
      translate(0, 0)
      translateZ(0)
      scale(0.92);
  }
  60% {
    transform:
      perspective(1200px)
      rotateX(0deg) rotateY(0deg)
      translate(0, 0)
      translateZ(0)
      scale(1.03);
  }
  to {
    opacity: 1;
    transform:
      perspective(1200px)
      rotateX(var(--card-rotate-x))
      rotateY(var(--card-rotate-y))
      translate(var(--card-translate-x), var(--card-translate-y))
      translateZ(0)
      scale(1);
  }
}

@keyframes border-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ring-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Fallback ───────────────────────────────────────────── */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .glass-card {
    background: rgba(255, 255, 255, 0.92);
  }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .glass-card {
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateZ(0);
  }

  .glass-card__shine {
    transform: translateX(0) rotate(14deg);
  }
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .card-stage {
    padding: 1.2rem;
    padding-left: 1.2rem;
  }

  .watermark {
    font-size: 6rem;
    left: 2%;
    opacity: 0.6;
  }

  .gold-ring {
    width: 22rem;
    left: 50%;
    opacity: 0.14;
  }

  .glass-card {
    width: min(100%, 26rem);
    min-height: auto;
  }

  .glass-card__content {
    gap: 1.3rem;
    padding: 1.4rem;
  }

  .corner-label { top: 1rem; right: 1.2rem; }
  .bottom-line { bottom: 1rem; left: 1.2rem; }

  .stats-grid { gap: 0.6rem; }

  .stat-card {
    padding: 0.75rem 0.7rem;
    border-radius: 0.6rem;
  }

  .cta-button { width: 100%; }
}

@media (max-width: 540px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) and (pointer: coarse) {
  .glass-card {
    touch-action: none;
  }
}
