/* ===== MODERN SKEUOMORPHIC DESIGN SYSTEM ===== */

:root {
  --bg: #e8e0d8;
  --bg-alt: #ddd5cc;
  --surface: linear-gradient(145deg, #f0e8e0, #d8d0c6);
  --surface-raised: linear-gradient(145deg, #f4ece4, #dcd4ca);
  --surface-inset: linear-gradient(145deg, #d4ccc2, #e8e0d6);
  --text: #2c2420;
  --text-muted: #6b5e54;
  --accent: #b05c3a;
  --accent-glow: #d4714a;
  --accent-deep: #8a4528;
  --gold: #c4943e;
  --shadow-out: 6px 6px 14px rgba(0,0,0,0.15), -6px -6px 14px rgba(255,255,255,0.6);
  --shadow-in: inset 4px 4px 10px rgba(0,0,0,0.12), inset -4px -4px 10px rgba(255,255,255,0.5);
  --shadow-soft: 3px 3px 8px rgba(0,0,0,0.1), -3px -3px 8px rgba(255,255,255,0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

html.dark {
  --bg: #1a1a22;
  --bg-alt: #22222e;
  --surface: linear-gradient(145deg, #24242e, #16161e);
  --surface-raised: linear-gradient(145deg, #2a2a36, #1e1e28);
  --surface-inset: linear-gradient(145deg, #141420, #20202c);
  --text: #e8e2dc;
  --text-muted: #9a928a;
  --accent: #d4714a;
  --accent-glow: #e8845c;
  --accent-deep: #b05c3a;
  --gold: #d4a84e;
  --shadow-out: 6px 6px 14px rgba(0,0,0,0.5), -6px -6px 14px rgba(255,255,255,0.04);
  --shadow-in: inset 4px 4px 10px rgba(0,0,0,0.45), inset -4px -4px 10px rgba(255,255,255,0.03);
  --shadow-soft: 3px 3px 8px rgba(0,0,0,0.4), -3px -3px 8px rgba(255,255,255,0.03);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }

/* ===== NAV ===== */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(232, 224, 216, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow 0.3s, background 0.3s;
}
#main-nav.scrolled {
  background: rgba(232, 224, 216, 0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
html.dark #main-nav { background: rgba(26, 26, 34, 0.85); }
html.dark #main-nav.scrolled { background: rgba(26, 26, 34, 0.95); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
  color: var(--accent); text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  text-decoration: none; color: var(--text-muted); font-size: 0.88rem;
  font-weight: 500; transition: color 0.25s; letter-spacing: 0.3px;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--surface-raised); box-shadow: var(--shadow-soft);
  padding: 8px 18px !important; border-radius: var(--radius-sm);
  color: var(--accent) !important; font-weight: 600 !important;
  transition: box-shadow 0.25s, transform 0.2s !important;
}
.nav-cta:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }

#mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
#mobile-toggle span { display: block; width: 24px; height: 2.5px; background: var(--text); border-radius: 2px; transition: 0.3s; }
#mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#mobile-toggle.active span:nth-child(2) { opacity: 0; }
#mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--surface-raised); box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: box-shadow 0.25s, transform 0.2s;
  color: var(--gold); font-size: 1rem; margin-left: 8px;
  position: relative; overflow: hidden;
}
.theme-toggle:hover { box-shadow: var(--shadow-out); transform: translateY(-1px); }
.theme-toggle:active { box-shadow: var(--shadow-in); transform: translateY(0); }
.theme-toggle .fa-moon { transition: 0.35s; }
.theme-toggle .fa-sun { position: absolute; transform: translateY(40px); opacity: 0; transition: 0.35s; }
html.dark .theme-toggle .fa-moon { transform: translateY(-40px); opacity: 0; }
html.dark .theme-toggle .fa-sun { transform: translateY(0); opacity: 1; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 100px 24px 60px;
  background: radial-gradient(ellipse at 30% 20%, rgba(176,92,58,0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(196,148,62,0.06) 0%, transparent 50%),
              var(--bg);
}
.hero-card {
  background: var(--surface-raised);
  border-radius: 24px; padding: 56px 48px;
  box-shadow: var(--shadow-out), inset 0 1px 0 rgba(255,255,255,0.5);
  max-width: 780px; width: 100%; text-align: center;
  border: 1px solid rgba(255,255,255,0.3);
  opacity: 0; animation: riseIn 0.8s ease-out 0.2s forwards;
}
html.dark .hero-card { border-color: rgba(255,255,255,0.06); }
html.dark .service-card,
html.dark .timeline-card,
html.dark .skill-card,
html.dark .project-card,
html.dark .edu-card,
html.dark .social-row a { border-color: rgba(255,255,255,0.04); }
.hero-badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
  background: var(--surface-inset); box-shadow: var(--shadow-in);
  padding: 8px 20px; border-radius: 20px; margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 900; line-height: 1.15; margin-bottom: 16px;
  color: var(--text);
}
.hero-last { color: var(--accent); }
.hero-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; }
.hero-desc {
  color: var(--text-muted); font-size: 1rem; line-height: 1.7;
  max-width: 600px; margin: 0 auto 32px;
}
.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 36px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; padding: 14px 32px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.92rem;
  text-decoration: none; transition: all 0.25s; cursor: pointer; border: none;
  letter-spacing: 0.3px;
}
.btn-primary {
  background: linear-gradient(145deg, var(--accent-glow), var(--accent-deep));
  color: #fff;
  box-shadow: 4px 4px 12px rgba(176,92,58,0.35), -2px -2px 6px rgba(255,255,255,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 6px 6px 18px rgba(176,92,58,0.4), -3px -3px 8px rgba(255,255,255,0.2); }
.btn-secondary {
  background: var(--surface-raised); color: var(--accent);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(176,92,58,0.15);
}
.btn-secondary:hover { box-shadow: var(--shadow-out); transform: translateY(-2px); }

.hero-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface-inset); box-shadow: var(--shadow-in);
  padding: 14px 20px; border-radius: var(--radius-sm);
  min-width: 90px;
}
.stat-num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }

/* ===== SECTIONS ===== */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; text-align: center; margin-bottom: 56px;
}
.accent { color: var(--accent); }

