/* ===== Variables ===== */
:root {
  --bg: #faf9f7;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #ff6b35;
  --accent-2: #4361ee;
  --accent-3: #2ec4b6;
  --border: #e5e2dd;
  --card-bg: #fff;
  --font-main: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain overlay */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  z-index: 1000;
  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)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: white;
}

/* ===== Container ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 5rem;
  border-bottom: 1px solid var(--border);
  min-height: 70vh;
}

.hero-text {
  display: flex;
  flex-direction: column;
}

.hero-photo {
  position: relative;
  height: 100%;
  min-height: 400px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.hero-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255,107,53,0.1) 0%, 
    rgba(67,97,238,0.1) 50%, 
    rgba(46,196,182,0.1) 100%
  );
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero-photo:hover::before {
  opacity: 1;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-photo:hover img {
  transform: scale(1.03);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8c42 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
}

.badge-alt {
  background: linear-gradient(135deg, var(--accent-2) 0%, #6b7fd4 100%);
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, #444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 1.5rem 0 2rem;
  line-height: 1.7;
}

.hero-desc a {
  color: var(--accent);
  font-weight: 600;
  position: relative;
}

.hero-desc a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.hero-desc a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.link-btn:hover {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.link-icon {
  font-size: 1rem;
}

/* ===== Section Label ===== */
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Projects ===== */
.projects {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: transparent;
}

.project-card:hover .project-arrow {
  transform: translateX(4px);
}

.project-card:hover .shape {
  animation-play-state: running;
}

.project-card:hover .pin {
  animation-play-state: running;
}

/* Project Visuals */
.project-visual {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.visual-floorplan {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.visual-bench {
  background: linear-gradient(135deg, var(--accent-3) 0%, #1a936f 100%);
}

.visual-screenshot {
  background: var(--bg);
}

.visual-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .visual-screenshot img {
  transform: scale(1.05);
}

/* Floating shapes for floor plan */
.floating-shapes {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape {
  position: absolute;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  animation: float 3s ease-in-out infinite paused;
}

.shape-1 {
  width: 60px;
  height: 40px;
  top: 30%;
  left: 20%;
  animation-delay: 0s;
}

.shape-2 {
  width: 40px;
  height: 40px;
  top: 50%;
  left: 45%;
  border-radius: 50%;
  animation-delay: 0.5s;
}

.shape-3 {
  width: 50px;
  height: 30px;
  top: 35%;
  right: 20%;
  animation-delay: 1s;
}

.shape-4 {
  width: 45px;
  height: 45px;
  bottom: 25%;
  left: 35%;
  animation-delay: 1.5s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

/* Bench visual */
.bench-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  color: rgba(255,255,255,0.9);
}

.pin {
  position: absolute;
  font-size: 1.5rem;
  animation: bounce 1s ease-in-out infinite paused;
}

.pin-1 {
  top: 25%;
  left: 25%;
  animation-delay: 0s;
}

.pin-2 {
  top: 40%;
  right: 30%;
  animation-delay: 0.3s;
}

.pin-3 {
  bottom: 30%;
  left: 40%;
  animation-delay: 0.6s;
}

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

/* Project Info */
.project-info {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.project-info p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-arrow {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

/* ===== Experience ===== */
.experience {
  padding: 4rem 0;
}

.exp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.exp-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.exp-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.exp-company {
  font-weight: 700;
  font-size: 0.9rem;
}

.exp-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border-radius: 4px;
}

.exp-role {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.exp-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-left p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-award {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.footer-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  transition: all 0.3s ease;
  opacity: 0.8;
}

.footer-photo:hover {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--accent);
  opacity: 1;
}

.footer-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(30%);
  transition: filter 0.3s ease;
}

.footer-photo:hover img {
  filter: grayscale(0%);
}

.footer-right a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--accent);
}

/* ===== Project Page Styles ===== */
.project-page {
  padding: 2rem 0 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

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

.project-hero {
  margin-bottom: 3rem;
}

.project-hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.project-hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.project-meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.meta-value {
  font-weight: 600;
}

.meta-value a {
  color: var(--accent);
}

.project-content {
  max-width: 640px;
}

.project-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.project-content h2:first-child {
  margin-top: 0;
}

.project-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.project-content strong {
  color: var(--text);
  font-weight: 600;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

.tech-list li {
  list-style: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.feature-list {
  margin: 1rem 0 2rem;
  padding-left: 1.25rem;
}

.feature-list li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  position: relative;
}

.feature-list li::marker {
  color: var(--accent);
}

/* Project Gallery */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.project-gallery.single {
  grid-template-columns: 1fr;
}

.project-gallery.single .gallery-item {
  aspect-ratio: 16/9;
}

.gallery-item {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item.placeholder img {
  display: none;
}

.gallery-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
}

.gallery-item.placeholder .gallery-placeholder {
  display: flex;
}

@media (max-width: 600px) {
  .project-gallery {
    grid-template-columns: 1fr;
  }
}

/* Code inline */
.project-content code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1.5rem;
  }
  
  .hero {
    grid-template-columns: 1fr;
    padding: 2rem 0 3rem;
    min-height: auto;
    gap: 2rem;
  }
  
  .hero-photo {
    min-height: 300px;
    order: -1;
  }
  
  .project-card {
    grid-template-columns: 1fr;
  }
  
  .project-visual {
    height: 160px;
  }
  
  .exp-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  
  .footer-photo {
    order: -1;
  }
  
  .hero-links {
    flex-direction: column;
  }
  
  .link-btn {
    justify-content: center;
  }
}
