/* ============================================
   MARATHON SCI-FI DESIGN SYSTEM
   Futuristic • Minimal • High-Tech
   ============================================ */

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* Core palette — Clean Light */
  --color-bg: #ffffff;
  --color-bg-elevated: #f7f7f9;
  --color-bg-card: #f2f2f5;
  --color-bg-hover: #ebebef;
  --color-surface: #eeeef1;
  --color-border: rgba(0, 0, 0, 0.07);
  --color-border-strong: rgba(0, 0, 0, 0.12);

  /* Single clean accent */
  --color-accent: #2d2d2d;
  --color-accent-soft: #555;
  --color-accent-dim: rgba(45, 45, 45, 0.08);

  /* Aliases for backward compat */
  --color-cyan: var(--color-accent);
  --color-magenta: var(--color-accent);
  --color-orange: var(--color-accent);
  --color-cyan-dim: var(--color-accent-dim);
  --color-magenta-dim: var(--color-accent-dim);
  --color-orange-dim: var(--color-accent-dim);

  /* Text */
  --color-text: #333;
  --color-text-dim: #777;
  --color-text-muted: #aaa;
  --color-white: #111;
  --color-black: #111;

  /* Glow effects — none on clean light */
  --glow-cyan: none;
  --glow-magenta: none;
  --glow-orange: none;

  /* Typography */
  --font-family-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-family-display: var(--font-family-sans);

  /* Spacing */
  --padding: 1.25rem;
  --grid-gap: 1.5rem;

  /* Code colors */
  --color-code-light-grey: #b0b2c0;
  --color-code-comment: #8a8c9a;
  --color-code-white: #e8e8f0;
  --color-code-red: #c0392b;
  --color-code-orange: #c76b2b;
  --color-code-yellow: #b8860b;
  --color-code-green: #1a8a4a;
  --color-code-aqua: #3a7a8a;
  --color-code-blue: #2a6fdb;
  --color-code-purple: #7b3fa0;
}

