:root {
  --pdf-bg: #DDE1E8;
  --pdf-paper: #F9FAFB;
  --pdf-toolbar: #DDE1E8;
  --pdf-border: #C7CCD5;
  --pdf-text: #3D3D3D;
  --pdf-muted: #666666;
  --pdf-gold: #a38d55;
  --pdf-gold-ink: #B8944F;
  --pdf-gold-strong: #AA7B03;
  --pdf-link: #B8944F;
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);
  --gold-gradient: linear-gradient(135deg, #F0D9A0 0%, #E8D09A 100%);
  --chip-bg: #FFF6CC;
  --chip-text: #AA7B03;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--pdf-bg);
  color: var(--pdf-text);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.bg-noise {
  display: none;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px;
  display: grid;
  grid-template-columns: 240px 1fr auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 1rem;
  background: var(--pdf-toolbar);
  border-bottom: 1px solid var(--pdf-border);
}

.kicker {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: var(--pdf-muted);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero h1 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  justify-self: center;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pdf-text);
  font-weight: 700;
  line-height: 1.2;
}

.hero-subtitle {
  display: none;
}

.hero-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.hero-actions a {
  text-decoration: none;
  border: none;
  border-radius: 6px;
  background: #F5F7FA;
  color: var(--pdf-text);
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.layout {
  width: min(1500px, calc(100% - 1rem));
  margin: 0.75rem auto 1.5rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 86px);
  overflow: auto;
  border: none;
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
}

.sidebar-head {
  position: sticky;
  top: 0;
  padding: 0;
  border-bottom: none;
  background: #fff7d2;
  border-radius: 10px 10px 0 0;
}

.overview-tabs {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: none;
}

.overview-tab {
  border: 0;
  border-right: 0;
  background: #e7ffe9;
  color: var(--pdf-gold-ink);
  cursor: pointer;
  padding: 0.5rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.overview-tab:last-child {
  border-right: 0;
}

.overview-tab.active {
  background: var(--chip-bg);
  color: var(--chip-text);
  box-shadow: 0 2px 4px rgba(184, 148, 79, 0.15);
}

#navSearch {
  width: calc(100% - 0.8rem);
  margin: 0.4rem;
  border: solid 0.1px #C7CCD5;
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--pdf-muted);
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.25;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#sidebarNav {
  display: block;
  padding: 0.35rem 0.32rem 0.45rem;
}

.ov-section + .ov-section {
  margin-top: 0;
}

.ov-section-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 0;
  padding-left: 0.35rem;
}

.ov-section-row:hover {
  background: transparent;
  box-shadow: none;
}

.ov-section-row:hover a {
  background: transparent;
  box-shadow: none;
}

#sidebarNav a {
  text-decoration: none;
  color: var(--pdf-muted);
  border-radius: 6px;
  padding: 0.38rem 0.4rem;
  font-size: 0.6125rem;
  line-height: 1.35;
  border: 1px solid transparent;
}

#sidebarNav a:not(.nav-sub) {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 0.35rem;
}

#sidebarNav a:hover {
  background: #FFF8E7;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#sidebarNav a.active {
  background: #FFF6CC; 
  color: #8D8B85;
  border-color: transparent;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(184, 148, 79, 0.15);
}

#sidebarNav a.nav-sub {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.35rem;
  padding-left: 3.2rem;
  font-size: 0.6125rem;
}

#sidebarNav a.nav-sub .ov-line {
  color: var(--pdf-gold-ink);
  font-weight: 400;
  font-size: 0.6rem;
}

#sidebarNav a.nav-sub.active {
  background: #FFF6CC;
  color: #8D8B85;
}



