/* Frachtschiff site - dark theme aligned with webapp .dark tokens */

:root {
  --background: #0a0a0a;
  --background-muted: #171717;
  --surface: #171717;
  --surface-subtle: #262626;
  --foreground: #f5f5f5;
  --foreground-secondary: #d4d4d4;
  --foreground-muted: #a3a3a3;
  --foreground-subtle: #737373;
  --border: #262626;
  --border-input: #404040;
  --primary: #f5f5f5;
  --primary-foreground: #171717;
  --accent: #93c5fd;
  --accent-soft: #172554;
  --accent-dim: rgba(147, 197, 253, 0.12);
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --max: 1120px;
  --nav-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #bfdbfe;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
  color: var(--foreground-secondary);
}

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--surface-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--foreground);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.8125rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--foreground-muted);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

ul,
ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
  color: var(--foreground-secondary);
}

li {
  margin-bottom: 0.4rem;
}

/* -- Canvas background -- */

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

body:has(#bg-canvas) > *:not(#bg-canvas):not(.lightbox) {
  position: relative;
  z-index: 1;
}

/* -- Nav -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 10, 0.92);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--foreground);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--foreground);
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--foreground-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--foreground);
  background: var(--surface-subtle);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--background-muted);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    gap: 0.15rem;
  }

  .nav-links.is-open {
    display: flex;
  }
}

/* -- Buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: #e5e5e5;
  color: var(--primary-foreground);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border-input);
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--foreground);
  border-color: var(--foreground-subtle);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* -- Landing hero -- */

.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: rise 0.8s var(--ease) both;
}

.hero__brand img {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 24px rgba(147, 197, 253, 0.25));
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  color: var(--foreground);
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  max-width: 18ch;
  margin-bottom: 1rem;
  animation: rise 0.8s var(--ease) 0.1s both;
}

.hero__lead {
  font-size: 1.125rem;
  max-width: 36rem;
  color: var(--foreground-muted);
  animation: rise 0.8s var(--ease) 0.2s both;
}

.hero .cta-group {
  animation: rise 0.8s var(--ease) 0.3s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__brand,
  .hero h1,
  .hero__lead,
  .hero .cta-group {
    animation: none;
  }
}

/* -- Features -- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
}

.section__intro {
  color: var(--foreground-muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feature-list li {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  margin: 0;
  align-items: baseline;
}

.feature-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.feature-list h3 {
  font-size: 1.0625rem;
  margin: 0;
  color: var(--foreground);
}

.feature-list p {
  margin: 0;
  color: var(--foreground-muted);
  font-size: 0.9875rem;
}

@media (max-width: 640px) {
  .feature-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* -- Footer -- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 3rem 1.5rem 2.5rem;
  background: rgba(10, 10, 10, 0.6);
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

.site-footer h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--foreground-subtle);
  margin-bottom: 0.85rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.45rem;
}

.site-footer a {
  color: var(--foreground-muted);
  font-size: 0.9375rem;
}

.site-footer a:hover {
  color: var(--foreground);
}

.ai-blurb {
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--foreground-subtle);
  max-width: 48rem;
  line-height: 1.55;
}

.ai-blurb a {
  color: var(--foreground-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-blurb a:hover {
  color: var(--accent);
}

.site-footer__meta {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--foreground-faint, #525252);
}

/* -- Docs layout -- */

.docs-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  padding: 0.5rem 0;
}

.docs-sidebar__title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--foreground-subtle);
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.docs-sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar a {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  color: var(--foreground-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.docs-sidebar a:hover {
  color: var(--foreground);
  background: var(--surface-subtle);
}

.docs-sidebar a.is-active {
  color: var(--accent);
  background: var(--accent-dim);
}

.docs-sidebar-toggle {
  display: none;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

@media (max-width: 860px) {
  .docs-sidebar-toggle {
    display: block;
  }

  .docs-sidebar {
    position: static;
    display: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
  }

  .docs-sidebar.is-open {
    display: block;
  }
}

.docs-content {
  min-width: 0;
  max-width: 42rem;
}

.docs-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.35rem;
}

.docs-lead {
  color: var(--foreground-muted);
  font-size: 1.0625rem;
  margin-bottom: 2rem;
}

.docs-content h2 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}

.docs-content h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  color: var(--foreground-secondary);
}

.docs-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.callout {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--foreground-secondary);
}

.callout strong {
  color: var(--accent);
}

.docs-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.docs-hub a {
  display: block;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.docs-hub a:hover {
  border-color: var(--border-input);
  background: var(--surface-subtle);
  color: inherit;
}

.docs-hub h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--foreground);
}

.docs-hub p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--foreground-muted);
}

/* -- Screenshots gallery -- */

.shots-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.shots-page h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.35rem;
}

.shots-page__lead {
  color: var(--foreground-muted);
  max-width: 36rem;
  margin-bottom: 2.25rem;
}

.shots-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.shots-grid button {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.2s var(--ease);
}

.shots-grid button:hover,
.shots-grid button:focus-visible {
  border-color: var(--border-input);
  transform: translateY(-2px);
  outline: none;
}

.shots-grid button:focus-visible {
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--accent);
}

.shots-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  display: block;
  background: var(--surface-subtle);
}

.shots-grid figcaption {
  padding: 0.75rem 0.9rem 0.9rem;
  font-size: 0.875rem;
  color: var(--foreground-muted);
  border-top: 1px solid var(--border);
}

.shots-grid strong {
  display: block;
  color: var(--foreground);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

/* Lightbox carousel */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox__dialog {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lightbox__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.lightbox__stage img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.15rem;
}

.lightbox__caption {
  margin: 0;
  color: var(--foreground-secondary);
  font-size: 0.9375rem;
}

.lightbox__caption strong {
  color: var(--foreground);
}

.lightbox__count {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--foreground-subtle);
  font-variant-numeric: tabular-nums;
}

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: rgba(23, 23, 23, 0.92);
  color: var(--foreground);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lightbox__btn:hover {
  background: var(--surface-subtle);
  border-color: var(--foreground-subtle);
}

.lightbox__prev {
  left: 0.75rem;
}

.lightbox__next {
  right: 0.75rem;
}

.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: rgba(23, 23, 23, 0.92);
  color: var(--foreground);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover {
  background: var(--surface-subtle);
}

@media (max-width: 640px) {
  .lightbox__prev {
    left: 0.35rem;
  }

  .lightbox__next {
    right: 0.35rem;
  }

  .lightbox__btn {
    width: 2.35rem;
    height: 2.35rem;
  }
}

body.lightbox-open {
  overflow: hidden;
}