html {
  font-family: var(--font-family-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

.site-wrapper {
  padding: 0 var(--padding);
  max-width: 72rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent
    transparent 2px,
    rgba(0, 0, 0, 0.008) 2px,
    rgba(0, 0, 0, 0.008) 4px
  );
}

img { width: 100%; }
li { list-style: none; }

a {
  color: var(--color-cyan);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
a:hover {
  color: var(--color-cyan);
}

button {
  font: inherit;
  background: none;
  border: 0;
  color: currentColor;
  cursor: pointer;
}

strong, b { font-weight: 700; }

small {
  font-size: inherit;
  color: var(--color-text-dim);
}

/* ============================================
   CURSOR
   ============================================ */

body { cursor: none; }
a, button, input, textarea, select { cursor: none; }
.cursor { pointer-events: none; }
.cursor__ball {
  position: fixed;
  top: 0;
  left: 0;
  mix-blend-mode: difference;
  z-index: 99999;
}
.cursor__ball circle { fill: #2a2a35; }

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding: 0.75rem 0;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled state — desktop */
.header.is-scrolled {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  margin-left: calc(var(--padding) * -1);
  margin-right: calc(var(--padding) * -1);
  padding-left: var(--padding);
  padding-right: var(--padding);
}

/* CTA links in header — shown on scroll */
.header-cta-actions {
  display: flex;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, max-width 0.3s ease;
}

.header.is-scrolled .header-cta-actions {
  visibility: visible;
  opacity: 1;
  max-width: 15rem;
  margin-left: 0.5rem;
}

.header-cta-link {
  font-size: 0.75rem;
  color: #fff !important;
  background: var(--color-black);
  letter-spacing: 0.02em;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-black);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.header-cta-link:hover {
  background: transparent;
  color: var(--color-accent) !important;
}

/* Hide social when scrolled */
.header.is-scrolled .menu-social {
  display: none;
}

.logo {
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  font-family: var(--font-family-sans);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0.01em;
  font-size: 0.875rem;
  height: 3rem;
  z-index: 10001;
  position: relative;
}
.logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.logo:hover { color: var(--color-accent); }
.logo:hover::after { transform: scaleX(1); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
}
.burger span {
  width: 100%;
  height: 1px;
  background: var(--color-black);
  transition: all 0.3s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
  background: var(--color-magenta);
}
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
  background: var(--color-magenta);
}

.menu {
  display: flex;
  align-items: center;
}
.menu a {
  padding: 0.5rem 0.75rem;
  display: block;
  color: var(--color-text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  position: relative;
}
.menu a:hover {
  color: var(--color-text);
}
.menu a[aria-current] {
  color: var(--color-text);
}
.menu a[aria-current]::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background: var(--color-text);
}

.menu-links { display: flex; }
.menu-icon-link { display: none; }
.menu-social { display: flex; }
.menu-mobile-icons { display: none; }

/* Mobile header bar — hidden on desktop */
.mobile-header-bar {
  display: none;
}

@media screen and (max-width: 768px) {
  .burger {
     display: flex;
     padding-top: 0.5rem;
    
    }

  /* Hide desktop nav on mobile */
  .menu { display: none; }

  /* Hide the in-wrapper header elements on mobile */
  .header .logo,
  .header .burger {
    display: none;
  }

  .header {
    position: relative;
    z-index: 10;
    background: transparent;
    padding: 1rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  body:has(.hero) .header {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: hidden;
  }

  body:not(:has(.hero)) .header {
    padding-bottom: 3rem;
  }

  /* Mobile header bar — outside site-wrapper */
  .mobile-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100003;
    padding: 0.75rem var(--padding);
    background: transparent;
    pointer-events: none;
  }

  .mobile-header-bar .logo,
  .mobile-header-bar .burger {
    pointer-events: auto;
  }

  .mobile-header-bar .burger {
    display: flex;
  }

  .main {
    padding-top: 2.5rem;
  }

  body:has(.hero) .main {
    padding-top: 0;
  }
}

/* Mobile overlay menu — sits outside site-wrapper */
.menu-overlay {
  display: none;
}

@media screen and (max-width: 768px) {
  .menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 100001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .menu-overlay.is-open {
    transform: translateX(0);
  }
  .menu-overlay-inner {
    padding: 6rem 2rem 2rem;
  }
  .menu-overlay .menu-links {
    display: flex;
    flex-direction: column;
  }
  .menu-overlay .menu-links a {
    padding: 1rem 0;
    display: block;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--color-text-dim);
    border-bottom: 1px solid var(--color-border);
    transition: color 0.2s ease;
  }
  .menu-overlay .menu-links a:hover {
    color: var(--color-text);
  }
  .menu-overlay .menu-links a[aria-current] {
    color: var(--color-text);
  }
  .menu-overlay .menu-mobile-icons {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
  }
  .menu-overlay .menu-icon-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--color-text-dim);
  }
  .menu-overlay .menu-icon-link:hover { color: var(--color-accent); }
  .menu-overlay .menu-icon-link svg { width: 1.25rem; height: 1.25rem; }
}

/* ============================================
   AVAILABILITY BADGE
   ============================================ */

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.availability-dot {
  display: block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  min-height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.availability-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: pulse 2.5s ease-out infinite;
}

.availability-badge.is-available .availability-dot {
  background: #86efac;
}

.availability-badge.is-available .availability-dot::before {
  background: #86efac;
}

.availability-badge.is-unavailable .availability-dot {
  background: #fca5a5;
}

