/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #08090b;
  --bg-raised: #111318;
  --bg-raised-hover: #16181f;
  --fg: #f4f4f1;
  --muted: #8a8f98;
  --border: #24262c;
  --border-strong: #34363e;

  --accent: #ff2e63;
  --accent-1: #ffd400;
  --accent-2: #22d3ee;
  --accent-3: #22c55e;
  --accent-4: #ff8a1e;
  --accent-5: #b26bff;
  --cta: #ff2e63;          /* primary button background — independent of --accent on purpose,
                               so recoloring a status badge never breaks button contrast */
  --ok: #22c55e;           /* status-dot green — "systems operational" */

  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --max-width: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.tagline {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  gap: 2rem;
}
.nav a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--fg); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--fg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   WORK / PROJECT GRID
   ============================================ */
.work {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 6rem) var(--gutter);
}

.section-head {
  margin-bottom: 2.5rem;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
}
.section-sub {
  color: var(--muted);
  margin-top: 0.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transform: translateY(16px);
  transition: transform 0.5s ease, opacity 0.5s ease, border-color 0.15s ease, background 0.15s ease;
}
.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-raised-hover);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-version {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.card-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border: 1px solid currentColor;
  color: var(--muted); /* fallback for any type not listed below */
}
.card-status[data-type="demo"] { color: var(--accent); }
.card-status[data-type="prototype"] { color: var(--accent-1); }
.card-status[data-type="game"] { color: var(--accent-2); }
.card-status[data-type="hardware"] { color: var(--accent-3); }
.card-status[data-type="tool"] { color: var(--accent-4); }
.card-status[data-type="archived"] { color: var(--muted); }

.card-name {
  font-size: 1.4rem;
  font-weight: 700;
}

.card-tagline {
  color: var(--muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
}

.card-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.15s ease, color 0.15s ease;
}
.card:hover .card-link {
  color: var(--accent);
  gap: 0.6rem;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
}
.about-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 6rem) var(--gutter);
}
.about-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 1rem;
}
.about h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  max-width: 20ch;
}
.about-copy {
  margin-top: 1.25rem;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
}
.about-copy p + p {
  margin-top: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  font-family: var(--font-mono);
  font-weight: 600;
}
.footer-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-links a:hover { color: var(--fg); }
.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
  width: 100%;
  order: 3;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

/* ============================================
   PROJECT DETAIL PAGE
   ============================================ */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 0;
}
.breadcrumb a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.breadcrumb a:hover { color: var(--fg); }

.project-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) clamp(2.5rem, 6vh, 4rem);
}

.project-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 1.25rem;
}

.project-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.badge-row .card-version { font-size: 0.85rem; }

.project-tagline {
  margin-top: 1.5rem;
  max-width: 100ch;
  font-size: 1.15rem;
  color: var(--muted);
}

.btn-row {
  display: flex;
  gap: 1rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--border-strong);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  display: inline-block;
}
.btn-primary {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  color: var(--accent-2);
  border-color: var(--accent-2);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--bg-raised);
}

.shot {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.shot-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--border-strong);
  display: block;
}

.shot-placeholder {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.shot-placeholder-inner {
  height: clamp(220px, 40vw, 420px);
  border: 1px dashed var(--border-strong);
  background:
    repeating-linear-gradient(135deg, var(--bg-raised), var(--bg-raised) 10px, var(--bg) 10px, var(--bg) 20px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shot-placeholder-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 0.6rem 1rem;
  text-transform: uppercase;
}

.detail-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) var(--gutter);
  border-top: 1px solid var(--border);
}
.detail-section h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}
.detail-copy {
  color: var(--muted);
}
.detail-copy p {
  max-width: 60ch;
}
.detail-copy p + p {
  margin-top: 1rem;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.feature-list li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--muted);
}
.feature-list li::before {
  content: "*";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}
.feature-list strong {
  color: var(--fg);
  font-weight: 600;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag-list .card-tag {
  color: var(--accent-2);
  border-color: var(--accent-2);
  transition: background 0.15s ease, color 0.15s ease;
}
a.card-tag:hover {
  background: var(--accent-2);
  color: var(--bg);
}

.placeholder-note {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--gutter) 0;
}
.placeholder-note p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  padding: 0.9rem 1.1rem;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .tagline { display: none; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav.is-open {
    max-height: 240px;
  }
  .nav a {
    padding: 1rem var(--gutter);
    border-top: 1px solid var(--border);
  }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}
