:root {
  --ink: #0a0b0d;
  --text: #f8f7f2;
  --muted: #6d7480;
  --paper: #f4f5f7;
  --surface: #ffffff;
  --line: rgba(10, 11, 13, 0.12);
  --line-dark: rgba(255, 255, 255, 0.16);
  --accent: #ff4d3d;
  --lime: #b7ff48;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans KR", "Noto Sans JP", sans-serif;
}

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

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--max-width));
  padding: 14px 18px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(7, 8, 11, 0.72);
  color: var(--text);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(183, 255, 72, 0.65);
  border-radius: 50%;
  color: var(--lime);
  font-family: "Teko", sans-serif;
  font-size: 1.45rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong,
.home-link,
.eyebrow,
.language-switch button {
  font-family: "Teko", sans-serif;
}

.brand-copy strong {
  font-size: 1.25rem;
  font-weight: 600;
}

.brand-copy span {
  margin-top: 2px;
  color: rgba(248, 247, 242, 0.58);
  font-size: 0.72rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.home-link {
  color: rgba(248, 247, 242, 0.74);
  font-size: 1.05rem;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--text);
}

.language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(248, 247, 242, 0.16);
  border-radius: 999px;
  background: rgba(248, 247, 242, 0.08);
}

.language-switch button {
  min-width: 34px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(248, 247, 242, 0.58);
  cursor: pointer;
  font-size: 1rem;
}

.language-switch button[aria-pressed="true"] {
  background: var(--lime);
  color: var(--ink);
}

.agreements-hero {
  padding: 150px max(24px, calc((100vw - var(--max-width)) / 2)) 72px;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 26%, rgba(183, 255, 72, 0.16), transparent 26%),
    linear-gradient(135deg, #0a0b0d, #171b1c 58%, #09100d);
}

.hero-inner {
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--lime);
  font-size: 1.05rem;
}

.agreements-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.03;
  word-break: keep-all;
}

.hero-summary {
  max-width: 740px;
  margin: 24px 0 0;
  color: rgba(248, 247, 242, 0.68);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.75;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 36px 0 0;
}

.document-meta div {
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid rgba(248, 247, 242, 0.14);
  border-radius: 8px;
  background: rgba(248, 247, 242, 0.05);
}

.document-meta dt {
  color: rgba(248, 247, 242, 0.5);
  font-size: 0.78rem;
}

.document-meta dd {
  margin: 5px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.agreements-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 64px;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 72px 0 40px;
}

.table-of-contents {
  position: sticky;
  top: 112px;
  align-self: start;
  max-height: calc(100vh - 140px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.table-of-contents > p {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 900;
}

.table-of-contents nav {
  display: grid;
  gap: 2px;
}

.table-of-contents a {
  padding: 7px 8px;
  border-radius: 5px;
  color: #676e79;
  font-size: 0.84rem;
  line-height: 1.45;
}

.table-of-contents a:hover,
.table-of-contents a:focus-visible,
.table-of-contents a.is-active {
  background: rgba(183, 255, 72, 0.38);
  color: var(--ink);
}

.agreement-document {
  min-width: 0;
}

.agreement-intro {
  margin: 0 0 32px;
  padding: 20px 22px;
  border-left: 4px solid var(--lime);
  background: var(--surface);
  color: #555d68;
  line-height: 1.8;
}

.agreement-section {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 112px;
}

.agreement-section:first-of-type {
  border-top: 0;
}

.agreement-section h2 {
  margin: 0 0 18px;
  font-size: clamp(1.3rem, 2.3vw, 1.75rem);
  line-height: 1.4;
  word-break: keep-all;
}

.agreement-section p,
.agreement-section li {
  color: #424954;
  font-size: 0.98rem;
  line-height: 1.9;
}

.agreement-section p {
  margin: 0 0 12px;
}

.agreement-section ol,
.agreement-section ul {
  margin: 12px 0;
  padding-left: 1.5rem;
}

.agreement-section li + li {
  margin-top: 6px;
}

html[lang="ja"] .agreements-hero h1,
html[lang="ja"] .agreement-section h2 {
  overflow-wrap: anywhere;
  word-break: normal;
}

.legal-note {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 48px auto;
  padding: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--text);
}

.legal-note h2 {
  margin: 0;
  font-size: 1.8rem;
}

.legal-note p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(248, 247, 242, 0.68);
  line-height: 1.8;
}

.legal-note > a {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 900;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 30px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 700;
}

noscript {
  display: block;
  padding: 20px;
  text-align: center;
}

@media (max-width: 900px) {
  .agreements-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .table-of-contents {
    position: static;
    max-height: none;
  }

  .table-of-contents nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    top: 12px;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .brand-copy {
    display: none;
  }

  .header-actions {
    gap: 10px;
  }

  .home-link {
    display: none;
  }

  .language-switch button {
    min-width: 30px;
  }

  .agreements-hero {
    padding: 118px 18px 48px;
  }

  .agreements-hero h1 {
    font-size: 3.15rem;
  }

  .document-meta {
    display: grid;
  }

  .agreements-layout,
  .legal-note,
  .site-footer {
    width: calc(100% - 36px);
  }

  .agreements-layout {
    padding-top: 38px;
  }

  .table-of-contents nav {
    grid-template-columns: 1fr;
  }

  .agreement-section {
    padding: 28px 0;
  }

  .legal-note {
    align-items: stretch;
    flex-direction: column;
    padding: 26px;
  }

  .legal-note > a {
    text-align: center;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
  }
}

@media print {
  .site-header,
  .reading-progress,
  .table-of-contents,
  .legal-note,
  .site-footer {
    display: none;
  }

  .agreements-hero {
    padding: 30px 0;
    color: #000;
    background: #fff;
  }

  .hero-summary,
  .document-meta dt {
    color: #333;
  }

  .document-meta div {
    border-color: #bbb;
    background: #fff;
  }

  .agreements-layout {
    display: block;
    width: 100%;
    padding: 0;
  }

  .agreement-section {
    break-inside: avoid;
  }
}
