:root {
  --bg-deep: #0b0f14;
  --bg-surface: #12181f;
  --text-primary: #e6ebf1;
  --text-muted: #8a99a8;
  --accent: #b33939;
  --button-bg: #e6ebf1;
  --button-text: #0b0f14;
  --border-soft: rgb(230 235 241 / 8%);
  --glass-bg: rgb(18 24 31 / 85%);
  --sidebar-width: 300px;
  --header-height: 72px;
  --accent-glow: rgb(179 57 57 / 15%);
  --code-bg: #0d1117;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
}

.main-header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: blur(0);
  background: transparent;
  border-bottom: none;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 5%;
  width: 100%;
  margin: 0;
}

.menu-toggle {
  display: none;
}

.logo {
  flex: 1;
}

.logo a {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.03em;
  font-size: 1.9rem;
  margin-left: 0.25rem;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  justify-content: center;
}

.nav-item {
  position: relative;
  padding: 0.5rem 0;
}

.nav-item > a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.25s ease;
}

.nav-item > a span {
  font-size: 0.8rem;
  display: inline-block;
  margin-left: 0.35rem;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: -1rem;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  list-style: none;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  min-width: 220px;
  padding: 0.75rem 0;
  box-shadow: 0 12px 32px rgb(0 0 0 / 40%);
  z-index: 200;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s;
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown li {
  margin: 0;
}

.dropdown a {
  display: block;
  padding: 0.85rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 450;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

.github-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
}

.icon-github {
  width: 20px;
  height: 20px;
  fill: currentcolor;
}

.icon-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.github-btn:hover .icon-arrow {
  transform: translateX(3px);
}

.content {
  margin-top: 0;
  padding: 0;
}

.hero-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-image: url('../assets/seaheart.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(23 29 33 / 15%), rgb(23 29 33 / 65%));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 4rem 2rem;
  text-align: left;
}

.hero-copy h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.hero-copy p {
  max-width: 46rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  line-height: 1.85;
}

.footer-section {
  padding: 6rem 2rem;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-soft);
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 4rem;
}

.footer-brand {
  max-width: 320px;
}

.footer-logo {
  font-size: 2.2rem;
  font-weight: 750;
  margin-bottom: 1.25rem;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.footer-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 2rem;
  opacity: 0.85;
}

.bg-credit {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 20px;
}

.bg-credit a {
  color: var(--text-muted);
}

.github-btn-footer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.github-btn-footer:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.footer-links-grid {
  display: flex;
  gap: 5rem;
}

.footer-column h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.footer-column a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.social-icons {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
}

.social-icons a {
  color: var(--text-primary);
  opacity: 0.6;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  display: block;
}

.social-icons svg {
  width: 20px;
  height: 20px;
  fill: currentcolor;
}

/* Documentation */
.docs-page {
  background: var(--bg-deep);
  overflow-x: hidden;
}

.docs-header {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(16px) !important;
}

.docs-container {
  display: grid;
  max-width: 1400px;
  margin: var(--header-height) auto 0;
  min-height: calc(100vh - var(--header-height));
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 0;
}

.docs-sidebar {
  background: var(--bg-deep);
  border-right: 1px solid var(--border-soft);
  padding: 2rem 1.5rem;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  z-index: 10;
}

.sidebar-search {
  margin-bottom: 2rem;
  position: relative;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search input:focus {
  border-color: var(--accent);
}

.sidebar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.sidebar-section {
  margin-bottom: 2.5rem;
}

.sidebar-section h3 {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-weight: 700;
  opacity: 0.8;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  margin: 0.1rem 0;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.sidebar-link:hover {
  background: rgb(230 235 241 / 3%);
  color: var(--text-primary);
  transform: translateX(4px);
  opacity: 1;
}

.sidebar-link.active {
  background: var(--accent-glow);
  color: var(--text-primary);
  border: 1px solid rgb(179 57 57 / 20%);
  font-weight: 500;
  opacity: 1;
}

.sidebar-link.active svg {
  color: var(--accent);
  opacity: 1;
}

.docs-content {
  flex: 1;
  padding: 3rem 4rem 6rem;
  max-width: 900px;
  background: var(--bg-deep);
}

.docs-inner-content {
  max-width: 820px;
  margin: 0 auto;
}

.docs-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.docs-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.docs-breadcrumbs a:hover {
  color: var(--text-primary);
}

.bg-credit a:hover {
  color: var(--text-primary);
}

.footer-column a:hover {
  color: var(--text-primary);
}

.social-icons a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.nav-item:hover > a {
  opacity: 1;
}

.dropdown a:hover {
  background: rgb(230 235 241 / 5%);
  color: white;
}

.markdown-body {
  line-height: 1.6;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.markdown-body h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.5rem;
}

.markdown-body h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.3rem;
}

.markdown-body h3 {
  font-size: 1.4rem;
  margin: 2rem 0 0.8rem;
}

.markdown-body p {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body code {
  background: rgb(230 235 241 / 10%);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.markdown-body pre {
  background: #0d1117;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 2rem 0;
}

.markdown-body .anchor-link {
  opacity: 0;
  margin-left: -20px;
  padding-right: 4px;
  color: var(--accent);
  transition: opacity 0.2s;
}

.markdown-body h1:hover .anchor-link,
.markdown-body h2:hover .anchor-link,
.markdown-body h3:hover .anchor-link {
  opacity: 1;
}

.code-block-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgb(255 255 255 / 5%);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  z-index: 5;
}

.copy-button:hover {
  background: rgb(255 255 255 / 10%);
  color: var(--text-primary);
}

.github-edit-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.github-edit-link:hover {
  color: var(--text-primary);
}

.loading-spinner {
  padding: 4rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.error-state {
  padding: 4rem;
  text-align: center;
  color: #ff4d4d;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@media (width <= 1024px) {
  .hero-panel {
    background-image: url('../assets/seaheart-phone.png');
  }

  .docs-container {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-content {
    padding: 2rem 1.5rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 3rem;
    padding: 0 1rem;
  }

  .footer-links-grid {
    gap: 3rem;
    flex-wrap: wrap;
  }

  .footer-brand {
    max-width: 100%;
  }

  .logo {
    flex: 1;
    z-index: 1001;
  }

  .nav-actions {
    display: none;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
  }

  .menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-deep);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 2rem;
  }

  .navbar.is-active .nav-links {
    display: flex;
  }

  .navbar.is-active .nav-actions {
    display: flex;
    position: fixed;
    top: 1000%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    flex: none;
  }

  .navbar.is-active .menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .navbar.is-active .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .navbar.is-active .menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}
