/* ==========================================================================
   Dr. Brooks Blog & Portal - Modern Editorial Design System
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --bg-primary: #fcfcfd;
  --bg-secondary: #f4f5f8;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-alt: #f1f5f9;
  
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-active: #0ea5e9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;

  --accent-primary: #0284c7;
  --accent-hover: #0369a1;
  --accent-subtle: #e0f2fe;
  
  --pill-bg: #f1f5f9;
  --pill-text: #334155;
  --pill-accent-bg: #e0f2fe;
  --pill-accent-text: #0369a1;

  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --card-shadow-hover: 0 12px 30px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  --font-serif: "Noto Serif KR", Georgia, "Times New Roman", serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  /* Color Palette - Dark Mode */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --surface: #131d31;
  --surface-hover: #1e293b;
  --surface-alt: #1a253c;

  --border-light: #1e293b;
  --border-subtle: #334155;
  --border-active: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-subtle: rgba(56, 189, 248, 0.12);

  --pill-bg: #1e293b;
  --pill-text: #cbd5e1;
  --pill-accent-bg: rgba(56, 189, 248, 0.15);
  --pill-accent-text: #7dd3fc;

  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Container & Layout
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(252, 252, 253, 0.85);
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .site-nav {
  background-color: rgba(9, 13, 22, 0.85);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-avatar-mini {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1.5px solid var(--border-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background-color: var(--surface-alt);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--border-light);
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  transition: all var(--transition-fast);
}

.nav-link-btn:hover {
  background-color: var(--accent-primary);
  color: #ffffff;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border-light);
}

.hero-profile {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.hero-avatar-wrapper {
  flex-shrink: 0;
}

.hero-avatar {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.hero-info {
  flex: 1;
}

.hero-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid var(--border-light);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.hero-subheadline {
  font-size: 1.05rem;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.hero-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Three Pillars Showcase (글 · 소설 · 웹서비스)
   ========================================================================== */
.pillars-section {
  padding: 36px 0;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pillar-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-active);
}

.pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--accent-subtle);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.pillar-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.pillar-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
  flex: 1;
}

.pillar-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pillar-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Filter Tabs Navigation
   ========================================================================== */
.tabs-section {
  position: sticky;
  top: 68px;
  z-index: 90;
  background-color: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.tab-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* ==========================================================================
   Feed & Content Cards Grid
   ========================================================================== */
.feed-section {
  padding-bottom: 60px;
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 0.94rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

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

.cards-grid.single-col {
  grid-template-columns: 1fr;
}

/* Novel Card Spec */
.novel-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 20px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.novel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-active);
}

.novel-cover-wrapper {
  width: 110px;
  flex-shrink: 0;
}

.novel-cover {
  width: 100%;
  aspect-ratio: 1 / 1.45;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  background-color: var(--surface-alt);
}

.novel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.novel-badge-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--pill-accent-bg);
  color: var(--pill-accent-text);
}

.badge-episodes {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.novel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
}

.novel-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
  flex: 1;
}

.novel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.novel-tag-item {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  background-color: var(--pill-bg);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.novel-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary);
  color: #ffffff;
  transition: background-color var(--transition-fast);
}

.btn-primary-sm:hover {
  background-color: var(--accent-hover);
}

/* Service Card Spec */
.service-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.service-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.service-tagline {
  font-size: 0.92rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 12px;
}

.service-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.service-features-list {
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-feature-item {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-feature-item::before {
  content: "✓";
  color: var(--accent-primary);
  font-weight: bold;
}

.service-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.tech-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--pill-bg);
  color: var(--pill-text);
}

/* Article Card Spec */
.article-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-active);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.article-category {
  color: var(--accent-primary);
  font-weight: 600;
}

.article-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.article-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

/* About Section Card */
.about-card {
  background-color: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--card-shadow);
  line-height: 1.8;
}

.about-card h3 {
  font-size: 1.4rem;
  margin: 28px 0 12px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.about-card h3:first-child {
  margin-top: 0;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  margin-bottom: 18px;
}

.about-quote {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  padding: 20px 24px;
  background-color: var(--surface-alt);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
  color: var(--text-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border-light);
  padding: 48px 0 32px;
  margin-top: 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  max-width: 400px;
}

.footer-links-group {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-col h5 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-list a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .hero-badge-group {
    justify-content: center;
  }

  .hero-stats-row {
    justify-content: center;
  }

  .novel-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .novel-cover-wrapper {
    width: 140px;
  }

  .novel-badge-bar, .novel-tags, .novel-action-row {
    justify-content: center;
  }

  .footer-top {
    flex-direction: column;
  }
}

/* ==========================================================================
   Selection Translation Floating Tooltip (영어 버전 팝오버)
   ========================================================================== */
.translation-tooltip {
  position: absolute;
  z-index: 1000;
  max-width: 440px;
  width: max-content;
  min-width: 260px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 0.92rem;
  line-height: 1.5;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-theme="dark"] .translation-tooltip {
  background: rgba(22, 32, 54, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.7);
}

.translation-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.tooltip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-action-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.tooltip-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.tooltip-body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: #f1f5f9;
  font-weight: 450;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.tooltip-original {
  font-size: 0.78rem;
  color: #94a3b8;
  border-left: 2px solid #38bdf8;
  padding-left: 8px;
  margin-top: 6px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

