:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --text: #0a0a0a;
  --text-soft: #1f1f1f;
  --text-sub: #404040;
  --muted: #525252;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --max: 880px;
  --c-ai: #6d28d9;
  --c-ai-bg: #f3ecff;
  --c-tech: #1d4ed8;
  --c-tech-bg: #e8efff;
  --c-business: #b45309;
  --c-business-bg: #fdf1dc;
  --c-guides: #047857;
  --c-guides-bg: #def7eb;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  font-feature-settings: "ss02", "tnum";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

button,
input {
  font: inherit;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--c-ai), var(--c-tech));
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.nav-links a::after {
  display: none;
}

.nav-links a[data-cat="ai"] {
  --nav-accent: var(--c-ai);
}

.nav-links a[data-cat="tech"] {
  --nav-accent: var(--c-tech);
}

.nav-links a[data-cat="business"] {
  --nav-accent: var(--c-business);
}

.nav-links a[data-cat="guides"] {
  --nav-accent: var(--c-guides);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--surface);
  color: var(--text);
}

.nav-links a.active::after,
.nav-links a[aria-current="page"]::after {
  display: none;
}

.nav-links a.active,
.nav-links a[aria-current="page"] {
  text-decoration-color: var(--nav-accent, var(--text));
}

.nav-search {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-search:hover {
  background: var(--surface);
  color: var(--text);
}

.hero {
  padding: 40px 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  word-break: keep-all;
  color: var(--text);
}

.intro {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
}

.search-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-row input[type="search"] {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.search-row input[type="search"]:focus {
  border-color: var(--line-strong);
  outline: 2px solid rgba(29, 78, 216, 0.16);
}

.search-row button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.search-open {
  overflow: hidden;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: 96px 20px 20px;
}

.search-modal[hidden] {
  display: none;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 10, 10, 0.42);
  cursor: pointer;
}

.search-dialog {
  position: relative;
  width: min(560px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(10, 10, 10, 0.22);
}

.search-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.search-dialog h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

.search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.section {
  padding: 30px 0 36px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head > div {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.section-title {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}

.section-link:hover,
.section-link.active {
  color: var(--text);
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  column-gap: 18px;
  row-gap: 8px;
  padding: 22px 14px;
  margin: 0 -14px;
  border-top: 1px solid var(--line);
  border-radius: 8px;
}

.post-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 26px;
  bottom: 26px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-color, transparent);
  opacity: 0.22;
  transition: opacity 0.2s ease;
}

.post-item:hover {
  background: var(--surface);
}

.post-item:hover::before {
  opacity: 0.9;
}

.post-item[data-cat="ai"] {
  --accent-color: var(--c-ai);
}

.post-item[data-cat="tech"] {
  --accent-color: var(--c-tech);
}

.post-item[data-cat="business"] {
  --accent-color: var(--c-business);
}

.post-item[data-cat="guides"] {
  --accent-color: var(--c-guides);
}

.date {
  grid-column: 1;
  grid-row: 1;
  align-self: baseline;
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.title {
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  margin: 0;
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
  word-break: keep-all;
  color: var(--text);
}

.title a {
  display: inline;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 0.25s ease;
}

.title a:hover {
  background-size: 100% 1px;
}

.summary {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag {
  grid-column: 3;
  grid-row: 1;
  align-self: baseline;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag[data-cat="ai"] {
  background: var(--c-ai-bg);
  color: var(--c-ai);
}

.tag[data-cat="tech"] {
  background: var(--c-tech-bg);
  color: var(--c-tech);
}

.tag[data-cat="business"] {
  background: var(--c-business-bg);
  color: var(--c-business);
}

.tag[data-cat="guides"] {
  background: var(--c-guides-bg);
  color: var(--c-guides);
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-posts {
  padding: 0 0 40px;
}

.related-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.related-post {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 12px 14px 18px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-soft);
}

.related-post::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-color, var(--line-strong));
  opacity: 0;
}

.related-post:hover,
.related-post.current {
  background: var(--surface);
  color: var(--text);
}

.related-post.current::before {
  opacity: 1;
}

.related-post time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.related-post span {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.45;
  word-break: keep-all;
}

.related-post[data-cat="ai"] {
  --accent-color: var(--c-ai);
}

.related-post[data-cat="tech"] {
  --accent-color: var(--c-tech);
}

.related-post[data-cat="business"] {
  --accent-color: var(--c-business);
}

.related-post[data-cat="guides"] {
  --accent-color: var(--c-guides);
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg);
  cursor: pointer;
}

.topic::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--muted));
}

.topic::after {
  content: attr(data-count);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.topic:hover,
.topic.active {
  border-color: var(--dot, var(--text));
  background: var(--surface);
}

.empty {
  margin: 0;
  padding: 20px 0;
  color: var(--text-sub);
  border-top: 1px solid var(--line);
}

footer {
  padding: 24px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 500;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.foot-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.foot a:hover {
  color: var(--text);
}

.top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-soft);
}

.top-link:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 28px, var(--max));
  }

  .nav {
    min-height: 52px;
  }

  .nav-links {
    gap: 0;
    margin-right: -6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .nav-links a {
    padding: 0 9px;
    font-size: 13.5px;
  }

  .nav-search {
    width: 34px;
    height: 34px;
  }

  .hero {
    padding: 28px 0 22px;
  }

  .eyebrow {
    font-size: 11.5px;
  }

  h1 {
    font-size: clamp(22px, 5.4vw, 28px);
  }

  .intro {
    font-size: 14.5px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-modal {
    padding: 74px 14px 14px;
  }

  .section {
    padding: 24px 0 28px;
  }

  .section-head {
    margin-bottom: 12px;
  }

  .post-item {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 6px;
    padding: 18px 12px;
    margin: 0 -12px;
  }

  .post-item::before {
    top: 22px;
    bottom: 22px;
    left: 3px;
  }

  .date {
    grid-column: 1;
    grid-row: 1;
    font-size: 12.5px;
  }

  .tag {
    grid-column: 2;
    grid-row: 1;
  }

  .title {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 16.5px;
    line-height: 1.45;
  }

  .summary {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 14.5px;
    line-height: 1.65;
  }

  .related-post {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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