/* ==========================================================================
   3DKit — theme.css
   - 다크(기본)는 기존 custom.css 그대로 사용
   - <html data-theme="light"> 일 때만 아래 규칙이 적용됨
   - custom.css 뒤에 로드해야 함 (순서 중요)
   - Tailwind 재빌드 불필요: 이미 컴파일된 클래스를 속성 선택자로 덮어씀
   ========================================================================== */

:root {
  color-scheme: dark;
  --toggle-border: rgba(255, 255, 255, 0.15);
  --toggle-hover: rgba(255, 255, 255, 0.06);
}

/* ---------- 테마 토글 버튼 (두 테마 공통) ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--toggle-border);
  background: transparent;
  color: var(--n-2);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--n-1); background: var(--toggle-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
/* 다크에서는 해(라이트로 전환), 라이트에서는 달(다크로 전환) */
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }


/* ==========================================================================
   LIGHT THEME
   ========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  /* 기존 변수 덮어쓰기 */
  --bg: #F1F1F1;       /* #FAF9FD*/
  --n-1: #14121F;      /* 제목 */
  --n-2: #3F3B52;      /* 본문 */
  --n-3: #6B6680;      /* 보조 */
  --n-6: #E7E4F0;
  --primary: #8F4DF0;
  --secondary: #1FA3E0;
  --tertiary: #E866C0;
  --surface: #FFFFFF;
  --text: #3F3B52;
  --text-dim: #6B6680;
  --border: #14121f14;
  --n-1: rgba(0, 0, 0, 0.8);    /* 제목 #101013;    */
  --n-2: #303030;      /* 본문 */
  --n-3: #585858;      /* 보조 */

  /* 라이트 전용 보조 변수 */
  --ink-soft: #504B63;                    /* text-gray-400 대체 (설명문) */
  --line-weak: rgba(20, 18, 31, 0.06);
  --line: rgba(20, 18, 31, 0.12);
  --line-strong: rgba(20, 18, 31, 0.18);
  --accent-text: #7C3AED;                 /* 흰 배경용 보라 */
  --cyan-text: #0E7490;                   /* 흰 배경용 시안 */

  --toggle-border: #14121f29;
  --toggle-hover: #14121f0d;
}

/* ---------- 타이포 ---------- */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 { color: var(--n-1); }
[data-theme="light"] p { color: var(--n-1); }

/* 헤드라인 그라데이션: 하늘색 끝을 진하게 (흰 배경 대비 확보) */
[data-theme="light"] .gradient-text {
  /* background-image: linear-gradient(90deg, #8F4DF0, #1692D0); */
  /* background-color: #14121F; */
  background: none;
  -webkit-text-fill-color: currentColor;
}

/* ---------- 텍스트 색 (Tailwind 유틸 → 라이트용) ---------- */
[data-theme="light"] [class~="text-white"]       { color: var(--n-1); }
[data-theme="light"] [class~="text-white/80"]    { color: #14121fbf; }
[data-theme="light"] [class~="text-white/70"]    { color: #14121fb8; }
[data-theme="light"] [class~="text-white/50"]    { color: #14121f99; }
[data-theme="light"] [class~="text-white/20"]    { color: #14121f80; }
[data-theme="light"] [class~="text-gray-400"]    { color: var(--ink-soft); }
[data-theme="light"] [class~="text-gray-500"]    { color: var(--n-3); }
[data-theme="light"] [class~="text-neutral-100"] { color: var(--n-1); }
[data-theme="light"] [class~="text-neutral-500"] { color: var(--n-3); }
[data-theme="light"] [class~="text-neutral-600"] { color: #4B4760; }

/* 포인트 컬러: 연한 파스텔 → 흰 배경에서 읽히는 진한 톤 */
[data-theme="light"] [class~="text-cyan-400"],
[data-theme="light"] [class~="text-cyan-400/80"],
[data-theme="light"] [class~="text-[#83F9FB]"]   { color: var(--cyan-text); }
[data-theme="light"] [class~="text-purple-400"]  { color: var(--accent-text); }
[data-theme="light"] [class~="text-blue-400"]    { color: #2563EB; }
[data-theme="light"] [class~="text-blue-500"]    { color: var(--accent-text) !important; }
[data-theme="light"] [class~="text-tertiary"]    { color: #D6459C; }
[data-theme="light"] .text-black {color: #ffffff;}


/* hover / group-hover */
[data-theme="light"] [class~="hover:text-white"]:hover { color: var(--n-1); }
[data-theme="light"] .group:hover [class~="group-hover:text-white"] { color: var(--n-1); }
[data-theme="light"] .group:active [class~="group-active:text-white"] { color: var(--n-1); }
[data-theme="light"] .group:hover [class~="group-hover:text-cyan-400"] { color: var(--cyan-text); }
[data-theme="light"] [class~="hover:text-[#00FFBD]"]:hover {
  color: #0B8A66;
  border-color: rgba(11, 138, 102, 0.5);
}

/* ---------- 테두리 ---------- */
[data-theme="light"] [class~="border-white/5"]  { border-color: var(--line-weak); }
[data-theme="light"] [class~="border-white/15"] { border-color: var(--line); }
[data-theme="light"] [class~="border-white/20"] { border-color: var(--line-strong); }
[data-theme="light"] [class~="border-gray-700"] { border-color: rgba(20, 18, 31, 0.22); }
[data-theme="light"] [class~="border-white/60"] { border-color: rgba(0, 0, 0, 0.8); }

[data-theme="light"] [class~="text-white"]       { color: var(--n-1); }

/* ---------- 배경 ---------- */
[data-theme="light"] [class~="bg-black"]       { background-color: var(--bg); }   /* 모바일 메뉴 오버레이 */
[data-theme="light"] .bg-gradient-600          {background: #14121F;}
[data-theme="light"] .bg-gradient-600 > [class~="bg-black"] { background-color: #fff; } /* Growth 카드 안쪽 */
[data-theme="light"] [class~="bg-black/40"]    { background-color: rgba(255, 255, 255, 0.72); } /* Wireframe 버튼 */
[data-theme="light"] [class~="bg-black/80"]    { background-color: rgba(250, 249, 253, 0.82); } /* 스크롤 시 헤더 */
[data-theme="light"] [class~="bg-[#1a1e26]"]   { background-color: #F1EFF8; }
[data-theme="light"] [class~="hover:bg-white/5"]:hover { background-color: rgba(20, 18, 31, 0.04); }
[data-theme="light"] .bg-black { background-color: #fff; z-index: 10000; }

/* 추가 */
[data-theme="light"] [class~="bg-[#0A090E]"]   { background-color: #fafafa; }




/* 텍스트 보더 */
[data-theme="light"] .glow-text {
          paint-order: stroke fill; 
          -webkit-text-stroke: 6px var(--bg); /* 테두리 두께와 색상 */
          /*text-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff;  x축, y축, 블러 크기, 색상 */
}


/* ---------- 폼 ---------- */
[data-theme="light"] :is(input, select, textarea)[class~="bg-[#0E0C15]"] {
  background-color: #fff;
  color: var(--n-1);
}
[data-theme="light"] :is(input, select, textarea)[class~="border-white/20"] {
  border-color: rgba(20, 18, 31, 0.35);
}
[data-theme="light"] :is(input, select, textarea)[class~="border-white/20"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(143, 77, 240, 0.18);
}
[data-theme="light"] ::placeholder { color: rgba(20, 18, 31, 0.45); }

/* ---------- 글래스 카드 ---------- */
[data-theme="light"] .brainwave-border,
[data-theme="light"] .brainwave-border-contact {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(20, 18, 31, 0.08);
  box-shadow: 0 8px 32px rgba(143, 77, 240, 0.08);
}
[data-theme="light"] .brainwave-border:hover {
  background: rgba(255, 255, 255, 0.95) !important;
}
[data-theme="light"] .bg-background80 {
  /* background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(20, 18, 31, 0.08);
  box-shadow: 0 8px 32px rgba(143, 77, 240, 0.08); */
  /* background: var(--bg transparent 30%) !important; */
  /* background:#F1F1F130 !important; */
  padding: 62px 32px;
background: color-mix(in srgb, var(--bg) 80%, transparent) !important; 

}
[data-theme="light"] .bg-background{
  background:  var(--bg) !important; 
}
[data-theme="light"] .bg-fff{
  background:  #ffffff !important; 
}

[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 32px rgba(20, 18, 31, 0.06);
}

/* ---------- 샌드박스 ---------- */
[data-theme="light"] .preview-container-wrapper {
  /* background: rgba(13, 13, 22, 0.918); */
  background: #ffffff90;
  border: 1px solid rgba(20, 18, 31, 0.08);
  box-shadow: 0 8px 32px rgba(20, 18, 31, 0.08);
}
/* 에셋 선택 버튼 (유틸 border 덮어쓰기보다 뒤에 위치해야 함) */
[data-theme="light"] .asset-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}
[data-theme="light"] .asset-btn:hover { background: rgba(255, 255, 255, 0.95); }
[data-theme="light"] .asset-btn.active {
  background: #fff;
  border: 1px solid rgba(143, 77, 240, 0.4);
  box-shadow: 0 8px 24px rgba(143, 77, 240, 0.12);
}

/* ---------- 상단 Get Started 버튼 (.btn-gradient 기본 글자색이 white) ---------- */
[data-theme="light"] .btn-gradient { color: var(--n-1); }
[data-theme="light"] .btn-gradient:hover { box-shadow: 0 0 20px rgba(143, 77, 240, 0.25); }

/* ---------- 히어로 3D 배경 (와이어프레임 터널) ---------- */
[data-theme="light"] #hero-canvas-container {
  opacity: 1;
  filter: brightness(0.7) saturate(1.5);
}

/* ---------- 로고 / 이미지 ---------- */
/* 로고가 흰색 기반이라 가정하고 명도만 반전 (색상 hue 유지).
   라이트용 SVG를 따로 만들면 아래 두 줄은 지우고 src를 교체하세요. */
[data-theme="light"] img[src$="logo_3dkit.svg"],
[data-theme="light"] img[src$="3DkitHero-banner.svg"] {
  filter: invert(1) hue-rotate(180deg);
}

/* ---------- 푸터 SVG 아이콘 ---------- */
[data-theme="light"] footer svg path[fill="#fff"] { fill: currentColor; }

/* ---------- 모바일 ---------- */
@media (max-width: 768px) {
  [data-theme="light"] .brainwave-border-contact {
    background: none !important;
    border: none;
    box-shadow: none;
  }
}
@media (max-width: 767px) {
  [data-theme="light"] .preview-container-wrapper {
    background: rgba(255, 255, 255, 0.85);
    border: initial;
    box-shadow: none;
  }
}
