/* =========================================================================
   CodeBasic — design system
   ========================================================================= */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-ink: #0b0e1a;
  --ink: #14161f;
  --ink-soft: #4b5066;
  --ink-faint: #8a8fa6;
  --line: #e6e8f0;
  --brand: #5b4bff;
  --brand-2: #00c2d1;
  --brand-ink: #3a2fd6;
  --accent: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 34, .04), 0 12px 32px rgba(16, 18, 34, .08);
  --shadow-sm: 0 1px 2px rgba(16, 18, 34, .05), 0 6px 16px rgba(16, 18, 34, .06);
  --maxw: 1120px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* ---- i18n: hide content until strings are rendered (no flash of keys) ----- */
html.i18n-pending body { visibility: hidden; }

/* ---- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand);
}
.muted { color: var(--ink-soft); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(91, 75, 255, .28); }
.btn-primary:hover { background: var(--brand-ink); box-shadow: 0 10px 26px rgba(91, 75, 255, .36); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.22); }
.btn-light:hover { background: rgba(255,255,255,.2); }

/* ---- header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: inline-flex; align-items: center; }
.brand .logo { width: 28px; height: 28px; }
.brand .wordmark { height: 22px; width: auto; display: block; }
.site-footer .brand .wordmark { height: 20px; }
.nav-links { display: flex; gap: 4px; margin-left: 14px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-links a.active { color: var(--brand); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* demoted /market link — a utility item, not a primary nav entry */
.nav-market {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-faint);
  transition: background .15s ease, color .15s ease;
}
.nav-market:hover { background: var(--bg-soft); color: var(--ink); }
.nav-market.active { color: var(--brand); }
.nav-market svg { display: block; }

.social-links { display: inline-flex; gap: 2px; }
.social-links a {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  color: var(--ink-faint); transition: background .15s ease, color .15s ease;
}
.social-links a:hover { background: var(--bg-soft); color: var(--brand); }
.social-links svg { display: block; }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff;
}
.lang-toggle button {
  border: 0; background: transparent; padding: 7px 13px; font-size: 13px; font-weight: 600;
  color: var(--ink-faint); cursor: pointer; font-family: inherit;
}
.lang-toggle button.active { background: var(--ink); color: #fff; }

.nav-toggle { display: none; }

/* ---- hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,194,209,.35), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(91,75,255,.45), transparent 55%),
    var(--bg-ink);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(to bottom, black, transparent 80%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; padding-top: 92px; padding-bottom: 96px; }
.hero .eyebrow { color: var(--brand-2); }
.hero h1 { font-size: clamp(34px, 6vw, 62px); font-weight: 800; margin: 18px 0 0; }
.hero h1 .grad {
  background: linear-gradient(100deg, #8b7dff, #00d8c0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { margin-top: 22px; font-size: clamp(16px, 2.2vw, 20px); color: rgba(255,255,255,.78); max-width: 640px; }
.hero-cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }
.triad {
  margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); overflow: hidden;
}
.triad div { background: rgba(11,14,26,.55); padding: 24px 22px; backdrop-filter: blur(4px); }
.triad .k { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2); font-weight: 700; }
.triad .v { margin-top: 8px; font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; }
.triad .d { margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.66); }

/* ---- sections ------------------------------------------------------------ */
section { padding: 88px 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-top: 12px; }
.section-head p { margin-top: 14px; font-size: 17px; color: var(--ink-soft); }
.bg-soft { background: var(--bg-soft); }

/* ---- cards / grid -------------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d9dcec; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(91,75,255,.12), rgba(0,194,209,.12));
  color: var(--brand); margin-bottom: 18px;
}
.card h3 { font-size: 20px; font-weight: 700; }
.card p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }

/* book / app cards with link */
.linkcard { position: relative; }
.linkcard .meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.linkcard .tag {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-soft);
}
.linkcard .arrow { margin-top: auto; padding-top: 18px; font-weight: 600; color: var(--brand); font-size: 15px; }
.linkcard.disabled { opacity: .72; }
.linkcard.disabled:hover { transform: none; box-shadow: var(--shadow-sm); }

