/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Mirrored from laplace/application/frontend/src/styles/theme.css for easier parity */
  --color-bg-black: #000000;
  --color-bg-darker: #0a0a0a;
  --color-fg-light: #eeeeee;
  --color-platinum: #e5e4e2;
  --color-silver: #c0c0c0;
  --color-muted-gray: #888888;
  --color-border-gray: #333333;
  --color-code-bg: #1a1a1a;
  --color-string: #c0c0c0;
  --color-number: #e5e4e2;
  --color-keyword: #d2d2d2;
  --color-type: #79c0ff;
  --color-function: var(--color-platinum);
  --color-border-light: var(--color-type);
  --bg-primary: var(--color-bg-black);
  --bg-secondary: var(--color-code-bg);
  --text-primary: var(--color-fg-light);
  --text-secondary: var(--color-muted-gray);
  --accent-cyan: var(--color-border-light);
  --accent-green: var(--color-border-light);
  --accent-magenta: #ff00ff;
  --border: var(--color-border-gray);
  --font-mono: "Courier New", "JetBrains Mono", ui-monospace, monospace;
  --font-pixel: "Press Start 2P", cursive;
  --global-header-height: clamp(32px, 4.5vw, 44px);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-shell {
  padding-top: calc(var(--global-header-height) + 32px);
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 40px;
}

/* Header styles mirrored from laplace/application/frontend/src/components/SiteHeader.module.css */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: var(--global-header-height);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(4px, 1.1vw, 8px) clamp(8px, 2vw, 14px);
  background: rgba(17, 17, 17, 0.94);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(51, 51, 51, 0.4) 2px,
      rgba(51, 51, 51, 0.4) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(51, 51, 51, 0.4) 2px,
      rgba(51, 51, 51, 0.4) 4px
    );
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 228, 226, 0.08);
  overflow: hidden;
}

.site-header-inner {
  display: contents;
  position: relative;
  z-index: 1;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 2px;
  position: relative;
  z-index: 2;
}

.header-nav-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.header-ribbon-bg {
  position: absolute;
  inset: 0;
  transform: translateY(-6px);
  padding: clamp(8px, 1.6vw, 12px) clamp(8px, 2vw, 14px) clamp(8px, 1.6vw, 12px)
    clamp(110px, 18vw, 220px);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.28;
  color: rgba(200, 200, 200, 0.78);
  opacity: 0.9;
  text-transform: uppercase;
  overflow: hidden;
  pointer-events: none;
  display: block;
  z-index: 0;
  white-space: normal;
}

.header-ribbon-bg::before {
  content: attr(data-text);
}

.header-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.header-eyebrow {
  font-family: var(--font-pixel);
  font-size: clamp(0.55rem, 1.5vw, 0.75rem);
  color: rgba(229, 228, 226, 0.6);
  letter-spacing: 0.14em;
  line-height: 1.4;
}

.header-title {
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--color-platinum);
  letter-spacing: 0.12em;
  line-height: 1.6;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.5vw, 5px);
  padding: clamp(1px, 0.4vw, 4px) clamp(5px, 1vw, 9px);
  background: var(--bg-secondary);
  border: 1px solid var(--color-border-light);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.header-nav-link {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  line-height: 1.2;
  color: rgba(229, 228, 226, 0.75);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0;
}

.header-nav-link:hover {
  color: var(--color-platinum);
  border-color: rgba(229, 228, 226, 0.2);
  background: rgba(229, 228, 226, 0.05);
}

/* Typography */
h1 {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -1px;
}

h2 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-transform: lowercase;
}

p {
  margin-bottom: 16px;
  color: var(--text-primary);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.2s ease;
}

a:hover {
  border-bottom: 1px solid var(--accent-cyan);
}

/* Hero Section */
.hero {
  margin-bottom: 60px;
}

.button-group {
  display: flex;
  gap: 16px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
  text-decoration: none;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background-color: rgba(0, 255, 255, 0.05);
}

.btn-primary {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.btn-primary:hover {
  border-color: var(--accent-green);
  color: var(--bg-primary);
  background-color: var(--accent-green);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background-color: rgba(0, 255, 255, 0.05);
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
  margin-top: 12px;
  display: inline-block;
}

.quickstart-cta {
  margin-top: 30px;
  text-align: center;
}

.subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.6;
}

