/* ========================================
   TrendJourney CI — Stratega Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #050510;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --text: #e0e0e8;
  --text-muted: #8888a0;
  --text-dim: #55556a;
  --accent: #825af5;
  --accent-glow: rgba(130,90,245,0.15);
  --accent-border: rgba(130,90,245,0.3);
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --high: #ff4d6a;
  --medium: #f0a030;
  --low: #30d0a0;
  --opp: #60b0ff;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* Auth gate */
.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}
.auth-gate.hidden { display: none; }
.auth-gate h2 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.auth-gate .brand {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.auth-input-wrap {
  display: flex;
  gap: 8px;
}
.auth-input-wrap input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  outline: none;
  width: 260px;
  transition: border-color 0.2s;
}
.auth-input-wrap input:focus { border-color: var(--accent-border); }
.auth-input-wrap button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
.auth-input-wrap button:hover { opacity: 0.85; }
.auth-error {
  color: var(--high);
  font-size: 13px;
  min-height: 20px;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(5,5,16,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
}
.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-brand {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text);
}
.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--accent);
  opacity: 0.6;
}
.nav-subtitle {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.nav-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-back:hover { color: var(--text); }

/* Layout */
.content { display: none; }
.content.visible { display: block; }
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 40px 80px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 80px;
}
.hero-label {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}
.hero-meta {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Section */
section { margin-bottom: 80px; }
.section-label {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
section > h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
}
section > .section-desc {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: background 0.2s, border-color 0.2s;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}
.card-stat {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Insight cards */
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  border-left: 3px solid var(--accent);
}
.insight-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.insight-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

/* Market map */
.market-map {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  position: relative;
  min-height: 500px;
}
.map-axis-label {
  position: absolute;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.map-axis-y { top: 20px; left: 50%; transform: translateX(-50%); }
.map-axis-y-bottom { bottom: 20px; left: 50%; transform: translateX(-50%); }
.map-axis-x-left { bottom: 50%; left: 20px; transform: rotate(-90deg) translateX(50%); transform-origin: left bottom; }
.map-axis-x-right { bottom: 50%; right: 20px; transform: rotate(90deg) translateX(-50%); transform-origin: right bottom; }
.map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  height: 100%;
  min-height: 420px;
  padding: 30px 10px;
}
.map-quadrant {
  background: rgba(255,255,255,0.01);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-quadrant-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.map-player {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
  transition: transform 0.2s;
  text-decoration: none;
  color: var(--text);
}
.map-player:hover { transform: scale(1.05); }
.map-player.enterprise { background: rgba(255,77,106,0.12); border: 1px solid rgba(255,77,106,0.25); }
.map-player.mid-tier { background: rgba(240,160,48,0.12); border: 1px solid rgba(240,160,48,0.25); }
.map-player.accessible { background: rgba(48,208,160,0.12); border: 1px solid rgba(48,208,160,0.25); }
.map-player.target { background: rgba(130,90,245,0.15); border: 1px solid rgba(130,90,245,0.4); color: #fff; font-weight: 600; }
.map-player .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.map-player.enterprise .dot { background: var(--high); }
.map-player.mid-tier .dot { background: var(--medium); }
.map-player.accessible .dot { background: var(--low); }
.map-player.target .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
tbody tr:hover td { background: var(--bg-card); }
tbody td:first-child { color: var(--text); font-weight: 500; }
tbody td a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
tbody td a:hover { text-decoration: underline; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-high { background: rgba(255,77,106,0.15); color: var(--high); }
.badge-medium { background: rgba(240,160,48,0.15); color: var(--medium); }
.badge-low { background: rgba(48,208,160,0.15); color: var(--low); }
.badge-opp { background: rgba(96,176,255,0.15); color: var(--opp); }

/* Competitor cards (landing page) */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.comp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  display: block;
}
.comp-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.comp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.comp-card h3 { font-size: 16px; font-weight: 600; }
.comp-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.comp-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.comp-card .arrow {
  color: var(--accent);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}
.comp-card:hover .arrow { opacity: 1; }

/* Tier sections */
.tier-section {
  margin-bottom: 48px;
}
.tier-label {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tier-label.enterprise { color: var(--high); }
.tier-label.ai-design { color: var(--medium); }
.tier-label.accessible { color: var(--low); }

/* Gap / opportunity cards */
.gap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.gap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  border-top: 3px solid var(--accent);
}
.gap-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.gap-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Monitoring triggers */
.trigger-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trigger-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.trigger-item .priority {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-width: 64px;
}

/* Deep dive page specific */
.competitor-header {
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.competitor-header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}
.competitor-header .tagline {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 20px;
}
.key-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.key-fact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.key-fact .label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.key-fact .value {
  font-size: 16px;
  font-weight: 600;
}

/* Strengths/weaknesses */
.sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.sw-col h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.sw-col.strengths h3 { color: var(--low); }
.sw-col.weaknesses h3 { color: var(--high); }
.sw-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sw-col li {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* TJ comparison */
.comparison-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.comparison-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.comparison-box h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.comparison-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comparison-box li {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}
.comparison-box li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.comparison-box.stronger li::before { background: var(--low); }
.comparison-box.weaker li::before { background: var(--high); }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 1px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  main { padding: 100px 20px 60px; }
  .nav { padding: 0 20px; }
  .nav-links { display: none; }
  .card-grid-3 { grid-template-columns: 1fr; }
  .gap-grid { grid-template-columns: 1fr; }
  .sw-grid { grid-template-columns: 1fr; }
  .comparison-row { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .comp-grid { grid-template-columns: 1fr; }
}