.availability-badge.is-unavailable .availability-dot::before {
  background: #fca5a5;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  70% {
    transform: scale(2.8);
    opacity: 0;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* Header placement — not used, badge is in hero only */

@media screen and (max-width: 768px) {
  .header .availability-badge {
    display: none;
  }
}

/* ============================================
   SOCIAL ICONS
   ============================================ */

.social {
  display: flex;
  padding: 0 0.5rem;
}
.social a {
  padding: 0.75rem 0.5rem;
  color: var(--color-text-dim);
  transition: color 0.2s ease;
}
.social a:hover { color: var(--color-cyan); }
.social svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ============================================
   LAYOUT SYSTEM
   ============================================ */

.section { padding: 3rem 0; }

/* Extra top spacing on subpages (home has hero, so no extra needed) */
.main {
  padding-top: 0.5rem;
}
body:has(.hero) .main {
  padding-top: 0;
}

.grid {
  --columns: 12;
  --gutter: 3rem;
  display: grid;
  grid-gap: var(--gutter);
  grid-template-columns: 1fr;
}
.grid > .column { margin-bottom: var(--gutter); }

.autogrid {
  --gutter: 3rem;
  --min: 10rem;
  display: grid;
  grid-gap: var(--gutter);
  grid-template-columns: repeat(auto-fit, minmax(var(--min), 1fr));
  grid-auto-flow: dense;
}

@media screen and (min-width: 60rem) {
  body { --padding: 3rem; }
  .grid { grid-template-columns: repeat(12, 1fr); }
  .grid > .column { grid-column: span var(--columns); }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.text {
  line-height: 1.7em;
  color: var(--color-text);
}
.text a {
  text-decoration: none;
  color: var(--color-cyan);
  border-bottom: 1px solid var(--color-cyan-dim);
  transition: border-color 0.2s ease;
}
.text a:hover { border-color: var(--color-cyan); }
.text :first-child { margin-top: 0; }
.text :last-child { margin-bottom: 0; }
.text p, .text ul, .text ol { margin-bottom: 1.5rem; }
.text ul, .text ol { margin-left: 1rem; }
.text ul p, .text ol p { margin-bottom: 0; }
.text ul > li { list-style: disc; }
.text ol > li { list-style: decimal; }
.text ul ol, .text ul ul, .text ol ul, .text ol ol { margin-bottom: 0; }

.text h1, .h1, .intro {
  font-family: var(--font-family-sans);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  line-height: 1.15em;
  color: var(--color-white);
  letter-spacing: -0.01em;
}

.text h2, .h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--color-white);
  letter-spacing: 0.02em;
}

.text h3, .h3 {
  font-weight: 600;
  color: var(--color-white);
}

