/* ============================================================
   style.css — Moonwhisper Coven
   ============================================================ */

/* ── Google Fonts ── */
/* Google Fonts loaded via HTML <link> */

/* ────────────────────────────────────────
   DESIGN TOKENS
──────────────────────────────────────── */
:root {
  --ink:        #050310;
  --deep:       #080620;
  --mid:        #120d30;
  --violet:     #2d1b69;
  --purple:     #6b3fa0;
  --lavender:   #a78bda;
  --silver:     #c8bfe7;
  --moonwhite:  #f0eaff;
  --gold:       #d4a843;
  --stargold:   #ffe680;
  --rose:       #d46b8a;
  --teal:       #4fd1c5;

  --font-title: 'Cinzel Decorative', serif;
  --font-body:  'Cormorant Garamond', serif;

  --radius-card: 16px;
  --radius-pill: 50px;

  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Fluid spacing tokens */
  --section-pad-y: clamp(3.5rem, 8vw, 7rem);
  --section-pad-x: clamp(1rem, 4vw, 2rem);
}

/* ────────────────────────────────────────
   BASE
──────────────────────────────────────── */
body {
  background: var(--ink);
  color: var(--moonwhite);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
}

/* ────────────────────────────────────────
   CURSOR
──────────────────────────────────────── */
#cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 14px;
  height: 14px;
  background: var(--stargold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px var(--stargold), 0 0 30px var(--gold);
  mix-blend-mode: screen;
  transition: width 0.15s, height 0.15s;
}

#cursor-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(167, 139, 218, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.1s ease, top 0.1s ease;
}

/* Hide custom cursor on touch devices and restore native cursor */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  #cursor,
  #cursor-trail { display: none; }
  a, button, .hero__cta, .contact__btn, .spell-card { cursor: pointer; }
}

/* ────────────────────────────────────────
   BACKGROUND CANVASES
──────────────────────────────────────── */
#star-canvas,
#magic-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#star-canvas  { z-index: 0; }
#magic-canvas { z-index: 1; }

/* ────────────────────────────────────────
   SHOOTING STAR
──────────────────────────────────────── */
.shooting-star {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  width: 2px;
  height: 90px;
  background: linear-gradient(to bottom, transparent, var(--stargold));
  border-radius: 2px;
  animation: shoot 0.8s linear forwards;
}

@keyframes shoot {
  0%   { opacity: 1; transform: rotate(45deg) translateY(0); }
  100% { opacity: 0; transform: rotate(45deg) translateY(220px); }
}

/* ────────────────────────────────────────
   MAGIC CIRCLE
──────────────────────────────────────── */
.mc-wrap {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.mc {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mc1 {
  width: clamp(180px, 42vw, 340px);
  height: clamp(180px, 42vw, 340px);
  border: 1px solid rgba(107, 63, 160, 0.22);
  animation: mcRotate 22s linear infinite;
}
.mc2 {
  width: clamp(260px, 65vw, 520px);
  height: clamp(260px, 65vw, 520px);
  border: 1px solid rgba(107, 63, 160, 0.14);
  animation: mcRotate 36s linear infinite reverse;
}
.mc3 {
  width: clamp(340px, 88vw, 700px);
  height: clamp(340px, 88vw, 700px);
  border: 1px solid rgba(107, 63, 160, 0.07);
  animation: mcRotate 52s linear infinite;
}

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

/* ────────────────────────────────────────
   NAVIGATION
──────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 200;
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: background var(--transition-slow), backdrop-filter var(--transition-slow);
}

.nav.scrolled {
  background: rgba(5, 3, 16, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(167, 139, 218, 0.12);
}

.nav__logo {
  font-family: var(--font-title);
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--gold);
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  gap: clamp(0.8rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav__links a {
  color: var(--silver);
  font-size: clamp(0.68rem, 1.4vw, 0.82rem);
  letter-spacing: 0.2em;
  font-family: var(--font-title);
  transition: color var(--transition-base);
  position: relative;
  white-space: nowrap;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 100%;
  height: 1px;
  background: var(--gold);
  transition: right var(--transition-base);
}

.nav__links a:hover              { color: var(--stargold); }
.nav__links a:hover::after       { right: 0; }

/* ────────────────────────────────────────
   HERO (FV)
──────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh; /* safer on mobile with URL bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  overflow: hidden;
  padding: 0 1rem 10vh;
}

/* Scene background image */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center top;
  transform-origin: center;
  animation: heroZoom 24s ease-in-out infinite alternate;
  filter: brightness(0.82) saturate(1.1);
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 3, 16, 0.08) 0%,
    rgba(5, 3, 16, 0.00) 25%,
    rgba(5, 3, 16, 0.10) 55%,
    rgba(5, 3, 16, 0.88) 100%
  );
}

