:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --ink: #111827;
  --text: #1d2533;
  --sub: #687386;
  --muted: #96a0b3;
  --primary: #6d5df6;
  --primary-soft: #f0edff;
  --border: #e2e6ef;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

main {
  overflow: hidden;
}

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

.docs-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 5vw, 80px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand,
.docs-header nav,
.docs-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.docs-header nav {
  gap: 10px;
}

.docs-header nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--sub);
  font-size: 14px;
  font-weight: 800;
}

.docs-header nav a:last-child {
  background: var(--ink);
  color: white;
}

.hero {
  padding: clamp(62px, 9vw, 108px) clamp(18px, 5vw, 80px) clamp(52px, 7vw, 76px);
  background:
    linear-gradient(180deg, rgba(109, 93, 246, 0.1), transparent 55%),
    var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.locale {
  display: inline-flex;
  margin: 0 0 20px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero > p:not(.locale) {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  color: var(--sub);
  font-size: 18px;
  line-height: 1.72;
}

.search {
  position: relative;
  max-width: 720px;
  margin: 34px auto 0;
}

.search span {
  position: absolute;
  top: 50%;
  left: 22px;
  color: var(--muted);
  font-size: 28px;
  transform: translateY(-54%);
}

.search input {
  width: 100%;
  min-height: 62px;
  padding: 0 24px 0 62px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: white;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.search input::placeholder {
  color: var(--muted);
}

.categories,
.article-section {
  padding: clamp(54px, 7vw, 92px) clamp(18px, 5vw, 80px);
}

.section-heading,
.article-heading {
  max-width: 840px;
  margin-bottom: 28px;
}

.section-heading p,
.article-heading p {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
}

.section-heading h2,
.article-heading h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
}

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

.category-card,
.article-list article {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.05);
}

.category-card {
  display: grid;
  min-height: 224px;
  padding: 24px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.category-card:hover {
  border-color: rgba(109, 93, 246, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.category-card span {
  width: max-content;
  margin-bottom: 34px;
  color: var(--primary);
  font-weight: 950;
}

.category-card h3,
.article-list h3 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.3;
}

.category-card p,
.article-list p {
  color: var(--sub);
  line-height: 1.68;
  overflow-wrap: anywhere;
  white-space: normal;
}

.category-card strong {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
}

.article-section {
  border-top: 1px solid var(--border);
}

.article-section:nth-of-type(even) {
  background: var(--surface-2);
}

.article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.article-list article {
  padding: 22px;
}

.article-list p {
  margin-bottom: 0;
}

.article-list a {
  color: var(--primary);
  font-weight: 900;
}

.docs-footer {
  justify-content: space-between;
  gap: 18px;
  padding: 30px clamp(18px, 5vw, 80px);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.72);
}

.docs-footer span {
  color: white;
  font-weight: 950;
}

@media (max-width: 980px) {
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .docs-header {
    padding: 14px 16px;
  }

  .brand span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .docs-header nav {
    display: none;
  }

  .hero {
    padding-top: 54px;
  }

  .categories,
  .article-section,
  .hero {
    padding-right: 18px;
    padding-left: 18px;
  }

  h1 {
    font-size: 38px;
  }

  .hero > p:not(.locale) {
    max-width: 320px;
    font-size: 16px;
  }

  .search input {
    min-height: 56px;
    font-size: 15px;
  }

  .category-grid,
  .article-list {
    grid-template-columns: 1fr;
  }

  .category-card,
  .article-list article {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    overflow: hidden;
  }

  .search {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .category-card p,
  .article-list p {
    word-break: break-all;
  }

  .category-card p {
    display: none;
  }

  .category-card {
    min-height: auto;
  }

  .docs-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
