:root {
  --bg: #f5f5dc;
  --panel: #fafafa;
  --text: #1a1f0a;
  --muted: #4a5d23;
  --brand: #dda15e;
  --brand-2: #bc6c25;
  --border: #d4d4aa;
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
  --accent: #f0f0e6;
  --search-bg: #fafafa;
  --search-border: #b8b894;
  --search-focus: #dda15e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f5dc 0%, #f0f0e6 100%);
  color: var(--text);
  line-height: 1.6;
}

.avatar { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); box-shadow: var(--shadow); }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.section { padding: 80px 0; scroll-margin-top: 80px; }
.section-head { margin-bottom: 28px; }
.section-head h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: 0.2px; position: relative; }
.section-head h2::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 40px; height: 3px; background: linear-gradient(90deg, var(--muted), var(--brand)); border-radius: 2px; }
.section-head p { margin: 0; color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(120%) blur(12px);
  background: rgba(250,250,250,0.9); border-bottom: 2px solid var(--muted);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.brand-logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--muted), var(--brand)); font-weight: 700; }
.brand-text { font-weight: 600; letter-spacing: 0.2px; }

.nav-toggle { display: none; background: transparent; border: none; color: var(--text); font-size: 22px; }
.nav-menu { display: flex; list-style: none; gap: 16px; margin: 0; padding: 0; }
.nav-menu a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.nav-menu a:hover { background: rgba(74,93,35,0.15); color: var(--muted); }

.hero { padding: 86px 0 64px; scroll-margin-top: 80px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; }
.hero-text h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.2; }
.hero-text p { margin: 0 0 20px; color: var(--muted); }
.hero-cta { display: flex; gap: 12px; }
.button { display: inline-block; padding: 10px 16px; border-radius: 10px; text-decoration: none; border: 1px solid var(--border); color: var(--text); transition: transform .05s ease, background .2s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; border-color: transparent; font-weight: 600; box-shadow: 0 2px 8px rgba(221,161,94,0.3); }
.button.primary:hover { box-shadow: 0 4px 12px rgba(221,161,94,0.4); }
.button.ghost { background: var(--accent); color: var(--text); border-color: var(--border); }

.hero-media { display: flex; justify-content: center; }
.hero-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.hero-card-row { min-height: 72px; border-radius: 12px; background: var(--accent); border: 1px solid var(--border); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px 12px; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: 0.2px; line-height: 1.3; position: relative; }
.hero-card-row::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--muted); border-radius: 12px 0 0 12px; }
.hero-card-row:last-child { margin-bottom: 0; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform .1s ease, box-shadow .2s ease, border-color .2s ease; cursor: pointer; position: relative; }
.project-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--muted), var(--brand)); opacity: 0; transition: opacity 0.2s ease; }
.project-card:hover::before { opacity: 1; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); border-color: rgba(221,161,94,0.3); }
.project-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--accent); }
.project-body { padding: 14px; }
.project-title { margin: 0 0 6px; font-size: 18px; }
.project-desc { margin: 0 0 10px; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tag { font-size: 12px; color: var(--text); border: 1px solid var(--muted); background: rgba(74,93,35,0.12); padding: 4px 8px; border-radius: 999px; transition: all 0.2s ease; }
.tag:hover { background: rgba(74,93,35,0.25); border-color: var(--muted); }

.contact-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.contact-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; color: var(--text); text-decoration: none; transition: border-color .2s ease, transform .1s ease; }
.contact-card:hover { transform: translateY(-1px); border-color: rgba(221,161,94,0.3); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.contact-label { color: var(--muted); font-size: 12px; }
.contact-value { font-weight: 600; margin-top: 4px; }

.site-footer { border-top: 2px solid var(--muted); padding: 24px 0; color: var(--muted); background: rgba(74,93,35,0.08); }
.footer-inner { display: flex; align-items: center; justify-content: center; }

.modal { position: fixed; inset: 0; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-dialog { position: relative; margin: 2vh auto; width: min(900px, 92%); max-height: 96vh; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.modal-close { position: absolute; right: 10px; top: 10px; border: none; background: var(--accent); color: var(--text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; }
.modal-content { display: grid; grid-template-columns: 1.2fr 1fr; }
.modal-content img { width: 100%; height: 100%; object-fit: cover; background: var(--accent); }
.modal-body { padding: 16px; }
.modal-body h3 { margin: 0 0 8px; }
.modal-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.modal-links a { text-decoration: none; color: white; background: linear-gradient(135deg, var(--brand), var(--brand-2)); padding: 8px 12px; border-radius: 999px; font-weight: 600; }

/* Search and Filter Styles */
.search-filter-section { 
  margin-bottom: 32px; 
  padding: 24px; 
  background: var(--panel); 
  border-radius: 16px; 
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-container { 
  position: relative; 
  margin-bottom: 20px; 
}

.search-input { 
  width: 100%; 
  padding: 16px 20px 16px 48px; 
  border: 2px solid var(--search-border); 
  border-radius: 12px; 
  background: var(--search-bg); 
  color: var(--text); 
  font-size: 15px; 
  font-weight: 400;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.search-input:focus { 
  outline: none; 
  border-color: var(--muted); 
  box-shadow: 0 0 0 3px rgba(74,93,35,0.15);
  transform: translateY(-1px);
}

.search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-container::before {
  content: "🔍";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
  pointer-events: none;
}

.filter-dropdown {
  position: relative;
  display: inline-block;
}

.filter-dropdown::before {
  content: "Filter by:";
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin-right: 12px;
  display: inline-block;
}

.filter-dropdown-btn {
  padding: 12px 20px;
  border: 2px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  justify-content: space-between;
}

.filter-dropdown-btn:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.filter-dropdown-btn.active {
  border-color: var(--muted);
  background: rgba(74,93,35,0.15);
}

.filter-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1000;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  margin-top: 4px;
}

.filter-dropdown-content.show {
  display: block;
}

.filter-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.filter-option:last-child {
  border-bottom: none;
}

.filter-option:hover {
  background: rgba(74,93,35,0.15);
}

.filter-option.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
}

.filter-option.active:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

/* Slideshow Styles */
.slideshow-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.slideshow-image { width: 100%; height: 100%; object-fit: cover; display: none; }
.slideshow-image.active { display: block; }
.slideshow-nav { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.slideshow-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: background 0.2s ease; }
.slideshow-dot.active { background: white; }
.slideshow-arrows { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.slideshow-arrow-left { left: 12px; }
.slideshow-arrow-right { right: 12px; }
.slideshow-arrows:hover { background: rgba(0,0,0,0.7); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .modal-content { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-cards { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: inline-block; }
  .nav-menu { display: none; position: absolute; right: 4%; top: 58px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px; flex-direction: column; min-width: 200px; }
  .nav-menu.open { display: flex; }
  .search-filter-section { padding: 20px; }
  .filter-buttons::before { display: none; }
}

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