/* ============================================================
   michaelpierce.com — Dark Sci-Fi Landing Page
   Pure CSS, no frameworks
   ============================================================ */

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

:root {
  --bg-base:       #0a0a0f;
  --bg-surface:    #0f0f1a;
  --bg-card:       #11111e;
  --accent-cyan:   #ff9500;
  --accent-amber:  #00ffd5;
  --text-primary:  #e8e8f0;
  --text-muted:    #6b6b8a;
  --text-dim:      #3a3a55;
  --border-subtle: rgba(255, 149, 0, 0.12);
  --border-glow:   rgba(255, 149, 0, 0.45);
  --glow-cyan:     0 0 8px rgba(255, 149, 0, 0.6),
                   0 0 20px rgba(255, 149, 0, 0.3),
                   0 0 40px rgba(255, 149, 0, 0.1);
  --glow-amber:    0 0 8px rgba(0, 255, 213, 0.5),
                   0 0 20px rgba(0, 255, 213, 0.2);
  --font-mono:     Menlo, Monaco, Consolas, "Courier New", monospace;
  --font-sans:     -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  /* Star-field dots base pattern — JS will inject individual stars */
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 45%, rgba(255,255,255,0.10) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 20%, rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 60%, rgba(255,255,255,0.08) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 35%, rgba(255,255,255,0.14) 0%, transparent 100%);
}

/* ── Scan-line overlay ────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

/* ── Subtle grid/matrix background pattern ────────────────── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 255, 213, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 213, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── CRT flicker keyframe ─────────────────────────────────── */
@keyframes crtFlicker {
  0%   { opacity: 1; }
  92%  { opacity: 1; }
  93%  { opacity: 0.96; }
  94%  { opacity: 1; }
  96%  { opacity: 0.98; }
  97%  { opacity: 1; }
  99%  { opacity: 0.97; }
  100% { opacity: 1; }
}

/* ── Star twinkle (used by JS-generated stars) ────────────── */
@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50%       { opacity: 0.9; }
}

@keyframes twinkleSlow {
  0%, 100% { opacity: 0.05; }
  50%       { opacity: 0.6; }
}

@keyframes twinkleFast {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 1; }
}

/* ── RV drive animation ───────────────────────────────────── */
@keyframes driveRV {
  0%   { transform: translateX(-660px); }
  100% { transform: translateX(calc(100vw + 60px)); }
}

/* ── Typing cursor blink ──────────────────────────────────── */
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Section fade-in on scroll ────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
  animation: crtFlicker 8s infinite;
}

/* Star container (populated by JS) */
#star-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #ffffff;
  animation: twinkle linear infinite;
}

/* Hero content wrapper */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 900px;
  width: 100%;
}

/* ── Site title ───────────────────────────────────────────── */
.hero__title {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 5.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

/* Decorative bracket accents */
.hero__title::before {
  content: "[ ";
  color: var(--text-dim);
  font-size: 0.6em;
  vertical-align: middle;
}

.hero__title::after {
  content: " ]";
  color: var(--text-dim);
  font-size: 0.6em;
  vertical-align: middle;
}

/* ── Subtitle / typing target ─────────────────────────────── */
.hero__subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 2.2vw, 1.15rem);
  color: var(--accent-amber);
  letter-spacing: 0.12em;
  margin-bottom: 2.5rem;
  min-height: 1.6em;
}

.hero__subtitle .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent-amber);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.9s step-end infinite;
}

/* ── Decorative divider ───────────────────────────────────── */
.hero__divider {
  width: 180px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-cyan),
    transparent
  );
  margin: 0 auto 2rem;
  box-shadow: var(--glow-cyan);
}

/* ── Hero tagline ─────────────────────────────────────────── */
.hero__tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

/* ── Scroll cue ───────────────────────────────────────────── */
.hero__scroll-cue {
  position: absolute;
  bottom: 140px;           /* above RV strip */
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}

.hero__scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--accent-cyan), transparent);
}

/* ============================================================
   RV ANIMATION STRIP
   ============================================================ */
.rv-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

/* Road/ground line */
.rv-strip__road {
  position: absolute;
  bottom: 18px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--text-dim) 10%,
    var(--text-dim) 90%,
    transparent 100%
  );
}

/* Dashed center line */
.rv-strip__road::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 255, 213, 0.25) 0px,
    rgba(0, 255, 213, 0.25) 20px,
    transparent 20px,
    transparent 44px
  );
}

/* The RV image */
.rv-strip__rv {
  position: absolute;
  bottom: 19px;
  left: 0;
  height: 60px;
  width: auto;
  filter:
    drop-shadow(0 0 6px rgba(0, 255, 213, 0.7))
    drop-shadow(0 0 14px rgba(0, 255, 213, 0.35))
    brightness(0.9) sepia(0.3) hue-rotate(150deg) saturate(1.8);
  animation: driveRV 18s linear infinite;
}

