/* ------------------ FONTS ------------------ */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Jost:wght@300;400;500&display=swap');

/* ------------------ ROOT (LIGHT) ------------------ */
:root {
  --bg: #FAFDF9;
  --bg-soft: #EAF4EA;
  --bg-accent: #EFF7D4;
  --text: #2F3E34;
  --text-secondary: #5F6F66;
  --primary: #6B8F71;
  --secondary: #A4C3A2;
  --accent: #A3BEA0;
  --hover: #5A7A60;
  --card: rgba(255, 255, 255, 0.72);
  --border: rgba(107, 143, 113, 0.18);
  --wave-fill: #EAF4EA;
}

/* ------------------ DARK MODE ------------------ */
[data-theme="dark"] {
  --bg: #1B2420;
  --bg-soft: #2A332E;
  --bg-accent: #2F3E34;
  --text: #EAF4EA;
  --text-secondary: #B7CFC0;
  --primary: #A4C3A2;
  --secondary: #6B8F71;
  --accent: #A3BEA0;
  --hover: #8FB69A;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.09);
  --wave-fill: #2A332E;
}

/* ------------------ GLOBAL ------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}

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

/* ------------------ TYPOGRAPHY ------------------ */
h1, h2, h3 { font-family: 'Lora', serif; font-weight: 600; line-height: 1.25; }
h2 { font-size: 2rem; margin-bottom: 0.5rem; color: var(--primary); }
h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
p  { margin: 0.5rem 0 1rem; }
a  { color: var(--primary); }

