/* Garnet Page Redesign - Metatron & Antigravity Inspired */

:root {
    --jgpt-primary: #901539;
    /* Garnet */
    --jgpt-secondary: #ff2d55;
    /* Hot Pink/Red */
    --jgpt-accent: #00f0ff;
    /* Cyan for 'thinking' state */
    --jgpt-bg: #050505;
    --jgpt-glass: rgba(15, 15, 15, 0.7);
    --jgpt-border: rgba(255, 45, 85, 0.2);
}

.jgpt-body {
    background-color: var(--jgpt-bg);
    color: #fff;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

/* --- Metatron Background System --- */

.jgpt-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at center, #1a050a 0%, #050505 100%);
    overflow: hidden;
}

.jgpt-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 30%, rgba(144, 21, 57, 0.15) 100%);
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.8);
}

/* Grain Overlay */
.jgpt-background::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    animation: grain-shift 8s steps(10) infinite;
}

@keyframes grain-shift {
    0% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-5%, -5%);
    }

    20% {
        transform: translate(-10%, 5%);
    }

    30% {
        transform: translate(5%, -10%);
    }

    40% {
        transform: translate(-5%, 15%);
    }

    50% {
        transform: translate(-10%, -5%);
    }

    60% {
        transform: translate(15%, 0);
    }

    70% {
        transform: translate(0, 10%);
    }

    80% {
        transform: translate(-15%, 0);
    }

    90% {
        transform: translate(10%, 5%);
    }

    100% {
        transform: translate(5%, 0);
    }
}

/* --- Metatron's Cube — Eye-Dazzling Overhaul --- */

.jgpt-hero.hero-wrapper {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: clip;
    overflow-y: visible;
    padding: 2rem;
}

.metatron-core-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-text-layer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 4rem;
    max-width: 900px;
}

.metatron-cube {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: metatron-rotate 45s linear infinite;
    filter:
        drop-shadow(0 0 15px rgba(255, 45, 85, 0.4)) drop-shadow(0 0 40px rgba(144, 21, 57, 0.3)) drop-shadow(0 0 80px rgba(144, 21, 57, 0.15));
}

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

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

/* --- Connection Lines --- */
.metatron-lines line {
    stroke: rgba(255, 45, 85, 0.55);
    stroke-width: 0.9;
    transition: stroke 0.4s, stroke-width 0.4s;
}

