/* ================================
   VARIABLES
================================ */
:root {
  --bg: #0B0E0C;
  --surface: #101410;
  --text: #E6ECE8; /* Lighter text for better contrast on dark bg */
  --muted: #B0C0B8; /* Brighter muted color for dark mode */
  --brand: #1E7F4F;
  --brand-2: #12A062;
  --highlight: #FF6F61;
  --ring: #66d19e;
  --card: #121712;
}

/* Light theme */
:root.light {
  --bg: #FFFFFF;
  --surface: #F6F8F7;
  --text: #0B0E0C; /* Darker text for better contrast on white bg */
  --muted: #4A5A52; /* Darker muted color for light mode */
  --card: #FFFFFF;
}

/* ================================
   BASE
================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, #0E120E 60%);
  line-height: 1.6;
}
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; color: var(--text); font-family: "Playfair Display", serif; }
h3, .btn { font-family: "Montserrat", sans-serif; font-weight: 600; }
h1 { font-size: clamp(2rem, 3vw + 1rem, 3.2rem); }
h2 { font-size: clamp(1.6rem, 1.6vw + 1rem, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: .5rem 0 1rem; color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1100px, 92%); margin-inline: auto; padding: 0 1rem; }
.section { padding: 64px 0; opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.section.visible { opacity: 1; transform: translateY(0); }
.section.alt { background: linear-gradient(180deg, var(--surface) 0%, rgba(14, 18, 14, 0.9) 100%); }
.section-header { max-width: 760px; margin: 0 auto 2rem; text-align: center; }
.section-header p { color: var(--muted); }

/* ================================
   NAVIGATION
================================ */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10,14,12,.6);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: box-shadow .2s ease;
}
.site-header[data-elevate="true"] { box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; font-weight: 700; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap; white-space: nowrap; }
.nav-links a { color: var(--text); text-decoration: none; opacity: .9; }
.nav-links a:hover { opacity: 1; }
.menu-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: .3rem .5rem; color: var(--text); cursor: pointer; }

/* ================================
   HERO
================================ */
.hero { padding: 96px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 1rem; }
.eyebrow { letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.highlight { background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.profile-card { position: relative; width: 300px; height: 300px; border-radius: 50%; overflow: hidden; margin: 0 auto; transition: transform 0.3s ease; }
.profile-card:hover { transform: scale(1.05); }
.profile-img { width: 100%; height: 100%; object-fit: cover; }
.profile-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(30,127,79,0.4), rgba(18,160,98,0.4)); opacity: 0; transition: opacity 0.3s ease; }
.profile-card:hover .profile-overlay { opacity: 1; }

/* ================================
   CARDS + GRID
================================ */
.grid.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding: 0 1rem; }
.card { background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; padding: 1.5rem; box-shadow: 0 10px 24px rgba(0,0,0,.2); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: scale(1.03); box-shadow: 0 12px 28px rgba(0,0,0,.3); }
.card h3 { margin-bottom: .4rem; color: var(--text); }
.check { margin: 0; padding: 0; list-style: none; color: var(--muted); }
.check li { padding-left: 1rem; position: relative; }
.check li::before { content: "•"; position: absolute; left: .1rem; opacity: .6; }
.portfolio-img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 1rem; }
.filter-buttons { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.filter-btn { padding: 0.5rem 1rem; transition: background 0.2s ease, color 0.2s ease; }
.filter-btn.active { background: var(--brand-2); color: #fff; }
.portfolio-grid .card { transition: opacity 0.3s ease, transform 0.3s ease; }
.portfolio-grid .card.hidden { opacity: 0; height: 0; margin: 0; padding: 0; overflow: hidden; transform: scale(0.8); }

/* ================================
   TOOLS
================================ */
.strip { background: var(--surface); padding: 2rem 0; }
.strip-title { text-align: center; margin-bottom: 1rem; }
.tool-rail { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; padding: 0; list-style: none; }
.tool-rail li { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--text); transition: color 0.3s ease, transform 0.3s ease; }
.tool-rail li:hover { color: var(--brand-2); transform: translateY(-2px); }
.tool-rail i { font-size: 2.5rem; transition: transform 0.3s ease; }
.tool-rail li:hover i { transform: scale(1.1); }

/* ================================
   ABOUT
================================ */
#about { background: linear-gradient(135deg, var(--surface), rgba(30, 127, 79, 0.1)); padding: 64px 1rem; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.about-text p { max-width: 80ch; color: var(--text); }
.stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.5rem; background: rgba(255, 255, 255, 0.05); border-radius: 12px; transition: transform 0.3s ease, background 0.3s ease; }
.stat:hover { transform: scale(1.05); background: rgba(255, 255, 255, 0.1); }
.num { font-size: 2rem; font-weight: 700; color: var(--brand-2); margin-bottom: 0.5rem; }
.label { font-size: 1rem; color: var(--muted); }

/* Video Container */
.video-container {
  margin: 1.5rem 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}
.video-container video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--card);
}
.video-caption {
  margin-top: 0.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}
/* Portfolio Section */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.portfolio-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.portfolio-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-card:hover img {
  transform: scale(1.1);
}

/* Overlay */
.portfolio-card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card:hover .overlay {
  opacity: 1;
}

