/* Celestial Stables — showcase edition */
:root {
  --bg: #050816;
  --bg-2: #0c1226;
  --card: rgba(14, 20, 42, 0.62);
  --card-strong: rgba(21, 28, 56, 0.86);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef2ff;
  --muted: #b8c0e0;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --gold: #fbbf24;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --max: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.25), transparent 32%),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 30%),
    radial-gradient(circle at bottom, rgba(244, 114, 182, 0.1), transparent 28%),
    linear-gradient(120deg, #040814, #070d1c 35%, #0b1330 65%, #050816);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 24px),
    linear-gradient(25deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 28px);
  opacity: 0.12;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 90%);
}

.section {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(var(--max), calc(100% - 24px));
  margin: 14px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7, 12, 28, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.45);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  transition: 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
  transition: 0.25s ease;
}

.hero,
.page-hero {
  min-height: calc(100vh - 128px);
  display: grid;
  place-items: center;
  align-items: center;
  grid-template-columns: 1.15fr .95fr;
  gap: 28px;
  padding-top: 20px;
}

.page-hero {
  min-height: 55vh;

  display: flex;
  flex-direction: column;

  justify-content: center;
  align-items: flex-start;

  padding-top: 30px;
  padding-bottom: 10px;

  gap: 0;
}

.hero-copy h1,
.page-hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-copy h1 .glow-word {
  background: linear-gradient(135deg, var(--accent-2), var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: hueShift 6s ease-in-out infinite;
}

.lead {
  max-width: 58ch;
  font-size: 1.07rem;
  line-height: 1.75;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;

  font-size: 1.0rem;
  font-weight: 800;
  letter-spacing: .20em;
  text-transform: uppercase;

  background: linear-gradient(90deg,
      #fbbf24,
      #ffffff,
      #60a5fa,
      #a855f7,
      #fbbf24);

  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;

  animation: eyebrowFlow 8s linear infinite;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 60px;
  height: 1px;

  background: linear-gradient(to right,
      transparent,
      rgba(255, 255, 255, .75),
      transparent);
}

.master-summon {

  animation: masterCelebration 2s ease;

}

@keyframes masterCelebration {

  0% {

    box-shadow:
      0 0 0 rgba(251, 191, 36, 0);

    transform: scale(1);

  }

  30% {

    box-shadow:
      0 0 60px rgba(251, 191, 36, .8),
      0 0 120px rgba(168, 85, 247, .45);

    transform: scale(1.02);

  }

  70% {

    box-shadow:
      0 0 80px rgba(96, 165, 250, .55),
      0 0 140px rgba(251, 191, 36, .55);

  }

  100% {

    box-shadow: none;

    transform: scale(1);

  }

}

@keyframes eyebrowFlow {

  0% {
    background-position: 0%;
  }

  100% {
    background-position: 300%;
  }

}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  transition: 0.25s ease;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
  border-color: transparent;
}

.btn.ghost {
  backdrop-filter: blur(12px);
}

/* ---------- Portrait frames (hero + horse cards) ---------- */

.hero-art {
  position: relative;
  width: min(100%, 460px);
  margin-left: auto;
  animation: float 8s ease-in-out infinite;
}

.portrait-frame {
  position: relative;
  padding: 4px;
  border-radius: var(--radius-xl);

  background: conic-gradient(from var(--angle),
      var(--accent),
      var(--accent-2),
      var(--accent-3),
      var(--gold),
      var(--accent));

  animation: borderRotate 2s linear infinite;

  box-shadow: 0 30px 80px rgba(139, 92, 246, 0.35);
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes borderRotate {
  from {
    --angle: 0deg;
  }

  to {
    --angle: 360deg;
  }
}

/* Outer glow */
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: calc(var(--radius-xl) + 18px);
  background: radial-gradient(circle,
      rgba(139, 92, 246, 0.35),
      transparent 70%);
  filter: blur(22px);
  z-index: -1;

  animation: glowPulse 4s ease-in-out infinite;
}

.portrait-inner {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 4px);
  background: #0b0f1f;
}

.portrait-inner img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.portrait-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 20px 16px;
  background: linear-gradient(to top,
      rgba(3, 5, 14, 0.92),
      transparent);
  text-align: left;
}

.portrait-caption .tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.portrait-caption h3 {
  margin: 0;
  font-size: 1.4rem;
}

@keyframes rotateBorder {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.45;
    transform: scale(1);
  }

  50% {
    opacity: 0.85;
    transform: scale(1.06);
  }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 4px;
}

.info-card,
.horse-card,
.summon-box,
.about {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), rgba(9, 14, 30, 0.72));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.info-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  min-height: 250px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.info-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(139, 92, 246, 0.25);
}

.info-card h2,
.horse-head h2,
.section-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.info-card p,
.horse-content p,
.about p,
.summon-box p {
  color: var(--muted);
  line-height: 1.75;
}

.card-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 1.45rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(34, 211, 238, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 18px;
}