@keyframes heroZoom {
  from { transform: scale(1.0); }
  to   { transform: scale(1.07); }
}

/* Text overlay */
.hero__content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 720px;
  padding: 0 1rem;
}

.hero__tagline {
  font-family: var(--font-title);
  font-size: clamp(0.65rem, 2.2vw, 1rem);
  letter-spacing: clamp(0.2em, 1vw, 0.5em);
  color: var(--silver);
  opacity: 0;
  animation: fadeUp 1.5s ease forwards 0.8s;
}

.hero__cta {
  display: inline-block;
  margin-top: 1.8rem;
  padding: clamp(0.75rem, 2vw, 0.9rem) clamp(1.8rem, 6vw, 3rem);
  font-family: var(--font-title);
  font-size: clamp(0.68rem, 1.7vw, 0.78rem);
  letter-spacing: 0.3em;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold), var(--stargold));
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  opacity: 0;
  animation: fadeUp 1.5s ease forwards 1.3s;
}

.hero__cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: rgba(255, 255, 255, 0.3);
  transform: skewX(-20deg);
  transition: left var(--transition-slow);
}

.hero__cta:hover {
  transform: scale(1.06);
  box-shadow: 0 0 40px rgba(212, 168, 67, 0.6);
}

.hero__cta:hover::before { left: 125%; }

.hero__scroll-hint {
  position: absolute;
  bottom: clamp(1.2rem, 3vw, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-title);
  font-size: clamp(0.55rem, 1.3vw, 0.6rem);
  letter-spacing: 0.35em;
  color: var(--lavender);
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  animation: fadeUp 1s ease forwards 2s, scrollBounce 2.5s ease-in-out 2.5s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.6; }
  50%       { transform: translateX(-50%) translateY(8px); opacity: 1.0; }
}

/* ────────────────────────────────────────
   SHARED SECTION STYLES
──────────────────────────────────────── */
.section {
  position: relative;
  z-index: 2;
  padding: var(--section-pad-y) var(--section-pad-x);
}

.section--dark {
  background: radial-gradient(ellipse at 20% 50%, rgba(45, 27, 105, 0.28), transparent 60%);
}

.section__title {
  font-family: var(--font-title);
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.14em;
  margin-bottom: 0.4rem;
}

.section__sub {
  text-align: center;
  font-style: italic;
  color: var(--lavender);
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  margin-bottom: 0.8rem;
  letter-spacing: 0.1em;
}

.section__divider {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0 clamp(2rem, 5vw, 3.5rem);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--purple);
  flex-wrap: wrap;
}

/* ────────────────────────────────────────
   SPELL CARDS (魔法の書)
──────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  max-width: 900px;
  margin: 0 auto;
}

.spell-card {
  background: linear-gradient(135deg, rgba(45, 27, 105, 0.5), rgba(5, 3, 16, 0.8));
  border: 1px solid rgba(167, 139, 218, 0.22);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  cursor: pointer;
}

.spell-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(167, 139, 218, 0.15), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 1;
}

.spell-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 60px rgba(107, 63, 160, 0.45), 0 0 40px rgba(167, 139, 218, 0.15);
  border-color: rgba(167, 139, 218, 0.6);
}

.spell-card:hover::before { opacity: 1; }

/* Card artwork image */
.spell-card__img {
  width: 100%;
  aspect-ratio: 696 / 376;
  object-fit: cover;
  display: block;
  transition: filter 0.4s, transform 0.6s;
  filter: brightness(0.9) saturate(1.1);
}

