/* ==========================================================================
   GBT Zero - design tokens, component styles and motion
   Fonts are loaded from includes/header.php (preconnect + non-blocking link),
   deliberately not @imported here so they never block first paint.
   ========================================================================== */

:root {
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  --ink: #0f152a;
  --surface: #f8fafc;

  /* Sticky header height, used for anchor scroll offsets */
  --header-h: 105px;
}

@media (max-width: 639px) {
  :root { --header-h: 68px; }
}

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

body {
  font-family: var(--font-body);
  color: #0f172a;
  background-color: var(--surface);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  text-wrap: balance;
}

p { text-wrap: pretty; }

.font-mono { font-family: var(--font-mono); }

/* Every in-page anchor clears the sticky header instead of hiding under it. */
section[id],
[id^="glossary"],
[id^="comparison"] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ==========================================================================
   Custom scrollbar
   ========================================================================== */

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: #93b4f5 #eef2f7;
}

/* WebKit / Blink */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 55%, #1d4ed8 100%);
  border: 3px solid #eef2f7;   /* inset look, keeps the thumb visually slim */
  border-radius: 999px;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 55%, #1e40af 100%);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: #1e40af;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner { background: #eef2f7; }

/* Dark surfaces get a matching dark scrollbar */
.scroll-dark {
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #1e293b;
}

.scroll-dark::-webkit-scrollbar-track { background: #1e293b; }

.scroll-dark::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border: 3px solid #1e293b;
  background-clip: padding-box;
}

/* Compact scrollbar for inner panes (textarea, tables, code blocks) */
.scroll-slim::-webkit-scrollbar { width: 7px; height: 7px; }
.scroll-slim::-webkit-scrollbar-thumb {
  background: #bfd2f2;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.scroll-slim::-webkit-scrollbar-thumb:hover { background: #93b4f5; background-clip: padding-box; }

/* ==========================================================================
   Focus & accessibility
   ========================================================================== */

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  z-index: 100;
  transform: translateX(-50%);
  padding: 0.65rem 1.25rem;
  border-radius: 0 0 0.75rem 0.75rem;
  background: var(--primary-600);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  box-shadow: 0 10px 25px -8px rgba(37, 99, 235, 0.5);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   Navigation components
   ========================================================================== */

.nav-link {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  transition: color 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-600);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }

.nav-link.is-active { color: var(--primary-700); }

