/* ===== DevInsight Global Stylesheet ===== */

:root {
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-serif: "Gowun Batang", "Noto Serif KR", serif;
  --bg: #f2f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #0f172a;
  --muted: #516074;
  --line: #d6e0ee;
  --accent: #1278f3;
  --accent-2: #00a3a3;
  --header-bg: rgba(242, 246, 251, 0.82);
  --max-w: 980px;
  --max-w-narrow: 980px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 22px 56px rgba(15, 23, 42, 0.1);
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.75;
  background:
    radial-gradient(circle at 8% -12%, rgba(18, 120, 243, 0.18), transparent 30%),
    radial-gradient(circle at 96% 2%, rgba(0, 163, 163, 0.14), transparent 26%),
    linear-gradient(180deg, #f6f9ff 0%, var(--bg) 48%, #eef3fa 100%);
}

a {
  color: inherit;
}

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

/* ===== Site Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(214, 224, 238, 0.85);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  width: min(100% - 40px, var(--max-w));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--font-serif);
  text-decoration: none;
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.logo span {
  margin-left: 2px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-color: #c8d9f0;
  background: #f5f9ff;
}

/* ===== Layout ===== */
.container {
  width: min(100% - 40px, var(--max-w));
  margin: 0 auto;
  padding: 0 0 72px;
}

.container-narrow {
  width: min(100% - 40px, var(--max-w-narrow));
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 18px 0 4px;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  margin: 0 7px;
  opacity: 0.6;
}

/* ===== Homepage ===== */
.hero {
  padding: 76px 0 42px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.hero h1 {
  margin: 0;
  max-width: 850px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.8vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.02rem;
}

.stats-row {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  border: 1px solid #cfe0f3;
  border-radius: var(--radius-md);
  padding: 18px;
  background: linear-gradient(160deg, #ffffff 0%, #f6faff 100%);
  box-shadow: var(--shadow-sm);
}

.stat-card strong {
  display: block;
  color: var(--accent);
  font-size: 1.16rem;
  line-height: 1.2;
}

.stat-card span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.section-card {
  margin: 26px 0;
  padding: 30px;
  border: 1px solid #d3dfef;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow-sm);
}

.section-card h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.52rem;
  letter-spacing: -0.01em;
}

.section-card .lead {
  margin: 9px 0 0;
  font-size: 0.96rem;
  color: var(--muted);
}

.posts-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.post-link {
  display: block;
  text-decoration: none;
  border: 1px solid #d5e1ef;
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.post-link:hover {
  transform: translateY(-3px);
  border-color: #b9d0ea;
  box-shadow: 0 12px 28px rgba(18, 120, 243, 0.08);
}

.post-link .pl-cat {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.post-link .pl-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
}

.post-link .pl-desc {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.48;
}

.post-link .pl-date {
  display: block;
  margin-top: 8px;
  font-size: 0.79rem;
  color: #75839a;
}

.view-all {
  display: inline-block;
  margin-top: 18px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.view-all:hover {
  text-decoration: underline;
}

.cat-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cat-card {
  display: block;
  text-decoration: none;
  border: 1px solid #d5e1ef;
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-soft);
  transition: transform 0.2s, border-color 0.2s;
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: #bdd2ea;
}

.cat-card strong {
  display: block;
  font-size: 0.94rem;
}

.cat-card span {
  font-size: 0.82rem;
  color: var(--muted);
}

.pillars {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pillars article {
  border: 1px solid #d5e1ef;
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface-soft);
}

.pillars h3 {
  margin: 0 0 7px;
  font-size: 0.95rem;
}

.pillars p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.policy-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.policy-row a {
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid #d0deef;
  border-radius: 999px;
  padding: 7px 14px;
  background: #fff;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.policy-row a:hover {
  color: var(--accent);
  border-color: #b7cce6;
  transform: translateY(-1px);
}

/* ===== Archive ===== */
.archive-section {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid #d3dfef;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.archive-section h2 {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.archive-section .cat-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.archive-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.archive-list li + li {
  border-top: 1px solid #ebf0f7;
}

.archive-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  border-radius: 10px;
  padding: 11px 10px;
  transition: background-color 0.2s;
}

.archive-list a:hover {
  background: #f5f9ff;
}

.archive-list .al-title {
  flex: 1;
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.42;
}

.archive-list .al-date {
  white-space: nowrap;
  color: #73839a;
  font-size: 0.78rem;
}

/* ===== Policy Pages ===== */
.policy-card {
  margin: 26px 0 72px;
  padding: 32px;
  border: 1px solid #d3dfef;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.policy-card h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.95rem;
}

.policy-card h2 {
  margin: 28px 0 10px;
  font-family: var(--font-serif);
  font-size: 1.18rem;
}

.policy-card p {
  margin: 0 0 14px;
}

.policy-card .updated {
  margin: 8px 0 22px;
  font-size: 0.88rem;
  color: var(--muted);
}

.policy-card a {
  color: var(--accent);
}

.policy-card .channel {
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid #d6e0ee;
  border-radius: 10px;
  background: #f9fbff;
}

/* ===== Posts ===== */
.post-wrap {
  width: min(100% - 40px, var(--max-w-narrow));
  margin: 0 auto;
  padding: 0 0 88px;
}

.post-card {
  border: 1px solid #cfddef;
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 34px;
  box-shadow: var(--shadow-md);
}

.post-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.2vw, 2.2rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.post-card .meta {
  margin: 0 0 28px;
  padding-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid #e2e9f3;
}

.post-card h2 {
  margin: 36px 0 12px;
  padding-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  border-bottom: 1px solid #e2e9f3;
}

.post-card h3 {
  margin: 24px 0 10px;
  color: #0f5bc7;
  font-size: 1.06rem;
}

.post-card p {
  margin: 0 0 16px;
}

.post-card a {
  color: var(--accent);
}

.post-card ul,
.post-card ol {
  margin: 0 0 16px 20px;
}

.post-card li {
  margin-bottom: 8px;
}

.post-card pre {
  margin: 0 0 16px;
  border: 1px solid #293042;
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  background: #0f172a;
  color: #dbeafe;
  font-size: 0.86rem;
}

.post-card code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef4fd;
  font-size: 0.87em;
}

.post-card pre code {
  padding: 0;
  background: transparent;
}

.post-card blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  background: #f6f9ff;
}

