/* ============================================================================
   Autopilot Engineer — shared stylesheet for static pages
   ----------------------------------------------------------------------------
   Used by every page EXCEPT the homepage (/index.html), which still renders
   through the dc-runtime (support.js). The token values below are extracted
   verbatim from the homepage's inline styles and are the single reconciliation
   sheet: if the homepage look changes, mirror it here (and vice-versa).
   Load order per page:  Google Fonts <link>  ->  this file.
   ========================================================================== */

/* ---- 1. Design tokens ---------------------------------------------------- */
:root {
  /* surfaces */
  --bg:            #0A0F1A;                 /* page background */
  --panel:         #101C2E;                 /* secondary panel (Follow section) */
  --panel-alt:     rgba(30,144,255,0.03);   /* faint tinted card */

  /* accents */
  --accent:        #1E90FF;                 /* dodger blue — primary */
  --accent-hover:  #1a7de0;                 /* solid-button hover */
  --cyan:          #00D4FF;                 /* bright cyan — links / eyebrow */

  /* text (white at documented opacities) */
  --text:          #ffffff;
  --text-72:       rgba(255,255,255,0.72);
  --text-58:       rgba(255,255,255,0.58);
  --text-48:       rgba(255,255,255,0.48);
  --text-45:       rgba(255,255,255,0.45);
  --text-28:       rgba(255,255,255,0.28);
  --text-20:       rgba(255,255,255,0.20);

  /* blue hairline borders */
  --line-10:       rgba(30,144,255,0.10);
  --line-12:       rgba(30,144,255,0.12);
  --line-14:       rgba(30,144,255,0.14);   /* nav scrolled border */
  --line-18:       rgba(30,144,255,0.18);
  --line-30:       rgba(30,144,255,0.30);
  --line-35:       rgba(30,144,255,0.35);   /* Newsletter button border */
  --line-white-20: rgba(255,255,255,0.20);

  --nav-bg-scrolled: rgba(10,15,26,0.96);
  --selection:       rgba(30,144,255,0.28);

  /* type */
  --font-head: 'Orbitron', sans-serif;
  --font-body: 'Raleway', sans-serif;

  /* layout */
  --maxw:       1200px;
  --maxw-prose: 68ch;
  --pad-x:      52px;
  --nav-h:      71px;
}

/* ---- 2. Base / reset ----------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--selection); }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* visually-hidden skip link that appears on keyboard focus */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 18px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: 0.08em; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---- 3. Keyframes (motion gated for accessibility) ----------------------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp   { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes heroZoom { from { transform: scale(1.05); } to { transform: scale(1); } }
  @keyframes scrollPulse { 0%,100% { opacity: 0.25; } 50% { opacity: 0.6; } }
  .anim-up { animation: fadeUp 0.8s both; }
}

/* ---- 4. Layout ----------------------------------------------------------- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }

/* wrapper for content pages: clears the fixed nav */
.page { padding-top: var(--nav-h); }

.section { position: relative; padding-block: 96px; }
.section--panel {
  background: var(--panel);
  border-top: 1px solid var(--line-10);
  border-bottom: 1px solid var(--line-10);
}
.section__head { margin-bottom: 56px; }

/* ---- 5. Components ------------------------------------------------------- */

/* 5a. Eyebrow label + display headings */
.eyebrow {
  font-family: var(--font-body); font-size: 10px; font-weight: 600;
  letter-spacing: 0.38em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 14px;
}
.eyebrow--cyan { color: var(--cyan); }

.h1 {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(28px, 3.6vw, 58px); line-height: 1.08; letter-spacing: 0.02em;
  margin: 0; color: #fff; text-wrap: balance;
}
.h2 {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(22px, 2.6vw, 38px); letter-spacing: 0.03em;
  margin: 0; color: #fff;
}
.lead {
  font-family: var(--font-body); font-size: 17px; font-weight: 400; line-height: 1.7;
  color: var(--text-58); max-width: 560px; margin: 24px 0 0;
}