/* --- Accent Lines (inner hexagon shimmer) --- */
.metatron-accent-lines {
    filter: url(#glow);
}

/* --- Energy Pulse Rings --- */
.energy-ring {
    transform-origin: 200px 200px;
}

.ring-1 {
    animation: energy-pulse-1 3s ease-in-out infinite;
}

.ring-2 {
    animation: energy-pulse-2 4s ease-in-out infinite 0.5s;
}

.ring-3 {
    animation: energy-pulse-3 5s ease-in-out infinite 1s;
}

@keyframes energy-pulse-1 {

    0%,
    100% {
        r: 60;
        stroke-opacity: 0.15;
        stroke-width: 1;
    }

    50% {
        r: 80;
        stroke-opacity: 0.35;
        stroke-width: 2;
    }
}

@keyframes energy-pulse-2 {

    0%,
    100% {
        r: 120;
        stroke-opacity: 0.10;
        stroke-width: 0.8;
    }

    50% {
        r: 140;
        stroke-opacity: 0.25;
        stroke-width: 1.5;
    }
}

@keyframes energy-pulse-3 {

    0%,
    100% {
        r: 180;
        stroke-opacity: 0.06;
        stroke-width: 0.6;
    }

    50% {
        r: 195;
        stroke-opacity: 0.18;
        stroke-width: 1.2;
    }
}

/* --- Node Animations --- */
.node-center {
    animation: center-breathe 3s ease-in-out infinite alternate;
}

@keyframes center-breathe {
    0% {
        stroke-width: 2;
        filter: drop-shadow(0 0 8px rgba(255, 45, 85, 0.5));
    }

    100% {
        stroke-width: 3;
        filter: drop-shadow(0 0 25px rgba(255, 45, 85, 1));
    }
}

.node-core {
    animation: core-throb 2s ease-in-out infinite alternate;
}

@keyframes core-throb {
    0% {
        r: 4;
        opacity: 0.7;
    }

    100% {
        r: 8;
        opacity: 1;
    }
}

.inner-node {
    animation: inner-orbit 6s ease-in-out infinite alternate;
}

@keyframes inner-orbit {
    0% {
        stroke-width: 1.2;
        filter: drop-shadow(0 0 4px rgba(255, 45, 85, 0.3));
    }

    50% {
        stroke-width: 2;
        filter: drop-shadow(0 0 12px rgba(255, 45, 85, 0.7));
    }

    100% {
        stroke-width: 1.2;
        filter: drop-shadow(0 0 4px rgba(255, 45, 85, 0.3));
    }
}

.outer-node {
    animation: outer-pulse 8s ease-in-out infinite alternate;
}

@keyframes outer-pulse {
    0% {
        stroke-opacity: 0.5;
        r: 15;
    }

    100% {
        stroke-opacity: 0.9;
        r: 17;
    }
}

/* --- Boundary Rings --- */
.boundary-ring {
    animation: boundary-spin 90s linear infinite reverse;
    transform-origin: 200px 200px;
}

.boundary-ring-outer {
    animation: boundary-spin 120s linear infinite;
    transform-origin: 200px 200px;
}

@keyframes boundary-spin {
    from {
        transform: rotate(0deg);
    }

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

/* --- Particle Overlay (CSS-only floating dots) --- */
.metatron-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.metatron-particles::before,
.metatron-particles::after {
    content: "";
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 45, 85, 0.6);
    box-shadow:
        40px 60px 0 rgba(255, 45, 85, 0.3),
        120px 180px 0 rgba(255, 80, 110, 0.4),
        200px 100px 0 rgba(255, 45, 85, 0.25),
        280px 240px 0 rgba(255, 120, 150, 0.35),
        350px 140px 0 rgba(255, 45, 85, 0.3),
        180px 300px 0 rgba(255, 80, 110, 0.2),
        60px 320px 0 rgba(255, 45, 85, 0.15),
        310px 50px 0 rgba(255, 120, 150, 0.25),
        150px 220px 0 rgba(255, 45, 85, 0.3),
        400px 280px 0 rgba(255, 80, 110, 0.2),
        250px 350px 0 rgba(255, 45, 85, 0.15),
        90px 160px 0 rgba(255, 120, 150, 0.3);
    animation: particle-drift 20s linear infinite;
}

.metatron-particles::after {
    width: 2px;
    height: 2px;
    box-shadow:
        80px 40px 0 rgba(255, 45, 85, 0.2),
        160px 280px 0 rgba(255, 80, 110, 0.3),
        240px 60px 0 rgba(255, 45, 85, 0.35),
        320px 200px 0 rgba(255, 120, 150, 0.2),
        50px 250px 0 rgba(255, 45, 85, 0.25),
        380px 100px 0 rgba(255, 80, 110, 0.15),
        130px 350px 0 rgba(255, 45, 85, 0.2),
        270px 130px 0 rgba(255, 120, 150, 0.4),
        450px 320px 0 rgba(255, 45, 85, 0.1),
        30px 100px 0 rgba(255, 80, 110, 0.25);
    animation: particle-drift 28s linear infinite reverse;
}

@keyframes particle-drift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }

    25% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-10px) translateX(-20px);
        opacity: 0.4;
    }

    75% {
        transform: translateY(-40px) translateX(10px);
        opacity: 0.7;
    }

    100% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }
}

/* --- Hover Enhancement --- */
.hero-wrapper:hover .metatron-cube {
    animation-duration: 20s;
    filter:
        drop-shadow(0 0 20px rgba(255, 45, 85, 0.6)) drop-shadow(0 0 60px rgba(144, 21, 57, 0.5)) drop-shadow(0 0 100px rgba(144, 21, 57, 0.25));
}

.hero-wrapper:hover .metatron-lines line {
    stroke: rgba(255, 45, 85, 0.75);
    stroke-width: 1.2;
}

/* --- Hero Section --- */

.jgpt-hero {
    padding: 2rem 0 0;
    text-align: center;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-label {
    font-family: monospace;
    color: var(--jgpt-secondary);
    letter-spacing: 0.3em;
    font-weight: 700;
    display: block;
    margin-bottom: 1rem;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 45, 85, 0.6), 0 0 40px rgba(255, 45, 85, 0.2);
}

.hero-subtitle {
    max-width: 800px;
    margin: 0 auto;
    color: #ccc;
    font-size: 1.15rem;
    line-height: 1.7;
}

.jgpt-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #d0d0d0 50%, #ffffff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    will-change: background-position;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    animation: title-shimmer 6s ease-in-out infinite;
}

@keyframes title-shimmer {

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

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

.jgpt-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--jgpt-secondary), transparent);
    animation: title-bar-pulse 3s ease-in-out infinite;
}

@keyframes title-bar-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* --- Holographic Cards --- */

.holo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    padding: 4rem 0;
}

.holo-card {
    background: var(--jgpt-glass);
    border: 1px solid var(--jgpt-border);
    border-radius: 12px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    position: relative;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.holo-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--jgpt-secondary), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.holo-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 45, 85, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(144, 21, 57, 0.1);
}

.holo-card:hover::before {
    transform: translateX(100%);
}