/* ------------------ NAVBAR ------------------ */
.nav-bar {
  background-color: var(--bg-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.nav-bar h1 {
  font-family: 'Lora', serif;
  font-size: 1.35rem;
  color: var(--primary);
  font-style: italic;
  font-weight: 400;
  margin: 0;
}

.nav-buttons { display: flex; gap: 12px; align-items: center; }

.nav-button {
  padding: 7px 16px;
  background: var(--primary);
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-button:hover { background: var(--hover); transform: translateY(-1px); }

/* ------------------ HERO ------------------ */
.hero {
  position: relative;
  text-align: center;
  padding: 140px 20px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(164,195,162,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(107,143,113,0.15) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(239,247,212,0.4) 0%, transparent 60%);
}

.hero .content { position: relative; z-index: 1; }

.hero h2 {
  font-size: 3rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  animation: fadeUp 0.8s ease both;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  animation: fadeUp 0.8s 0.15s ease both;
}

/* floating leaves */
.leaf {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 0 80% 0 80%;
  background: var(--secondary);
  opacity: 0;
  animation: drift linear infinite;
  z-index: 0;
}

.leaf:nth-child(1)  { left: 8%;  animation-duration: 14s; animation-delay: 0s;   width: 10px; height: 10px; }
.leaf:nth-child(2)  { left: 18%; animation-duration: 18s; animation-delay: 3s;   width: 14px; height: 14px; }
.leaf:nth-child(3)  { left: 32%; animation-duration: 12s; animation-delay: 6s;   width: 8px;  height: 8px;  }
.leaf:nth-child(4)  { left: 55%; animation-duration: 20s; animation-delay: 1.5s; width: 12px; height: 12px; }
.leaf:nth-child(5)  { left: 70%; animation-duration: 16s; animation-delay: 4s;   width: 9px;  height: 9px;  }
.leaf:nth-child(6)  { left: 85%; animation-duration: 13s; animation-delay: 7s;   width: 13px; height: 13px; }
.leaf:nth-child(7)  { left: 44%; animation-duration: 17s; animation-delay: 2s;   width: 7px;  height: 7px;  }
.leaf:nth-child(8)  { left: 62%; animation-duration: 15s; animation-delay: 9s;   width: 11px; height: 11px; }

@keyframes drift {
  0%   { transform: translateY(-30px) rotate(0deg);   opacity: 0;   }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0;   }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------ WAVE DIVIDER ------------------ */
.wave-divider {
  display: block;
  width: 100%;
  height: 60px;
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg { display: block; width: 100%; height: 100%; }

/* ------------------ SECTIONS ------------------ */
.section {
  padding: 80px 20px;
  position: relative;
  z-index: 1;
}

.section:nth-of-type(even) { background: var(--bg-soft); }

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

/* ------------------ ABOUT ------------------ */
.about-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 2rem;
}

/* ------------------ GRID ------------------ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* ------------------ CARDS (general) ------------------ */
.card {
  background: var(--card);
  padding: 26px 28px;
  border-radius: 16px;
  text-align: left;
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(107,143,113,0.15);
}

.card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.9;
}

/* ------------------ STATUS BADGES ------------------ */
.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
  margin-bottom: 10px;
  width: fit-content;
}

.badge-complete { background: rgba(107,143,113,0.18); color: var(--primary); }
.badge-progress { background: rgba(163,190,160,0.2);  color: #4a7a55; }
.badge-future   { background: rgba(194,195,149,0.25); color: #7a7a3a; }

[data-theme="dark"] .badge-progress { color: var(--accent); }
[data-theme="dark"] .badge-future   { color: #c2c395; }

/* ------------------ PROJECT CARDS (fixed size) ------------------ */
.project-card {
  display: flex;
  flex-direction: column;
  height: 260px;
  cursor: pointer;
  padding: 18px 20px;
}

.project-card .card-thumb {
  width: 100%;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.project-card .card-thumb .thumb-placeholder {
  font-size: 2rem;
  opacity: 0.45;
}

.project-card h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card .card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0 0 8px;
  line-height: 1.5;
}

.project-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  flex-shrink: 0;
}

.btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: var(--primary);
  color: white;
  border-radius: 50px;
  font-size: 0.78rem;
  font-family: 'Jost', sans-serif;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-preview:hover { background: var(--hover); transform: translateY(-1px); }

/* ------------------ SWIPER ------------------ */
.swiper {
  margin-top: 24px;
  padding: 0 48px 12px;
}

.swiper-slide { height: auto; }

.swiper-button-next,
.swiper-button-prev {
  width: 36px;
  height: 36px;
  background: var(--secondary);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  transition: background 0.2s;
}

.swiper-button-next { right: 0; }
.swiper-button-prev { left: 0; }

.swiper-button-next:hover,
.swiper-button-prev:hover { background: var(--primary); }

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 13px !important;
  color: white;
  font-weight: 700;
}

/* ------------------ MODAL ------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: var(--bg-soft);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  z-index: 1;
  transition: background 0.2s;
}

.modal-close:hover { background: var(--primary); color: white; }

.modal-image-wrap {
  width: 100%;
  height: 220px;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image { width: 100%; height: 100%; object-fit: cover; display: none; }
.modal-image.loaded { display: block; }

.modal-image-placeholder { font-size: 3.5rem; opacity: 0.4; }

.modal-body { padding: 24px 28px 28px; }

.modal-body h3 { font-size: 1.3rem; margin: 6px 0 10px; }

.modal-body p {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.tech-tag {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 50px;
  font-family: 'Jost', sans-serif;
}

.modal-links { display: flex; flex-wrap: wrap; gap: 10px; }

.modal-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 18px;
  background: var(--primary);
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.2s;
}

.modal-links a:hover { background: var(--hover); transform: translateY(-1px); }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ------------------ CONTACT SECTION ------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 2rem;
}

.contact-links p { margin: 0.4rem 0; font-size: 0.95rem; color: var(--text-secondary); }
.contact-links a { color: var(--primary); text-decoration: none; font-weight: 500; }
.contact-links a:hover { text-decoration: underline; }

.contact-form { display: flex; flex-direction: column; gap: 12px; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--primary); }

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-secondary); opacity: 0.7; }

.contact-form button {
  align-self: flex-start;
  padding: 9px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.contact-form button:hover { background: var(--hover); transform: translateY(-1px); }

.form-success {
  display: none;
  padding: 12px 16px;
  background: rgba(107,143,113,0.12);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--primary);
  font-size: 0.9rem;
}

/* ------------------ FOOTER ------------------ */
footer {
  text-align: center;
  padding: 28px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* ------------------ BACK TO TOP ------------------ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: white;
  padding: 11px 15px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(107,143,113,0.35);
  transition: background 0.2s, transform 0.2s;
  z-index: 50;
  line-height: 1;
}

.back-to-top:hover { background: var(--hover); transform: translateY(-2px); }

/* ------------------ DARK MODE BUTTON ------------------ */
.theme-toggle {
  padding: 8px 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-accent);
  font-size: 1rem;
  transition: background 0.2s;
  line-height: 1;
}

.theme-toggle:hover { background: var(--secondary); }

/* ------------------ SECTION TAG ------------------ */
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ------------------ RESPONSIVE ------------------ */
@media (max-width: 768px) {
  .grid, .contact-grid { grid-template-columns: 1fr; }
  .nav-bar { padding: 14px 20px; }
  .nav-buttons { gap: 8px; }
  .nav-button { padding: 6px 12px; font-size: 0.8rem; }
  .hero h2 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }
}