/* ===== SERVICES ===== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 24px; }
.service-card {
  background: var(--surface-raised); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow-out);
  border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}
.service-card.animate-ready { opacity: 0; transform: translateY(30px); }
.service-card.visible { opacity: 1; transform: translateY(0); transition: opacity 0.6s, transform 0.6s; }
.service-card:hover { transform: translateY(-4px); box-shadow: 8px 8px 20px rgba(0,0,0,0.18), -8px -8px 20px rgba(255,255,255,0.65); }
.service-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--surface-inset); box-shadow: var(--shadow-in);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--accent); margin-bottom: 20px;
}
.service-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.service-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
  width: 3px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--gold), var(--accent));
  opacity: 0.3;
}
.timeline-item {
  position: relative; margin-bottom: 32px;
}
.timeline-item.animate-ready { opacity: 0; transform: translateX(-20px); }
.timeline-item.visible { opacity: 1; transform: translateX(0); transition: opacity 0.5s, transform 0.5s; }
.timeline-dot {
  position: absolute; left: -30px; top: 28px;
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-glow), var(--accent-deep));
  box-shadow: 0 0 0 4px var(--bg), 0 0 12px rgba(176,92,58,0.3);
}
.section-alt .timeline-dot { box-shadow: 0 0 0 4px var(--bg-alt), 0 0 12px rgba(176,92,58,0.3); }

.timeline-card {
  background: var(--surface-raised); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-out);
  border: 1px solid rgba(255,255,255,0.3);
  transition: box-shadow 0.3s;
}
.timeline-card:hover { box-shadow: 8px 8px 20px rgba(0,0,0,0.16), -8px -8px 20px rgba(255,255,255,0.6); }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.timeline-header h3 { font-size: 1.08rem; font-weight: 700; }
.timeline-company { font-size: 0.88rem; color: var(--accent); font-weight: 600; margin-top: 2px; }
.timeline-date {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface-inset); box-shadow: var(--shadow-in);
  padding: 5px 14px; border-radius: 16px; white-space: nowrap;
}
.timeline-card ul { list-style: none; margin-bottom: 16px; }
.timeline-card li {
  position: relative; padding-left: 18px; font-size: 0.88rem;
  color: var(--text-muted); margin-bottom: 8px; line-height: 1.55;
}
.timeline-card li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.timeline-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline-tags span {
  font-size: 0.72rem; font-weight: 600; padding: 4px 12px;
  border-radius: 14px; background: var(--surface-inset);
  box-shadow: var(--shadow-in); color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; }
.skill-card {
  background: var(--surface-raised); border-radius: var(--radius);
  padding: 28px 16px; text-align: center;
  box-shadow: var(--shadow-out); border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}
.skill-card.animate-ready { opacity: 0; transform: translateY(20px); }
.skill-card.visible { opacity: 1; transform: translateY(0); transition: opacity 0.5s, transform 0.5s; }
.skill-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: 8px 8px 20px rgba(0,0,0,0.17), -8px -8px 20px rgba(255,255,255,0.6); }
.skill-card i { font-size: 2rem; color: var(--accent); margin-bottom: 12px; display: block; }
.skill-card span { font-size: 0.88rem; font-weight: 600; display: block; margin-bottom: 4px; }
.skill-card small { font-size: 0.72rem; color: var(--text-muted); }

/* ===== PROJECTS ===== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.project-card {
  background: var(--surface-raised); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow-out);
  border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-card.animate-ready { opacity: 0; transform: translateY(30px); }
.project-card.visible { opacity: 1; transform: translateY(0); transition: opacity 0.6s, transform 0.6s; }
.project-card:hover { transform: translateY(-4px); box-shadow: 8px 8px 20px rgba(0,0,0,0.18), -8px -8px 20px rgba(255,255,255,0.65); }
.project-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(145deg, var(--accent-glow), var(--accent-deep));
  box-shadow: 3px 3px 8px rgba(176,92,58,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff; margin-bottom: 20px;
}
.project-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 10px; }
.project-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tags span {
  font-size: 0.72rem; font-weight: 600; padding: 4px 12px;
  border-radius: 14px; background: var(--surface-inset);
  box-shadow: var(--shadow-in); color: var(--accent);
}

/* ===== EDUCATION ===== */
.edu-card {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface-raised); border-radius: var(--radius);
  padding: 32px 36px; box-shadow: var(--shadow-out);
  border: 1px solid rgba(255,255,255,0.3);
  max-width: 520px; margin: 0 auto;
}
.edu-card.animate-ready { opacity: 0; transform: translateY(20px); }
.edu-card.visible { opacity: 1; transform: translateY(0); transition: opacity 0.5s, transform 0.5s; }
.edu-icon {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  background: var(--surface-inset); box-shadow: var(--shadow-in);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--gold);
}
.edu-card h3 { font-size: 1.05rem; font-weight: 700; }
.edu-card p { font-size: 0.88rem; color: var(--text-muted); }

