/* ==========================================================================
   Martian Defense design system
   Brand: bright green on black, white content pages, Overpass. Self-hosted
   fonts, no third-party CSS, no CDN.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/overpass-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/overpass-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/overpass-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/overpass-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 900; font-display: swap; src: url("/assets/fonts/overpass-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/lato-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/noto-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/noto-serif-latin-700-normal.woff2") format("woff2"); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:where(a) { color: inherit; }

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --green: #12d04e;          /* primary brand green */
  --green-bright: #0bff00;   /* brightest highlight green */
  --green-strong: #0a7f2e;   /* green text on white, meets WCAG AA */
  --gold: #ffc947;           /* secondary accent */

  --black: #000000;
  --near-black: #0a0a0a;
  --white: #ffffff;
  --ink: #15171c;            /* body text on white */
  --ink-soft: #4a4f57;       /* muted text on white */
  --line-dark: #262626;      /* borders on black */
  --line-light: #e3e6eb;     /* borders on white */
  --surface: #f5f7f9;        /* light card surface */

  --focus: #0bff00;

  --font-sans: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --font-alt: "Lato", var(--font-sans);

  --container: 1170px;
  --container-narrow: 780px;

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;

  --transition: 150ms ease;
}

/* ---------- Base (light content) ---------- */
body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
}

h1, h2, h3, h4, h5, h6 { line-height: 1.15; font-weight: 800; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }
p { text-wrap: pretty; }

a { color: var(--green-strong); text-underline-offset: 0.15em; transition: color var(--transition); }
a:hover { color: var(--green); }
strong { font-weight: 700; }
code, kbd, samp { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--line-light); margin: var(--space-8) 0; }
::selection { background: var(--green); color: var(--black); }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  background: var(--green); color: var(--black); padding: var(--space-2) var(--space-4);
  font-weight: 700; transition: top var(--transition);
}
.skip-link:focus { top: var(--space-4); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-6); }
.mx-auto { margin-inline: auto; }
.page-body { padding-bottom: var(--space-16); }
.section { padding-block: var(--space-16); }
.section--tight { padding-block: var(--space-12); }