.about {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.section-heading {
  margin-bottom: 18px;
}

.horses-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.horse-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.horse-master {
  grid-column: 1 / -1;
  width: min(100%, 700px);
  justify-self: center;
}

.horse-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 70px rgba(34, 211, 238, 0.2);
}

.horse-image {
  position: relative;
  padding: 0;
  aspect-ratio: 1/1;
  width: 100%;
  overflow: hidden;
}

.horse-image .portrait-frame {
  border-radius: 0;
  padding: 0;
  animation: none;
  box-shadow: none;
}

.horse-image .portrait-frame::after {
  display: none;
}

.horse-image .portrait-inner {
  border-radius: 0;
}

.horse-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: transform 0.6s ease;
}

.horse-card:hover .horse-image img {
  transform: scale(1.06);
}

.horse-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 -60px 60px -20px rgba(6, 9, 20, 0.85);
}

.elem-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.horse-image.white .elem-badge {
  background: radial-gradient(circle, rgba(226, 232, 240, 0.5), rgba(148, 163, 184, 0.25));
}

.horse-image.red .elem-badge {
  background: radial-gradient(circle, rgba(251, 113, 133, 0.5), rgba(239, 68, 68, 0.25));
}

.horse-image.earth .elem-badge {
  background: radial-gradient(circle, rgba(163, 230, 53, 0.4), rgba(132, 94, 52, 0.35));
}

.horse-image.night .elem-badge {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.5), rgba(37, 99, 235, 0.3));
}

.horse-image.master .elem-badge {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.5), rgba(15, 23, 42, 0.4));
}

.horse-content {
  padding: 22px 22px 26px;
}

.horse-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.horse-head span {
  color: #d9c8ff;
  font-weight: 600;
  font-size: 0.92rem;
}

/* ---------- Summon section ---------- */

.summon {
  padding-bottom: 8px;
}

.summon-box {
  margin-top: 32px;
  padding: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 620px;
}

.summon-visual {
  position: relative;
  min-height: 100%;
  background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.35), transparent 60%), #070b18;
  display: grid;
  place-items: center;
  padding: 40px;
}

.summon-visual .portrait-frame {
  width: min(100%, 520px);
  max-width: none;
}

.summon-visual .portrait-inner img {
  aspect-ratio: 1 / 1;
  transition: opacity 0.22s ease;
}

.summon-panel {
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.summon-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
}

#horseName {
  margin: 18px 0 10px;
  font-size: clamp(2.7rem, 5vw, 4.3rem);
  line-height: .95;
  letter-spacing: 0.02em;
}

#horseElement {
  display: inline-block;
  margin-bottom: 14px;
  border-radius: 999px;
  font-size: .95rem;
  padding: 10px 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--gold);
}

#horseTag {
  margin-bottom: 26px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.summon-panel .btn {
  align-self: flex-start;
}

.summon-panel .btn{
    min-height:60px;
    padding:0 34px;
    font-size:1.08rem;
}

#horseTag{
    font-size:1.15rem;
    line-height:1.8;
}

@media (max-width: 860px) {
  .summon-box {
    grid-template-columns: 1fr;
  }

  .summon-panel {
    text-align: center;
    align-items: center;
  }

  .summon-panel .btn {
    align-self: center;
  }
}

.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 30;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 12px auto 28px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
  opacity: 0.55;
  z-index: -1;
}

.stars-1 {
  background-image:
    radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.95) 0 1px, transparent 1.6px),
    radial-gradient(circle at 80px 140px, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.6px),
    radial-gradient(circle at 200px 60px, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px);
  background-size: 260px 260px;
  animation: drift 34s linear infinite;
}

.stars-2 {
  background-image:
    radial-gradient(circle at 50px 80px, rgba(34, 211, 238, 0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle at 160px 180px, rgba(139, 92, 246, 0.75) 0 1px, transparent 1.6px),
    radial-gradient(circle at 240px 30px, rgba(244, 114, 182, 0.7) 0 1px, transparent 1.4px);
  background-size: 320px 320px;
  animation: drift 48s linear reverse infinite;
}

.stars-3 {
  background-image:
    radial-gradient(circle at 30px 120px, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px),
    radial-gradient(circle at 120px 30px, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.3px),
    radial-gradient(circle at 220px 190px, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px);
  background-size: 180px 180px;
  animation: drift 22s linear infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(0.6deg);
  }
}

@keyframes rotateGlow {
  from {
    filter: hue-rotate(0deg);
  }

  to {
    filter: hue-rotate(360deg);
  }
}

@keyframes hueShift {

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

  50% {
    background-position: 100% 50%;
  }
}

@keyframes drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 1000px 700px;
  }
}

@media (max-width: 960px) {

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 20px;
  }

  .page-hero {
    min-height: auto;
    padding-top: 20px;
    align-items: flex-start;
  }

  .hero-art {
    width: min(100%, 380px);
    margin: 8px auto 0;
  }

  .cards-grid,
  .horses-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    border-radius: 24px;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

  .nav {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 8px;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    padding: 12px 14px;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: clamp(2.2rem, 11vw, 4rem);
  }

  .horse-head {
    flex-direction: column;
    align-items: flex-start;
  }
}