@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-cream: #faf8f5;
  --bg-warm: #f5f0e8;
  --bg-card: #ffffff;
  --accent-rust: #c45d3a;
  --accent-rust-light: #e8a48c;
  --accent-sage: #7d9a78;
  --accent-sage-light: #b8d4b3;
  --text-primary: #1a1a18;
  --text-secondary: #5c5c58;
  --text-muted: #8a8a85;
  --shadow-soft: 0 2px 20px rgba(26, 26, 24, 0.06);
  --shadow-hover: 0 12px 40px rgba(26, 26, 24, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-cream);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Grain 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)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1000;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--accent-rust-light) 0%, transparent 70%);
  opacity: 0.15;
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--accent-sage-light) 0%, transparent 70%);
  opacity: 0.2;
  border-radius: 50%;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  animation: slideInLeft 1s ease-out;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-rust);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.hero-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent-rust);
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-title span {
  display: block;
  font-style: italic;
  font-weight: 300;
  color: var(--accent-rust);
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 440px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

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

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 100px;
  transition: all 0.3s ease;
}

.hero-link--primary {
  background: var(--text-primary);
  color: var(--bg-cream);
}

.hero-link--primary:hover {
  background: var(--accent-rust);
  transform: translateY(-2px);
}

.hero-link--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--text-primary);
}

.hero-link--secondary:hover {
  background: var(--text-primary);
  color: var(--bg-cream);
}

.hero-link svg {
  width: 18px;
  height: 18px;
}

/* Hero Image Side */
.hero-visual {
  position: relative;
  animation: slideInRight 1s ease-out 0.2s both;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(135deg, var(--accent-sage-light) 0%, var(--accent-rust-light) 100%);
  opacity: 0.6;
}

.profile-image {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid var(--bg-card);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  text-align: center;
  position: relative;
}

.profile-name {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.profile-role {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-rust);
}

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

/* Decorative elements */
.hero-deco {
  position: absolute;
  font-family: 'Fraunces', serif;
  font-size: 12rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

.hero-deco--1 { top: 10%; right: 5%; }
.hero-deco--2 { bottom: 10%; left: 5%; }

/* ===== APPS SECTION ===== */
.apps-section {
  padding: 6rem 2rem 8rem;
  background: var(--bg-warm);
  position: relative;
}

.apps-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-warm) 100%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.section-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border-radius: 100px;
}

/* ===== PROJECT GRID ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== PROJECT CARD ===== */
.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Card Header */
.project-card__header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.project-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.project-card:hover .project-card__icon {
  transform: scale(1.05);
}

.project-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__info {
  flex: 1;
  min-width: 0;
}

.project-card__title {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.project-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.project-card__title a:hover {
  color: var(--accent-rust);
}

.project-card__link-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.project-card__description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tech Stack */
.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  background: rgba(125, 154, 120, 0.12);
  color: var(--accent-sage);
  border-radius: 100px;
  white-space: nowrap;
}

/* Store Links */
.project-card__stores {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: auto;
}

.store-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-warm);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.store-link:hover {
  background: var(--text-primary);
  color: var(--bg-cream);
}

.store-link img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.store-link:hover img {
  filter: brightness(10);
}

.store-link span {
  display: none;
}

@media (min-width: 480px) {
  .store-link span {
    display: inline;
  }
}

/* ===== FOOTER ===== */
.footer {
  padding: 4rem 2rem;
  background: var(--text-primary);
  color: var(--bg-cream);
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.footer-text {
  font-size: 0.9rem;
  color: rgba(250, 248, 245, 0.6);
  margin-bottom: 2rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.footer-link {
  color: rgba(250, 248, 245, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent-rust-light);
}

/* ===== SCROLL ANIMATIONS ===== */
.project-card {
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.5s ease-out forwards;
}

.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-card:nth-child(7) { animation-delay: 0.35s; }
.project-card:nth-child(8) { animation-delay: 0.4s; }
.project-card:nth-child(9) { animation-delay: 0.45s; }
.project-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-text {
    order: 2;
  }

  .hero-visual {
    order: 1;
  }

  .hero-label {
    justify-content: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-links {
    justify-content: center;
  }

  .profile-card {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 4rem 1.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .profile-stats {
    gap: 1.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .apps-section {
    padding: 4rem 1.5rem 5rem;
  }
}

@media (max-width: 480px) {
  .hero-links {
    flex-direction: column;
    width: 100%;
  }

  .hero-link {
    justify-content: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ===== SELECTION & SCROLLBAR ===== */
::selection {
  background: var(--accent-rust);
  color: var(--bg-cream);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-cream);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-rust);
}
