/* ===================================================
   Greg Blacketter — Portfolio Showcase
   Dark theme · Categorized grid · Terminal aesthetic
   Space Grotesk + DM Sans + JetBrains Mono
   =================================================== */

/* --- Custom Properties --- */
:root {
  --bg:          #3e5671;
  --bg-card:     #4a6685;
  --bg-card-hover: #567494;
  --bg-alt:      #445e78;
  --accent:      #0fbcbf;
  --accent-glow: rgba(15, 188, 191, 0.3);
  --accent-2:    #e8a838;
  --accent-2-glow: rgba(232, 168, 56, 0.3);
  --accent-3:    #a78bfa;
  --accent-3-glow: rgba(167, 139, 250, 0.3);
  --ink:         #e4ecf0;
  --ink-muted:   rgba(228, 236, 240, 0.65);
  --ink-heading: #f5f9fb;
  --border:      rgba(255, 255, 255, 0.15);
  --radius:      12px;
  --radius-sm:   6px;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --transition:  0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Subtle CRT scanlines overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0%   { background-position: 0 0; }
  100% { background-position: 0 100px; }
}

/* Ambient glow at top of page */
body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: 50%;
  width: 120vw;
  height: 80vh;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(15, 188, 191, 0.08) 0%,
    rgba(232, 168, 56, 0.04) 40%,
    transparent 70%
  );
  animation: ambientPulse 8s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-2); }

/* --- Scroll Reveal with staggered delays --- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance for cards in the grid */
.card.reveal { transition-delay: var(--reveal-delay, 0s); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card.reveal { transition-delay: 0s; }
  body::before, body::after { animation: none; }
  .hero__bg::before { animation: none; }
  .hero__name { animation: none; }
  .hero__cta { animation: none; }
  .focus-card { animation: none; }
  .focus-card.reveal { transition-delay: 0s; }
  .card::before { animation: none; opacity: 0.5; }
  .section__heading::after { animation: none; }
  .badge--progress::after { animation: none; }
  .category-label__cursor { animation: none; }
}

/* ===================================================
   HERO — left 1/3 identity, right 2/3 particles
   =================================================== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 2fr;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    #4a6e8a 0%,
    var(--bg) 30%,
    #3d6655 55%,
    #5a4a7a 75%,
    var(--bg) 100%
  );
  background-size: 100% 100%;
  z-index: 0;
}

/* Conic gradient orbit overlay in hero */
.hero__bg::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 200deg,
    rgba(15, 188, 191, 0.08),
    rgba(232, 168, 56, 0.06),
    rgba(167, 139, 250, 0.06),
    rgba(15, 188, 191, 0.08)
  );
}

.hero__left {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2rem 2rem clamp(1.5rem, 4vw, 4rem);
}

.hero__right {
  position: relative;
  z-index: 1;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.2rem;
  background: linear-gradient(135deg, var(--ink-heading) 0%, var(--accent) 50%, var(--accent-2) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameShimmer 6s ease-in-out infinite alternate;
}

@keyframes nameShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hero__location {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.hero__tagline {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 380px;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: rgba(15, 188, 191, 0.15);
  border: 1px solid rgba(15, 188, 191, 0.4);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  width: fit-content;
  animation: bob 3.5s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.hero__cta:hover {
  background: rgba(15, 188, 191, 0.28);
  border-color: var(--accent);
  box-shadow: 0 0 28px var(--accent-glow), 0 0 8px rgba(15, 188, 191, 0.15);
  color: var(--accent);
  transform: translateY(-3px) scale(1.03);
  animation-play-state: paused;
}

.hero__github-icon { flex-shrink: 0; }

/* ===================================================
   CURRENT FOCUS (inside hero__right)
   =================================================== */
.hero__focus {
  position: relative;
  z-index: 2;
  padding: 2rem 2rem 2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.hero__focus-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink-heading);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.focus__grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.focus-card {
  background: rgba(74, 102, 133, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent-2);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  animation: drift var(--drift-speed, 6s) ease-in-out infinite alternate;
  animation-delay: var(--drift-delay, 0s);
}

.focus-card:nth-child(1) { --drift-speed: 5.5s; --drift-delay: 0s; }
.focus-card:nth-child(2) { --drift-speed: 6.5s; --drift-delay: 1.2s; }
.focus-card:nth-child(3) { --drift-speed: 7s; --drift-delay: 2.4s; }

@keyframes drift {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.focus-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), 0 0 16px rgba(232, 168, 56, 0.15);
}

.focus-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-heading);
  margin-bottom: 0.25rem;
}

