.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-neutral-800) 100%);
  color: white;
  padding: var(--space-16) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(249, 115, 22, 0.1) 100%);
  pointer-events: none;
}

.breadcrumb {
  margin-bottom: var(--space-6);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  font-size: var(--text-sm);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb__item:not(:last-child)::after {
  content: '/';
  color: var(--color-neutral-400);
  margin-left: var(--space-2);
}

.breadcrumb__link {
  color: var(--color-neutral-300);
  transition: color var(--transition-fast);
}

.breadcrumb__link:hover {
  color: var(--color-accent);
}

.breadcrumb__current {
  color: white;
  font-weight: 600;
}

.page-hero__content {
  position: relative;
  z-index: 1;
}

.page-hero__title {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
  color: white;
  line-height: var(--leading-tight);
}

.page-hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-neutral-300);
  margin-bottom: var(--space-4);
  max-width: 60ch;
}

.page-hero__updated {
  font-size: var(--text-sm);
  color: var(--color-neutral-400);
  font-style: italic;
}

.terms-wrapper {
  padding: var(--space-16) 0;
  background-color: var(--color-bg-alt);
}

.terms-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-12);
  align-items: start;
}

.terms-sidebar {
  position: relative;
}

.terms-sidebar__sticky {
  position: sticky;
  top: var(--space-8);
}

.terms-sidebar__toggle {
  display: none;
  width: 100%;
  margin-bottom: var(--space-4);
}

.terms-sidebar__title {
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-accent);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.terms-sidebar__list {
  list-style: none;
}

.terms-sidebar__item {
  margin-bottom: var(--space-1);
}

.terms-sidebar__link {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.terms-sidebar__link:hover {
  background-color: var(--color-bg);
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

.terms-sidebar__link.active {
  background-color: white;
  color: var(--color-primary);
  border-left-color: var(--color-accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.terms-content {
  background-color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-10) var(--space-12);
}

.terms-section {
  margin-bottom: var(--space-12);
  scroll-margin-top: var(--space-24);
}

.terms-section:last-of-type {
  margin-bottom: 0;
}

.terms-section__title {
  font-size: var(--text-3xl);
  color: var(--color-primary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-neutral-200);
  font-family: var(--font-display);
  line-height: var(--leading-tight);
}

.terms-section__content p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  max-width: 100%;
}

.terms-section__content p:last-child {
  margin-bottom: 0;
}

.terms-section__content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.terms-section__content a:hover {
  color: #ea580c;
}

.terms-related {
  margin-top: var(--space-12);
  padding-top: var(--space-10);
  border-top: 2px solid var(--color-neutral-200);
}

.terms-related__title {
  font-size: var(--text-2xl);
  color: var(--color-primary);
  margin-bottom: var(--space-6);
  font-family: var(--font-display);
}

.terms-related__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.terms-related__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.terms-related__card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.terms-related__icon {
  font-size: var(--text-3xl);
  line-height: 1;
}

.terms-related__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  background-color: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: 100;
}

.back-to-top:hover {
  background-color: #ea580c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.back-to-top[hidden] {
  display: none;
}

@media (max-width: 1024px) {
  .terms-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .terms-sidebar__sticky {
    position: static;
  }
  
  .terms-sidebar__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .terms-sidebar__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
  
  .terms-sidebar__nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
  }
  
  .terms-sidebar__nav.is-open {
    max-height: 600px;
    margin-bottom: var(--space-6);
  }
  
  .terms-content {
    padding: var(--space-6);
  }
  
  .terms-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .page-hero {
    padding: var(--space-10) 0 var(--space-8);
  }
  
  .page-hero__title {
    font-size: var(--text-3xl);
  }
  
  .page-hero__subtitle {
    font-size: var(--text-lg);
  }
  
  .terms-content {
    padding: var(--space-5);
  }
  
  .terms-section__title {
    font-size: var(--text-2xl);
  }
  
  .terms-related__grid {
    grid-template-columns: 1fr;
  }
  
  .terms-section {
    scroll-margin-top: var(--space-20);
  }
}

@media print {
  .page-hero {
    background: white;
    color: black;
    padding: var(--space-4) 0;
  }
  
  .page-hero__title {
    color: black;
    font-size: var(--text-3xl);
  }
  
  .page-hero__subtitle,
  .page-hero__updated {
    color: #333;
  }
  
  .terms-sidebar,
  .back-to-top {
    display: none;
  }
  
  .terms-layout {
    grid-template-columns: 1fr;
  }
  
  .terms-content {
    box-shadow: none;
    padding: 0;
  }
  
  .terms-section {
    break-inside: avoid;
    margin-bottom: var(--space-8);
  }
  
  a {
    text-decoration: underline;
    color: black;
  }
}