@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');
@import "tailwindcss";

@theme {
  /* Mystic color palette */
  --color-mystic-ink: #08054a;
  --color-mystic-ink-50: #110a65;
  --color-mystic-ink-100: #050334;

  --color-mystic-purple-50: #f7eefa;
  --color-mystic-purple-100: #ead5f0;
  --color-mystic-purple-200: #d4aade;
  --color-mystic-purple-300: #bd80ca;
  --color-mystic-purple-400: #a56da6;
  --color-mystic-purple-500: #8a4a8b;
  --color-mystic-purple-600: #6d2577;
  --color-mystic-purple-700: #520b7e;
  --color-mystic-purple-800: #3a075c;
  --color-mystic-purple-900: #27043f;
  --color-mystic-purple-950: #160227;

  --color-mystic-blue-50: #e8e8ff;
  --color-mystic-blue-100: #c5c6ff;
  --color-mystic-blue-200: #9a9bff;
  --color-mystic-blue-300: #6769ff;
  --color-mystic-blue-400: #3e40ff;
  --color-mystic-blue-500: #1a1bff;
  --color-mystic-blue-600: #0002cc;
  --color-mystic-blue-700: #0001a8;
  --color-mystic-blue-800: #000180;
  --color-mystic-blue-900: #000160;
  --color-mystic-blue-950: #000140;

  --color-mystic-gold-50: #fffdf0;
  --color-mystic-gold-100: #fef9d3;
  --color-mystic-gold-200: #fde47a;
  --color-mystic-gold-300: #ffd700;
  --color-mystic-gold-400: #e8c300;
  --color-mystic-gold-500: #d4af37;
  --color-mystic-gold-600: #ccaa3a;
  --color-mystic-gold-700: #a88520;
  --color-mystic-gold-800: #7c6104;
  --color-mystic-gold-900: #5c4702;
  --color-mystic-gold-950: #3a2c01;

  /* Fonts */
  --font-family-display: 'Cinzel', Georgia, serif;
  --font-family-body: 'Cormorant Garamond', Georgia, serif;
  --font-family-ui: 'Inter', system-ui, sans-serif;

  /* Bump small text utilities so nothing is too tiny */
  --text-xs:   0.8rem;
  --text-sm:   0.95rem;
  --text-base: 1.05rem;
  --text-lg:   1.2rem;
  --text-xl:   1.35rem;

  /* Shadows */
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.5);
  --shadow-purple: 0 0 30px rgba(82, 11, 126, 0.6);
  --shadow-mystic: 0 4px 60px rgba(8, 5, 74, 0.8);

  /* Animations */
  --animate-float: float 6s ease-in-out infinite;
  --animate-glow-pulse: glow-pulse 2s ease-in-out infinite;
  --animate-shimmer: shimmer 2.5s linear infinite;
  --animate-flicker: flicker 4s ease-in-out infinite;

  @keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
  }

  @keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 28px rgba(212, 175, 55, 0.8); }
  }

  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }

  /* Quiz-specific animations */
  @keyframes sigil-entrance {
    0%   { transform: scale(0.2) rotate(-180deg); opacity: 0; filter: blur(16px); }
    60%  { transform: scale(1.12) rotate(8deg);   opacity: 1; filter: blur(0); }
    100% { transform: scale(1)    rotate(0deg);   opacity: 1; }
  }

  @keyframes ring-expand {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(2.8); opacity: 0; }
  }

  @keyframes name-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
  }

  @keyframes star-fall {
    0%   { transform: translateY(-20px) rotate(0deg)   scale(1);   opacity: 1; }
    80%  { opacity: 0.6; }
    100% { transform: translateY(100vh) rotate(540deg) scale(0.4); opacity: 0; }
  }

  @keyframes reveal-fade-up {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes progress-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }

  @keyframes flicker {
    0%, 100% { opacity: 1;    filter: brightness(1); }
    30%       { opacity: 0.94; filter: brightness(0.96); }
    60%       { opacity: 0.98; filter: brightness(0.99); }
    80%       { opacity: 0.92; filter: brightness(0.95); }
  }

  @keyframes corner-glow {
    0%, 100% { opacity: 0.35; }
    50%       { opacity: 0.65; }
  }

  @keyframes portal-pulse {
    0%   { opacity: 0; transform: scale(0.2) rotate(0deg); }
    20%  { opacity: 0.75; transform: scale(0.9) rotate(12deg); }
    100% { opacity: 0; transform: scale(2.4) rotate(-8deg); }
  }
}