.focus-card__desc {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.5;
}

/* Staggered entrance for focus cards */
.focus-card.reveal:nth-child(1) { transition-delay: 0.1s; }
.focus-card.reveal:nth-child(2) { transition-delay: 0.25s; }
.focus-card.reveal:nth-child(3) { transition-delay: 0.4s; }

/* ===================================================
   SECTIONS (shared)
   =================================================== */
.section {
  padding: 4rem 2rem;
}

.section--alt {
  background: var(--bg-alt);
}

.section__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section__inner--wide {
  max-width: 1280px;
}

.section__heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.8vw, 2.5rem);
  font-weight: 600;
  color: var(--ink-heading);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section__heading::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  border-radius: 2px;
  margin-top: 0.5rem;
  animation: gradientSlide 3s ease-in-out infinite alternate;
}

@keyframes gradientSlide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ===================================================
   CATEGORIZED PROJECT GRID
   3 cols × 8 rows explicit grid
   =================================================== */
.projects-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(7, auto);
  gap: 1.25rem;
}

/* ===================================================
   CATEGORY LABELS — terminal prompt style
   =================================================== */
.category-label {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cat-accent, var(--accent));
  padding: 0;
  align-self: end;
  background: color-mix(in srgb, var(--cat-accent, var(--accent)) 12%, var(--bg));
  border-radius: var(--radius-sm);
}

.category-label__prompt {
  opacity: 0.8;
  padding: 0.45rem 0.5rem 0.45rem 0.75rem;
}

.category-label__text {
  padding: 0.45rem 0.5rem;
}

.category-label__cursor {
  padding-right: 0.5rem;
}

.category-label__line {
  flex: 1;
  height: 0;
  border-top: 2px solid var(--cat-accent, var(--accent));
  opacity: 0.2;
  margin-right: 0.75rem;
}

.category-label__cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--cat-accent, var(--accent));
  opacity: 0.6;
  animation: cursorBlink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 0.25rem;
}

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

/* ===================================================
   PROJECT CARDS
   =================================================== */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cat-accent, var(--accent));
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color var(--transition), background var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 24px var(--cat-glow, var(--accent-glow));
  border-color: var(--border);
  border-left-color: var(--cat-accent, var(--accent));
  background: var(--bg-card-hover);
}

/* Subtle glow pulse on card left border */
.card::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--cat-accent, var(--accent));
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0.5;
  animation: borderPulse 3s ease-in-out infinite alternate;
  animation-delay: var(--pulse-delay, 0s);
}

@keyframes borderPulse {
  0%   { opacity: 0.3; box-shadow: 0 0 4px var(--cat-glow, var(--accent-glow)); }
  100% { opacity: 0.8; box-shadow: 0 0 12px var(--cat-glow, var(--accent-glow)); }
}

/* Category accent tints on cards */
.card[data-category="dev-qa"] {
  --cat-accent: #0fbcbf;
  --cat-glow: rgba(15, 188, 191, 0.2);
  background: linear-gradient(135deg, rgba(15, 188, 191, 0.08) 0%, var(--bg-card) 60%);
}
.card[data-category="tools"] {
  --cat-accent: #e8a838;
  --cat-glow: rgba(232, 168, 56, 0.2);
  background: linear-gradient(135deg, rgba(232, 168, 56, 0.08) 0%, var(--bg-card) 60%);
}
.card[data-category="fun"] {
  --cat-accent: #a78bfa;
  --cat-glow: rgba(167, 139, 250, 0.2);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08) 0%, var(--bg-card) 60%);
}

