/* ============================================================
   K-IT Insight — Design System & Main Styles
   ============================================================ */

/* ── 1. CSS VARIABLES ──────────────────────────────────────── */
:root {
  /* Color Palette */
  --bg-base:      #08090d;
  --bg-card:      #0f1117;
  --bg-elevated:  #161922;
  --bg-glass:     rgba(22, 25, 34, 0.72);

  --accent-blue:  #3b8beb;
  --accent-cyan:  #00d4aa;
  --accent-gold:  #f5a623;
  --accent-red:   #ff5c5c;

  --text-primary: #e8eaf0;
  --text-secondary: #8b90a0;
  --text-muted:   #4a4f62;

  --border:       rgba(255,255,255,0.07);
  --border-glow:  rgba(59,139,235,0.35);

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;

  --font-main:    'Pretendard', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --shadow-card:  0 4px 24px rgba(0,0,0,0.45);
  --shadow-glow:  0 0 32px rgba(59,139,235,0.18);
}

/* ── 2. RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── 3. HEADER ─────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(8,9,13,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: 0 2px 30px rgba(0,0,0,0.6); }
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; gap: 2rem;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em;
}
.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; color: #fff;
}
.logo-text em { color: var(--accent-cyan); font-style: normal; }
.header-nav {
  display: flex; gap: 1.8rem; margin-left: auto;
  font-size: 0.88rem; font-weight: 500; color: var(--text-secondary);
}
.header-nav a { transition: color 0.2s; }
.header-nav a:hover { color: var(--text-primary); }
.header-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--accent-cyan);
  background: rgba(0,212,170,0.08);
  border: 1px solid rgba(0,212,170,0.2);
  padding: 4px 12px; border-radius: 20px;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-cyan);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ── 4. HERO ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 100px 5% 60px;
  gap: 3rem;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(59,139,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,139,235,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero::before {
  content: '';
  position: absolute;
  top: 20%; left: 10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,139,235,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }

/* Market Bar */
.market-bar {
  display: inline-flex; align-items: center; gap: 1.2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  margin-bottom: 2.2rem;
  font-size: 0.82rem;
}
.market-item { display: flex; align-items: center; gap: 7px; }
.market-label { color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.72rem; }
.market-value { font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem; }
.market-change { font-family: var(--font-mono); font-weight: 600; font-size: 0.82rem; }
.market-change.up   { color: #4caf8e; }
.market-change.down { color: var(--accent-red); }
.market-divider { width: 1px; height: 20px; background: var(--border); }
.keyword-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ktag {
  background: rgba(59,139,235,0.12);
  border: 1px solid rgba(59,139,235,0.25);
  color: var(--accent-blue);
  padding: 2px 9px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 600;
}

/* Hero Title */
.hero-title {
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1rem; color: var(--text-secondary);
  line-height: 1.8; margin-bottom: 2rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  padding: 13px 28px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(59,139,235,0.35);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(59,139,235,0.5); }

.btn-ghost {
  padding: 13px 28px;
  border: 1px solid var(--border);
  color: var(--text-secondary); font-weight: 600; font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(59,139,235,0.06); }

/* Harness Flow Visual */
.hero-visual { position: relative; z-index: 1; }
.harness-flow {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.hf-node {
  flex: 1; min-width: 90px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem 0.8rem;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  cursor: default;
}
.hf-node:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(59,139,235,0.2);
  transform: translateY(-3px);
}
.hf-icon { font-size: 1.8rem; margin-bottom: 6px; }
.hf-label { font-weight: 700; font-size: 0.88rem; }
.hf-sub { color: var(--text-muted); font-size: 0.72rem; font-family: var(--font-mono); margin-top: 2px; }
.hf-arrow { color: var(--accent-blue); font-size: 1.2rem; font-weight: 700; opacity: 0.7; }

/* ── 5. MAIN CONTENT ───────────────────────────────────────── */
.main-content { max-width: 1280px; margin: 0 auto; padding: 0 2rem 6rem; }

/* Section Header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 2rem;
}
.section-title {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em;
}
.section-desc {
  color: var(--text-secondary); font-size: 0.95rem;
  max-width: 600px; margin-top: 0.5rem;
}
.date-chip {
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.25);
  color: var(--accent-gold);
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
  margin-left: 8px;
}

/* Filter Tabs */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; scroll-margin-top: 100px; }
.ftab {
  padding: 6px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 0.83rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.ftab:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.ftab.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-color: transparent; color: #fff;
}

