/* =============================================================
   PORTFOLIO — styles.css
   Structure:
   1.  CSS Custom Properties (tokens)
   2.  Reset / Base
   3.  Typography
   4.  Navbar
   5.  Buttons
   6.  Hero Section
   7.  Section Shared Styles
   8.  Projects Section
   9.  About Section
   10. Testimonials Section
   11. Contact Section
   12. Footer
   13. Utility / Animations
   14. Responsive overrides
================================================================ */


/* =============================================================
   1. CSS CUSTOM PROPERTIES
================================================================ */
:root {
  /* Colors */
  --color-bg:           #ffffff;
  --color-bg-alt:       #f8f8f6;
  --color-text:         #111111;
  --color-text-muted:   #666666;
  --color-border:       #e5e5e5;
  --color-accent:       #1a1a1a;
  --color-accent-hover: #333333;
  --color-tag-bg:       #f0f0ee;
  --color-tag-text:     #555555;

  /* Typography */
  --font-base:   'Inter', system-ui, sans-serif;
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* Spacing */
  --section-pad: 100px;
  --section-pad-sm: 60px;

  /* Transitions */
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;

  /* Shadows */
  --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.13);
}


/* =============================================================
   2. RESET / BASE
================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}


/* =============================================================
   3. TYPOGRAPHY
================================================================ */
h1, h2, h3 {
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

p {
  color: var(--color-text-muted);
  line-height: 1.75;
}


/* =============================================================
   4. NAVBAR
================================================================ */
#mainNav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  padding: 18px 0;
  transition: border-color var(--transition-base), padding var(--transition-base), box-shadow var(--transition-base);
  z-index: 1000;
}

/* Scrolled state — applied via JS */
#mainNav.scrolled {
  border-color: var(--color-border);
  padding: 12px 0;
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: var(--fw-bold);
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.brand-dot {
  color: var(--color-accent);
  /* Swap to an accent color like #4f46e5 for a colored dot */
}

.nav-link {
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  color: var(--color-text-muted) !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm);
  transition: color var(--transition-base), background var(--transition-base);
}

.nav-link:hover {
  color: var(--color-text) !important;
  background: var(--color-bg-alt);
}

/* "Let's talk" nav CTA */
.nav-link.nav-cta {
  color: var(--color-bg) !important;
  background: var(--color-accent);
  margin-left: 6px;
}

.nav-link.nav-cta:hover {
  background: var(--color-accent-hover);
  color: var(--color-bg) !important;
}

/* Language toggle pill — SV / EN */
.lang-toggle {
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 0.73rem;
  font-weight: var(--fw-semibold);
  font-family: var(--font-base);
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-text-muted);
  margin-left: 12px;
  transition: border-color var(--transition-base);
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--color-accent);
}

.lang-toggle span[data-lang] {
  transition: color var(--transition-base);
}

.lang-toggle span[data-lang].active {
  color: var(--color-text);
}

.lang-toggle .lang-sep {
  color: var(--color-border);
  font-weight: var(--fw-light);
  font-size: 0.85rem;
}

/* On mobile the toggle sits below the nav links — add breathing room */
@media (max-width: 991px) {
  .lang-toggle {
    margin: 12px 0 4px 2px;
  }
}


/* =============================================================
   5. BUTTONS
================================================================ */
.btn-primary-custom {
  display: inline-block;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: var(--fw-semibold);
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-accent);
  transition: background var(--transition-base), transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary-custom:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-outline-custom {
  display: inline-block;
  background: transparent;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: var(--fw-semibold);
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
  transition: border-color var(--transition-base), background var(--transition-base), transform 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-outline-custom:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
  color: var(--color-text);
  transform: translateY(-2px);
}

/* Overlay button on project card hover */
.btn-overlay {
  background: #ffffff;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-base);
}

.btn-overlay:hover {
  transform: scale(1.04);
  color: var(--color-text);
}


/* =============================================================
   6. HERO SECTION
================================================================ */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  background-color: var(--color-bg);
  /* Graph paper grid: faint minor lines every 32px,
     slightly stronger major lines every 128px */
  background-image:
    linear-gradient(rgba(0,0,0,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.055) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.022) 1px, transparent 1px);
  background-size:
    128px 128px,
    128px 128px,
    32px  32px,
    32px  32px;
}