.highlight {
  background-color: var(--accent-cyan);
  color: var(--bg-primary);
  padding: 0 4px;
}

.install-header {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  margin-top: 30px;
}

.tagline-bottom {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 20px;
  margin-bottom: 0;
}

.cursor {
  color: var(--accent-green);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Terminal Block */
.terminal {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 20px;
  margin: 30px 0;
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
}

.prompt {
  color: var(--accent-green);
  margin-right: 8px;
}

/* Divider */
.divider {
  color: var(--border);
  margin: 50px 0;
  font-size: 12px;
  user-select: none;
  overflow: hidden;
}

/* Overview Section */
.overview {
  margin-bottom: 60px;
}

.feature-list {
  margin-top: 30px;
}

.list-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

ul {
  list-style: none;
  padding-left: 0;
}

ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  color: var(--text-primary);
}

ul li:before {
  content: "─";
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
}

/* ASCII Diagram */
.diagram {
  margin-bottom: 60px;
}

.ascii-art {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 30px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent-cyan);
  overflow-x: auto;
}

/* Setup Section */
.setup {
  margin-bottom: 60px;
}

ol {
  list-style: none;
  counter-reset: step-counter;
  padding-left: 0;
  margin-bottom: 30px;
}

ol li {
  counter-increment: step-counter;
  padding-left: 40px;
  position: relative;
  margin-bottom: 12px;
  color: var(--text-primary);
}

ol li:before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  color: var(--accent-green);
  font-weight: 700;
  width: 24px;
  text-align: right;
}

.step-title {
  display: inline;
  color: var(--text-primary);
}

.step-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 12px;
}

ol li .code-block {
  margin-top: 12px;
  margin-bottom: 12px;
}

.code-block {
  margin-bottom: 30px;
}

.code-title {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.code-block pre {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 20px;
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  color: var(--text-primary);
}

.comment {
  color: var(--text-secondary);
}

.keyword {
  color: var(--accent-magenta);
}

.string {
  color: var(--accent-green);
}

code {
  background-color: var(--bg-secondary);
  padding: 2px 6px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--accent-cyan);
}

/* Usage Section */
.usage {
  margin-bottom: 60px;
}

.why-list {
  list-style: none;
  padding-left: 0;
}

.why-list li {
  margin-bottom: 24px;
  padding-left: 0;
}

.why-list li:before {
  content: none;
}

.why-list strong {
  display: block;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
}

.why-list span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

/* Philosophy Section */
.philosophy {
  margin-bottom: 60px;
}

/* Footer */
footer {
  padding-top: 30px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.footer-nav a:hover {
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--accent-cyan);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.social-link {
  color: var(--text-secondary);
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  border: none;
}

.social-link:hover {
  color: var(--accent-cyan);
  border: none;
}

.social-link svg {
  width: 16px;
  height: 16px;
}

.footer-info {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.footer-info a {
  color: var(--text-secondary);
  margin: 0 8px;
}

.footer-info a:hover {
  color: var(--accent-cyan);
}

@media (max-width: 900px) {
  .site-header {
    backdrop-filter: none;
    background: rgba(17, 17, 17, 0.98);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .page-shell {
    padding-top: calc(var(--global-header-height) + 44px);
  }

  .site-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }

  .header-ribbon-bg {
    padding-left: clamp(90px, 30vw, 180px);
    transform: translateY(-4px);
  }

  .header-nav-stack {
    align-items: flex-start;
    width: 100%;
  }

    .header-nav {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 6px 8px;
    }

    .header-nav-link {
        flex: 0 0 auto;
        text-align: center;
    padding: 5px 9px;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .container {
    padding: 32px 16px 24px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 16px;
  }

  .terminal,
  .code-block pre,
  .ascii-art {
    font-size: 11px;
    padding: 16px;
  }

  .divider {
    font-size: 10px;
  }

  .button-group {
    flex-direction: column;
    gap: 12px;
  }

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

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  h1 {
    font-size: 28px;
  }

  .tagline {
    font-size: 14px;
  }

  .ascii-art {
    font-size: 10px;
  }
}

/* Selection */
::selection {
  background-color: var(--accent-cyan);
  color: var(--bg-primary);
}

::-moz-selection {
  background-color: var(--accent-cyan);
  color: var(--bg-primary);
}

/* Hide scrollbars while keeping scroll functionality */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}