.card[data-category="dev-qa"]:hover { background: linear-gradient(135deg, rgba(15, 188, 191, 0.14) 0%, var(--bg-card-hover) 60%); }
.card[data-category="tools"]:hover { background: linear-gradient(135deg, rgba(232, 168, 56, 0.14) 0%, var(--bg-card-hover) 60%); }
.card[data-category="fun"]:hover { background: linear-gradient(135deg, rgba(167, 139, 250, 0.14) 0%, var(--bg-card-hover) 60%); }

/* --- Featured card modifier --- */
.card--featured {
  border-left-width: 5px;
}

.card--featured::before {
  width: 5px;
}

/* --- Window dots (top-right decorative) --- */
.card__window-dots {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 4px;
  opacity: 0.15;
  z-index: 2;
}

.card__window-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

/* --- Repo slug (monospace label above title) --- */
.card__slug {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--cat-accent, var(--accent));
  opacity: 0.6;
  margin-bottom: 0.25rem;
  letter-spacing: 0.04em;
}

/* Card illustration image */
.card__image {
  margin: -1.75rem -1.75rem 1rem -1.75rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: #141e2a;
  border-bottom: 1px solid var(--border);
}

.card__image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}

.card:hover .card__image img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink-heading);
  margin-bottom: 0.5rem;
}

/* Featured card gets larger title */
.card--featured .card__title {
  font-size: 1.6rem;
}

.card__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(232, 168, 56, 0.15);
  color: var(--accent-2);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Pulsing badge for in-progress items */
.badge--progress {
  position: relative;
  padding-right: 1.2rem;
}

.badge--progress::after {
  content: '';
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(232, 168, 56, 0.4); }
  50%      { opacity: 0.4; box-shadow: 0 0 6px 2px rgba(232, 168, 56, 0.2); }
}

.card__desc {
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 0.5rem;
  flex: 1;
}

.card__impact {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-accent, var(--accent)) 12%, transparent);
  color: var(--cat-accent, var(--accent));
  border: 1px solid color-mix(in srgb, var(--cat-accent, var(--accent)) 22%, transparent);
  transition: all var(--transition);
}

.tag:hover {
  background: color-mix(in srgb, var(--cat-accent, var(--accent)) 20%, transparent);
  box-shadow: 0 0 8px var(--cat-glow, var(--accent-glow));
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-2);
  margin-top: auto;
  transition: color var(--transition);
}
.card__link:hover { color: var(--accent); }
.card__link-arrow { transition: transform var(--transition); }
.card__link:hover .card__link-arrow { transform: translateX(3px); }

.card__link--disabled {
  color: var(--ink-muted);
  cursor: default;
  pointer-events: none;
}

/* ===================================================
   CATEGORY ZONE BORDERS (decorative dashed outlines)
   =================================================== */
.category-zone {
  position: relative;
  display: contents;
}

/* ===================================================
   DEMO PLACEHOLDER
   =================================================== */
.demo__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.demo__icon {
  color: var(--ink-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.demo__text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--ink-muted);
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
}

.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--ink-muted);
}

.footer__link { color: var(--ink-muted); font-weight: 500; }
.footer__link:hover { color: var(--accent); }
.footer__sep { opacity: 0.4; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__left { padding: 2rem 1.5rem 1rem; }
  .hero__focus { padding: 0 1.5rem 2rem; }
  .section { padding: 3rem 1.5rem; }

  .projects-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  /* Reset all explicit grid placements on mobile */
  .projects-layout > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}

@media (max-width: 480px) {
  .hero__left { padding: 1.5rem 1rem 0.75rem; }
  .section { padding: 2.5rem 1rem; }
  .hero__cta { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
  .card { padding: 1.25rem; }
  .card__image { margin: -1.25rem -1.25rem 0.75rem -1.25rem; }
}