/* ── 6. REPORT CARD ────────────────────────────────────────── */
.report-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.4rem;
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex; flex-direction: column; gap: 0.9rem;
  transition: border-color 0.2s, transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.report-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 0 24px rgba(59,139,235,0.12);
}
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-ticker {
  display: flex; align-items: center; gap: 8px;
}
.ticker-code {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted);
}
.ticker-name { font-weight: 700; font-size: 0.95rem; }
.trust-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 12px;
}
.trust-badge.high { background: rgba(76,175,142,0.12); color: #4caf8e; border: 1px solid rgba(76,175,142,0.25); }
.trust-badge.mid  { background: rgba(245,166,35,0.1);  color: var(--accent-gold); border: 1px solid rgba(245,166,35,0.25); }

.card-sector-tag {
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent-blue);
  background: rgba(59,139,235,0.08);
  border: 1px solid rgba(59,139,235,0.18);
  padding: 2px 8px; border-radius: 8px;
  display: inline-block;
}
.card-title {
  font-size: 1rem; font-weight: 700; line-height: 1.45;
  color: var(--text-primary);
}
.card-summary {
  font-size: 0.87rem; color: var(--text-secondary); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.8rem; border-top: 1px solid var(--border);
}
.card-agents {
  display: flex; gap: 4px;
}
.agent-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  title: attr(data-tip);
}
.agent-dot.passed { border-color: #4caf8e; background: rgba(76,175,142,0.1); }
.card-time { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.card-read-btn {
  font-size: 0.8rem; font-weight: 600; color: var(--accent-blue);
  padding: 5px 12px; border-radius: 8px;
  border: 1px solid rgba(59,139,235,0.25);
  background: rgba(59,139,235,0.06);
  transition: background 0.2s, border-color 0.2s;
}
.card-read-btn:hover { background: rgba(59,139,235,0.14); border-color: var(--accent-blue); }

/* ── 7. HOW IT WORKS ───────────────────────────────────────── */
.how-it-works { margin-top: 6rem; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem; margin-top: 2rem;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  position: relative; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.step-card:hover { border-color: var(--border-glow); transform: translateY(-3px); }
.step-num {
  font-family: var(--font-mono); font-size: 3.5rem; font-weight: 800;
  color: rgba(255,255,255,0.04); position: absolute; top: 12px; right: 16px;
  line-height: 1; pointer-events: none;
}
.step-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.step-card h3 span { font-weight: 400; color: var(--text-muted); font-size: 0.82rem; margin-left: 4px; font-family: var(--font-mono); }
.step-card p { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.7; }
.step-model {
  margin-top: 1rem; font-family: var(--font-mono); font-size: 0.73rem;
  color: var(--accent-cyan); background: rgba(0,212,170,0.07);
  border: 1px solid rgba(0,212,170,0.18); display: inline-block;
  padding: 3px 10px; border-radius: 8px;
}

/* ── 8. FOOTER ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-base);
  padding: 3rem 2rem;
}
.footer-inner { max-width: 1280px; margin: 0 auto; text-align: center; }
.footer-logo {
  font-size: 1.2rem; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.footer-logo em { color: var(--accent-cyan); font-style: normal; }
.footer-notice { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }

/* ── 9. BRIEFING SECTION SPACING ──────────────────────────── */
.briefing-section { padding-top: 4rem; scroll-margin-top: 100px; }

/* ── 10. SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 11. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 80px; }
  .hero-visual { order: -1; }
  .harness-flow { justify-content: center; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .header-nav { display: none; }
}
@media (max-width: 600px) {
  .market-bar { flex-direction: column; align-items: flex-start; }
  .market-divider { display: none; }
  .hero-title { font-size: 2.4rem; }
}

/* ── 12. REPORT DETAIL PAGE STYLES ────────────────────────── */
.detail-wrap {
  max-width: 820px; margin: 90px auto 4rem; padding: 0 2rem;
}
.detail-header {
  margin-bottom: 2rem;
}
.detail-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.detail-ticker-tag {
  font-family: var(--font-mono); font-size: 0.8rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 8px; color: var(--text-secondary);
}
.detail-sector-tag {
  background: rgba(59,139,235,0.1);
  border: 1px solid rgba(59,139,235,0.2);
  color: var(--accent-blue); font-size: 0.8rem; font-weight: 600;
  padding: 4px 12px; border-radius: 8px;
}
.detail-trust {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-secondary);
}
.trust-bar {
  width: 100px; height: 6px;
  background: var(--bg-elevated); border-radius: 3px; overflow: hidden;
}
.trust-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 3px; transition: width 1s ease;
}
.detail-title {
  font-size: 1.9rem; font-weight: 800; letter-spacing: -0.04em;
  line-height: 1.3; margin-bottom: 0.6rem;
}
.detail-summary-box {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent-blue);
  padding: 1rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 2rem;
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7;
}
.detail-body {
  font-size: 1rem; line-height: 1.9; color: var(--text-primary);
}
.detail-body h2 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 0.7rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.detail-body h3 { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--accent-blue); }
.detail-body p { margin-bottom: 1rem; }
.detail-body strong { color: var(--text-primary); font-weight: 700; }

/* Harness Log */
.harness-log {
  margin-top: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.harness-log-title {
  font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 1.2rem;
}
.harness-log-title::before {
  content: ''; display: block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-cyan);
}
.log-timeline { display: flex; flex-direction: column; gap: 0; }
.log-item {
  display: grid; grid-template-columns: 24px 1fr;
  gap: 0 1rem; position: relative;
  padding-bottom: 1.2rem;
}
.log-item:last-child { padding-bottom: 0; }
.log-dot-col { display: flex; flex-direction: column; align-items: center; }
.log-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
  border: 2px solid;
}
.log-dot.pass { border-color: #4caf8e; background: rgba(76,175,142,0.15); color: #4caf8e; }
.log-dot.fail { border-color: var(--accent-red); background: rgba(255,92,92,0.1); color: var(--accent-red); }
.log-line {
  width: 2px; flex: 1; background: var(--border); margin-top: 4px;
}
.log-item:last-child .log-line { display: none; }
.log-content { padding-top: 2px; }
.log-agent-name { font-weight: 700; font-size: 0.85rem; margin-bottom: 2px; }
.log-model-tag { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.log-note { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.log-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }
