
/* =========================================================
   BenAnt Strategy Lab — base styles (tokens + components)
   색상은 :root 토큰만 사용, 파생색은 rgba() 사용
   ========================================================= */
:root {
  --bg:      #0b0e14;
  --panel:   #11151c;
  --stripe:  #0e1218;
  --border:  #1f2630;
  --text:    #d7dde5;
  --muted:   #7d8794;
  --accent:  #35c8d4;
  --warn:    #e8b33e;
  --up:      #2ecc71;
  --down:    #e74c3c;
  --mono:    Consolas, 'Courier New', monospace;
  --shadow:  0 4px 16px rgba(0, 0, 0, 0.35);
  --inset:   inset 0 1px 0 rgba(215, 221, 229, 0.04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', 'Malgun Gothic', sans-serif;
  font-size: 15.5px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* 본문 인라인 링크 기본색 (기본 파랑/보라 방지) */
a {
  color: var(--accent);
}

/* 스크린리더 전용 (h1 계층/폼 라벨) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- header + navigation ----------------
   상단 고정 바. 왼쪽 = 로고(사이트이름), 가운데/오른쪽 = 메뉴, 맨 오른쪽 = 로그인.
   고정 위치는 .site-header 가 갖고, nav 는 그 안의 일반 플렉스 컨테이너다. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 32px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(11, 14, 20, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  border-radius: 9px 9px 0 0;
  box-shadow: var(--inset);
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}

.site-header nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  justify-content: flex-end;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 2px 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
nav a:hover,
nav a:focus-visible,
nav a[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.header-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 로그인은 아직 백엔드가 없다. 클릭해도 아무 일도 되지 않는 상태를
   시각적으로 분명히 해, 없는 기능이 있는 것처럼 보이지 않게 한다. */
.login-btn {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: not-allowed;
  white-space: nowrap;
}

/* ---------------- typography ---------------- */
h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 8px 0 24px;
  color: var(--text);
}
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 64px 0 24px;
  padding-bottom: 10px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 56px 2px no-repeat;
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 24px 0 12px;
}
p { margin: 12px 0; }
ul { padding-left: 22px; }
li { margin: 6px 0; }
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}
a { transition: color 150ms ease; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------- layout: 글래스 패널 거터 ---------------- */
/* .glass.page-wrapper 자체는 배경/보더만 담당하고, 안쪽 요소가 좌우 여백을 갖는다 */
.page-wrapper > main { padding: 0 28px; }
.page-wrapper > footer { padding: 0 28px 34px; }
.page-wrapper main > section:first-child > h2:first-child { margin-top: 8px; }
.page-wrapper main > article:first-child { padding-top: 8px; }

/* ---------------- honest banner ---------------- */
.banner {
  position: relative;
  background: rgba(232, 179, 62, 0.08);
  border: 1px solid rgba(232, 179, 62, 0.45);
  border-left: 4px solid var(--warn);
  border-radius: 6px;
  padding: 14px 16px 14px 44px;
  margin: 16px 0;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  box-shadow: var(--inset);
}
.banner::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px rgba(232, 179, 62, 0.8);
  animation: led-pulse 2s ease-in-out infinite;
}
.banner .status,
.banner code {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--warn);
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------------- hero ---------------- */
.hero {
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(53, 200, 212, 0.10), transparent 60%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 48px 32px;
  margin: 32px 0;
  text-align: center;
  box-shadow: var(--shadow), var(--inset);
}
.hero h1 { margin-bottom: 16px; }
.hero p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 640px;
  margin: 12px auto;
}

/* ---------------- process grid ---------------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.process-step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow), var(--inset);
  transition: transform 150ms ease, border-color 150ms ease;
}
.process-step:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 200, 212, 0.45);
}
.process-step .step-num {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), rgba(53, 200, 212, 0.7));
  color: var(--bg);
  border-radius: 50%;
  line-height: 40px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(53, 200, 212, 0.35);
}
.process-step h3 {
  margin: 12px 0 8px;
  font-size: 1rem;
}
.process-step p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* ---------------- cards ---------------- */
.featured-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow), var(--inset);
}
.featured-card.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
  border-style: dashed;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  box-shadow: var(--shadow), var(--inset);
  transition: transform 150ms ease, border-color 150ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 200, 212, 0.45);
}
.card h3 { margin-top: 0; }
.card b {
  font-family: var(--mono);
  font-size: 1.25em;
  font-variant-numeric: tabular-nums;
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}

/* ---------------- blog (카드 그리드) ----------------
   홈(index.html)과 블로그 목록(blog/index.html)이 같은 .blog-list 를 쓴다.
   대표 이미지는 잔액 변동 곡선 + 전략 이름이 들어 있는 카드 썸네일이다. */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.blog-list li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--inset);
  transition: transform 150ms ease, border-color 150ms ease;
}
.blog-list li:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 200, 212, 0.45);
}
/* 대표 이미지: 카드 상단 16:9 썸네일 */
.post-thumb-link {
  display: block;
  line-height: 0;
  border-bottom: 1px solid var(--border);
}
.post-thumb {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 150ms ease;
}
.blog-list li:hover .post-thumb { transform: scale(1.03); }

/* 카드 본문: 제목 + 날짜 */
.post-meta {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}
.post-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.45;
  transition: color 150ms ease;
}
.post-title:hover { color: var(--accent); }
.blog-list li .muted {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* 블로그 상세: 대표 이미지 + 설명 */
.post-hero {
  margin: 0 0 24px;
}
.post-thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.post-hero figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.5;
}