.ov-caret {
  color: var(--pdf-gold-ink);
  font-size: 0.68rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.ov-caret:hover {
  color: #D4A843;
}

.ov-line {
  color: var(--pdf-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ov-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.ov-pin {
  display: none;
}

.content {
  min-width: 0;
  max-width: 1040px;
}

.manual-section {
  scroll-margin-top: 80px;
  background: var(--pdf-paper);
  border: none;
  border-radius: 10px;
  padding: 2rem 2.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.manual-section h2 {
  margin: 0 0 1.35rem;
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: transparent;
  color: var(--chip-text);
  font-size: 1.25rem !important;
  letter-spacing: 0.01em;
  line-height: 1.25 !important;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: none;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.manual-section h2.active,
.manual-section h3.active {
  background: #FFF8E7;
  box-shadow: 0 2px 8px rgba(184, 148, 79, 0.12);
}

.manual-section h3 {
  scroll-margin-top: 80px;
  margin: 1.45rem 0 0.6rem;
  color: var(--pdf-gold-ink);
  font-size: 1rem !important;
  line-height: 1.35;
  font-weight: 700;
}

.section-clear {
  clear: both;
}

.manual-section p,
.manual-section li {
  font-size: 0.9375rem !important;
  line-height: 1.62;
  color: var(--pdf-text);
}

.manual-section ul,
.manual-section ol {
  margin: 0.65rem 0 0.55rem 1.5rem;
  padding: 0;
}

.manual-section li {
  margin-bottom: 0.45rem;
}

.manual-section strong {
  color: var(--pdf-text);
  font-weight: 700;
}

  .manual-section img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    margin: 0.75rem 0 0.25rem;
    display: block;
    cursor: zoom-in;
  }

.manual-section .img-right {
  float: right;
  max-width: 260px;
  width: 30%;
  margin: 0.5rem 0 1.25rem 1.25rem;
}

.manual-section .img-right img {
  margin: 0;
}

.manual-section .img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0 0.25rem;
}

.manual-section .img-row > p {
  flex: 0 0 auto;
  max-width: 240px;
  margin: 0;
}

.manual-section .img-row > p.img-main {
  max-width: 365px;
}

.manual-section .img-row.img-row-center {
  justify-content: center;
}

.manual-section .img-row.img-row-center > p {
  max-width: 455px;
}

.manual-section .img-row.img-row-center.img-row-3up > p {
  max-width: 320px;
}

.manual-section .img-row.img-row-center > .img-subtitle {
  max-width: 400px;
  flex: 0 0 auto;
}

.manual-section .img-row > p img {
  margin: 0;
}

.manual-section .img-center {
  text-align: center;
  margin: 0.75rem auto 0.25rem;
}

.manual-section .img-center img {
  max-width: 480px;
  width: 80%;
  margin: 0 auto;
  display: inline-block;
}

.manual-section .img-center.img-lg img {
  max-width: 580px;
  width: 90%;
}

.manual-section .img-center.img-xl img {
  max-width: 700px;
  width: 95%;
}

.img-subtitle {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.img-subtitle span {
  margin-top: 0.35rem;
  color: var(--pdf-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.img-collage {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0 0.25rem;
  align-items: stretch;
}

.img-collage-left {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

.img-collage-left p,
.img-collage-right {
  margin: 0;
}

.img-collage-left img,
.img-collage-right img {
  width: 100%;
  height: auto;
  margin: 0;
  display: block;
}

.img-collage-right {
  flex: 1.2;
  display: flex;
  align-items: center;
}

.image-placeholder {
  margin-top: 1rem;
  min-height: 88px;
  border: 1px dashed var(--pdf-gold-ink);
  border-radius: 10px;
  background: #FFF8E7;
  color: var(--pdf-gold-ink);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.85rem;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.table-wrap th {
  background: var(--chip-bg);
  color: var(--chip-text);
  font-weight: 700;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--pdf-border);
  position: sticky;
  top: 0;
}

.table-wrap td {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--pdf-border);
  vertical-align: top;
}

.table-wrap td code {
  background: #FFF8E7;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.8em;
  white-space: nowrap;
}

.table-wrap td[colspan] {
  font-weight: 700;
  color: var(--pdf-gold-ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  background: #F5F7FA;
}

.table-wrap tbody tr:hover td,
.table-wrap tbody tr:hover td[colspan] {
  background: #FFF8E7;
}

.code-grid {
  margin-top: 0.62rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
}

.code-grid div {
  border: none;
  border-radius: 10px;
  background: #FFF8E7;
  padding: 0.55rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.code-grid strong {
  display: block;
  margin-bottom: 0.16rem;
  color: var(--pdf-gold-ink);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.code-grid span {
  color: var(--pdf-muted);
  font-size: 0.75rem;
}

.manual-footer {
  margin-top: 0.5rem;
  border: none;
  border-radius: 10px;
  background: var(--pdf-paper);
  padding: 0.62rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow: var(--shadow-card);
}

.manual-footer p {
  margin: 0;
  color: var(--pdf-muted);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

  .manual-footer a {
  color: var(--pdf-link);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1.5rem;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
  background: rgba(255, 255, 255, 0.3);
  outline: 2px solid rgba(255, 255, 255, 0.5);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  margin: 0;
  cursor: default;
}

#lightbox-caption {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

/* Mobile Section Nav Button */
.mobile-nav-btn {
  display: none;
  border: none;
  border-radius: 6px;
  background: #F5F7FA;
  color: var(--pdf-text);
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-family: inherit;
}

/* Mobile Bottom Sheet */
.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.mobile-sheet.active {
  pointer-events: auto;
  visibility: visible;
}

.mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sheet.active .mobile-sheet-backdrop {
  opacity: 1;
}

.mobile-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  background: var(--pdf-paper);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobile-sheet.active .mobile-sheet-panel {
  transform: translateY(0);
}

.mobile-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--pdf-border);
  margin: 0.6rem auto 0.25rem;
  flex-shrink: 0;
}

.mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.1rem 0.4rem;
  border-bottom: 1px solid var(--pdf-border);
  flex-shrink: 0;
}

.mobile-sheet-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pdf-text);
}

.mobile-sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--pdf-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.mobile-sheet-close:hover,
.mobile-sheet-close:focus {
  background: var(--pdf-bg);
}

.mobile-sheet-list {
  overflow-y: auto;
  padding: 0.5rem 0.6rem 1.2rem;
  -webkit-overflow-scrolling: touch;
}

.mobile-sheet-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--pdf-text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.mobile-sheet-list a:hover,
.mobile-sheet-list a:focus {
  background: #FFF8E7;
  outline: none;
}

.mobile-sheet-list a.sub {
  padding-left: 2.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pdf-muted);
}

.mobile-sheet-list a .ov-line {
  color: var(--pdf-gold-ink);
  font-weight: 700;
  font-size: 0.75rem;
  min-width: 2.2rem;
  text-align: right;
}

.mobile-sheet-list a.sub .ov-line {
  font-size: 0.7rem;
}

/* Back to Top Button (Mobile/Tablet) */
.back-to-top {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(184, 148, 79, 0.4);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  opacity: 0;
  transform: translateY(10px);
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) {
  .back-to-top:hover {
    background: rgba(184, 148, 79, 1);
    transform: translateY(-2px);
  }
}

.back-to-top:active,
.back-to-top.scrolling {
  background: rgba(184, 148, 79, 1);
  transform: scale(0.95);
}

@media (max-width: 980px) {
  .back-to-top {
    display: flex;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr auto;
    min-height: auto;
    gap: 0.4rem;
    padding: 0.65rem;
  }

  .kicker,
  .hero h1 {
    justify-self: start;
  }

  .mobile-nav-btn {
    display: inline-block;
  }

  .layout {
    width: calc(100% - 0.6rem);
    margin-top: 0.5rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  #sidebarNav.collapsed {
    display: none;
  }

  .content {
    max-width: none;
  }

  .manual-section .img-right {
    float: none;
    max-width: 100%;
    width: 100%;
    margin: 0.75rem 0 0.25rem;
    text-align: center;
  }

  .manual-section .img-row {
    flex-direction: column;
  }

  .manual-section .img-row.img-row-center > p,
  .manual-section .img-row.img-row-center.img-row-3up > p {
    max-width: 100%;
    width: 100%;
    text-align: center;
  }

  .img-collage {
    flex-direction: column;
  }

  .img-collage-right {
    flex: none;
    display: block;
    text-align: center;
  }

  .img-collage-left,
  .img-collage-right {
    align-items: center;
    text-align: center;
  }

  .img-subtitle {
    width: 100%;
    text-align: center;
  }

  .manual-section .img-center.img-xl img,
  .manual-section .img-center.img-lg img,
  .manual-section .img-center img,
  .manual-section .img-right img,
  .manual-section .img-row > p img,
  .manual-section .img-collage-left img,
  .manual-section .img-collage-right img,
  .manual-section .img-subtitle img,
  .manual-section img {
    max-height: 40vh;
    width: auto;
    max-width: 100%;
    margin: 0.75rem auto 0.25rem;
    display: inline-block;
  }

  .manual-section {
    padding: 1.25rem 1.1rem;
  }

  .lightbox {
    padding: 0.75rem;
  }

  .lightbox-content img {
    max-height: 80vh;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .manual-section {
    padding: 1rem 0.85rem;
  }

  .manual-section h2 {
    font-size: 1.05rem !important;
  }

  .manual-section h3 {
    font-size: 0.9rem !important;
  }

  .manual-section p,
  .manual-section li {
    font-size: 0.875rem !important;
  }
}

/* --- Hamburger inside hero-actions --- */
.hamburger {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  background: #F5F7FA;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.45rem 0.65rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-family: inherit;
}

.hamburger span {
  width: 1.1rem;
  height: 0.11rem;
  background: #3D3D3D;
  border-radius: 1px;
  display: block;
}

/* Tablet/Mobile: Hamburger repositioned to top-right */
@media (max-width: 1024px) {
  .hero {
    position: sticky;
    top: 0;
    z-index: 1000;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    min-height: auto;
    padding-top: 0.55rem;
    padding-bottom: 0.5rem;
  }
  
  .kicker {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
    align-self: center;
  }
  
  .hero h1 {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
  }
  
  .hamburger {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    align-self: center;
    z-index: 1001;
    padding: 0.3rem 0.4rem;
  }
  
  .hamburger span {
    width: 0.9rem;
    height: 0.1rem;
  }
  
  .hero-actions {
    grid-row: 3;
    grid-column: 1 / -1;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.25rem;
    justify-self: stretch !important;
    margin-right: 0 !important;
  }
  
  .hero-actions a,
  .hero-actions .mobile-nav-btn {
    width: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0.7rem;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  .hero-actions .mobile-nav-btn {
    grid-column: 1 / -1;
  }
}

/* Nav Close Button */
.nav-close-item {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1110;
  list-style: none;
  opacity: 0;
  transform: translate3d(0, -10px, 0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.nav-links.active .nav-close-item {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.3s;
}

.nav-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
}

.nav-close-btn span {
  position: absolute;
  width: 1.5rem;
  height: 0.125rem;
  background: #f0f0f0;
  border-radius: 1px;
  display: block;
}

.nav-close-btn span:nth-child(1) {
  transform: rotate(45deg);
}

.nav-close-btn span:nth-child(2) {
  transform: rotate(-45deg);
}

.nav-links {
  position: fixed;
  right: 0;
  top: 0;
  transform: translate3d(100%, 0, 0);
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background: #0a0a0c;
  background: rgba(10, 10, 12, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 100%;
  height: 100vh;
  min-height: 100svh;
  height: 100dvh;
  text-align: center;
  gap: clamp(1.25rem, 2.2vh, 2.2rem);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1100; /* Above everything including hero */
  padding: max(1rem, env(safe-area-inset-top)) 2rem max(2rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  will-change: transform;
  margin: 0;
}

/* Hide visual scrollbar for Webkit browsers */
.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0c;
  background: radial-gradient(circle at center, rgba(0, 123, 255, 0.07) 0%, rgba(10, 10, 12, 1) 100%);
  pointer-events: none;
  z-index: -1;
}

.nav-links.active {
  transform: translate3d(0, 0, 0);
}

.nav-links li {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: opacity, transform;
}

.nav-links.active li {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Staggered entry */
.nav-links.active li:nth-child(1) { transition-delay: 0.35s; }
.nav-links.active li:nth-child(2) { transition-delay: 0.4s; }
.nav-links.active li:nth-child(3) { transition-delay: 0.45s; }
.nav-links.active li:nth-child(4) { transition-delay: 0.5s; }
.nav-links.active li:nth-child(5) { transition-delay: 0.55s; }
.nav-links.active li:nth-child(6) { transition-delay: 0.6s; }
.nav-links.active li:nth-child(7) { transition-delay: 0.65s; }
.nav-links.active li:nth-child(8) { transition-delay: 0.7s; }
.nav-links.active li:nth-child(9) { transition-delay: 0.75s; }
.nav-links.active li.lang-dropdown-container { transition-delay: 0.8s; }

.nav-links a {
  text-decoration: none;
  color: #f0f0f0;
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem; /* Reduced from 1.6rem to be consistent without the root clamp */
  font-weight: 300;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.4rem;
  display: inline-block;
  position: relative;
  padding: 0.8rem 2rem;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffd700, transparent);
  transition: all 0.4s ease;
  transform: translateX(-50%);
  opacity: 0.7;
}

.nav-links a:hover {
  color: #ffd700;
  letter-spacing: 0.55rem;
  text-shadow: 0 0 2rem rgba(255, 215, 0, 0.4);
  transform: scale(1.05);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Language Dropdown (Homepage Imitation) */
.lang-dropdown-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2.5rem;
}

.lang-dropdown-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  padding: 1rem 3rem;
  border-radius: 10rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.1rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  letter-spacing: 2px;
}

.lang-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 2rem rgba(255, 215, 0, 0.1);
}

.lang-dropdown-menu {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: center;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin-top 0.4s ease;
  gap: 0.6rem;
}

.lang-dropdown-container.active .lang-dropdown-menu {
  max-height: 400px !important;
  opacity: 1 !important;
  margin-top: 0.5rem;
}

.lang-dropdown-menu li {
  width: auto;
  opacity: 0;
  transform: translate3d(0, -10px, 0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.lang-dropdown-container.active .lang-dropdown-menu li {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.lang-dropdown-menu .lang-btn {
  background: none;
  border: none;
  color: #f0f0f0;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.1rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
  opacity: 0.5;
  letter-spacing: 1px;
}

.lang-dropdown-menu .lang-btn:hover {
  color: #ffd700;
  opacity: 1;
  transform: scale(1.1);
}


@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Software Dropdown Styles for Manual Site */
.nav-links.active li.software-dropdown-container { transition-delay: 0.75s; }
.software-dropdown-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.software-dropdown-btn {
    background: transparent;
    border: none;
    color: #f0f0f0;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 300;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.4rem;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.software-dropdown-btn:hover {
    color: #ffd700;
    letter-spacing: 0.55rem;
    text-shadow: 0 0 2rem rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}
.software-dropdown-menu {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: center;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out;
    gap: 1rem;
}
.software-dropdown-container.active .software-dropdown-menu {
    max-height: 200px !important;
    opacity: 1 !important;
}
.software-dropdown-menu li {
    width: auto;
    opacity: 0;
    transform: translate3d(0, -10px, 0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.software-dropdown-container.active .software-dropdown-menu li {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
.software-dropdown-container.active .software-dropdown-menu li:nth-child(1) { transition-delay: 0.1s; }
.software-dropdown-container.active .software-dropdown-menu li:nth-child(2) { transition-delay: 0.18s; }

.software-dropdown-menu .software-dropdown-item {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 0.4rem;
    font-weight: 300;
    opacity: 0.7;
    text-transform: uppercase;
    padding: 0.8rem 2rem;
    color: #f0f0f0;
    text-decoration: none;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.software-dropdown-menu .software-dropdown-item:hover {
    opacity: 1;
    color: #ffd700;
    letter-spacing: 0.55rem;
    text-shadow: 0 0 2rem rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}