/* Bottom fade — blends the blobs cleanly into the next section */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
  z-index: 0;
}

/* ── Gradient blobs ──────────────────────────────────────────
   Large, heavily blurred radial gradients that float slowly.
   Very low opacity keeps them subtle on the white background.
─────────────────────────────────────────────────────────────── */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Primary blob — top-right, large, soft indigo */
.hero-blob--1 {
  width: 700px;
  height: 700px;
  top: -160px;
  right: -160px;
  background: radial-gradient(circle at center,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(139, 92, 246, 0.08) 45%,
    transparent 70%
  );
  filter: blur(80px);
  animation: blobDrift1 12s ease-in-out infinite alternate;
}

/* Secondary blob — lower-left, medium, softer violet */
.hero-blob--2 {
  width: 520px;
  height: 520px;
  bottom: 60px;
  left: -100px;
  background: radial-gradient(circle at center,
    rgba(139, 92, 246, 0.12) 0%,
    rgba(99, 102, 241, 0.05) 50%,
    transparent 70%
  );
  filter: blur(90px);
  animation: blobDrift2 16s ease-in-out infinite alternate;
}

/* Slow, subtle floating motion — different paths per blob */
@keyframes blobDrift1 {
  0%   { transform: translate(0,    0)    scale(1);    }
  100% { transform: translate(-40px, 30px) scale(1.08); }
}

@keyframes blobDrift2 {
  0%   { transform: translate(0,   0)    scale(1);    }
  100% { transform: translate(50px, -35px) scale(1.06); }
}

/* ── Hero Code Card ──────────────────────────────────────────
   Dark mock code editor in the right column of the hero.
   Visible only on large screens (d-none d-lg-flex).
─────────────────────────────────────────────────────────────── */
.code-card {
  width: 100%;
  max-width: 420px;
  background: #0d1117;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 24px 48px rgba(0, 0, 0, 0.28),
    0 6px 12px  rgba(0, 0, 0, 0.12);
  transform: rotate(-2deg);
  animation:
    codeEntrance 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both,
    codeFloat    7s  ease-in-out                     1.6s infinite;
}

.code-chrome {
  background: #161b22;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-dots { display: flex; gap: 6px; flex-shrink: 0; }
.code-dot  { width: 12px; height: 12px; border-radius: 50%; }
.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }

.code-tab {
  font-size: 0.72rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.04em;
}

.code-body {
  margin: 0;
  padding: 20px 22px 26px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.77rem;
  line-height: 1.85;
  background: none;
  border: none;
  overflow: hidden;
  white-space: pre;
  color: #e1e4e8;
}

