@import url('tokens.css');

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--jg-color-base);
  color: var(--jg-color-text-main);
  font-family: var(--jg-font-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 108px; /* space for compliance bar + header */
  padding-bottom: 72px; /* space for mobile dock */
  background: radial-gradient(circle at 50% 0%, oklch(14% 0.012 240) 0%, var(--jg-color-base) 70%);
}

a {
  color: var(--jg-color-primary);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--jg-color-primary-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Compliance Bar (Non-blocking Top Fixed) */
.jg-compliance-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background-color: oklch(7% 0.005 240);
  border-bottom: 1px solid var(--jg-color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--jg-color-text-muted);
  letter-spacing: 0.02em;
  padding: 0 12px;
  text-align: center;
}

.jg-compliance-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.jg-compliance-bar .badge-21 {
  background: var(--jg-color-danger);
  color: #fff;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--jg-radius-sm);
  font-size: 0.65rem;
}

/* Sticky Header */
.jg-header {
  position: fixed;
  top: 28px;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(14, 15, 18, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--jg-color-border);
  z-index: 999;
  display: flex;
  align-items: center;
}

.jg-header-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.jg-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--jg-font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--jg-color-text-main);
  text-transform: uppercase;
}

.jg-brand span {
  color: var(--jg-color-primary);
  text-shadow: 0 0 10px rgba(230, 180, 50, 0.4);
}

.jg-nav-links {
  display: none;
  align-items: center;
  gap: 20px;
}

@media (min-width: 860px) {
  .jg-nav-links {
    display: flex;
  }
}

.jg-nav-links a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--jg-color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 0;
}

.jg-nav-links a:hover, .jg-nav-links a.active {
  color: var(--jg-color-primary);
  text-decoration: none;
}

.jg-auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--jg-radius-base);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: var(--jg-font-heading);
}

.jg-btn-outline {
  border-color: var(--jg-color-border);
  background: var(--jg-color-surface-2);
  color: var(--jg-color-text-main);
}

.jg-btn-outline:hover {
  border-color: var(--jg-color-primary);
  color: var(--jg-color-primary);
  text-decoration: none;
}

.jg-btn-primary {
  background: linear-gradient(135deg, var(--jg-color-primary) 0%, oklch(62% 0.17 65) 100%);
  color: #0b0c10;
  box-shadow: var(--jg-shadow-sm), var(--jg-elevation-gold);
}

.jg-btn-primary:hover {
  background: linear-gradient(135deg, var(--jg-color-primary-hover) 0%, var(--jg-color-primary) 100%);
  color: #000;
  text-decoration: none;
  box-shadow: var(--jg-shadow-md), 0 0 20px oklch(72% 0.18 68 / 0.4);
}

/* Category Scroller */
.jg-category-bar {
  background: var(--jg-color-surface-1);
  border-bottom: 1px solid var(--jg-color-border);
  padding: 8px 0;
}

.jg-category-scroll {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.jg-category-scroll::-webkit-scrollbar {
  display: none;
}

.jg-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--jg-color-surface-2);
  border: 1px solid var(--jg-color-border);
  border-radius: var(--jg-radius-base);
  color: var(--jg-color-text-muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.jg-chip:hover, .jg-chip.active {
  background: var(--jg-color-surface-3);
  border-color: var(--jg-color-primary);
  color: var(--jg-color-primary);
  text-decoration: none;
}

/* Marquee Win Ticker */
.jg-ticker-wrap {
  background: oklch(11% 0.01 240);
  border-bottom: 1px solid var(--jg-color-border);
  height: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

.jg-ticker-title {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  background: var(--jg-color-primary);
  color: #0b0c10;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--jg-font-heading);
  text-transform: uppercase;
  padding: 0 10px;
  display: flex;
  align-items: center;
  box-shadow: 2px 0 6px rgba(0,0,0,0.4);
}

.jg-ticker-content {
  display: inline-flex;
  white-space: nowrap;
  animation: jgMarquee 35s linear infinite;
  padding-left: 110px;
  font-size: 0.75rem;
  color: var(--jg-color-text-muted);
}

.jg-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 32px;
}

.jg-ticker-item strong {
  color: var(--jg-color-primary);
}

.jg-ticker-item .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--jg-color-success);
  display: inline-block;
  box-shadow: 0 0 6px var(--jg-color-success);
}

@keyframes jgMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 3-Slide Hero Carousel (Touch Swipeable) */
.jg-carousel {
  position: relative;
  max-width: 1140px;
  margin: 16px auto 0;
  padding: 0 16px;
  overflow: hidden;
}

.jg-carousel-viewport {
  overflow: hidden;
  border-radius: var(--jg-radius-base);
  border: 1px solid var(--jg-color-border);
  background: var(--jg-color-surface-card);
  box-shadow: var(--jg-shadow-md);
}