.cover {
  height: 120px; border-radius: var(--radius-sm); margin-bottom: 18px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 26px; letter-spacing: -.02em;
}
.cover-1 { background: linear-gradient(135deg, #5b4bff, #8b7dff); }
.cover-2 { background: linear-gradient(135deg, #0ea5b5, #00d8c0); }
.cover-3 { background: linear-gradient(135deg, #f0653e, #ff9a6b); }

/* ---- CTA band ------------------------------------------------------------ */
.cta {
  color: #fff; border-radius: 24px; padding: 56px 48px; text-align: center;
  background:
    radial-gradient(700px 300px at 50% -40%, rgba(0,194,209,.4), transparent 60%),
    linear-gradient(120deg, #4a3bf0, #1a1d33);
}
.cta h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
.cta p { margin-top: 14px; color: rgba(255,255,255,.8); font-size: 17px; }
.cta .hero-cta { justify-content: center; margin-top: 28px; }

/* ---- footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; color: var(--ink-soft); font-size: 14px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.foot-grid .brand { color: var(--ink); font-size: 17px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--ink); }

/* ---- page hero (sub pages) ----------------------------------------------- */
.page-hero { padding: 72px 0 24px; }
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; }
.page-hero p { margin-top: 16px; font-size: 18px; color: var(--ink-soft); max-width: 640px; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .triad { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-market .label { display: none; }
  .nav-market { padding: 6px 8px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 66px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px; gap: 2px;
  }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; cursor: pointer;
  }
  section { padding: 64px 0; }
  .cta { padding: 40px 24px; }
}

/* =========================================================================
   Memory Market terminal (/market) — dark "trading console" band
   ========================================================================= */
.market-hero .wrap { padding-top: 72px; padding-bottom: 40px; }
.market-hero h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; margin: 16px 0 0; }
.market-hero h1 .grad {
  background: linear-gradient(100deg, #8b7dff, #00d8c0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mkt-asof {
  margin-top: 20px; color: rgba(255, 255, 255, .6); font-size: 13px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

/* dark band that continues the hero into a console */
.mkt {
  --mkt-panel: #111722; --mkt-panel2: #0d131c; --mkt-border: #1e2836;
  --mkt-text: #e6edf3; --mkt-muted: #7d8896; --mkt-grid: #182230;
  --mkt-up: #00c97b; --mkt-down: #ff5c5c; --mkt-accent: #ffb020;
  background: var(--bg-ink); color: var(--mkt-text);
  padding: 32px 0 72px;
  font-variant-numeric: tabular-nums;
}
.mkt .wrap { display: flex; flex-direction: column; gap: 16px; }

/* marquee */
.mkt-marquee-box {
  background: var(--mkt-panel2); border: 1px solid var(--mkt-border);
  border-radius: var(--radius-sm); overflow: hidden; white-space: nowrap;
}
.mkt-marquee-inner {
  display: inline-block; padding: 9px 0; font-size: 13px;
  animation: mkt-scroll 40s linear infinite;
}
.mkt-marquee-inner span { margin: 0 22px; color: var(--mkt-muted); }
.mkt-marquee-inner b { color: var(--mkt-text); font-weight: 700; }
.mkt-marquee-inner b.down { color: var(--mkt-down); }
.mkt-marquee-inner b.up { color: var(--mkt-up); }
.mkt-marquee-box:hover .mkt-marquee-inner { animation-play-state: paused; }
@keyframes mkt-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ticker cards */
.mkt-tickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mkt-tk {
  position: relative; overflow: hidden;
  background: var(--mkt-panel); border: 1px solid var(--mkt-border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.mkt-tk-name { font-size: 12px; color: var(--mkt-muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.mkt-tk-sub { font-size: 11px; color: var(--mkt-muted); margin-top: 1px; }
.mkt-tk-price { font-size: 26px; font-weight: 800; margin-top: 8px; }
.mkt-tk-chg { font-size: 13px; font-weight: 700; margin-top: 2px; }
.mkt-mom { color: var(--mkt-muted); font-weight: 400; }
.mkt .up { color: var(--mkt-up); }
.mkt .down { color: var(--mkt-down); }
.mkt-spark { position: absolute; right: 12px; bottom: 12px; width: 92px; height: 34px; opacity: .9; }

/* panels */
.mkt-grid2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.mkt-panel {
  background: var(--mkt-panel); border: 1px solid var(--mkt-border);
  border-radius: var(--radius); padding: 22px;
}
.mkt-h2 { font-size: 16px; font-weight: 700; color: var(--mkt-text); letter-spacing: -.01em; }
.mkt-h2 .dim { color: var(--mkt-muted); font-weight: 400; }
.mkt-hint { font-size: 12px; color: var(--mkt-muted); margin-top: 5px; margin-bottom: 14px; line-height: 1.5; }

/* segmented control */
.mkt-seg {
  display: inline-flex; background: var(--mkt-panel2); border: 1px solid var(--mkt-border);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px;
}
.mkt-seg button {
  background: transparent; border: none; color: var(--mkt-muted);
  padding: 7px 13px; font-size: 12px; cursor: pointer; font-weight: 700; font-family: inherit;
}
.mkt-seg button.on { background: var(--mkt-accent); color: #0a0e14; }
.mkt-chart-box { position: relative; height: 320px; }

/* buyer signal */
.mkt-signal { text-align: center; padding: 4px 0 2px; }
.mkt-gauge { font-size: 12px; color: var(--mkt-muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.mkt-verdict { font-size: clamp(22px, 3vw, 28px); font-weight: 800; margin: 8px 0 2px; color: var(--mkt-down); }
.mkt-verdict-sub { font-size: 12px; font-weight: 600; color: var(--mkt-muted); margin-top: 2px; }
.mkt-meter {
  height: 10px; border-radius: 6px; margin: 16px 0 6px; position: relative;
  background: linear-gradient(90deg, var(--mkt-up), var(--mkt-accent) 55%, var(--mkt-down));
}
.mkt-pin {
  position: absolute; top: -5px; width: 3px; height: 20px; background: #fff;
  border-radius: 2px; box-shadow: 0 0 6px rgba(0, 0, 0, .6); transform: translateX(-50%);
}
.mkt-meter-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--mkt-muted); }

/* fact lists */
.mkt-facts { list-style: none; font-size: 13px; margin: 12px 0 0; padding: 0; }
.mkt-facts li {
  padding: 9px 0; border-bottom: 1px solid var(--mkt-border);
  display: flex; justify-content: space-between; gap: 12px;
}
.mkt-facts li:last-child { border-bottom: none; }
.mkt-facts .k { color: var(--mkt-muted); }
.mkt-facts .v { font-weight: 700; text-align: right; }

/* drivers */
.mkt-drivers { list-style: none; font-size: 13.5px; color: #c6ced8; margin: 0; padding: 0; line-height: 1.6; }
.mkt-drivers li { position: relative; margin: 0 0 11px 18px; }
.mkt-drivers li::before { content: "▸"; position: absolute; left: -16px; color: var(--mkt-accent); }
.mkt-drivers b { color: var(--mkt-text); }
.mkt-disc {
  margin-top: 16px; font-size: 11.5px; line-height: 1.55; border-radius: var(--radius-sm);
  background: #1a1206; border: 1px solid #3a2a08; color: #d9b877; padding: 11px 13px;
}

/* sources */
.mkt-src { color: var(--mkt-muted); font-size: 11.5px; line-height: 1.8; margin-top: 6px; }
.mkt-src a { color: var(--mkt-muted); text-decoration: underline; text-underline-offset: 2px; }
.mkt-src a:hover { color: var(--mkt-text); }
.mkt-method { margin-top: 8px; font-size: 11px; color: var(--mkt-muted); }

@media (max-width: 820px) {
  .mkt-grid2 { grid-template-columns: 1fr; }
}

/* ── 내비 TellMe 로고 — Tell·Me 사이 틸 하트비트 점 + 브랜드 그라디언트(퍼플→틸).
   밋밋한 텍스트 대신 TellMe 브랜드 마크를 상단 내비에 사용. 색은 기존 브랜드 토큰 재사용(신규 색 없음). ── */
.cb-tellme {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: transparent;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links a.cb-tellme-link:hover .cb-tellme { filter: brightness(1.08); }
.cb-tellme-dot {
  width: 5px;
  height: 5px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--brand-2);
  -webkit-text-fill-color: initial;
  box-shadow: 0 0 6px rgba(0, 194, 209, .6);
  animation: cb-tellme-beat 1.7s ease-in-out infinite;
}
@keyframes cb-tellme-beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.72); }
}
@media (prefers-reduced-motion: reduce) {
  .cb-tellme-dot { animation: none; }
}