/* ================================
   TESTIMONIALS CAROUSEL
================================ */
.testimonial-carousel { position: relative; overflow: hidden; max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.testimonial-track { display: flex; transition: transform 0.6s ease-in-out; }
.testimonial { flex: 0 0 100%; background: var(--card); border-left: 4px solid var(--brand); border-radius: 12px; padding: 1.5rem; margin: 0 0.5rem; box-shadow: 0 6px 18px rgba(0,0,0,0.18); color: var(--text); font-style: italic; transition: transform 0.3s ease; }
.testimonial:hover { transform: translateY(-4px); }
.testimonial footer { margin-top: 0.8rem; font-size: 0.9rem; color: var(--muted); font-style: normal; }
.carousel-nav { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1rem; }
.carousel-btn { width: 12px; height: 12px; border-radius: 50%; border: none; background: var(--muted); opacity: 0.5; cursor: pointer; transition: opacity 0.3s ease, transform 0.3s ease; }
.carousel-btn:hover { opacity: 0.9; transform: scale(1.2); }
.carousel-btn.active { background: var(--brand-2); opacity: 1; }
.testimonial-carousel:hover .testimonial-track { animation-play-state: paused; }

/* ================================
   BLOG MODALS
================================ */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); }
.modal-content { background: var(--card); margin: 10% auto; padding: 20px; border-radius: 16px; width: 90%; max-width: 700px; color: var(--text); animation: fadeIn 0.4s ease; }
.modal-content p { color: var(--text); } /* Ensure modal text is readable */
.close { color: var(--muted); float: right; font-size: 24px; cursor: pointer; transition: color 0.2s ease; }
.close:hover { color: var(--brand-2); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ================================
   FORM
================================ */
.form { max-width: 600px; margin: 0 auto; padding: 0 1rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: 0.5rem; color: var(--text); }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 0.8rem; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; background: var(--surface); color: var(--text); }
.form-row select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23B0C0B8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1.2rem; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--ring); }
.form-message { margin-top: 0.5rem; font-size: 0.9rem; color: var(--text); }
.form-message.success { color: var(--brand-2); }
.form-message.error { color: var(--highlight); }

/* ================================
   MICRO-INTERACTIONS
================================ */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px; padding: .6rem 1rem; border: 1px solid rgba(255,255,255,.16); text-decoration: none; color: var(--text); transition: background 0.2s ease, transform 0.2s ease; }
.btn:hover { background: rgba(255,255,255,.08); transform: scale(1.03); }
.btn::after { content: ""; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; background: rgba(255,255,255,0.3); border-radius: 50%; transform: scale(0); opacity: 0; pointer-events: none; }
.btn:active::after { transform: scale(18); opacity: 0; transition: transform 0.5s, opacity 1s; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--highlight)); border-color: transparent; color: #fff; }
.hero-copy h1 { display: inline-block; white-space: nowrap; overflow: hidden; border-right: 3px solid var(--brand-2); animation: typing 3.5s steps(40,end), blink .75s step-end infinite; max-width: 100%; }
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blink { 50% { border-color: transparent; } }

/* ================================
   STICKY CTA
================================ */
.sticky-cta {
  position: fixed;
  inset: auto 20px calc(20px + env(safe-area-inset-bottom)) auto;
  z-index: 9999;
  display: flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--brand), var(--highlight));
  color: #fff; padding: .6rem 1.1rem; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sticky-cta.hidden { opacity: 0; transform: translateY(16px); pointer-events: none; }
.sticky-cta .btn,
.sticky-cta .btn:hover,
.sticky-cta .btn:active,
.sticky-cta .btn:focus {
  background: transparent; color: #fff; border: 0; padding: .4rem .8rem; font-weight: 600;
  transform: none !important; animation: pulse 2s infinite;
}
.sticky-cta .btn::after { content: none !important; }
.sticky-cta .close-cta {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 0; cursor: pointer; background: rgba(255,255,255,.15);
  color: #fff; font-size: .9rem; line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}
.sticky-cta .close-cta:hover { background: rgba(255,255,255,.35); transform: scale(1.05); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,160,98, 0.7); } 70% { box-shadow: 0 0 0 12px rgba(18,160,98,0); } 100% { box-shadow: 0 0 0 0 rgba(18,160,98,0); } }

/* ================================
   FOOTER
================================ */
.site-footer { padding: 36px 0; border-top: 1px solid rgba(255,255,255,.08); background: linear-gradient(180deg, var(--surface), var(--bg)); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; align-items: start; }
.footer-links { display: flex; gap: 1rem; align-items: center; }
.footer-links i { font-size: 1.2rem; margin-left: 0.5rem; }
.small { color: var(--muted); }

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 960px) {
  .grid.cards { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .profile-card { width: 200px; height: 200px; }
}
@media (max-width: 768px) {
  .grid.cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .grid.cards { grid-template-columns: 1fr; }
  .nav-links { display: none; position: fixed; right: 20px; top: 60px; background: var(--surface); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 1rem; flex-direction: column; min-width: 220px; max-width: calc(100% - 40px); }
  .nav-links.active { display: flex; }
  .menu-toggle { display: inline-block; }
}

/* REMINDER: What to Change */
/* 1. Fonts: Ensure Montserrat and Playfair Display fonts load via Google Fonts link in index.html. */
/* 2. Colors: Adjust --text or --muted further if contrast still needs tweaking after testing (e.g., darken --text in light mode to #000000). */
/* 3. Test: Check https://masterliyuu.github.io/Portfolio/#main in both light and dark modes using Chrome DevTools to verify text readability, especially in Hero, About, and modals. */
