:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent-blue: #3B8BD4;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-amber: #d29922;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav-brand-company {
  font-size: 0.78rem;
  font-weight: 700;
  color: #F5A623;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-brand-product {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.nav-links a.active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-blue);
  border-radius: 0;
  padding-bottom: 4px;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.25rem;
  padding: 4px 8px;
}

/* NAV DROPDOWN */
.nav-dropdown { position: relative; }
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  right: -10px;
  height: 12px;
  z-index: 1999;
}
.nav-caret { font-size: 0.65rem; opacity: 0.6; margin-left: 1px; vertical-align: middle; }

.nav-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  list-style: none;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown:hover .nav-submenu { display: block; }
.nav-submenu a {
  display: block;
  padding: 7px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  white-space: nowrap;
  border-radius: 0;
  transition: background 0.1s, color 0.1s;
}
.nav-submenu a:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.submenu-divider { height: 1px; background: var(--border); margin: 4px 8px; }

/* ── NAV LOGIN BUTTON ────────────────────────────────────────────────────── */
.nav-login-btn {
  padding: 5px 14px; border-radius: 6px;
  border: 1px solid var(--accent-blue);
  background: transparent; color: var(--accent-blue);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-login-btn:hover { background: var(--accent-blue); color: #fff; }

/* ── NAV AVATAR & PROFILE MENU ─────────────────────────────────────────── */
.nav-avatar-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center;
}
.nav-avatar-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), #3fb950);
  color: #fff; font-size: 0.85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.nav-avatar-btn:hover .nav-avatar-circle { border-color: var(--accent-blue); }
.nav-avatar-lg { width: 44px; height: 44px; font-size: 1.1rem; }

