/* Patient Rank - Custom styles */

:root {
  --brand: #0066FF;
  --accent: #00D084;
  --warn: #FF6B6B;
}

html { scroll-behavior: smooth; }

/* 블러 처리된 잠금 행 */
.blur-row { pointer-events: none; }
.blur-row .blur-sm { filter: blur(4px); }

/* details/summary 화살표 회전 */
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '+';
  display: inline-block;
  width: 1.2em;
  color: #0066FF;
  font-weight: bold;
}
details[open] summary::before { content: '−'; }

/* 부드러운 페이드 애니메이션 */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.4s ease-out; }

/* 스크롤바 (데스크탑) */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: #F8FAFC; }
  ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 6px; }
  ::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
}

/* 테이블 행 부드러운 호버 */
#kw-tbody .kw-row { transition: background-color 0.12s ease; }

/* 인쇄 시 블러 제거 (Pro 유저 PDF 내보내기 대비) */
@media print {
  .blur-row, .blur-sm { filter: none !important; }
  header, footer, button, a[href="/#diagnose"] { display: none !important; }
}
:root { color-scheme: light; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* 노이즈 텍스처 (히어로 배경 깊이감) */
.bg-noise::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.6; mix-blend-mode: multiply; z-index: 0;
}
/* 그라디언트 텍스트 */
.text-gradient-brand {
  background: linear-gradient(135deg, #0066FF 0%, #7C5CFF 50%, #00D084 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-iris {
  background: linear-gradient(135deg, #7C5CFF 0%, #0066FF 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-mesh {
  background: linear-gradient(135deg, #0F172A 0%, #0066FF 50%, #00D084 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 스크롤 시 등장 애니메이션 (JS 없이) */
.reveal { opacity: 0; transform: translateY(20px); transition: all 0.7s ease-out; }
.reveal.in { opacity: 1; transform: translateY(0); }
/* 커스텀 스크롤바 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
/* 카드 hover lift */
.card-lift { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card-lift:hover { transform: translateY(-4px); }
/* 배경 그리드 (헤어라인) */
.bg-grid {
  background-image: linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(15,23,42,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-grid-mask {
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
/* shimmer for skeleton */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
  background-size: 1000px 100%;
  animation: shimmer 2.5s linear infinite;
}
/* 3D Tilt 카드 (마우스 패럴랙스) */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.tilt-card > * {
  transform: translateZ(0);
}
/* 글로우 보더 (호흡) */
.glow-border {
  position: relative;
  background: white;
  z-index: 0;
}
.glow-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle, 0deg), #0066FF, #00D084, #7AA6FF, #0066FF);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: rotateAngle 4s linear infinite;
}
.glow-border:focus-within::before,
.glow-border:hover::before {
  opacity: 1;
}
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotateAngle {
  to { --angle: 360deg; }
}
/* Aurora 블롭 */
.aurora-blob {
  background: radial-gradient(circle at 30% 30%, #0066FF 0%, transparent 60%),
              radial-gradient(circle at 70% 70%, #00D084 0%, transparent 60%);
  filter: blur(60px);
  opacity: 0.4;
}
/* SERP 카드 떨어지는 애니메이션 */
.serp-card {
  animation: dropIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.serp-card:nth-child(1) { animation-delay: 0.1s; }
.serp-card:nth-child(2) { animation-delay: 0.25s; }
.serp-card:nth-child(3) { animation-delay: 0.4s; }
.serp-card:nth-child(4) { animation-delay: 0.55s; }
.serp-card:nth-child(5) { animation-delay: 0.7s; }
.serp-card:nth-child(6) { animation-delay: 0.85s; }
.serp-card:nth-child(7) { animation-delay: 1.0s; }
/* 뱃지 글로우 */
.badge-glow {
  box-shadow: 0 0 0 1px rgba(0, 102, 255, 0.2),
              0 0 20px rgba(0, 102, 255, 0.3),
              0 0 40px rgba(0, 208, 132, 0.15);
}
/* 텍스트 그라디언트 애니메이션 */
.text-gradient-animated {
  background: linear-gradient(90deg, #0066FF, #00D084, #7AA6FF, #00D084, #0066FF);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientX 8s ease infinite;
}
/* 부드러운 마퀴 (브랜드 로고 무한 스크롤) */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee { animation: marquee 30s linear infinite; }
.marquee:hover { animation-play-state: paused; }
/* 노이즈 강화 (히어로 배경 깊이감 +) */
.bg-noise-strong::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.7; mix-blend-mode: multiply; z-index: 0;
}
/* 광선 효과 */
.beam {
  position: absolute;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(0, 102, 255, 0.4), transparent);
  animation: beamFall 4s linear infinite;
}
@keyframes beamFall {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}
/* 카운터 숫자 hover 효과 */
.counter-card {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.counter-card:hover {
  transform: translateY(-6px) scale(1.02);
}
.counter-card:hover .counter-num {
  background: linear-gradient(135deg, #0066FF 0%, #00D084 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* SERP 결과 라이브 핑 */
.live-ping {
  position: relative;
}
.live-ping::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: inherit;
  background: rgba(0, 208, 132, 0.4);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
/* 스크롤 진행바 (상단 고정 그라디언트) */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0066FF 0%, #00D084 50%, #7AA6FF 100%);
  transform: scaleX(0); transform-origin: 0 0;
  z-index: 100; transition: transform 0.1s linear;
  box-shadow: 0 1px 8px rgba(0, 102, 255, 0.4);
}
/* 마퀴 그라디언트 마스크 */
.marquee-mask {
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
/* 스포트라이트 카드 (마우스 따라 빛이 따라옴) */
.spotlight {
  position: relative;
  overflow: hidden;
}
.spotlight::before {
  content: '';
  position: absolute;
  top: var(--mx, 0); left: var(--my, 0);
  width: 400px; height: 400px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 102, 255, 0.18) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }
/* 인풋 입력 검증 체크 */
.flash-success {
  animation: flashSuccess 0.6s ease-out;
}
@keyframes flashSuccess {
  0% { background-color: transparent; }
  30% { background-color: rgba(0, 208, 132, 0.12); }
  100% { background-color: transparent; }
}
.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
/* 떠다니는 키워드 칩 (히어로 배경) */
.floating-kw {
  position: absolute;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 102, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 102, 255, 0.08);
  font-size: 12px; font-weight: 600;
  color: #334155;
  white-space: nowrap;
  animation: kwFloat 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes kwFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  50% { transform: translateY(-20px) rotate(2deg); opacity: 1; }
}
/* 자석 버튼 (마우스 따라 미세하게 끌림) */
.magnetic { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
/* SERP 시뮬레이션 타이핑 커서 */
.typing-cursor::after {
  content: '|';
  color: #0066FF;
  font-weight: 200;
  animation: blink 1s infinite;
  margin-left: 1px;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
/* ============ 다크 프리미엄 HERO (v3: 3색 오로라) ============ */
.hero-dark {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 102, 255, 0.38), transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 25%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 75% 55%, rgba(0, 208, 132, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 40% at 15% 70%, rgba(122, 166, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #030614 0%, #080C1E 40%, #0F172A 100%);
  color: #F8FAFC;
}
.hero-dark .text-display,
.hero-dark h1, .hero-dark h2 {
  color: #F8FAFC;
  text-shadow: 0 0 60px rgba(0, 102, 255, 0.15);
}
/* 별 그리드 (다크 hero 배경) */
.stars-grid {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
}
/* 큰 그라디언트 텍스트 (다크용) */
.text-gradient-dark {
  background: linear-gradient(135deg, #FFFFFF 0%, #A78BFA 35%, #7AA6FF 60%, #00D084 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-aurora {
  background: linear-gradient(90deg, #7AA6FF 0%, #A78BFA 30%, #00D084 60%, #7AA6FF 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientX 6s ease infinite;
}
/* 글래스 패널 (다크 hero용) */
.glass-dark {
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 30px 80px -20px rgba(0,0,0,0.5);
}
/* Bento 카드 hover 보더 빛 */
.bento-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.45), rgba(124, 92, 255, 0.35) 35%, transparent 50%, rgba(0, 208, 132, 0.45));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none;
}
.bento-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.15); }
.bento-card:hover::before { opacity: 1; }
/* 3D 데이터 큐브 (CSS only) */
.data-cube {
  width: 280px; height: 280px;
  position: relative;
  transform-style: preserve-3d;
  animation: cubeRotate 22s linear infinite;
  margin: 0 auto;
}
.cube-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(122, 166, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.18), rgba(0, 208, 132, 0.1));
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 60px rgba(0, 102, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(255,255,255,0.6); font-family: 'JetBrains Mono', monospace;
}
.cube-face.front  { transform: translateZ(140px); }
.cube-face.back   { transform: rotateY(180deg) translateZ(140px); }
.cube-face.right  { transform: rotateY(90deg) translateZ(140px); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(140px); }
.cube-face.top    { transform: rotateX(90deg) translateZ(140px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(140px); }
@keyframes cubeRotate {
  0%   { transform: rotateX(-15deg) rotateY(0deg); }
  100% { transform: rotateX(-15deg) rotateY(360deg); }
}
/* 다크 인풋 (글래스 + 글로우) */
.input-dark-glow {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
}
.input-dark-glow:focus-within {
  border-color: rgba(0, 102, 255, 0.5);
  box-shadow:
    0 0 0 4px rgba(0, 102, 255, 0.15),
    0 0 60px rgba(0, 102, 255, 0.3),
    0 20px 60px -10px rgba(0, 0, 0, 0.6);
}
/* 라이브 활동 피드 (다크) */
.live-feed-row {
  opacity: 0;
  animation: feedIn 0.6s ease-out forwards;
}
@keyframes feedIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
/* 빛나는 보더 (orbit) */
.orbit-border {
  position: relative;
}
.orbit-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent 0deg, #00D084 60deg, transparent 120deg, transparent 240deg, #0066FF 300deg, transparent 360deg);
  animation: rotateAngle 6s linear infinite;
  z-index: -1;
}
/* ============ v3 신규 유틸리티 ============ */
/* 섹션 eyebrow (통일된 라벨) */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: linear-gradient(135deg, rgba(0,102,255,0.08), rgba(124,92,255,0.08));
  border: 1px solid rgba(0,102,255,0.15);
  color: #0052CC;
}
/* 프리미엄 CTA 버튼 shine */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}
.btn-shine:hover::after { transform: translateX(100%); }
/* 라이트 섹션 카드 v3 (미세한 그라디언트 헤어라인) */
.card-v3 {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s, border-color 0.3s;
}
.card-v3:hover {
  transform: translateY(-4px);
  border-color: rgba(0,102,255,0.25);
  box-shadow: 0 20px 50px -12px rgba(0,102,255,0.12), 0 8px 24px -8px rgba(15,23,42,0.08);
}
/* 오로라 링 CTA 래퍼 */
.aurora-ring {
  position: relative; border-radius: inherit;
}
.aurora-ring::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  background: conic-gradient(from var(--angle, 0deg), #0066FF, #7C5CFF, #00D084, #7AA6FF, #0066FF);
  animation: rotateAngle 5s linear infinite;
  z-index: -1; filter: blur(6px); opacity: 0.7;
}
/* 내비 링크 그라디언트 언더라인 */
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #0066FF, #00D084);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.nav-link:hover::after { transform: scaleX(1); }
/* 숫자 강조 (지표) */
.stat-num {
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #FFFFFF 30%, rgba(255,255,255,0.55) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 다크 섹션 divider 글로우 */
.divider-glow {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, rgba(0,102,255,0.5), rgba(124,92,255,0.5), rgba(0,208,132,0.5), transparent);
}
/* 미디어 쿼리 - 모션 줄임 */
@media (prefers-reduced-motion: reduce) {
  .serp-card, .float, .beam, .marquee, .text-gradient-animated,
  .badge-glow, .floating-kw, .typing-cursor::after, .scroll-progress {
    animation: none !important;
  }
}

/* ── result 테이블 압축 유틸 (SSR 페이로드 다이어트) ── */
.td-x { padding: 0.875rem 1.25rem; }
.rk-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 3rem; padding: 0.25rem 0.625rem; border-radius: 0.5rem; font-size: 0.75rem; line-height: 1rem; font-weight: 800; border: 1px solid transparent; }
.rk-sm { min-width: 2.5rem; padding: 0.125rem 0.5rem; }
.lnk-b { color: #7AA6FF; }
.lnk-b:hover { color: #ADC8FF; text-decoration: underline; }
.row-h { transition: background-color 0.15s ease; }
.row-h:hover { background-color: rgba(255,255,255,0.04); }