.jg-carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.jg-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 24px 16px;
  background: linear-gradient(135deg, oklch(16% 0.015 240) 0%, oklch(12% 0.01 240) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

@media (min-width: 768px) {
  .jg-carousel-slide {
    padding: 32px 28px;
  }
}

.jg-carousel-slide-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.jg-slide-content {
  width: 100%;
}

.jg-slide-media {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.jg-slide-media img {
  width: 100%;
  max-width: 440px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--jg-radius-base);
  border: 1px solid var(--jg-color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: block;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.jg-slide-media img:hover {
  transform: scale(1.02);
  border-color: var(--jg-color-primary);
}

@media (min-width: 860px) {
  .jg-carousel-slide-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }
  .jg-slide-content {
    flex: 1 1 56%;
    min-width: 0;
  }
  .jg-slide-media {
    flex: 0 0 380px;
    max-width: 380px;
  }
}

/* Note: Slide headers use container classes, never <h2> */
.jg-slide-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--jg-color-primary);
  background: var(--jg-color-primary-muted);
  border: 1px solid var(--jg-color-primary);
  padding: 2px 8px;
  border-radius: var(--jg-radius-sm);
  margin-bottom: 12px;
  width: fit-content;
}

.jg-slide-headline {
  font-family: var(--jg-font-heading);
  font-size: 1.8rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--jg-color-text-main);
  text-transform: uppercase;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .jg-slide-headline {
    font-size: 2.3rem;
  }
}

.jg-slide-headline span {
  color: var(--jg-color-primary);
}

.jg-slide-desc {
  font-size: 0.95rem;
  color: var(--jg-color-text-muted);
  max-width: 600px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.jg-slide-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.jg-carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 0 4px;
}

.jg-carousel-dots {
  display: flex;
  gap: 6px;
}

.jg-carousel-dot {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: var(--jg-color-surface-3);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}

.jg-carousel-dot.active {
  background: var(--jg-color-primary);
  width: 36px;
}

.jg-carousel-nav-btn {
  background: var(--jg-color-surface-2);
  border: 1px solid var(--jg-color-border);
  color: var(--jg-color-text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--jg-radius-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.jg-carousel-nav-btn:hover {
  border-color: var(--jg-color-primary);
  color: var(--jg-color-primary);
}

/* Main Content Layout */
.jg-main {
  width: 100%;
  max-width: 1140px;
  margin: 24px auto 0;
  padding: 0 16px;
  flex: 1;
}

.jg-article {
  background: var(--jg-color-surface-1);
  border: 1px solid var(--jg-color-border);
  border-radius: var(--jg-radius-base);
  padding: 24px 18px;
  box-shadow: var(--jg-shadow-sm);
}

@media (min-width: 768px) {
  .jg-article {
    padding: 40px 36px;
  }
}

/* Headings */
h1.jg-page-title {
  font-family: var(--jg-font-heading);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--jg-color-text-main);
  margin-bottom: 16px;
  border-left: 4px solid var(--jg-color-primary);
  padding-left: 14px;
}

@media (min-width: 768px) {
  h1.jg-page-title {
    font-size: 2.6rem;
  }
}

h2 {
  font-family: var(--jg-font-heading);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--jg-color-text-main);
  margin-top: 36px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--jg-color-border);
  padding-bottom: 8px;
}

@media (min-width: 768px) {
  h2 {
    font-size: 1.85rem;
  }
}

h2 span {
  color: var(--jg-color-primary);
}

h3 {
  font-family: var(--jg-font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--jg-color-text-main);
  margin-top: 24px;
  margin-bottom: 10px;
}

