/* ==========================================================================
   Bernard Web — Horizontal-Scrolling Product Page
   ========================================================================== */

/* --- Custom Properties (Light Theme Default) --- */
:root {
  --nav-height: 56px;
  --column-width: 100vw;
  --column-padding: 3rem 4rem;
  --column-max-content: 950px;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --color-bg: #ffffff;
  --color-surface: #f4f4f5;
  --color-text: #18181b;
  --color-text-muted: #71717a;
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --color-border: #e4e4e7;
  --color-nav-bg: rgba(255, 255, 255, 0.85);
  --color-code-bg: #f4f4f5;
  --color-blockquote-border: #6366f1;
  --color-placeholder-border: #a5b4fc;
  --color-placeholder-text: #6366f1;
}

/* --- Dark Theme --- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f1117;
    --color-surface: #1a1b23;
    --color-text: #e4e4e7;
    --color-text-muted: #a1a1aa;
    --color-accent: #818cf8;
    --color-accent-hover: #a5b4fc;
    --color-border: #27272a;
    --color-nav-bg: rgba(15, 17, 23, 0.85);
    --color-code-bg: #1a1b23;
    --color-blockquote-border: #818cf8;
    --color-placeholder-border: #6366f1;
    --color-placeholder-text: #818cf8;
  }
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  overflow: hidden;
  height: 100vh;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.nav-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.65rem;
}

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

.nav-links li {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.2s, background-color 0.2s;
}

.nav-link:hover {
  color: var(--color-text);
  background-color: var(--color-surface);
}

.nav-link.active {
  color: var(--color-accent);
  background-color: var(--color-surface);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-link--github {
  background-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  padding: 0 1rem;
  height: 32px;
  line-height: 1;
}

.nav-link--github:hover {
  filter: brightness(1.1);
  color: #fff;
  background-color: var(--color-accent);
}

/* --- Download Button --- */
.btn {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
}

.btn--primary {
  background-color: var(--color-accent);
  color: #fff;
}

.btn--primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* --- Columns Container --- */
.columns {
  display: flex;
  height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;

  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.columns::-webkit-scrollbar {
  display: none;
}

/* --- Individual Column --- */
.column {
  flex: 0 0 var(--column-width);
  width: var(--column-width);
  height: 100%;
  overflow-y: hidden;
  padding: var(--column-padding);
  display: flex;
  justify-content: center;

  /* Subtle left border between columns */
  border-left: 1px solid var(--color-border);
}

.column:first-child {
  border-left: none;
}

.column-inner {
  max-width: var(--column-max-content);
  width: 100%;
  padding-bottom: env(safe-area-inset-bottom, 4rem);
}

/* --- Typography --- */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  text-align: center;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  text-align: center;
}

.lead {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: center;
}

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 600;
}

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

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* --- Lists --- */
ul {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.625rem;
}

li:last-child {
  margin-bottom: 0;
}

/* --- Code --- */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

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

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

/* --- Blockquote --- */
blockquote {
  border-left: 3px solid var(--color-blockquote-border);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* --- Screenshot Placeholders --- */
.screenshot {
  margin: 1.5rem 0;
}

.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 2px dashed var(--color-placeholder-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-placeholder-text);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.7;
  background: var(--color-surface);
}

.screenshot-placeholder::after {
  content: attr(data-label);
}

.screenshot img {
  width: 95%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  display: block;
  margin: 0 auto;
}

.screenshot figcaption {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- About Credits --- */
.about-credits {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- Standalone Page Layout (Impressum, etc.) --- */
body:has(.page) {
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body:has(.page)::-webkit-scrollbar {
  display: none;
}

.page {
  max-width: 950px;
  margin: calc(var(--nav-height) + 2rem) auto 0;
  padding: 0 2rem env(safe-area-inset-bottom, 4rem);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.page h1 {
  text-align: left;
  margin-top: 2rem;
  font-size: 1.5rem;
}

.page h2 {
  text-align: left;
  font-size: 1.125rem;
  margin-top: 1.5rem;
}

.page h3 {
  font-size: 0.9375rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.page h4 {
  font-size: 0.875rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.page hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* --- Language Toggle --- */
.lang-toggle {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: background-color 0.2s, color 0.2s;
}

.lang-toggle:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

/* --- Language-Based Content Visibility --- */
:root[lang="de"] .lang-en,
:root[lang="en"] .lang-de {
  display: none !important;
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.35s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner-text {
  font-size: 0.875rem;
  color: var(--color-text);
  max-width: 600px;
  line-height: 1.5;
}

.cookie-banner-text a {
  color: var(--color-accent);
  text-decoration: underline;
}

.cookie-banner-buttons {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.cookie-btn:hover {
  background: var(--color-border);
}

.cookie-btn--accept {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.cookie-btn--accept:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 1rem;
    text-align: center;
  }

  .cookie-banner-buttons {
    width: 100%;
    justify-content: center;
  }
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
  :root {
    --column-padding: 2rem 2.5rem;
  }

  .nav-links {
    gap: 0.125rem;
  }

  .nav-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
  :root {
    --column-padding: 1.5rem 1.25rem;
    --nav-height: 88px;
  }

  .nav {
    padding: 0 1rem;
    flex-wrap: wrap;
    height: auto;
  }

  /* Top row: logo (left) + GitHub button (right) */
  .nav-logo {
    flex: 1;
    padding: 0.5rem 0;
  }

  .nav-right {
    margin: 0.5rem 0;
    order: 0;
  }

  .nav-link--github {
    font-size: 0.75rem;
    height: 28px;
    padding: 0 0.75rem;
  }

  /* Bottom row: section links (full width) */
  .nav-links {
    order: 1;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
    justify-content: center;
    padding-bottom: 0.375rem;
  }

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

  .nav-link {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.375rem;
  }

  .lead {
    font-size: 1.0625rem;
  }
}
