/* --- 1. GLOBAL VARIABLES & RESET --- */
:root {
  --ink: #0c1a22;
  --ink-soft: #11242e;
  --foam: #f4f6f5;
  --mist: #9fb3bb;
  --hairline: rgba(244,246,245,0.12);
  --aegean: #5b9bb5;
  --sand: #e3c08f;
  --sand-ink: #1c130a;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(120% 140% at 85% -10%, var(--ink-soft) 0%, var(--ink) 55%);
  background-attachment: fixed; /* Prevents background recalculation on scroll */
  color: var(--foam);
  min-height: 100vh;
}

/* --- 2. HERO PAGE STYLES (index.html) --- */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 32px;
}

.meander {
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 520px;
  height: 360px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M0 36 L0 12 L12 12 L12 36 L24 36 L24 12 L36 12 L36 36 L48 36' fill='none' stroke='%239fb3bb' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.07;
  pointer-events: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 56px;
}

.wordmark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--mist);
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--mist);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.headline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 380;
  font-size: clamp(2.1rem, 5.6vw, 3.6rem);
  line-height: 1.18;
  max-width: 600px;
}

.headline .accent {
  color: var(--sand);
}

.signature-wrap {
  width: clamp(200px, 32vw, 320px);
  margin: 22px 0 40px;
}

.signature-line {
  fill: none;
  stroke: var(--aegean);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: draw 1.5s ease 0.35s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.spec-row {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
}

.spec-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--mist);
}

.spec-divider {
  width: 1px;
  background: var(--hairline);
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 13px 22px;
  border-radius: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--sand);
  color: var(--sand-ink);
}

.btn-secondary {
  border: 1px solid var(--hairline);
  color: var(--foam);
  background: transparent;
}


/* --- 3. PROJECTS PAGE STYLES (projects.html) --- */

#projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.project-card {
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  /* Optimized background: Replaced heavy backdrop-filter with a solid dark color */
  background: var(--ink-soft); 
  display: flex;
  flex-direction: column;
  opacity: 0; /* Hidden initially for fade-in animation */
  animation: fadeUp 0.6s ease-out forwards;
  
  /* Hardware acceleration for smooth hover performance */
  will-change: transform, box-shadow;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--aegean);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4); /* Slightly darker shadow for contrast */
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 24px;
  border: 1px solid var(--hairline);
  background: #000; /* Fallback color */
}

.project-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--sand);
  margin-bottom: 12px;
}

.project-desc {
  color: var(--foam);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.tech-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tech-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(159, 179, 187, 0.1);
  color: var(--mist);
  border: 1px solid rgba(159, 179, 187, 0.15);
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 20px;
}

.btn-link {
  color: var(--aegean);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  transition: color 0.2s ease;
}

.btn-link:hover {
  color: var(--sand);
}

/* --- 4. MOBILE RESPONSIVENESS --- */
/* This MUST stay at the very bottom of the document to work correctly! */
@media (max-width: 520px) {
  .hero-inner { 
    padding: 48px 24px; 
  }

  .cta-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
  
  #projects-container {
    grid-template-columns: 1fr; /* Forces exactly 1 column on mobile */
    gap: 24px;
  }
}