/* ============================================================
   BIO SECTION
   ============================================================ */
.bio {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  animation: fadeInUp 0.8s ease both;
  animation-delay: 0.2s;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-subtle), transparent);
}

.bio__heading {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}

.bio__text {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.bio__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.bio__text a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 213, 0.3);
  transition: border-color 0.2s, text-shadow 0.2s;
}

.bio__text a:hover {
  border-color: var(--accent-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 213, 0.5);
}

/* Interest tags */
.bio__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.bio__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: border-color 0.2s, color 0.2s, text-shadow 0.2s;
}

.bio__tag:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  text-shadow: 0 0 6px rgba(0, 255, 213, 0.4);
}

/* ============================================================
   GALLERY PREVIEW SECTION
   ============================================================ */
.gallery {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

/* ── Gallery card ─────────────────────────────────────────── */
.gallery-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.gallery-card:hover {
  border-color: var(--border-glow);
  box-shadow:
    0 0 0 1px rgba(0, 255, 213, 0.15),
    0 0 20px rgba(0, 255, 213, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(-3px);
}

/* Cover photo (replaces placeholder once real images are wired up) */
.gallery-card__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.75) saturate(0.8);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .gallery-card__cover {
  filter: brightness(0.9) saturate(1.1);
  transform: scale(1.04);
}

/* Placeholder shimmer */
.gallery-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    var(--bg-card) 0%,
    rgba(0, 255, 213, 0.03) 50%,
    var(--bg-card) 100%
  );
}

.gallery-card__placeholder .icon {
  font-size: 2rem;
  opacity: 0.25;
}

.gallery-card__placeholder .label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Corner accent marks on cards */
.gallery-card::before,
.gallery-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  z-index: 2;
  pointer-events: none;
  transition: border-color 0.3s;
}

.gallery-card::before {
  top: 6px;
  left: 6px;
  border-top: 1px solid var(--text-dim);
  border-left: 1px solid var(--text-dim);
}

.gallery-card::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 1px solid var(--text-dim);
  border-right: 1px solid var(--text-dim);
}

.gallery-card:hover::before {
  border-color: var(--accent-cyan);
}

.gallery-card:hover::after {
  border-color: var(--accent-cyan);
}

/* Card label bar */
.gallery-card__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(to top, rgba(10,10,15,0.9) 0%, transparent 100%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.gallery-card:hover .gallery-card__bar {
  transform: translateY(0);
}

.gallery-card__title {
  color: var(--text-primary);
  font-size: 0.75rem;
  margin-bottom: 2px;
}

.gallery-card__desc {
  color: var(--text-dim);
  font-size: 0.6rem;
}

/* ============================================================
   ARTICLES SECTION
   ============================================================ */
.articles {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.articles__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.article-link {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  text-decoration: none;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.article-link:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(255, 149, 0, 0.15);
  transform: translateX(4px);
}

.article-link__title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.article-link:hover .article-link__title {
  color: var(--accent-cyan);
}

.article-link__desc {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   ARTICLE PAGE LAYOUT
   ============================================================ */
.article-page {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.article-page__back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

.article-page__back:hover {
  color: var(--accent-cyan);
}

.article-page__title {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
  letter-spacing: 0.05em;
}

.article-page__subtitle {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.article-page__image {
  width: 100%;
  max-width: 620px;
  display: block;
  margin: 0 auto 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
}

.article-page__text {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.article-page__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-page__attribution {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

/* ── Garage page vehicle list ──────────────────────────────── */
.vehicle-section__heading {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.vehicle-list {
  list-style: none;
  padding: 0;
}

.vehicle-list li {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 149, 0, 0.06);
}

.vehicle-list li a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 149, 0, 0.2);
  transition: color 0.2s, border-color 0.2s;
}

.vehicle-list li a:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.vehicle-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-block;
  min-width: 100px;
  margin-right: 0.75rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: 2rem;
  text-align: center;
}

.footer__inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.footer__sig {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  opacity: 0.5;
}

.footer__sig span {
  color: var(--accent-cyan);
  opacity: 1;
}

/* ============================================================
   UTILITY / SHARED
   ============================================================ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Horizontal rule / separator */
.hr-glow {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-subtle) 20%,
    var(--border-subtle) 80%,
    transparent
  );
  border: none;
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .hero__title {
    letter-spacing: 0.08em;
  }

  .hero__title::before,
  .hero__title::after {
    display: none;
  }

  .hero__subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.07em;
  }

  .bio {
    padding: 4rem 1.25rem 3rem;
  }

  .gallery {
    padding: 2rem 1.25rem 4rem;
  }

  .rv-strip__rv {
    height: 44px;
  }

  .rv-strip {
    height: 72px;
  }

  .hero__scroll-cue {
    bottom: 100px;
  }
}

@media (max-width: 400px) {
  .gallery__grid {
    grid-template-columns: 1fr;
  }
}