.post-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.92rem;
}

.post-card th,
.post-card td {
  border: 1px solid #d7e1ef;
  padding: 10px 12px;
  text-align: left;
}

.post-card th {
  background: #f5f9ff;
  font-weight: 600;
}

.post-card .note {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #d4dfef;
  border-radius: 10px;
  background: #f9fcff;
  font-size: 0.95rem;
}

.back {
  display: inline-block;
  margin-top: 26px;
  text-decoration: none;
  font-weight: 700;
  color: var(--accent);
}

.back:hover {
  text-decoration: underline;
}

.author-box {
  margin-top: 38px;
  padding: 20px 22px;
  border: 1px solid #d3dfef;
  border-radius: 12px;
  background: #f7fbff;
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.author-info strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.author-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.related-posts {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e1e9f4;
}

.related-posts h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--text);
  font-family: var(--font-serif);
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-item {
  display: block;
  text-decoration: none;
  border: 1px solid #d5e1ef;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  transition: transform 0.2s, border-color 0.2s;
}

.related-item:hover {
  transform: translateY(-1px);
  border-color: #bcd0e8;
}

.related-item .ri-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: uppercase;
}

.related-item .ri-title {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid #d8e2ef;
  background: rgba(248, 251, 255, 0.8);
}

.footer-inner {
  width: min(100% - 40px, var(--max-w));
  margin: 0 auto;
  padding: 30px 0 38px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 12px;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.84rem;
  color: var(--muted);
}

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

.footer-copy {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

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

  .archive-list a {
    gap: 8px;
  }

  .archive-list .al-date {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .header-inner {
    min-height: 58px;
  }

  .logo {
    font-size: 1.28rem;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-links a {
    padding: 6px 9px;
    font-size: 0.82rem;
  }

  .hero {
    padding-top: 44px;
  }

  .section-card,
  .policy-card,
  .post-card,
  .archive-section {
    padding: 20px;
    border-radius: 16px;
  }

  .post-card h1 {
    font-size: 1.55rem;
  }

  .post-wrap,
  .container,
  .container-narrow,
  .header-inner,
  .footer-inner {
    width: min(100% - 28px, var(--max-w));
  }
}