/* ===== CONTACT ===== */
.contact-desc { color: var(--text-muted); font-size: 1rem; max-width: 500px; margin: -32px auto 36px; }
.social-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.social-row a {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--surface-raised); box-shadow: var(--shadow-out);
  border: 1px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--text-muted);
  text-decoration: none; transition: all 0.25s;
}
.social-row a:hover { color: var(--accent); transform: translateY(-3px); box-shadow: 6px 6px 16px rgba(0,0,0,0.15), -6px -6px 16px rgba(255,255,255,0.6); }

/* ===== FOOTER ===== */
footer {
  padding: 32px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: var(--bg);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-logo {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--accent);
}
.footer-inner p { font-size: 0.82rem; color: var(--text-muted); }

/* ===== ANIMATIONS ===== */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    background: rgba(232, 224, 216, 0.97); backdrop-filter: blur(16px);
    flex-direction: column; padding: 24px; gap: 16px;
    transform: translateY(-120%); transition: transform 0.35s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }
  html.dark .nav-links {
    background: rgba(26, 26, 34, 0.97);
  }
  .nav-links.open { transform: translateY(0); }
  #mobile-toggle { display: flex; }
  .hero-card { padding: 40px 24px; }
  .hero-stats { gap: 8px; }
  .stat-pill { padding: 10px 14px; min-width: 76px; }
  .stat-num { font-size: 1.15rem; }
  .timeline { padding-left: 28px; }
  .timeline-header { flex-direction: column; }
  .services-grid, .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .skill-card { padding: 20px 12px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
}
