/* ===== CSS VARIABLES (light, professional palette) ===== */
:root {
  --bg: #f8f9fa;
  --bg-alt: #f0f2f4;
  --card: #ffffff;
  --text: #1c2430;
  --text-muted: #5a6472;
  --primary: #205295;
  --primary-hover: #17416f;
  --border: #dee2e6;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
  --nav-bg: rgba(248, 249, 250, 0.88);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* keep anchors clear of the fixed navbar */
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--primary) 25%, transparent);
}

/* Visible keyboard focus for every interactive element */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Accessibility: skip straight to content */
.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.section {
  padding: 90px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.7rem;
  margin-bottom: 12px;
}

.section-title span {
  color: var(--primary);
}

/* Thin accent underline under each section heading */
.section-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background:
    radial-gradient(700px 400px at 85% 10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent),
    radial-gradient(600px 380px at 10% 85%, color-mix(in srgb, var(--primary) 10%, transparent), transparent);
}

.hero-inner {
  padding-top: 80px;
}

.hero-hello {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.1;
}

.hero-sub {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--text-muted);
  margin: 8px 0 18px;
}

.hero-text {
  max-width: 480px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.scroll-down {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-size: 1.3rem;
  color: var(--text-muted);
  animation: bounce 1.6s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-highlight {
  color: var(--primary) !important;
  font-weight: 600;
}

/* Quick credibility stats under the bio */
.about-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.about-facts li {
  display: grid;
}

.about-facts strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.about-facts span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.photo-frame {
  position: relative;
  padding: 14px;
  border: 2px solid var(--primary);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.photo-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
}

/* ===== BACK TO TOP ===== */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--primary);
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.to-top:hover {
  transform: translateY(-3px);
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-6px);
}

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.skill-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.project-body {
  padding: 22px;
}

.project-body h3 {
  margin-bottom: 8px;
}

.project-body > p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.project-tags span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
}

.project-links {
  display: flex;
  gap: 18px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ===== EXPERIENCE / TIMELINE ===== */
.timeline {
  position: relative;
  max-width: 640px;
  padding-left: 26px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 34px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -35px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.timeline-content h3 {
  font-size: 1.02rem;
  margin: 4px 0;
}

.timeline-content p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.contact-text {
  color: var(--text-muted);
  margin-bottom: 22px;
}

.contact-list {
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-form {
  display: grid;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.contact-form input.invalid,
.contact-form textarea.invalid {
  border-color: #e5484d;
}

.contact-form .btn {
  margin-top: 12px;
  border: none;
}

.form-status {
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 1.2em;
}

.form-status.ok { color: #2fa96e; }
.form-status.err { color: #e5484d; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .photo-img { height: 260px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }

  .nav-links.open { transform: translateY(0); }

  .nav-links li { text-align: center; padding: 12px 0; }
  .hamburger { display: flex; }
  .section { padding: 70px 0; }
}