.holo-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.holo-icon {
    width: 40px;
    height: 40px;
    background: rgba(144, 21, 57, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.holo-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin: 0;
}

.holo-card p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Terminal View within Card */
.holo-terminal {
    background: #000;
    border-radius: 6px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: #00ff00;
    opacity: 0.8;
    position: relative;
}

.terminal-header {
    display: flex;
    gap: 5px;
    margin-bottom: 0.5rem;
}

.t-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* --- Interaction Panel --- */

.jgpt-access {
    background: radial-gradient(circle at center, rgba(144, 21, 57, 0.2) 0%, transparent 70%);
    padding: 8rem 0;
    text-align: center;
}

.access-orb {
    width: 150px;
    height: 150px;
    margin: 0 auto 3rem;
    position: relative;
}

.orb-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--jgpt-secondary), var(--jgpt-primary));
    border-radius: 50%;
    filter: blur(2px);
    animation: orb-pulse 4s infinite alternate;
}

@keyframes orb-pulse {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.6;
        box-shadow: 0 0 20px var(--jgpt-secondary);
    }

    to {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
        box-shadow: 0 0 60px var(--jgpt-secondary);
    }
}

.orb-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180%;
    height: 180%;
    border: 1px solid rgba(255, 45, 85, 0.2);
    border-radius: 50%;
}

.orb-rings::after {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--jgpt-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--jgpt-secondary);
}

.btn-jgpt {
    background: white;
    color: black;
    padding: 1.2rem 3rem;
    border-radius: 100px;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
}

.btn-jgpt:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.btn-jgpt::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: left 0.5s;
}

.btn-jgpt:hover::after {
    left: 100%;
}

@media (max-width: 768px) {
    .metatron-core-container {
        width: 320px;
        height: 320px;
    }

    .hero-wrapper {
        min-height: 70vh;
    }

    .hero-text-layer {
        padding: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   GARNET LIGHT MODE OVERRIDES
   ============================================ */
body.light-mode .jgpt-body,
body.light-mode.jgpt-body {
    --jgpt-bg: hsl(30, 20%, 96%);
    --jgpt-glass: rgba(255, 255, 255, 0.6);
    --jgpt-border: rgba(144, 21, 57, 0.15);
    background-color: var(--jgpt-bg) !important;
    color: hsl(0, 0%, 12%) !important;
}

body.light-mode .jgpt-background {
    background: radial-gradient(circle at center, hsla(14, 100%, 64%, 0.05) 0%, hsl(30, 20%, 96%) 100%) !important;
}

body.light-mode .jgpt-vignette {
    background: radial-gradient(circle at center, transparent 30%, hsla(14, 100%, 64%, 0.05) 100%) !important;
    box-shadow: none !important;
}

body.light-mode .jgpt-background::after {
    opacity: 0.02 !important;
}

body.light-mode .jgpt-title {
    background: linear-gradient(135deg, hsl(0, 0%, 12%) 0%, hsl(0, 0%, 40%) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

body.light-mode .holo-card {
    background: rgba(255, 255, 255, 0.65) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(12px) !important;
}

body.light-mode .holo-card:hover {
    border-color: rgba(144, 21, 57, 0.3) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10) !important;
}

body.light-mode .holo-card h3 {
    color: hsl(0, 0%, 12%) !important;
}

body.light-mode .holo-card p {
    color: hsla(0, 0%, 12%, 0.7) !important;
}

body.light-mode .holo-icon {
    background: rgba(144, 21, 57, 0.1) !important;
}

body.light-mode .hero-label {
    color: hsl(348, 83%, 40%) !important;
    text-shadow: none !important;
}

body.light-mode .hero-subtitle {
    color: hsl(0, 0%, 30%) !important;
}

body.light-mode .jgpt-access {
    background: radial-gradient(circle at center, hsla(14, 100%, 64%, 0.08) 0%, transparent 70%) !important;
}

body.light-mode .metatron-cube {
    filter: drop-shadow(0 0 10px rgba(144, 21, 57, 0.15)) drop-shadow(0 0 30px rgba(144, 21, 57, 0.08)) !important;
}

body.light-mode .metatron-lines line {
    stroke: rgba(144, 21, 57, 0.3) !important;
}

body.light-mode .metatron-accent-lines line {
    stroke: rgba(144, 21, 57, 0.4) !important;
}

body.light-mode .metatron-nodes circle {
    stroke: rgba(144, 21, 57, 0.35) !important;
}

body.light-mode .node-center {
    stroke: rgba(144, 21, 57, 0.6) !important;
}

body.light-mode .boundary-ring,
body.light-mode .boundary-ring-outer {
    stroke: rgba(144, 21, 57, 0.08) !important;
}

body.light-mode .energy-ring {
    stroke: rgba(144, 21, 57, 0.08) !important;
}

body.light-mode .metatron-particles::before,
body.light-mode .metatron-particles::after {
    opacity: 0.3 !important;
}