/**
 * Sovereign Terminal — /thank-you/ (page-thank-you.php).
 * The gold CTA (.flags__cta) comes from fraud.css; post artwork (.home-media)
 * is styled here because home.css only loads on the front page.
 */

/* ══ Hero ════════════════════════════════════════════════════════════════════ */
.thanks-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--space-16) + 40px) 0 var(--space-16);
  background: var(--deep);
  text-align: center;
}

.thanks-hero__fx,
.thanks-hero__fx > span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.thanks-hero__glow {
  background:
    radial-gradient(40% 55% at 50% 22%, rgba(227, 201, 131, 0.22), transparent 70%),
    radial-gradient(60% 60% at 50% 120%, rgba(176, 141, 63, 0.16), transparent 70%);
}

.thanks-hero__grid {
  background-image:
    linear-gradient(rgba(227, 201, 131, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(227, 201, 131, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(55% 70% at 50% 30%, #000 10%, transparent 75%);
  mask-image: radial-gradient(55% 70% at 50% 30%, #000 10%, transparent 75%);
}

/* Sparks: burst once from behind the seal */
.thanks-hero__sparks {
  inset: auto !important;
  left: 50% !important;
  top: calc(var(--space-16) + 40px + 60px) !important;
  width: 0;
  height: 0;
}

.thanks-hero__sparks i {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px rgba(227, 201, 131, 0.8);
  opacity: 0;
  animation: thanks-spark var(--d) cubic-bezier(0.15, 0.7, 0.3, 1) 0.9s forwards;
}

.thanks-hero__sparks i:nth-child(3n) {
  width: 4px;
  height: 4px;
  background: #fff;
}

@keyframes thanks-spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(0) scale(0.4);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(1);
  }
}

.thanks-hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Seal: ring draws, then the tick */
.thanks-seal {
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-8);
}

.thanks-seal svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.thanks-seal__halo {
  fill: rgba(227, 201, 131, 0.08);
  stroke: rgba(227, 201, 131, 0.18);
  stroke-width: 1;
  transform-origin: 60px 60px;
  animation: thanks-halo 2.6s ease-out 1.2s infinite;
}

.thanks-seal__ring,
.thanks-seal__tick {
  fill: none;
  stroke: url(#thanks-gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.thanks-seal__ring {
  stroke-width: 3;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  animation: thanks-draw 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}

.thanks-seal__tick {
  stroke-width: 6;
  animation: thanks-draw 0.45s cubic-bezier(0.65, 0, 0.35, 1) 0.8s forwards;
}

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

@keyframes thanks-halo {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

.thanks-hero__eyebrow {
  margin-bottom: var(--space-3);
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.thanks-hero__title {
  margin-bottom: var(--space-5);
  font-family: var(--font-headline);
  font-size: var(--text-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--base);
}

/* Editor content: whatever headings/paragraphs were typed, restyled */
.thanks-hero__lead {
  max-width: 60ch;
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(252, 250, 246, 0.74);
}

.thanks-hero__lead > * + * {
  margin-top: var(--space-4);
}

.thanks-hero__lead h1,
.thanks-hero__lead h2,
.thanks-hero__lead h3,
.thanks-hero__lead h4 {
  font-family: var(--font-headline);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.25;
  background: linear-gradient(100deg, #f3dfa6, var(--gold-bright) 45%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.thanks-hero__lead a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.thanks-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.thanks-hero__ghost {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-6);
  border: 1px solid rgba(227, 201, 131, 0.35);
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--base);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.thanks-hero__ghost:hover {
  border-color: var(--gold-bright);
  background: rgba(227, 201, 131, 0.08);
  color: var(--gold-bright);
}

/* Copy rises in after the seal */
.thanks-hero__eyebrow,
.thanks-hero__title,
.thanks-hero__lead,
.thanks-hero__actions {
  animation: thanks-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.thanks-hero__eyebrow { animation-delay: 0.5s; }
.thanks-hero__title { animation-delay: 0.6s; }
.thanks-hero__lead { animation-delay: 0.7s; }
.thanks-hero__actions { animation-delay: 0.8s; }

@keyframes thanks-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ══ What happens next ═══════════════════════════════════════════════════════ */
.thanks-next__title {
  margin-bottom: var(--space-8);
  font-family: var(--font-headline);
  font-size: var(--text-headline-lg);
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}

.thanks-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.thanks-step {
  position: relative;
  padding: var(--space-8) var(--space-6) var(--space-6);
  border: 1px solid var(--gold-hairline);
  border-radius: var(--radius-lg);
  background: var(--elevated);
  box-shadow: var(--shadow-sm);
}

.thanks-step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--space-6);
  right: var(--space-6);
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.thanks-step__num {
  display: block;
  margin-bottom: var(--space-3);
  font-family: var(--font-headline);
  font-size: 2.25rem;
  font-style: italic;
  line-height: 1;
  color: var(--gold);
}

.thanks-step__title {
  margin-bottom: var(--space-2);
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.thanks-step__text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-body);
}

.thanks-step__text strong {
  color: var(--ink);
  word-break: break-all;
}

.thanks-step__text a {
  display: inline-block;
  margin-top: var(--space-2);
  font-weight: 600;
  color: var(--gold-deep);
}

/* ══ Start reading ═══════════════════════════════════════════════════════════ */
.thanks-read__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.thanks-card__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.thanks-card__media {
  aspect-ratio: 16 / 10;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
}

.thanks-card__cat {
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.thanks-card__title {
  font-family: var(--font-headline);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.2s ease;
}

.thanks-card__link:hover .thanks-card__title {
  color: var(--gold-deep);
}

.thanks-card__time {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Post artwork + fallback plate (mirrors home.css) */
.home-media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--deep);
}

.home-media__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

a:hover .home-media__img {
  transform: scale(1.04);
}

.home-media__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e1a15, var(--deep));
}

.home-media__ph-mark {
  font-family: var(--font-headline);
  font-size: 3rem;
  font-style: italic;
  color: var(--gold-bright);
}

.home-media__ph-label {
  display: none;
}

/* ══ Responsive ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .thanks-steps,
  .thanks-read__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .thanks-read__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .thanks-hero {
    padding-bottom: var(--space-12);
  }

  .thanks-seal {
    width: 96px;
    height: 96px;
  }

  .thanks-hero__sparks {
    top: calc(var(--space-16) + 40px + 48px) !important;
  }

  .thanks-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .thanks-hero__actions > * {
    justify-content: center;
    width: 100%;
  }

  .thanks-read__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thanks-hero__sparks {
    display: none;
  }

  .thanks-seal__ring,
  .thanks-seal__tick {
    animation: none;
    stroke-dashoffset: 0;
  }

  .thanks-seal__halo,
  .thanks-hero__eyebrow,
  .thanks-hero__title,
  .thanks-hero__lead,
  .thanks-hero__actions {
    animation: none;
  }
}