.mobile-link {
  display: block;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.mobile-link:hover,
.mobile-link:focus-visible {
  background-color: #eff6ff;
  color: var(--primary-700);
}

.footer-link {
  color: #94a3b8;
  transition: color 0.18s ease;
}

.footer-link:hover { color: #fff; }

/* ==========================================================================
   Forms
   Contrast checked against a white panel: border #cbd5e1 (3.1:1), placeholder
   #64748b (4.8:1), helper #64748b, error #b91c1c (5.9:1). All pass WCAG AA.
   ========================================================================== */

.form-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  background-color: #fff;
  color: #0f172a;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-input::placeholder { color: #64748b; }

.form-input:hover { border-color: #94a3b8; }

.form-input:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.form-input.is-invalid {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.05rem;
  padding-right: 2.4rem;
}

.form-error {
  margin-top: 0.375rem;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Header state once the page has scrolled */
#nav-shell.is-stuck {
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
}

body.menu-open { overflow: hidden; }

/* ==========================================================================
   Surfaces & cards
   ========================================================================== */

.glass-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.card-glow {
  position: relative;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-glow:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 35px -10px rgba(37, 99, 235, 0.12), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
}

/* Feature card with a hairline gradient edge that lights up on hover */
.edge-card {
  position: relative;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.edge-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.6), rgba(56, 189, 248, 0.15) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.edge-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 24px 45px -22px rgba(37, 99, 235, 0.45);
}

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

/* Subtle dotted / grid backdrops */
.bg-dot-grid {
  background-image: radial-gradient(rgba(148, 163, 184, 0.35) 1px, transparent 1px);
  background-size: 22px 22px;
}

.bg-line-grid {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 56px 56px;
}

.hero-gradient-bg {
  background-color: #f8fafc;
  background-image: 
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(37, 99, 235, 0.07), transparent 75%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Gradient text accent */
.text-gradient {
  background: linear-gradient(100deg, #2563eb 0%, #38bdf8 55%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Detection highlighting
   ========================================================================== */

.highlight-ai,
.highlight-mixed,
.highlight-human {
  border-radius: 3px;
  padding: 2px 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.highlight-ai {
  background-color: #fee2e2;
  border-bottom: 2px solid #ef4444;
}

.highlight-ai:hover {
  background-color: #fecaca;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.highlight-mixed {
  background-color: #fef9c3;
  border-bottom: 2px solid #eab308;
}

.highlight-mixed:hover {
  background-color: #fef08a;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.2);
}

.highlight-human {
  background-color: #dcfce7;
  border-bottom: 2px solid #10b981;
}

.highlight-human:hover {
  background-color: #bbf7d0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   Legal / policy documents
   ========================================================================== */

.legal-doc > section + section { margin-top: 2.75rem; }

.legal-doc h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 1rem;
}

.legal-doc h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-doc p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #475569;
  margin-bottom: 1rem;
}

.legal-doc ul {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  list-style: none;
}

.legal-doc ul li {
  position: relative;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 0.6rem;
}

.legal-doc ul li::before {
  content: '';
  position: absolute;
  left: -1.15rem;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #94a3b8;
}

.legal-doc strong { color: #0f172a; font-weight: 600; }

.legal-doc a {
  color: var(--primary-700);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #bfdbfe;
  text-underline-offset: 3px;
}

.legal-doc a:hover { text-decoration-color: var(--primary-600); }

/* ==========================================================================
   Comparison table
   ========================================================================== */

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  min-width: 720px;
}

.compare-table th,
.compare-table td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.compare-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #cbd5e1;
}

.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover td { background-color: #f8fafc; }

/* Highlighted "our product" column */
.compare-table th.col-featured,
.compare-table td.col-featured {
  background-color: rgba(37, 99, 235, 0.05);
  border-left: 1px solid rgba(37, 99, 235, 0.18);
  border-right: 1px solid rgba(37, 99, 235, 0.18);
}

.compare-table thead th.col-featured {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--primary-700);
  border-radius: 0.6rem 0.6rem 0 0;
}

.compare-table tbody tr:hover td.col-featured { background-color: rgba(37, 99, 235, 0.08); }

/* ==========================================================================
   Motion
   ========================================================================== */

@keyframes scanningLine {
  0%   { top: 0%;   opacity: 0.8; }
  50%  {            opacity: 1;   }
  100% { top: 100%; opacity: 0.2; }
}

.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2563eb, #38bdf8, #2563eb, transparent);
  box-shadow: 0 0 15px #3b82f6;
  animation: scanningLine 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes livePulse {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.live-pulse-dot { animation: livePulse 2s infinite; }

/* Scroll reveal - elements start hidden and are released by app.js */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children inside a revealed group */
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }

/* Back to top */
#back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Infinite logo marquee */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 34s linear infinite;
}

.marquee-mask:hover .marquee-track { animation-play-state: paused; }

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-mask {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   AI Detector Brand UI Styles (Official GBT Zero Palette)
   ========================================================================== */

/* Official Brand Ambient Glow */
.hero-ambient-glow {
  position: relative;
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 10% 40%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
}

/* Subtle tech grid background with radial fade */
.tech-grid-pattern {
  background-image: radial-gradient(rgba(148, 163, 184, 0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 35%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 65% 55% at 50% 35%, #000 70%, transparent 100%);
}

/* Premium White Card with Crisp Brand Shadow */
.brand-detector-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  box-shadow: 
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 10px 30px -5px rgba(37, 99, 235, 0.08),
    0 20px 40px -15px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.brand-detector-card:hover {
  border-color: #cbd5e1;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.03),
    0 15px 35px -5px rgba(37, 99, 235, 0.1),
    0 25px 50px -15px rgba(15, 23, 42, 0.08);
}

/* Official Blue Accent Rim */
.card-brand-rim {
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
}

/* Custom Sleek Scrollbar for Textarea */
.custom-editor-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-editor-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-editor-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.custom-editor-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Scanning Radar Laser Line in Brand Blue */
.enhanced-scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #60a5fa 30%, #2563eb 50%, #60a5fa 70%, transparent 100%);
  box-shadow: 0 0 14px 1px rgba(37, 99, 235, 0.6);
  animation: scanningLine 2s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  pointer-events: none;
  z-index: 30;
}