.text .codeblock { display: grid; }
.text code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  background: var(--color-surface);
  padding: 0.15rem 0.5rem;
  display: inline-block;
  color: var(--color-cyan);
  border: 1px solid var(--color-border);
  border-radius: 2px;
}
.text pre {
  margin: 2rem 0;
  background: #1e1e2a;
  color: #e0e0ec;
  padding: 1.5rem;
  overflow-x: auto;
  line-height: 1.6;
  border: 1px solid var(--color-border);
}
.text pre code {
  padding: 0;
  background: none;
  color: inherit;
  border: none;
}
.text hr { margin: 4rem 0; }
.text dt { font-weight: 600; color: var(--color-white); }
.text blockquote {
  font-size: 1.15rem;
  line-height: 1.5em;
  border-left: 2px solid var(--color-cyan);
  padding-left: 1.5rem;
  margin: 2rem 0;
  max-width: 30rem;
  color: var(--color-text);
}
.text blockquote footer {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--color-text-dim);
}
.text figure { margin: 2rem 0; }
.text figcaption {
  padding-top: 0.75rem;
  color: var(--color-text-dim);
  font-size: 0.85rem;
}
.text figure ul {
  line-height: 0;
  display: grid;
  gap: 1.5rem;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.text figure ul li { list-style: none; }

hr {
  border: 0;
  height: 1px;
  background: var(--color-border-strong);
  width: 3rem;
  margin: 3rem auto;
}

.align-center { text-align: center; }

.intro {
  max-width: 42rem;
}
.intro *:not(:last-child) { margin-bottom: 1em; }

/* ============================================
   BUTTONS / CTA
   ============================================ */

.cta {
  background: var(--color-accent);
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.7rem 1.75rem;
  border: 1px solid var(--color-accent);
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.cta::before { display: none; }
.cta:hover {
  background: transparent;
  color: var(--color-accent);
}
.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media screen and (max-width: 768px) {
  .cta {
    font-size: 0.875rem;
  }
}

/* ============================================
   BOX / CARD
   ============================================ */

.box {
  background: var(--color-bg-card);
  padding: 2rem;
  border: 1px solid var(--color-border);
  position: relative;
}
.box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2rem;
  height: 1px;
  background: var(--color-border-strong);
}

.bg-light { background-color: var(--color-surface); }
.color-grey { color: var(--color-text-dim); }

/* ============================================
   IMAGES / VIDEO
   ============================================ */

.video, .img {
  position: relative;
  display: block;
  --w: 1;
  --h: 1;
  padding-bottom: calc(100% / var(--w) * var(--h));
  background: var(--color-bg-elevated);
  overflow: hidden;
}
.img img, .video iframe {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}
.img[data-contain] img { object-fit: contain; }
.img-caption, .video-caption {
  padding-top: 0.75rem;
  line-height: 1.5em;
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 3rem 0;
  text-align: left;
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
}
.footer-nav {
  display: flex;
  gap: 2rem;
  justify-content: flex-start;
}
.footer-nav a {
  color: var(--color-text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}
.footer-nav a:hover { color: var(--color-cyan); }

/* ============================================
   MAP
   ============================================ */

.map {
  --w: 2; --h: 1;
  padding-bottom: calc(100% / var(--w) * var(--h));
  position: relative;
  overflow: hidden;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
}
.map iframe {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */

.margin-s { margin-bottom: 0.75rem; }
.margin-m { margin-bottom: 1.5rem; }
.margin-l { margin-bottom: 3rem; }
.margin-xl { margin-bottom: 4.5rem; }
.margin-xxl { margin-bottom: 6rem; }

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  padding-top: 4rem;
}
.pagination > span { color: var(--color-text-muted); }
.pagination > * {
  padding: 0.5rem;
  width: 3rem;
  text-align: center;
  border: 1px solid var(--color-border-strong);
  margin-right: 1rem;
  color: var(--color-text-dim);
  transition: all 0.2s ease;
}
.pagination a:hover {
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  box-shadow: var(--glow-cyan);
}

/* ============================================
   NOTE EXCERPTS
   ============================================ */

.note-excerpt {
  line-height: 1.5em;
}
.note-excerpt header { margin-bottom: 1rem; }
.note-excerpt figure {
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.note-excerpt a {
  color: var(--color-text);
  display: block;
  padding: 1.25rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: all 0.25s ease;
  position: relative;
}
.note-excerpt a:hover {
  border-color: var(--color-border-strong);
  background: var(--color-bg-hover);
  text-shadow: none;
}
.note-excerpt a:hover .note-excerpt-title { color: var(--color-accent); }
.note-excerpt-title {
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 0.25rem;
  transition: color 0.2s ease;
}
.note-excerpt-date {
  color: var(--color-text-dim);
  font-size: 0.8rem;
  font-family: var(--font-family-mono);
}
.note-excerpt-text {
  margin-top: 0.75rem;
  color: var(--color-text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============================================
   HUD DECORATIVE ELEMENTS
   ============================================ */

.hud-line {
  height: 1px;
  background: var(--color-border-strong);
  margin: 1.5rem 0;
  max-width: 120px;
}

.hud-label {
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.hud-corner {
  position: relative;
}
.hud-corner::before,
.hud-corner::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--color-border-strong);
  border-style: solid;
  opacity: 0.5;
}
.hud-corner::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
}
.hud-corner::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
}

/* Grid pattern background */
.grid-pattern {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
