@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --brand-50: #f0fdfa;
  --brand-100: #ccfbf1;
  --brand-500: #14b8a6;
  --brand-600: #0d9488;
  --brand-700: #0f766e;
  --brand-900: #134e4a;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  
  --white: #ffffff;
  --shadow-soft: 0 18px 55px rgba(15, 23, 42, 0.06);
  --shadow-lift: 0 30px 90px rgba(15, 23, 42, 0.12);
  
  --status-check-icon: var(--brand-700);
  --status-alert-icon: #ef4444;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

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

a:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 3px;
}

/* Gradients background */
.app-bg {
  position: fixed;
  inset: -26vmax;
  z-index: -3;
  background:
    radial-gradient(circle at 12% 14%, rgba(20, 184, 166, 0.22), transparent 30vmax),
    radial-gradient(circle at 86% 18%, rgba(37, 99, 235, 0.12), transparent 26vmax),
    radial-gradient(circle at 74% 86%, rgba(249, 115, 22, 0.1), transparent 24vmax),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 50%, #f8fafc 100%);
}

.grid-noise {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Header */
.site-header {
  position: sticky;
  top: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 28px));
  min-height: 72px;
  margin: 18px auto 0;
  padding: 12px 20px;
  border-radius: 999px;
}

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

.brand-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 5px;
  border: 1px solid var(--brand-100);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 38px rgba(15, 118, 110, 0.12);
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.brand strong {
  display: block;
  color: #020617;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--slate-500);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--slate-900);
  color: white;
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-link:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

/* Page Layout */
.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 54px 0 54px;
}

.document-hero {
  display: grid;
  justify-items: center;
  padding: 44px 0 34px;
  text-align: center;
}

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

.eyebrow::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.12);
  content: "";
}

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

h1 {
  max-width: 920px;
  margin-bottom: 18px;
  color: var(--slate-900);
  font-size: clamp(2.35rem, 4.9vw, 4.35rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-intro {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--slate-500);
  font-size: 1.04rem;
  line-height: 1.72;
}

.responsibility {
  width: min(840px, 100%);
  padding: 22px 26px;
  border-radius: 20px;
  text-align: left;
}

.responsibility strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-900);
  font-size: 0.98rem;
  font-weight: 800;
}

.responsibility p {
  margin: 0;
  color: var(--slate-600);
  font-size: 0.96rem;
  line-height: 1.74;
}

/* Terms Layout */
.terms-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Sidebar Navigation */
.sidebar {
  position: sticky;
  top: 108px;
  max-height: calc(100svh - 128px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 22px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.sidebar-head span {
  color: var(--slate-500);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-head strong {
  color: var(--brand-700);
  font-size: 0.86rem;
  font-weight: 800;
}

.section-nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 43px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--slate-600);
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--slate-100);
  color: var(--brand-700);
  font-size: 0.74rem;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(20, 184, 166, 0.24);
  background: rgba(240, 253, 250, 0.78);
  color: var(--slate-900);
  transform: translateX(2px);
}

.nav-button.active span {
  background: var(--slate-900);
  color: white;
}

/* Content Panel */
.content-panel {
  min-height: 620px;
  padding: 34px 38px;
  border-radius: 24px;
}

.mobile-index {
  display: none;
  margin-bottom: 22px;
}

.document-content {
  display: grid;
  gap: 0;
}

.document-section {
  scroll-margin-top: 112px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
}

.document-section:first-child {
  padding-top: 0;
}

.document-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.content-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--brand-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.content-kicker::before {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-500);
  content: "";
}

.content-title {
  margin-bottom: 16px;
  color: var(--slate-900);
  font-size: clamp(1.48rem, 2.6vw, 2.05rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.section-lead {
  margin-bottom: 16px;
  color: var(--slate-600);
  font-size: 0.98rem;
  line-height: 1.76;
}

/* Clauses list styling */
.term-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-list li {
  display: flex;
  align-items: start;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--slate-700);
  font-size: 0.98rem;
  line-height: 1.68;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.term-list li:hover {
  background: rgba(240, 253, 250, 0.6);
  border-color: rgba(20, 184, 166, 0.2);
  transform: translateX(3px);
}

.clause-icon {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.term-list li:hover .clause-icon {
  transform: scale(1.1);
}

.clause-icon.check {
  color: var(--status-check-icon);
}

.clause-icon.alert {
  color: var(--status-alert-icon);
}

.acceptance {
  margin-top: 32px;
  padding: 28px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 12%, rgba(20, 184, 166, 0.11), transparent 34%),
    rgba(240, 253, 250, 0.76);
  box-shadow: var(--shadow-soft);
}

.updated {
  display: inline-flex;
  width: fit-content;
  margin-top: 16px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--slate-900);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Media Queries */
@media (max-width: 980px) {
  .terms-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-index {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .mobile-index::-webkit-scrollbar {
    display: none;
  }

  .mobile-index .nav-button {
    display: inline-grid;
    grid-template-columns: 26px max-content;
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    padding: 6px 10px 6px 6px;
    border-color: rgba(15, 118, 110, 0.14);
    background: rgba(255, 255, 255, 0.62);
    scroll-snap-align: start;
  }

  .mobile-index .nav-button span {
    width: 26px;
    height: 26px;
  }

  .content-panel {
    padding: 26px;
  }
}

@media (max-width: 680px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    border-radius: 24px;
    padding: 10px 16px;
  }

  .brand small,
  .header-link {
    display: none;
  }

  .page-shell {
    width: calc(100% - 20px);
    padding-top: 28px;
  }

  .document-hero {
    padding: 30px 0 24px;
    text-align: left;
    justify-items: start;
  }

  h1 {
    font-size: clamp(2.12rem, 10.4vw, 3.2rem);
    line-height: 1.05;
  }

  .hero-intro,
  .section-lead {
    font-size: 1rem;
  }

  .responsibility,
  .content-panel,
  .acceptance {
    border-radius: 22px;
  }

  .content-panel {
    padding: 20px;
  }

  .document-section {
    scroll-margin-top: 92px;
    padding: 26px 0;
  }

  .content-title {
    font-size: clamp(1.34rem, 6.6vw, 1.88rem);
  }

  .term-list li {
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.96rem;
  }

  .term-list li:hover {
    transform: none;
  }

  .clause-icon {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