/* 소프트 CTA (amber 남용 대신 저채도 콜아웃) */
.soft-cta {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(232, 179, 62, 0.06);
  border: 1px solid rgba(232, 179, 62, 0.35);
  border-left: 4px solid var(--warn);
  border-radius: 6px;
  box-shadow: var(--inset);
}
.soft-cta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.soft-cta a:hover { text-decoration: underline; }

/* ---------------- tables ---------------- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 24px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: right;
  font-size: 0.9rem;
  font-family: var(--mono);
  color: var(--text);
  transition: background 150ms ease;
}
th:first-child, td:first-child { text-align: left; }
/* 텍스트 열은 왼쪽 정렬 (숫자는 기본 오른쪽 정렬 유지) */
th.t-left, td.t-left { text-align: left; }
th {
  background: var(--stripe);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(53, 200, 212, 0.35);
}
tbody tr:nth-child(even) td { background: var(--stripe); }
tbody tr:hover td { background: rgba(53, 200, 212, 0.06); }
td.muted, th.muted {
  text-align: center;
  color: var(--muted);
}
.table-container { overflow-x: auto; }
.profit-up { color: var(--up); }
.profit-down { color: var(--down); }

/* ---------------- chart ---------------- */
canvas {
  width: 100%;
  height: 300px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  display: block;
  box-shadow: var(--shadow), var(--inset);
}

/* ---------------- forms / cta ---------------- */
input[type='email'],
input[type='text'] {
  background: var(--stripe);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 10px 12px;
  min-width: 240px;
  transition: border-color 150ms ease;
}
input[type='email']:hover,
input[type='text']:hover { border-color: rgba(53, 200, 212, 0.45); }

/* waitlist form removed (no email endpoint); kept section uses .contact-disabled */

.cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), rgba(53, 200, 212, 0.72));
  color: var(--bg);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 8px 0;
  box-shadow: 0 4px 20px rgba(53, 200, 212, 0.25);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}
.cta-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 24px rgba(53, 200, 212, 0.4);
}
.cta-btn:active { transform: translateY(0); }

/* ---------------- empty states ---------------- */
.empty { color: var(--muted); text-align: center; padding: 16px 0; }
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
}
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.results-block { margin: 48px 0; }

/* ---------------- blog article ---------------- */
.interview { margin: 24px 0; }
.qa {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: var(--inset);
}
.qa p { margin: 8px 0; }
.qa p:first-child { margin-top: 0; }
.qa p:last-child { margin-bottom: 0; }
.next-teaser {
  margin: 24px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(53, 200, 212, 0.05);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
}
.next-teaser p { margin: 0; }
.blog-nav { margin-top: 32px; }
.blog-nav a { font-weight: 600; text-decoration: none; }
.blog-nav a:hover { text-decoration: underline; }

/* ---------------- footer ---------------- */
footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) and (min-width: 601px) {
  /* 4개 카드가 3+1로 갈라지지 않도록 2×2 고정 */
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}

.chart-tooltip {
  position: absolute;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
.chart-tooltip.profit-up { color: var(--up); }
.chart-tooltip.profit-down { color: var(--down); }

/* ---- 2차원 분포 (승률 × 거래당 순수 기대값) ---- */
.scatter-chart { display: block; width: 100%; height: 420px; }

/* 분포 툴팁은 링크를 담으므로 클릭을 받아야 한다. */
.scatter-tip {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 210px;
  max-width: 290px;
  line-height: 1.45;
}
.scatter-name { color: var(--text); }
.scatter-sub, .scatter-row { font-size: 0.74rem; color: var(--muted); }
.scatter-row b { color: var(--text); }
.scatter-link {
  margin-top: 5px;
  font-size: 0.76rem;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border);
  padding-top: 5px;
}
.scatter-link:hover { text-decoration: underline; }

.scatter-topright { margin-top: 14px; }
.scatter-topright strong {
  display: block;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 8px;
}
.scatter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.scatter-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--stripe);
  font-size: 0.85rem;
}
.scatter-list a { color: var(--accent); text-decoration: none; }
.scatter-list a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  body { padding: 24px 16px 48px; font-size: 15px; }
  .site-header {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    margin-bottom: 24px;
  }
  .brand-logo { height: 26px; }
  .header-side { margin-left: auto; }
  .site-header nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 2px 14px;
  }
  .site-header nav a { font-size: 0.86rem; }
  .login-btn { padding: 5px 9px; font-size: 0.7rem; }
  .page-wrapper > main { padding: 0 18px; }
  .page-wrapper > footer { padding: 0 18px 28px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; margin-top: 48px; }
  .hero { padding: 32px 20px; }
  .process-grid { grid-template-columns: 1fr; }
  /* 카드는 좁은 화면에서 1열로 접는다 (그리드가 알아서 처리하되, 최소 너비를 낮춘다) */
  .blog-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .blog-list li .muted { white-space: normal; }
  table { font-size: 0.8rem; }
  th, td { padding: 8px 6px; }
  canvas { height: 220px; }
  .scatter-chart { height: 320px; }
  input[type='email'], input[type='text'] { min-width: 0; width: 100%; }

.trade-log { margin-top: 12px; }
.trade-log summary { cursor: pointer; color: var(--muted); font-size: 0.86rem; }
.trade-log-body { max-height: 400px; overflow-y: auto; margin-top: 8px; }
.trade-log table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.trade-log th, .trade-log td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.trade-log th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.trade-log td:first-child, .trade-log th:first-child { text-align: left; }

.contact-disabled { display: inline-block; padding: 12px 24px; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); font-family: var(--mono); font-weight: 700; font-size: 0.92rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: not-allowed; margin: 8px 0; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