.spell-card:hover .spell-card__img {
  filter: brightness(1.08) saturate(1.25);
  transform: scale(1.04);
}

.spell-card__body {
  padding: clamp(1.2rem, 3vw, 1.8rem);
  padding-bottom: clamp(1.5rem, 3.5vw, 2rem);
  position: relative;
  z-index: 2;
}

.spell-card__title {
  font-family: var(--font-title);
  font-size: clamp(0.85rem, 2vw, 0.92rem);
  color: var(--stargold);
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.spell-card__text {
  font-size: clamp(0.9rem, 2vw, 0.95rem);
  line-height: 1.85;
  color: var(--lavender);
  font-style: italic;
}

/* ────────────────────────────────────────
   ABOUT
──────────────────────────────────────── */
.about__inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.about__text {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 2;
  color: var(--silver);
  font-style: italic;
}

.about__text em {
  color: var(--lavender);
  font-style: normal;
}

/* ────────────────────────────────────────
   CONTACT
──────────────────────────────────────── */
.contact {
  text-align: center;
}

.contact__text {
  max-width: 500px;
  margin: 0 auto;
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  line-height: 2;
  color: var(--silver);
  font-style: italic;
}

.contact__btn {
  display: inline-block;
  margin-top: clamp(1.8rem, 4vw, 2.5rem);
  padding: clamp(0.85rem, 2vw, 1rem) clamp(2rem, 6vw, 3.5rem);
  font-family: var(--font-title);
  font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  letter-spacing: 0.3em;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold), var(--stargold));
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.contact__btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: rgba(255, 255, 255, 0.3);
  transform: skewX(-20deg);
  transition: left var(--transition-slow);
}

.contact__btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 40px rgba(212, 168, 67, 0.65);
}

.contact__btn:hover::before { left: 125%; }

/* ────────────────────────────────────────
   FOOTER
──────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(1.8rem, 5vw, 3rem) clamp(1rem, 3vw, 3rem);
  border-top: 1px solid rgba(167, 139, 218, 0.1);
  font-family: var(--font-title);
  font-size: clamp(0.55rem, 1.4vw, 0.62rem);
  letter-spacing: 0.3em;
  color: rgba(167, 139, 218, 0.4);
  line-height: 1.8;
}

/* ────────────────────────────────────────
   SCROLL REVEAL
──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible             { opacity: 1; transform: translateY(0); }
.reveal.delay-1             { transition-delay: 0.15s; }
.reveal.delay-2             { transition-delay: 0.30s; }
.reveal.delay-3             { transition-delay: 0.45s; }

/* ────────────────────────────────────────
   KEYFRAMES — shared
──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────────────
   RESPONSIVE — breakpoints
──────────────────────────────────────── */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .nav {
    padding: 1rem 1.8rem;
  }

  .nav__links {
    gap: 1.8rem;
  }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .nav {
    padding: 0.9rem 1.2rem;
  }

  .nav__logo {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
  }

  .nav__links {
    gap: 1.1rem;
  }

  .nav__links a {
    font-size: 0.66rem;
    letter-spacing: 0.15em;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .hero {
    padding-bottom: 14vh;
  }

  .hero__scroll-hint {
    font-size: 0.55rem;
    letter-spacing: 0.25em;
  }

  .about__text br {
    display: none;
  }
}

/* ── Small mobile (≤480px) ── */
@media (max-width: 480px) {
  .nav {
    padding: 0.8rem 0.9rem;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .nav__logo {
    font-size: 0.78rem;
  }

  .nav__links {
    gap: 0.9rem;
    justify-content: center;
  }

  .nav__links a {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
  }

  .hero__tagline {
    letter-spacing: 0.2em;
  }

  .hero__cta,
  .contact__btn {
    letter-spacing: 0.2em;
  }

  .section__divider {
    gap: 0.4rem;
    font-size: 0.85rem;
  }

  .spell-card__body {
    padding: 1.1rem 1.2rem 1.4rem;
  }
}

/* ── Landscape phones (short height) ── */
@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    min-height: 620px;
    padding-bottom: 8vh;
  }

  .hero__scroll-hint {
    bottom: 1rem;
  }
}