:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f4f4;
  background: #111111;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #111111;
}

.knowledge-page,
.entry-page {
  width: min(100% - 40px, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 80px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #a8a8a8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
  transition: color 160ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: #ffffff;
  outline: none;
}

.section-name {
  color: #8b8b8b;
  font-size: 13px;
}

.entry-utilities {
  display: flex;
  align-items: center;
  gap: 16px;
}

.language-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #333333;
  border-radius: 999px;
  background: #181818;
}

.language-toggle button {
  display: grid;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #777777;
  font: 750 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.language-toggle button:hover,
.language-toggle button:focus-visible {
  color: #ffffff;
  outline: none;
}

.language-toggle button:focus-visible {
  box-shadow: 0 0 0 2px #111111, 0 0 0 4px #7f8ee8;
}

.language-toggle button[aria-pressed="true"] {
  background: #f3f3f3;
  color: #111111;
}

.knowledge-intro {
  margin: 118px 0 84px;
}

.knowledge-intro h1 {
  max-width: 760px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(54px, 10vw, 96px);
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.knowledge-intro p {
  max-width: 500px;
  margin: 24px 0 0;
  color: #929292;
  font-size: 16px;
  line-height: 1.7;
}

.dictionary {
  border-top: 1px solid #333333;
}

.dictionary > h2 {
  margin: 0;
  padding: 22px 4px 18px;
  color: #7f8ee8;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.dictionary-entry {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 25px 4px;
  border-top: 1px solid #292929;
  border-bottom: 1px solid #292929;
  color: #ffffff;
  text-decoration: none;
  transition: padding 180ms ease, border-color 180ms ease, background 180ms ease;
}

.dictionary-entry:hover,
.dictionary-entry:focus-visible {
  padding-right: 18px;
  padding-left: 18px;
  border-color: #575757;
  background: #171717;
  outline: none;
}

.entry-number {
  color: #666666;
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.entry-copy {
  display: grid;
  gap: 7px;
}

.entry-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.entry-copy span {
  color: #8f8f8f;
  font-size: 13px;
}

.entry-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #272727;
}

.entry-header {
  margin: 104px 0 60px;
  padding-bottom: 46px;
  border-bottom: 1px solid #333333;
}

.entry-header h1 {
  margin: 0;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(60px, 11vw, 108px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.word-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 22px 0 0;
  color: #8f8f8f;
  font-size: 14px;
}

.word-meta span + span::before {
  margin-right: 18px;
  color: #4a4a4a;
  content: "·";
}

.definition-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 44px;
}

.definition-label {
  margin: 6px 0 0;
  color: #7f8ee8;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.definition-content { max-width: 680px; }

.language-panel[hidden] { display: none; }

.language-panel[lang="ko"] {
  word-break: keep-all;
}

.language-panel[lang="ko"] .lead-definition {
  font-family: "Batang", "Malgun Gothic", serif;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.lead-definition {
  margin: 0;
  color: #f1f1f1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3.2vw, 36px);
  line-height: 1.46;
}

.definition-content h2 {
  margin: 52px 0 13px;
  color: #ffffff;
  font-size: 17px;
}

.definition-content p,
.definition-content li {
  color: #b1b1b1;
  font-size: 16px;
  line-height: 1.85;
}

.definition-content p { margin: 0; }

.definition-content ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.definition-content code {
  color: #bdc5ff;
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.definition-note {
  margin-top: 54px;
  padding: 22px 24px;
  border-left: 3px solid #7f8ee8;
  background: #171717;
}

.definition-note strong {
  display: block;
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 13px;
}

.definition-note p {
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .knowledge-page,
  .entry-page {
    width: min(100% - 32px, 920px);
    padding-top: 24px;
  }

  .knowledge-intro { margin: 82px 0 60px; }

  .dictionary-entry {
    grid-template-columns: 34px 1fr auto;
    gap: 12px;
    padding: 21px 2px;
  }

  .dictionary-entry:hover,
  .dictionary-entry:focus-visible {
    padding-right: 8px;
    padding-left: 8px;
  }

  .entry-copy strong { font-size: 23px; }
  .entry-copy span { max-width: 190px; }
  .entry-arrow { width: 38px; height: 38px; }
  .entry-header { margin: 72px 0 42px; padding-bottom: 34px; }

  .definition-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .definition-content h2 { margin-top: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .back-link,
  .dictionary-entry,
  .language-toggle button { transition: none; }
}