/* 5b. Nav (full-bleed, fixed, scroll-reactive) */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background 0.45s ease, border-color 0.45s ease;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav--scrolled { background: var(--nav-bg-scrolled); border-bottom-color: var(--line-14); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 18px var(--pad-x);
}
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.nav__brand img { height: 34px; width: auto; }
.wordmark { display: flex; align-items: baseline; gap: 4px; }
.wordmark__a { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; color: #fff; }
.wordmark__b { font-family: var(--font-body); font-weight: 500; font-size: 13px; letter-spacing: 0.16em; color: var(--accent); }

.nav__menu { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  font-family: var(--font-body); font-weight: 500; font-size: 13px; letter-spacing: 0.08em;
  color: var(--text-72); text-decoration: none; padding: 4px 0;
  border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.nav__link:hover { color: #fff; }
.nav__link--active { color: #fff; border-bottom-color: var(--accent); }

.nav__socials { display: flex; align-items: center; gap: 22px; }
.icon-link { display: flex; align-items: center; color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.2s; }
.icon-link:hover { color: #fff; }

/* 5c. Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.13em; text-transform: uppercase; text-decoration: none;
  padding: 16px 32px; border: 1px solid transparent; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn--solid  { background: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-hover); }
.btn--ghost  { border-color: var(--line-white-20); color: #fff; background: transparent; }
.btn--ghost:hover { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.05); }
.btn--outline {
  padding: 9px 20px; font-size: 11px; letter-spacing: 0.14em;
  border-color: var(--line-35); color: var(--accent); background: transparent;
}
.btn--outline:hover { background: rgba(30,144,255,0.08); border-color: rgba(30,144,255,0.6); }

/* 5d. Card grid (bordered 3-column) */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-12); }
.card {
  display: flex; flex-direction: column; gap: 22px;
  padding: 44px 36px; border-right: 1px solid var(--line-10);
}
.card:last-child { border-right: none; }
.card--tinted { background: var(--panel-alt); }
.card__icon {
  width: 42px; height: 42px; flex-shrink: 0; color: var(--accent);
  border: 1px solid var(--line-30); display: flex; align-items: center; justify-content: center;
}
.card__kicker { font-family: var(--font-body); font-size: 10px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.card__title { font-family: var(--font-head); font-weight: 700; font-size: 16px; letter-spacing: 0.02em; color: #fff; line-height: 1.35; margin: 0; }
.card__body  { font-family: var(--font-body); font-size: 15px; line-height: 1.68; color: var(--text-48); margin: 0; flex: 1; }
.card__link  {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cyan); text-decoration: none; transition: color 0.2s;
}
.card__link:hover { color: #fff; }

/* Wrapping project grid — tiles with their own hairline borders (robust to any count) */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.project-grid .card { border: 1px solid var(--line-12); background: var(--bg); }

/* 5e. Tag pill */
.tag {
  display: inline-block; font-family: var(--font-body); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan);
  border: 1px solid var(--line-18); padding: 4px 10px;
}

/* 5f. Blog listing — tiles with their own hairline borders (robust to any count) */
.post-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.post-card {
  display: flex; flex-direction: column; gap: 16px; padding: 38px 32px;
  border: 1px solid var(--line-12); background: var(--bg);
  text-decoration: none; transition: background 0.25s, border-color 0.25s;
}
.post-card:hover { background: var(--panel); border-color: var(--line-18); }
.post-card__meta { font-family: var(--font-body); font-size: 12px; letter-spacing: 0.06em; color: var(--text-45); }
.post-card__title { font-family: var(--font-head); font-weight: 700; font-size: 19px; line-height: 1.35; letter-spacing: 0.01em; color: #fff; margin: 0; }
.post-card__excerpt { font-family: var(--font-body); font-size: 15px; line-height: 1.68; color: var(--text-48); margin: 0; flex: 1; }
.post-card__more { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); transition: color 0.2s; }
.post-card:hover .post-card__more { color: #fff; }

/* 5g. Article (blog post) */
.article { padding-block: 64px 96px; }
.article__header { margin-bottom: 44px; }
.article__back {
  display: inline-block; font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan);
  text-decoration: none; margin-bottom: 28px; transition: color 0.2s;
}
.article__back:hover { color: #fff; }
.article__title {
  font-family: var(--font-head); font-weight: 900; font-size: clamp(26px, 3.4vw, 46px);
  line-height: 1.12; letter-spacing: 0.01em; color: #fff; margin: 18px 0 0; text-wrap: balance;
}
.article__meta { font-family: var(--font-body); font-size: 13px; letter-spacing: 0.06em; color: var(--text-45); margin-top: 18px; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* 5h. Prose (long-form body copy) */
.prose { max-width: var(--maxw-prose); margin-inline: auto; font-family: var(--font-body); font-size: 18px; line-height: 1.75; color: var(--text-72); }
.prose > * + * { margin-top: 1.15em; }
.prose h2, .prose h3 { font-family: var(--font-head); color: #fff; letter-spacing: 0.02em; line-height: 1.3; margin-top: 2em; scroll-margin-top: calc(var(--nav-h) + 16px); }
.prose h2 { font-size: 26px; }
.prose h3 { font-size: 20px; }
.prose a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #fff; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose strong { color: #fff; }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 20px; color: var(--text-58); font-style: italic; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: rgba(30,144,255,0.10); border: 1px solid var(--line-12); padding: 2px 6px; border-radius: 3px; }
.prose pre { background: var(--panel); border: 1px solid var(--line-12); padding: 20px; overflow-x: auto; border-radius: 4px; line-height: 1.6; }
.prose pre code { background: none; border: none; padding: 0; font-size: 14px; }
.prose img { margin-inline: auto; border: 1px solid var(--line-12); }
.prose figure { margin: 1.8em 0; }
.prose figcaption { font-size: 13px; color: var(--text-48); text-align: center; margin-top: 8px; }
.prose hr { border: none; border-top: 1px solid var(--line-12); margin: 2.4em 0; }

/* 5i. Follow row (shared social buttons) */
.follow { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.follow__btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-18); background: rgba(10,15,26,0.55); padding: 15px 24px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px; letter-spacing: 0.06em;
  color: var(--text-72); text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.follow__btn:hover { border-color: rgba(30,144,255,0.5); color: #fff; background: rgba(30,144,255,0.06); }

/* 5j. Signup form + contact */
.signup { max-width: 520px; margin-inline: auto; }
.signup__form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 220px; text-align: left; }
.field__label { font-family: var(--font-body); font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-48); }
.input {
  font-family: var(--font-body); font-size: 15px; color: #fff;
  background: rgba(10,15,26,0.55); border: 1px solid var(--line-18);
  padding: 15px 18px; width: 100%; transition: border-color 0.2s;
}
.input::placeholder { color: rgba(255,255,255,0.3); }
.input:focus { outline: none; border-color: var(--accent); }
.signup__form .btn { flex-shrink: 0; }
.form-note { flex-basis: 100%; margin: 4px 0 0; font-family: var(--font-body); font-size: 12px; color: var(--text-45); text-align: left; }
.contact-links { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.contact-links a { color: var(--cyan); text-decoration: none; }
.contact-links a:hover { color: #fff; }

/* 5k. Footer */
.footer {
  background: var(--bg); padding: 36px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer__brand img { height: 26px; width: auto; opacity: 0.5; }
.footer__brand span { font-family: var(--font-body); font-size: 13px; letter-spacing: 0.07em; color: var(--text-28); }
.footer__copy { font-family: var(--font-body); font-size: 12px; letter-spacing: 0.06em; color: var(--text-20); }

/* utility */
.center { text-align: center; }
.stack-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }

/* ---- 6. Responsive ------------------------------------------------------- */
@media (max-width: 860px) {
  .card-grid { grid-template-columns: 1fr; }
  .card { border-right: none; border-bottom: 1px solid var(--line-10); }
  .card:last-child { border-bottom: none; }
}
@media (max-width: 760px) {
  :root { --pad-x: 22px; }
  .section { padding-block: 68px; }
  .nav__inner { gap: 14px; }
  .nav__menu { gap: 18px; }
  .nav__socials .icon-link { display: none; }   /* keep text links + Newsletter button; socials live in footer/follow */
}
@media (max-width: 480px) {
  .wordmark { display: none; }                   /* logo mark alone on very narrow screens */
  .nav__menu { gap: 14px; }
  .nav__link { font-size: 12px; }
}