/* Paragraphs & Text: Enforcing 3-Sentence Screen Limit */
p {
  margin-bottom: 16px;
  color: var(--jg-color-text-muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

p strong {
  color: var(--jg-color-text-main);
}

/* Contextual Feature Image (Tier 1) */
.jg-feature-image-box {
  margin: 20px 0 28px;
  border-radius: var(--jg-radius-base);
  overflow: hidden;
  border: 1px solid var(--jg-color-border);
  background: var(--jg-color-surface-2);
  box-shadow: var(--jg-shadow-sm);
  position: relative;
}

.jg-feature-image-box img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.jg-image-caption {
  font-size: 0.78rem;
  color: var(--jg-color-text-subtle);
  padding: 8px 12px;
  background: var(--jg-color-surface-3);
  border-top: 1px solid var(--jg-color-border);
  font-style: italic;
}

/* Scannability Anchors: Data Frames & Key-Value Tables */
.jg-data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

@media (min-width: 640px) {
  .jg-data-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.jg-data-card {
  background: var(--jg-color-surface-2);
  border: 1px solid var(--jg-color-border);
  border-radius: var(--jg-radius-base);
  padding: 16px;
}

.jg-data-card-title {
  font-family: var(--jg-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--jg-color-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jg-key-value-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.88rem;
}

.jg-key-value-table th,
.jg-key-value-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--jg-color-border);
}

.jg-key-value-table th {
  background: var(--jg-color-surface-2);
  color: var(--jg-color-primary);
  font-family: var(--jg-font-heading);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.jg-key-value-table td {
  color: var(--jg-color-text-muted);
}

.jg-key-value-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.jg-key-value-table td:first-child {
  font-weight: 600;
  color: var(--jg-color-text-main);
  width: 40%;
}

/* Callout Boxes */
.jg-callout {
  background: var(--jg-color-surface-2);
  border-left: 4px solid var(--jg-color-primary);
  padding: 16px;
  margin: 20px 0;
  border-radius: 0 var(--jg-radius-base) var(--jg-radius-base) 0;
}

.jg-callout-warning {
  border-left-color: var(--jg-color-warning);
}

.jg-callout-danger {
  border-left-color: var(--jg-color-danger);
}

.jg-callout-title {
  font-weight: 700;
  color: var(--jg-color-text-main);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

/* Step Checklist */
.jg-steps {
  list-style: none;
  counter-reset: jgStepCounter;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jg-step-item {
  position: relative;
  padding-left: 44px;
  background: var(--jg-color-surface-2);
  border: 1px solid var(--jg-color-border);
  border-radius: var(--jg-radius-base);
  padding-top: 12px;
  padding-bottom: 12px;
  padding-right: 14px;
}

.jg-step-item::before {
  counter-increment: jgStepCounter;
  content: counter(jgStepCounter);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--jg-color-primary);
  color: #0b0c10;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ Accordion */
.jg-faq-container {
  margin: 32px 0 20px;
}

.jg-faq-item {
  background: var(--jg-color-surface-2);
  border: 1px solid var(--jg-color-border);
  border-radius: var(--jg-radius-base);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.jg-faq-item[open] {
  border-color: var(--jg-color-primary);
}

.jg-faq-item summary {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--jg-color-text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.jg-faq-item summary::-webkit-details-marker {
  display: none;
}

.jg-faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--jg-color-primary);
  font-weight: 800;
  transition: transform 0.2s ease;
}

.jg-faq-item[open] summary::after {
  content: "−";
}

.jg-faq-body {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--jg-color-border);
  color: var(--jg-color-text-muted);
  font-size: 0.92rem;
  background: rgba(0, 0, 0, 0.15);
}

/* Conversion Callout (Stage 5 non-heading rule) */
.jg-conversion-box {
  background: linear-gradient(135deg, oklch(16% 0.015 240) 0%, oklch(12% 0.01 240) 100%);
  border: 1px solid var(--jg-color-primary);
  border-radius: var(--jg-radius-base);
  padding: 24px 20px;
  margin: 36px 0 20px;
  text-align: center;
  box-shadow: var(--jg-elevation-gold);
}

.jg-conversion-label {
  font-family: var(--jg-font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--jg-color-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.jg-conversion-text {
  font-size: 0.92rem;
  color: var(--jg-color-text-muted);
  max-width: 600px;
  margin: 0 auto 18px;
}

/* Floating Action Bottom Dock (FAB) */
.jg-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(14, 15, 18, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--jg-color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px env(safe-area-inset-bottom);
}

.jg-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--jg-color-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--jg-radius-sm);
  transition: color 0.2s ease;
  flex: 1;
  text-align: center;
}

.jg-dock-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.jg-dock-item:hover, .jg-dock-item.active {
  color: var(--jg-color-primary);
  text-decoration: none;
}

.jg-dock-item.highlight {
  color: #0b0c10;
  background: linear-gradient(135deg, var(--jg-color-primary) 0%, oklch(62% 0.17 65) 100%);
  border-radius: var(--jg-radius-base);
  padding: 6px 10px;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(230, 180, 50, 0.35);
}

.jg-dock-item.highlight svg {
  stroke: #0b0c10;
}

/* Footer & Compliance Area */
.jg-footer {
  background: oklch(8% 0.005 240);
  border-top: 1px solid var(--jg-color-border);
  padding: 36px 16px 24px;
  margin-top: 48px;
  font-size: 0.82rem;
  color: var(--jg-color-text-subtle);
}

.jg-footer-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.jg-footer-trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--jg-color-border);
  padding-bottom: 24px;
}

@media (min-width: 768px) {
  .jg-footer-trust-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.jg-footer-disclaimer p {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--jg-color-text-subtle);
  margin-bottom: 8px;
}

.jg-footer-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.jg-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--jg-color-surface-2);
  border: 1px solid var(--jg-color-border);
  border-radius: var(--jg-radius-base);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--jg-color-text-muted);
}

.jg-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--jg-color-border);
  padding-bottom: 16px;
}

.jg-footer-links a {
  color: var(--jg-color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.jg-footer-links a:hover {
  color: var(--jg-color-primary);
  text-decoration: underline;
}

.jg-copyright {
  text-align: center;
  font-size: 0.75rem;
  color: var(--jg-color-text-subtle);
}
