/* =========================================================
   Portfolio — Industrial Technical Aesthetic
   Monospace-forward, high contrast, engineering feel
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Syne:wght@400;700;800&display=swap');

/* ---------------------------------------------------------
   Design Tokens
   --------------------------------------------------------- */
:root {
  --bg:           #0c0c0e;
  --bg-elevated:  #131317;
  --bg-card:      #18181d;
  --border:       #2a2a35;
  --border-focus: #4a90e2;

  --text-primary:   #e8e8f0;
  --text-secondary: #7a7a9a;
  --text-muted:     #44445a;

  --accent:       #4a90e2;
  --accent-dim:   rgba(74, 144, 226, 0.12);
  --accent-glow:  rgba(74, 144, 226, 0.25);

  --status-complete:    #2ecc71;
  --status-in-progress: #f39c12;

  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --font-display: 'Syne', sans-serif;

  --radius:    4px;
  --radius-lg: 8px;
  --gap:       24px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------
   Noise texture overlay
   --------------------------------------------------------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */
.site-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gap);
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.site-header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
}

.site-title span {
  color: var(--accent);
}

.header-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.header-meta .prompt {
  color: var(--accent);
}

/* ---------------------------------------------------------
   Project Grid
   --------------------------------------------------------- */
.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
  margin-bottom: 64px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--accent-glow);
}

.project-card:hover::before { opacity: 1; }

.card-thumb {
  height: 6px;
  width: 100%;
}

.card-body {
  padding: 20px 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.status-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.complete {
  color: var(--status-complete);
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.status-badge.in-progress {
  color: var(--status-in-progress);
  background: rgba(243, 156, 18, 0.1);
  border: 1px solid rgba(243, 156, 18, 0.2);
}

.card-summary {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-link-hint {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

.project-card:hover .card-link-hint { gap: 8px; }

/* ---------------------------------------------------------
   Project Detail Page
   --------------------------------------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 40px;
  transition: color var(--transition);
}

.back-link:hover { color: var(--accent); }

.project-hero {
  margin-bottom: 48px;
}

.project-hero-bar {
  height: 3px;
  width: 48px;
  border-radius: 2px;
  margin-bottom: 24px;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.meta-sep { color: var(--border); }

/* ---------------------------------------------------------
   Prose (Markdown rendered content)
   --------------------------------------------------------- */
.prose {
  max-width: 720px;
}

.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  margin: 2em 0 0.75em;
}

.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.1rem; }

.prose p { color: var(--text-secondary); margin-bottom: 1.2em; }

.prose ul, .prose ol {
  color: var(--text-secondary);
  margin: 0 0 1.2em 1.5em;
}

.prose li { margin-bottom: 0.4em; }

.prose strong { color: var(--text-primary); font-weight: 500; }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 6px;
  border-radius: var(--radius);
}

.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  position: relative;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.7;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.prose a { border-bottom: 1px solid var(--accent-glow); padding-bottom: 1px; }
.prose a:hover { border-color: var(--accent); }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  color: var(--text-muted);
  font-size: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   Animations
   --------------------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-card {
  animation: fadeUp 0.4s ease both;
}

.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.25s; }
.project-card:nth-child(6) { animation-delay: 0.3s; }

.project-hero { animation: fadeUp 0.4s ease 0.05s both; }
.prose        { animation: fadeUp 0.4s ease 0.15s both; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 600px) {
  .project-grid { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
}