.nav-profile-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; min-width: 220px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35); overflow: hidden;
}
.nav-profile-menu.open { display: block; }
.nav-profile-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.nav-profile-info { min-width: 0; }
.nav-profile-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-profile-email { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-profile-divider { height: 1px; background: var(--border); }
.nav-profile-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 0.85rem; color: var(--text-secondary);
  text-decoration: none; cursor: pointer; background: none; border: none;
  width: 100%; text-align: left; transition: background 0.12s;
}
.nav-profile-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-profile-signout { color: var(--accent-red, #f85149); }
.nav-profile-signout:hover { background: rgba(248,81,73,0.1); color: var(--accent-red, #f85149); }

@media (max-width: 640px) {
  .nav-hamburger { display: block; }
  .nav-links {
    display: none;
    position: fixed;
    top: 52px; left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 0;
    gap: 0;
    overflow-y: auto;
    max-height: calc(100vh - 52px);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 24px; border-radius: 0; border-bottom: none !important; }
  .nav-submenu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 16px;
    min-width: unset;
    background: transparent;
  }
  .nav-submenu a { padding: 8px 24px; font-size: 0.8rem; color: var(--text-muted); }
  .nav-caret { display: none; }
  .submenu-divider { display: none; }
}

/* MAIN */
main {
  padding-top: 52px;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 64px;
}

/* FOOTER */
footer {
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.7;
}
.footer-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.footer-company {
  font-size: 0.72rem;
  font-weight: 700;
  color: #F5A623;
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footer-product {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* HEADINGS */
h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; margin-bottom: 8px; }
h2 { font-size: 1.3rem; margin-bottom: 12px; }
h3 { font-size: 1.1rem; margin-bottom: 8px; }

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}

/* BADGES */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-finance { background: rgba(59,139,212,0.2); color: var(--accent-blue); }
.badge-analysis { background: rgba(63,185,80,0.2); color: var(--accent-green); }
.badge-weekly { background: rgba(210,153,34,0.2); color: var(--accent-amber); }

/* BLOG POST LIST */
.post-list { list-style: none; }
.post-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.post-item:hover { border-color: var(--accent-blue); }
.post-item a { text-decoration: none; }
.post-item h3 { color: var(--text-primary); font-size: 1.05rem; margin-bottom: 4px; }
.post-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 12px; align-items: center; }
.post-excerpt { color: var(--text-secondary); font-size: 0.875rem; }

/* POST CONTENT */
.post-content {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}
.post-content p { margin-bottom: 1.2em; }
.post-content h2 { margin-top: 1.8em; margin-bottom: 0.6em; }
.post-content h3 { margin-top: 1.4em; margin-bottom: 0.4em; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.post-content li { margin-bottom: 0.3em; }
.post-content strong { color: var(--text-primary); font-weight: 600; }
.post-content table { border-collapse: collapse; width: 100%; margin-bottom: 1.2em; }
.post-content table th, .post-content table td { padding: 6px 20px 6px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.post-content table th { color: var(--text-primary); font-weight: 600; border-bottom: 2px solid var(--border); }
.post-content table td { color: var(--text-secondary); }
.post-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

/* POST NAV */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav a { color: var(--accent-blue); text-decoration: none; font-size: 0.875rem; }
.post-nav a:hover { text-decoration: underline; }

/* PAGINATION */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
}
.pagination a:hover { background: var(--bg-card); color: var(--text-primary); }
.pagination .current { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* HOME PAGE */
.hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.hero p { color: var(--text-secondary); font-size: 1.05rem; max-width: 560px; margin-top: 8px; }

/* ── Landing Hero (homepage) ────────────────────────────────────────────── */
.hero-landing {
  padding: 56px 0 40px;
  background: linear-gradient(135deg, rgba(59,139,212,0.06) 0%, rgba(245,166,35,0.04) 100%);
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.hero-landing::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 20px rgba(245,166,35,0.25), 0 0 0 2px rgba(245,166,35,0.15);
}
.hero-brand { display: flex; flex-direction: column; gap: 4px; }
.hero-company {
  font-size: 1.1rem;
  font-weight: 800;
  color: #F5A623;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-product-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: rgba(59,139,212,0.15);
  border: 1px solid rgba(59,139,212,0.3);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--accent-blue);
  font-weight: 600;
  letter-spacing: 0.04em;
  width: fit-content;
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #e6edf3 0%, #8b949e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 24px;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-tag {
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}
.hero-tag:hover { border-color: var(--accent-blue); color: var(--text-primary); }

@media (max-width: 640px) {
  .hero-title { font-size: 1.6rem; }
  .hero-logo { width: 56px; height: 56px; }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s;
}
.feature-card:hover { border-color: var(--accent-blue); }
.feature-card a { text-decoration: none; display: block; }
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { color: var(--text-secondary); font-size: 0.875rem; }

.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.mini-card:hover { border-color: var(--accent-blue); }
.mini-card a { text-decoration: none; display: block; }
.mini-card .mc-symbol { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.mini-card .mc-name { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.section-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-blue); margin: 24px 0 10px; }

/* ABOUT */
.about-content { max-width: 680px; }
.about-content p { color: var(--text-secondary); margin-bottom: 1.2em; }

/* READING TIME */
.reading-time { color: var(--text-muted); }

/* LANGUAGE SWITCHER */
.lang-toggle-item {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 0 4px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.lang-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.15s;
}
.lang-btn:hover { color: var(--text-primary); border-color: var(--border); }
.lang-btn.active { color: var(--accent-blue); border-color: var(--accent-blue); }

/* I18N: hide Korean content by default (English is default) */
.ko-only { display: none !important; }
html.ko-mode .ko-only { display: revert !important; }
html.ko-mode .en-only { display: none !important; }

/* lang-ko / lang-en class system (mirrors ko-mode toggle) */
.lang-ko { display: none; }
html.ko-mode .lang-ko { display: block; }
html.ko-mode .lang-en { display: none; }
.lang-en { display: block; }

/* NEWSLETTER */
.newsletter-section {
  margin: 48px 0 0;
  padding: 32px 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.newsletter-inner { display: flex; flex-direction: column; gap: 20px; }
.newsletter-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.newsletter-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-row { display: flex; gap: 8px; }
.newsletter-input {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.newsletter-input:focus { border-color: var(--accent-blue); }
.newsletter-input::placeholder { color: var(--text-muted); }
.newsletter-btn {
  padding: 9px 18px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.newsletter-btn:hover { opacity: 0.85; }
.newsletter-fine {
  font-size: 0.75rem;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .newsletter-row { flex-direction: column; }
  .newsletter-btn { width: 100%; }
}

/* SHARE BUTTONS */
.share-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.share-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.share-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.share-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.share-btn.x:hover     { color: #fff; border-color: #fff; }
.share-btn.reddit:hover  { color: #ff4500; border-color: #ff4500; }
.share-btn.kakao:hover   { color: #fee500; border-color: #fee500; }
.share-btn.linkedin:hover    { color: #0a66c2; border-color: #0a66c2; }
/* Native share button: hidden on desktop (mouse), visible on touch devices only */
.share-btn.native-share { display: none; }
@media (hover: none) and (pointer: coarse) {
  .share-btn.native-share { display: inline-flex; }
}
