:root {
  --bg-1: #0f172a;
  --bg-2: #020617;
  --accent: #7c3aed;
  --muted: #9aa4b2;
  --card-bg: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  background: linear-gradient(120deg, var(--bg-1), var(--bg-2));
  color: #e6eef8;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.logo {
  font-weight: 700;
}
.nav-links {
  display: flex;
  gap: 18px;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
}
.nav-links a.active,
.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 8px;
}

/* HERO */
.hero {
  height: 63vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}
.hero-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}
.lead {
  color: var(--muted);
  margin-top: 10px;
}
.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
}
.hero button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.btn-outline {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
  text-decoration: none;
}
.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

/* SECTION */
section {
  padding: 80px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

/* CARDS */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px;
  border-radius: 14px;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* SKILLS */
.skills-grid .card {
  text-align: center;
  padding: 28px;
  font-weight: 600;
}

/* CONTACT */
.contact-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-form .row {
  display: flex;
  gap: 12px;
}
.contact-form input,
.contact-form textarea {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: inherit;
}
.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
}
.form-status {
  color: var(--muted);
  margin-top: 8px;
}

.socials {
  margin-top: 12px;
  color: var(--muted);
}

.socials a {
  color: #e6eef8;
  text-decoration: none;
  opacity: 0.95;
  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}
.socials a:hover {
  color: var(--accent);
  opacity: 1;
}

/* REVEAL ANIMATION */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s ease;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Center the blog section heading */
#blog h2 {
  text-align: center;
}

/* SCRATCH EMBED (responsive iframe) */
.scratch-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin-top: 18px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 56.25%; /* 16:9 aspect */
  background: rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.scratch-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* thumbnail & click-to-load */
.scratch-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scratch-load {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}
.scratch-load:focus {
  outline: 2px solid var(--accent);
}

/* fallback shown when thumbnail image can't load */
.scratch-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #e6eef8;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.55));
  z-index: 4;
  text-align: center;
  font-weight: 600;
  border-radius: 8px;
}
.scratch-fallback[hidden] {
  display: none;
}
.fallback-inner {
  max-width: 85%;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column;
    align-items: center;
  }
  .avatar {
    display: block;
    order: -1;
    margin-bottom: 14px;
    width: 96px;
    height: 96px;
  }
  .hero-inner > div {
    text-align: center;
  }
  .hero {
    height: auto;
    padding-top: 80px;
    padding-bottom: 30px;
  }
}
@media (max-width: 680px) {
  .menu-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    right: 12px;
    top: 64px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    flex-direction: column;
    padding: 12px;
    border-radius: 10px;
    display: none;
  }
  .nav-links.show {
    display: flex;
  }
  .contact-form .row {
    flex-direction: column;
  }
  /* reduce spacing on small screens */
  section {
    padding: 40px 12px;
  }
  /* make the scratch embed taller on narrow screens */
  .scratch-embed {
    max-width: 100%;
    padding-top: 75%; /* more vertical space for mobile */
    margin-top: 14px;
    border-radius: 10px;
  }
  .scratch-embed iframe {
    border-radius: 8px;
  }
}