@layer base {
  html {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 16px;
    @media (min-width: 640px) { font-size: 18px; }
    background-color: #08054a;
    /* Subtle diamond-grid texture — medieval stone / chainmail feel */
    background-image:
      repeating-linear-gradient(45deg,  transparent, transparent 58px, rgba(212,175,55,0.014) 58px, rgba(212,175,55,0.014) 59px),
      repeating-linear-gradient(-45deg, transparent, transparent 58px, rgba(212,175,55,0.014) 58px, rgba(212,175,55,0.014) 59px);
    color: #d9d9d9;
    scroll-behavior: smooth;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.7), 0 0 45px rgba(212,175,55,0.10);
  }

  a {
    transition: color 0.2s ease, opacity 0.2s ease;
  }

  ::selection {
    background-color: rgba(212, 175, 55, 0.3);
    color: #ffffff;
  }
}

@layer components {
  .btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000000;
    background-color: #d4af37;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);

    &:hover {
      background-color: #ffd700;
      box-shadow: 0 0 30px rgba(212, 175, 55, 0.7);
    }
  }

  .btn-outline-gold {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffd700;
    border: 1px solid #d4af37;
    transition: all 0.3s;

    &:hover {
      background-color: #d4af37;
      color: #000000;
    }
  }

  .btn-purple {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: white;
    background-color: #520b7e;
    transition: all 0.3s;

    &:hover { background-color: #6d2577; }
  }

  .card-mystic {
    position: relative;
    background-color: #110a65;
    border: 1px solid rgba(82, 11, 126, 0.3);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
    box-shadow: inset 0 0 40px rgba(8,5,74,0.55);

    &:hover {
      border-color: rgba(204, 170, 58, 0.4);
      box-shadow: 0 0 30px rgba(82, 11, 126, 0.6), inset 0 0 40px rgba(8,5,74,0.55);
    }
  }

  .section-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    color: #ffd700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 28px rgba(212,175,55,0.45), 0 0 60px rgba(212,175,55,0.20), 0 2px 20px rgba(0,0,0,0.8);

    &::before { content: "✦ "; font-size: 0.52em; opacity: 0.65; vertical-align: middle; }
    &::after  { content: " ✦"; font-size: 0.52em; opacity: 0.65; vertical-align: middle; }
  }

  .section-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
  }

  .gold-divider {
    margin: 2rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #D4AF37, transparent);
  }

  /* Ornamental divider with centred heraldic symbol */
  .ornamental-divider {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 2.5rem auto;

    &::before, &::after {
      content: '';
      flex: 1;
      height: 1px;
    }

    &::before {
      background: linear-gradient(to right, transparent, rgba(212,175,55,0.45));
    }

    &::after {
      background: linear-gradient(to left, transparent, rgba(212,175,55,0.45));
    }

    .ornament {
      color: #D4AF37;
      opacity: 0.70;
      font-size: 0.85rem;
      letter-spacing: 0.45em;
      white-space: nowrap;
      flex-shrink: 0;
    }
  }

  /* Section vignette — deep radial glow behind content */
  .medieval-vignette {
    position: relative;

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        radial-gradient(ellipse 70% 55% at 50% 40%, rgba(82,11,126,0.14) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 20% 80%, rgba(82,11,126,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 80% 80%, rgba(8,5,74,0.08) 0%, transparent 60%);
      pointer-events: none;
      z-index: 0;
    }

    > * { position: relative; z-index: 1; }
  }

  /* Heraldic corner brackets for cards / panels */
  .corner-ornament {
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: rgba(212,175,55,0.35);
    border-style: solid;
    animation: corner-glow 3s ease-in-out infinite;

    &.tl { top: 4px;  left: 4px;  border-width: 1px 0 0 1px; }
    &.tr { top: 4px;  right: 4px; border-width: 1px 1px 0 0; }
    &.bl { bottom: 4px; left: 4px;  border-width: 0 0 1px 1px; }
    &.br { bottom: 4px; right: 4px; border-width: 0 1px 1px 0; }
  }

  .prose-mystic {
    color: rgba(255, 255, 255, 0.75);

    h1, h2, h3, h4 {
      font-family: 'Cinzel', Georgia, serif;
      color: #ffd700;
    }

    a {
      color: #ffd700;
      text-decoration: none;

      &:hover { color: #ffd700; }
    }

    strong { color: #ffd700; }

    p + p { margin-top: 1.25rem; }
  }

  .nav-link {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #a56da6;
    transition: color 0.2s;

    &:hover { color: #ffd700; }
  }

  .input-mystic {
    width: 100%;
    background-color: #110a65;
    border: 1px solid rgba(82, 11, 126, 0.5);
    color: #d9d9d9;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.2s;

    &::placeholder { color: #808080; }

    &:focus { border-color: #D4AF37; }
  }

  /* ── Quiz progress bar ── */
  .quiz-progress-bar {
    background-image: linear-gradient(
      90deg,
      #520b7e 0%,
      #d4af37 60%,
      #ffd700 80%,
      #d4af37 100%
    );
    background-size: 200% 100%;
    animation: progress-shimmer 2.5s linear infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ── Quiz archetype reveal ── */
  .quiz-starfield {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
  }

  .quiz-star {
    position: absolute;
    left: var(--x);
    top: -1.5rem;
    font-size: var(--size);
    color: #D4AF37;
    opacity: 0.7;
    animation: star-fall 6s linear var(--delay) infinite;

    &::before { content: "✦"; }
  }

  .quiz-reveal-section { position: relative; z-index: 1; }
  .quiz-reveal-body    { position: relative; z-index: 1; }

  .quiz-sigil-wrap {
    position: relative;
    display: inline-block;
  }

  .quiz-sigil-img {
    animation: sigil-entrance 1.1s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  }

  .quiz-reveal-photo {
    animation: sigil-entrance 1.1s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  }

  .quiz-ring {
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.7);
    animation: ring-expand 1.4s ease-out 0.25s both;
  }

  .quiz-reveal-label {
    animation: reveal-fade-up 0.6s ease-out 0.7s both;
  }

  .archetype-name {
    background: linear-gradient(
      90deg,
      #ccaa3a 0%,
      #d4af37 20%,
      #ffd700 40%,
      #ffd700 50%,
      #ffd700 60%,
      #d4af37 80%,
      #ccaa3a 100%
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: name-shimmer 3s linear infinite, reveal-fade-up 0.7s ease-out 1s both;
  }

  .quiz-reveal-tagline {
    animation: reveal-fade-up 0.6s ease-out 1.5s both;
    opacity: 0;
    animation-fill-mode: both;
  }

  /* Reduce motion: disable all quiz animations */
  @media (prefers-reduced-motion: reduce) {
    .quiz-star,
    .quiz-sigil-img,
    .quiz-ring,
    .quiz-reveal-label,
    .archetype-name,
    .quiz-reveal-tagline,
    .quiz-progress-bar { animation: none; }

    .archetype-name {
      background: none;
      -webkit-text-fill-color: var(--archetype-color, #D4AF37);
      color: var(--archetype-color, #D4AF37);
    }
  }

  /* ── Roadmap luminosity enhancements ── */
  .roadmap-cosmic-bg {
    position: relative;
    &::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        radial-gradient(ellipse 55% 80% at 12% 50%, rgba(82,11,126,0.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 88% 50%, rgba(8,5,74,0.16) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 50% 50%, rgba(165,109,166,0.10) 0%, transparent 55%);
      pointer-events: none;
      z-index: 0;
    }
    > * { position: relative; z-index: 1; }
  }

  .roadmap-title-glow {
    text-shadow: 0 0 12px rgba(212,175,55,0.75), 0 0 28px rgba(212,175,55,0.38), 0 0 52px rgba(212,175,55,0.16);
  }

  .roadmap-node {
    box-shadow: 0 0 14px rgba(165,109,166,0.65), 0 0 38px rgba(165,109,166,0.30), inset 0 0 14px rgba(165,109,166,0.14);
    transition: box-shadow 0.35s ease;
  }
  .group:hover .roadmap-node {
    box-shadow: 0 0 22px rgba(212,175,55,0.65), 0 0 54px rgba(212,175,55,0.28), inset 0 0 18px rgba(212,175,55,0.12);
  }

  @keyframes roadmap-node-pulse {
    0%, 100% { box-shadow: 0 0 22px rgba(212,175,55,0.72), 0 0 58px rgba(212,175,55,0.40), 0 0 110px rgba(212,175,55,0.18), inset 0 0 22px rgba(212,175,55,0.14); }
    50%       { box-shadow: 0 0 38px rgba(212,175,55,0.98), 0 0 90px rgba(212,175,55,0.58), 0 0 155px rgba(212,175,55,0.26), inset 0 0 32px rgba(212,175,55,0.24); }
  }
  .roadmap-node-last {
    box-shadow: 0 0 24px rgba(212,175,55,0.82), 0 0 62px rgba(212,175,55,0.48), 0 0 115px rgba(212,175,55,0.20), inset 0 0 22px rgba(212,175,55,0.16);
    animation: roadmap-node-pulse 2.5s ease-in-out infinite;
  }

  .roadmap-tail {
    width: 1.5px;
    background: linear-gradient(to bottom, rgba(165,109,166,0.92), transparent);
    filter: drop-shadow(0 0 4px rgba(165,109,166,0.70));
  }
  .roadmap-tail-last {
    width: 1.5px;
    background: linear-gradient(to bottom, rgba(255,215,0,0.96), transparent);
    filter: drop-shadow(0 0 6px rgba(255,215,0,0.75));
  }

  .roadmap-dot-glow {
    box-shadow: 0 0 8px rgba(165,109,166,1), 0 0 22px rgba(165,109,166,0.58);
  }
  .roadmap-dot-glow-last {
    box-shadow: 0 0 12px rgba(212,175,55,1), 0 0 30px rgba(212,175,55,0.65), 0 0 58px rgba(212,175,55,0.25);
  }

  .roadmap-parallel-node {
    box-shadow: 0 0 8px rgba(165,109,166,0.42), 0 0 24px rgba(165,109,166,0.20);
    transition: box-shadow 0.3s ease;
  }
  .group:hover .roadmap-parallel-node {
    box-shadow: 0 0 14px rgba(212,175,55,0.52), 0 0 34px rgba(212,175,55,0.22);
  }

  @media (prefers-reduced-motion: reduce) {
    .roadmap-node-last { animation: none; }
    .roadmap-traveler  { display: none; }
  }

  /* ── Hero Carousel ── */
  [data-carousel-target="slide"] {
    transition: opacity 0.9s ease-in-out, transform 1s ease-in-out;
  }

  [data-carousel-target="slide"][data-active="false"] {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.03);
  }

  [data-carousel-target="slide"][data-active="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .carousel-dot {
    transition: all 0.35s ease;
    line-height: 1;
  }

  .carousel-dot--active {
    color: #D4AF37 !important;
    text-shadow: 0 0 14px rgba(212,175,55,0.95), 0 0 32px rgba(212,175,55,0.55);
    transform: scale(1.5);
  }

  .carousel-portal--pulse {
    animation: portal-pulse 1.2s ease-out forwards;
  }

  @media (prefers-reduced-motion: reduce) {
    [data-carousel-target="slide"] { transition: none; }
    .carousel-portal--pulse { animation: none; }
  }
}

/* ── Language toggle — outside @layer so body selector has full specificity ── */
body:not(.lang-en) [data-lang="en"] { display: none !important; }
body.lang-en [data-lang="pt"] { display: none !important; }
