/*
 * ChipMates static pages stylesheet.
 *
 * Used by every generated static page (about, mission, project, impressum,
 * datenschutz, cookies, 404). Mirrors the desktop-OS visual identity:
 * cosmic background, Space Grotesk, glassmorphic window cards, gold accents.
 *
 * No JavaScript, no React. Pure CSS so static pages stay fast and crawlable.
 */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk.woff2') format('woff2-variations'),
       url('/fonts/SpaceGrotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --gold-primary: #E6BC5C;
  --gold-subtle: #D4A539;
  --bg-deep-space: #0C1133;
  --bg-primary: #1A1A2E;
  --text-primary: #F5F5F0;
  --text-secondary: #B8B8C0;
  --text-muted: #A1A1A1;
  --text-link: #7DD3FC;
  --glass-bg: rgba(26, 26, 46, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-active: rgba(230, 188, 92, 0.2);
}

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-deep-space);
  background-image: url('/images/starry-background.webp');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   MenuBar — replica of the desktop-OS top bar
   ============================================================ */

.cm-menubar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 32px;
  background: rgba(26, 26, 46, 0.7);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 13px;
  user-select: none;
}

.cm-menubar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cm-menubar-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.cm-menubar-brand {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.cm-menubar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cm-menubar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cm-menubar-link:hover,
.cm-menubar-link:focus {
  color: var(--gold-primary);
}

/* ============================================================
   Page wrapper and the glass window card
   ============================================================ */

.cm-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.25rem 2.5rem;
}

.cm-window {
  width: 100%;
  max-width: 760px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.1) brightness(1.02);
  backdrop-filter: blur(12px) saturate(1.1) brightness(1.02);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow:
    0 2.8px 2.2px rgba(0, 0, 0, 0.04),
    0 6.7px 5.3px rgba(0, 0, 0, 0.06),
    0 12.5px 10px rgba(0, 0, 0, 0.07),
    0 22.3px 17.9px rgba(0, 0, 0, 0.085),
    0 41.8px 33.4px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(230, 188, 92, 0.08);
  overflow: hidden;
}

.cm-window-titlebar {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0.18) 100%);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cm-window-titlebar::before {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold-primary);
  opacity: 0.65;
  flex-shrink: 0;
}

.cm-window-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
}

.cm-window-content {
  padding: 2.75rem 2.5rem;
}

/* ============================================================
   Typography inside the window
   ============================================================ */

.cm-window-content h1 {
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.cm-window-content .cm-lede {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  color: var(--gold-subtle);
  font-style: italic;
  margin-bottom: 2rem;
  font-weight: 400;
}

.cm-window-content h2 {
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  font-weight: 600;
  color: var(--gold-subtle);
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.cm-window-content h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: var(--gold-subtle);
  margin: 1.5rem 0 0.5rem;
}

.cm-window-content p {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.65;
}

.cm-window-content ul,
.cm-window-content ol {
  margin: 0.5rem 0 1.5rem 1.25rem;
  padding-left: 0.5rem;
}

.cm-window-content li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.cm-window-content li::marker {
  color: var(--gold-subtle);
}

.cm-window-content a {
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 211, 252, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cm-window-content a:hover,
.cm-window-content a:focus {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
}

.cm-window-content strong {
  color: var(--gold-primary);
  font-weight: 600;
}

.cm-window-content em {
  font-style: italic;
}

.cm-window-content blockquote {
  margin: 2rem 0;
  padding: 1.1rem 1.5rem;
  border-left: 3px solid var(--gold-subtle);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 8px 8px 0;
  color: var(--text-primary);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
}

.cm-window-content blockquote span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: normal;
}

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

/* ============================================================
   Page navigation footer (under the window)
   ============================================================ */

.cm-page-nav {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 1.75rem;
  justify-content: center;
  font-size: 13px;
  max-width: 760px;
}

.cm-page-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cm-page-nav a:hover,
.cm-page-nav a:focus {
  color: var(--gold-primary);
}

.cm-page-nav a[aria-current="page"] {
  color: var(--gold-primary);
}

/* ============================================================
   404 page variant
   ============================================================ */

.cm-404 {
  text-align: center;
  padding: 3rem 1.5rem;
}

.cm-404 .cm-404-code {
  font-size: clamp(4rem, 12vw, 6rem);
  font-weight: 700;
  color: var(--gold-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.cm-404 .cm-404-label {
  font-size: 1.25rem;
  color: var(--gold-subtle);
  margin-bottom: 1.5rem;
}

/* ============================================================
   Mobile and small screens
   ============================================================ */

@media (max-width: 720px) {
  .cm-page {
    padding: 1.5rem 0.85rem 2rem;
  }
  .cm-window {
    border-radius: 12px;
  }
  .cm-window-titlebar {
    padding: 0.75rem 1.25rem;
  }
  .cm-window-content {
    padding: 1.75rem 1.5rem;
  }
  .cm-menubar {
    padding: 0 12px;
  }
  .cm-menubar-brand {
    font-size: 12px;
  }
  .cm-menubar-right {
    gap: 14px;
  }
  .cm-page-nav {
    gap: 1rem 1.25rem;
    font-size: 12.5px;
  }
}

@media (max-width: 420px) {
  .cm-menubar-brand-long {
    display: none;
  }
}

@media (min-width: 421px) {
  .cm-menubar-brand-short {
    display: none;
  }
}

/* Reduce-motion respect for backdrop-filter performance on low-end devices */
@media (prefers-reduced-motion: reduce) {
  .cm-window,
  .cm-window-titlebar,
  .cm-menubar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(12, 17, 51, 0.92);
  }
}