.t-comment { color: #6a737d; font-style: italic; }
.t-tag     { color: #f97583; }
.t-attr    { color: #b392f0; }
.t-str     { color: #9ecbff; }
.t-text    { color: #e1e4e8; }

@keyframes codeEntrance {
  from { opacity: 0; transform: rotate(-2deg) translateX(50px); }
  to   { opacity: 1; transform: rotate(-2deg) translateX(0);    }
}
@keyframes codeFloat {
  0%, 100% { transform: rotate(-2deg) translateY(0px);   }
  50%       { transform: rotate(-2deg) translateY(-10px); }
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.hero-headline {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: var(--fw-bold);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 24px;
  max-width: 680px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}


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


/* =============================================================
   7. SECTION SHARED STYLES
================================================================ */
.section-pad {
  padding: var(--section-pad) 0;
}

.section-header {
  margin-bottom: 56px;
}

.section-label {
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}

.section-sub {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}


/* =============================================================
   8. PROJECTS SECTION
================================================================ */
#projects {
  background-color: var(--color-bg);
}

/* Individual card wrapper — used for GSAP targeting */
.project-card-wrap {
  /* GSAP will set opacity: 0 initially via script */
}

.project-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

/* Image container with overlay */
.project-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--color-bg-alt);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-img {
  transform: scale(1.04);
}

/* Hover overlay with CTA */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
  backdrop-filter: blur(2px);
}

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

/* Card body */
.project-body {
  padding: 22px 24px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.project-name {
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  margin-bottom: 8px;
  color: var(--color-text);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.project-link {
  font-size: 0.88rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-base), color var(--transition-base);
  margin-top: auto;
}

.project-link:hover {
  gap: 10px;
  color: var(--color-accent-hover);
}


/* =============================================================
   9. ABOUT SECTION
================================================================ */
.about-section {
  background-color: var(--color-bg-alt);
}

/* Space between the title row and the two-column content row */
.about-content-row {
  margin-top: 44px;
}

/* The title in about gets slightly larger since it spans full width */
.about-title-large {
  font-size: clamp(2rem, 4vw, 3.2rem);
  max-width: 700px;
  margin-bottom: 0;
}

.about-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* Solo-but-capable callout — bold statement block */
.about-callout {
  border-left: 3px solid var(--color-text);
  margin: 28px 0 0;
  padding: 14px 0 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-callout p {
  font-size: 1.1rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  line-height: 1.55;
  margin: 0;
}

.about-callout-sub {
  font-size: 0.78rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Right column: list sits flush at the top, visually balanced with the text */
.about-right-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 4px;
}

.about-list {
  margin: 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-list li {
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.about-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Bullet dot */
.about-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text);
  flex-shrink: 0;
}


/* =============================================================
   10. TESTIMONIALS SECTION
================================================================ */
.testimonials-section {
  background-color: var(--color-bg);
}

.testimonial-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 36px 36px 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

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

.testimonial-quote-icon {
  font-size: 4rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--color-border);
  position: absolute;
  top: 16px;
  left: 30px;
  pointer-events: none;
  user-select: none;
}

.testimonial-text {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.75;
  flex: 1;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.testimonial-author strong {
  display: block;
  font-size: 0.9rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  line-height: 1.3;
}

.testimonial-author span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}


/* =============================================================
   11. CONTACT SECTION
================================================================ */
.contact-section {
  background-color: var(--color-bg);
}

.contact-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
}

.contact-email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 2px;
  transition: opacity var(--transition-base);
}

.contact-email:hover {
  opacity: 0.6;
  color: var(--color-text);
}

/* Form controls */
.form-label {
  font-size: 0.85rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  margin-bottom: 8px;
}

.form-control-custom {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  resize: vertical;
}

.form-control-custom::placeholder {
  color: #aaa;
}

.form-control-custom:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
  outline: none;
}

.form-feedback {
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: none; /* Shown via JS */
}

.form-feedback.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  display: block;
}

.form-feedback.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  display: block;
}


/* =============================================================
   12. FOOTER
================================================================ */
.site-footer {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
}

.footer-brand .navbar-brand {
  font-size: 1.2rem;
}

.footer-credit {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* The "Website by [Name]" link — same style placed on client sites */
.footer-credit a {
  color: var(--color-text);
  font-weight: var(--fw-semibold);
  border-bottom: 1px solid var(--color-border);
  transition: border-color var(--transition-base), color var(--transition-base);
}

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

.footer-social {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.social-link {
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

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


/* =============================================================
   13. UTILITY / ANIMATION CLASSES
================================================================ */

/* Elements start invisible for GSAP scroll animations.
   GSAP sets opacity and transform back on scroll. */
.gsap-fade {
  opacity: 0;
  transform: translateY(28px);
}


/* =============================================================
   14. RESPONSIVE OVERRIDES
================================================================ */

/* Medium screens */
@media (max-width: 991px) {
  :root {
    --section-pad: 80px;
  }

  .about-img-col {
    max-width: 400px;
    margin: 0 auto;
  }

  .footer-brand,
  .footer-credit,
  .footer-social {
    text-align: center;
    justify-content: center;
    margin-bottom: 10px;
  }

  .site-footer .row {
    row-gap: 10px;
  }
}

/* Small screens */
@media (max-width: 767px) {
  :root {
    --section-pad: 60px;
  }

  .hero-headline {
    font-size: 2.2rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions .btn-primary-custom,
  .hero-actions .btn-outline-custom {
    width: 100%;
    text-align: center;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .about-img-wrap {
    box-shadow: 8px 8px 0 var(--color-border);
  }

  .testimonial-card {
    padding: 28px 24px;
  }

  .footer-social {
    gap: 16px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .hero-headline {
    font-size: 1.9rem;
  }
}