/* Dark and green section variants (used on the home page) */
.section--dark { background: var(--black); color: var(--white); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--dark .prose { color: #d4d8e0; }
.section--dark .prose a { color: var(--green); }
.section--dark .prose strong { color: var(--white); }
.band--green { background: var(--green); color: var(--black); text-align: center; }
.band--green h1, .band--green h2, .band--green h3 { color: var(--black); }

.eyebrow {
  font-family: var(--font-sans); font-size: 0.82rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--green-strong); font-weight: 700;
  display: inline-block; margin-bottom: var(--space-2);
}
.section--dark .eyebrow { color: var(--green); }

.section-head { max-width: var(--container-narrow); margin-bottom: var(--space-8); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--ink-soft); margin-top: var(--space-3); font-size: 1.1rem; }
.section--dark .section-head p { color: #c8cdd6; }
.section-intro { margin-bottom: var(--space-12); }

/* Accent word helper: green portion of a heading */
.accent { color: var(--green); }
.section--dark .accent { color: var(--green); }

/* ---------- Header (black bar with the reversed logo) ---------- */
.site-header { background: var(--black); border-bottom: 1px solid var(--line-dark); position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 78px; }

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand__logo { height: 52px; width: auto; display: block; }

/* Nav toggle */
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 46px; height: 46px;
  background: transparent; border: 2px solid var(--green); color: var(--green); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav ul { list-style: none; padding: 0; margin: 0; }
.nav-primary { display: flex; align-items: center; gap: var(--space-3); }
.nav-primary > li { position: relative; }

/* Green-outlined nav buttons (brand signature) */
.nav-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.5rem 0.9rem; border: 2px solid var(--green); background: transparent;
  color: var(--green); text-decoration: none; font-weight: 700; font-size: 0.95rem;
  white-space: nowrap; cursor: pointer; transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link:focus-visible, .nav-link[aria-current="page"] { background: var(--green); color: var(--black); }
.nav-caret { width: 0.7em; height: 0.7em; transition: transform var(--transition); }
.has-submenu:hover .nav-caret, .has-submenu.is-open .nav-caret { transform: rotate(180deg); }

/* Dropdowns */
.submenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--black);
  border: 2px solid var(--green); padding: var(--space-2); display: grid; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition); z-index: 30;
}
.has-submenu:hover .submenu, .has-submenu.is-open .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a { display: block; padding: var(--space-2) var(--space-3); color: var(--green); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.submenu a:hover, .submenu a:focus-visible { background: var(--green); color: var(--black); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.7rem 1.4rem; font-weight: 800; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition); }
.btn svg { width: 1.1em; height: 1.1em; }
.btn:active { transform: translateY(1px); }
/* Solid green (READ MORE style): green fill, black text, square */
.btn--solid { background: var(--green); color: var(--black); border-color: var(--green); }
.btn--solid:hover { background: var(--green-bright); border-color: var(--green-bright); color: var(--black); }
/* Green outline */
.btn--outline { background: transparent; color: var(--green-strong); border-color: var(--green); }
.section--dark .btn--outline, .band--green .btn--outline { color: var(--green); }
.btn--outline:hover { background: var(--green); color: var(--black); }
/* Black pill (Dive into the Notebook) */
.btn--pill { background: var(--black); color: var(--white); border-color: var(--black); border-radius: 100px; padding: 0.85rem 2rem; }
.btn--pill:hover { background: #1a1a1a; color: var(--green); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem); text-align: center; }
.hero__title { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; color: var(--green); }
.section--dark .hero__title { color: var(--green); }
.hero__lede { margin: var(--space-6) auto 0; max-width: 60ch; font-size: clamp(1.05rem, 2vw, 1.25rem); color: #c8cdd6; }
.hero__actions { margin-top: var(--space-8); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: center; }

/* ---------- Two-column (Who / Mission) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); }
.split h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: var(--space-4); }
.split p { color: #c8cdd6; }

/* ---------- Chip / category row (green-outlined) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; margin-bottom: var(--space-12); }
.chip {
  display: inline-flex; align-items: center; padding: 0.45rem 0.9rem; border: 2px solid var(--green);
  color: var(--green-strong); background: transparent; font-weight: 700; font-size: 0.9rem; text-decoration: none;
}
.chip:hover, .chip[aria-current="page"] { background: var(--green); color: var(--black); }

/* ---------- Cards (white content pages) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-12) var(--space-8); }
.card { display: flex; flex-direction: column; text-align: center; }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); border: 1px solid var(--line-light); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--placeholder { display: grid; place-items: center; background: var(--black); }
.card__media--placeholder svg { width: 56px; height: 56px; }
.card__body { padding-top: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); flex: 1; }
.card__cat { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-strong); font-weight: 700; }
.card__title { font-size: 1.2rem; line-height: 1.3; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--green-strong); }
.card__excerpt { color: var(--ink-soft); font-size: 0.96rem; }
.card__foot { margin-top: auto; }

/* ---------- Feature lists (home expertise) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-12); }
.feature h3 { color: var(--white); font-size: 1.4rem; text-align: center; margin-bottom: var(--space-4); }
.feature ul { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.feature li { color: var(--green); font-weight: 600; position: relative; padding-left: 1.2em; }
.feature li::before { content: "\25B8"; position: absolute; left: 0; color: var(--green); }

.link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); text-align: center; }
.link-grid a { color: var(--green); font-weight: 700; text-decoration: none; }
.link-grid a:hover { color: var(--green-bright); }
.link-grid span { color: var(--green); font-weight: 700; }
.text-center { text-align: center; }

/* ---------- Prose (articles on white) ---------- */
.prose { max-width: var(--container-narrow); font-size: 1.08rem; color: var(--ink); }
.prose > * + * { margin-top: var(--space-6); }
.prose h2 { margin-top: var(--space-12); }
.prose h3 { margin-top: var(--space-8); }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 90px; }
.prose a { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--space-2); }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.5em; }
.prose ul > li::before { content: ""; position: absolute; left: 0.2em; top: 0.6em; width: 8px; height: 8px; background: var(--green); }
.prose ol { padding-left: 1.4em; }
.prose blockquote { border-left: 3px solid var(--green); padding: var(--space-2) var(--space-6); color: var(--ink-soft); font-style: italic; }
.post-figure { margin-block: var(--space-8); }
.post-figure img { width: 100%; border: 1px solid var(--line-light); }
.post-figure--pending { max-width: 560px; margin-inline: auto; }
.img--pending { min-height: 150px; aspect-ratio: 16 / 9; object-fit: cover; background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 12px, #e9edf1 12px, #e9edf1 24px); }
.prose pre, pre.code-block { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.55; background: var(--black); color: #d7f7de; border: 1px solid var(--line-light); padding: var(--space-4) var(--space-6); overflow-x: auto; }
.prose pre code { color: inherit; background: none; padding: 0; }
.prose :not(pre) > code { background: var(--surface); border: 1px solid var(--line-light); padding: 0.1em 0.4em; color: var(--green-strong); }

/* ---------- Article + listing headers ---------- */
.page-head { text-align: center; padding-block: var(--space-16) var(--space-8); }
.page-head h1 { margin-bottom: var(--space-3); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; justify-content: center; font-size: 0.9rem; color: var(--ink-soft); }
.breadcrumbs a { color: var(--green-strong); text-decoration: none; font-weight: 600; }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs span[aria-hidden] { color: var(--green); }
.article-head { max-width: var(--container-narrow); margin-inline: auto; text-align: center; padding-block: var(--space-12) var(--space-6); }
.article-head h1 { margin-block: var(--space-4); }
.article-meta { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; color: var(--ink-soft); font-size: 0.9rem; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--green); align-self: center; }
.note { background: var(--surface); border: 1px solid var(--line-light); border-left: 3px solid var(--green); padding: var(--space-6); color: var(--ink-soft); }
.note strong { color: var(--ink); }

/* ---------- Footer (always black) ---------- */
.site-footer { background: var(--black); color: var(--white); border-top: 2px solid var(--green); padding-block: var(--space-16) var(--space-8); text-align: center; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: center; margin-bottom: var(--space-8); }
.footer-nav a { color: var(--green); font-weight: 700; text-decoration: none; }
.footer-nav a:hover { color: var(--green-bright); }
.footer-socials { display: flex; gap: var(--space-4); justify-content: center; margin-bottom: var(--space-8); }
.footer-socials a { width: 40px; height: 40px; display: grid; place-items: center; border: 2px solid var(--green); color: var(--green); transition: background var(--transition), color var(--transition); }
.footer-socials a:hover { background: var(--green); color: var(--black); }
.footer-socials svg { width: 18px; height: 18px; }
.footer-bottom { color: #cfd4dc; font-weight: 700; font-size: 0.92rem; }

/* ---------- 404 ---------- */
.error-page { min-height: 55vh; display: grid; place-items: center; text-align: center; }
.error-page .code { color: var(--green); font-weight: 800; letter-spacing: 0.2em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--space-12); } .link-grid { grid-template-columns: 1fr; gap: var(--space-6); } }

@media (max-width: 780px) {
  .site-header__inner { flex-wrap: wrap; }
  html.js .nav-toggle { display: inline-flex; }
  .site-nav { width: 100%; }
  html.js .site-nav { position: fixed; inset: 78px 0 auto 0; width: auto; background: var(--black); border-bottom: 2px solid var(--green); padding: var(--space-4); max-height: calc(100vh - 78px); overflow-y: auto; display: none; }
  html.js .site-nav.is-open { display: block; }
  .nav-primary { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .nav-primary > li { position: static; }
  .nav-link { justify-content: space-between; width: 100%; }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; border: 0; border-left: 2px solid var(--green); margin-left: var(--space-3); padding: var(--space-1) 0 var(--space-1) var(--space-3); }
  html.js .submenu { display: none; }
  html.js .has-submenu.is-open .submenu { display: grid; }
}

@media (max-width: 560px) { .container { padding-inline: var(--space-4); } }

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
@media print { .site-header, .site-footer, .nav-toggle { display: none; } a { color: #000; text-decoration: underline; } }
