@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400&family=Archivo:wght@400;500;600&display=swap');

:root {
  --bg: #121014;
  --bg-raise: #1a171c;
  --line: rgba(234, 228, 219, 0.10);
  --text: #eae4db;
  --muted: #9b948a;
  --accent: #d9a441;
  --accent-soft: rgba(217, 164, 65, 0.12);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Archivo", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--sans);
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  padding: 0 0 40px;
  text-align: center;
  margin-bottom: 40px;
}

/* Facebook-style cover photo */
.cover {
  width: calc(100% + 40px);
  margin: 0 -20px;
  height: clamp(140px, 30vw, 320px);
  overflow: hidden;
  background: var(--bg-raise);
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    135deg,
    var(--bg-raise) 0,
    var(--bg-raise) 22px,
    var(--bg) 22px,
    var(--bg) 44px
  );
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
}

.profile-container {
  position: relative;
  display: inline-block;
  margin-top: -56px;
  z-index: 1;
}

.profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--bg-raise);
  display: block;
}

.wave-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease;
}

.wave-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--accent-soft);
  animation: wave-pulse 2.6s ease-out infinite;
  pointer-events: none;
}

.wave-btn:hover,
.wave-btn:focus-visible {
  transform: scale(1.15);
  border-color: var(--accent);
}

.wave-btn .wave {
  display: inline-block;
  font-size: 20px;
  animation: wave 1.8s infinite;
  transform-origin: 70% 70%;
}

@keyframes wave-pulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes wave {
  0% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  30% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }

  60% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3rem;
  letter-spacing: -0.015em;
  margin: 10px 0;
}

.code-animate {
  color: var(--accent);
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
}

.social-links {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.social-links a {
  color: var(--text);
  font-size: 1.5rem;
  transition: transform 200ms ease, color 200ms ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  color: var(--accent);
}

/* Common Section */
section {
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* About */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.1rem;
  color: var(--muted);
}

.strong-word {
  color: var(--accent);
  font-weight: 600;
}

/* Skills */
.skills-header { text-align: center; }
.skills-divider {
  width: 48px;
  height: 1px;
  background: var(--line);
  margin: 1.1rem auto 0;
}

.skill-groups {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  max-width: 800px;
  margin: 2.6rem auto 0;
}

.skill-group-label {
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  max-width: 900px;
  margin: 0 auto;
}

.skill-tag {
  background: var(--bg-raise);
  padding: 10px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  transition: border-color 200ms ease, transform 200ms ease;
}

.skill-tag:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.skill-tag i {
  color: var(--accent);
}

.skill-tag.exploring {
  border-style: dashed;
  color: var(--muted);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--bg-raise);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 200ms ease, transform 200ms ease;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.project-image-wrapper {
  overflow: hidden;
  height: 200px;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-info {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.project-info h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
}

.project-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.project-case {
  flex-grow: 1;
  margin-bottom: 1.1rem;
}

.project-case dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.85rem;
}

.project-case dt:first-child { margin-top: 0; }

.project-case dd {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.project-private {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- Projects archive (everything not featured) ---------- */
.projects-archive { margin-top: 3.5rem; }

.archive-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.archive-header h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
}

.archive-count { font-size: 0.8rem; color: var(--muted); }

.archive-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.tag-pill {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

.tag-pill:hover { color: var(--text); border-color: var(--accent); }
.tag-pill.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.archive-list { display: flex; flex-direction: column; }

.proj-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.3rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  transition: background 140ms ease;
}

.proj-list-item:hover { background: rgba(255, 255, 255, 0.03); }
.proj-list-item:hover .proj-list-name { color: var(--accent); }

.proj-list-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  transition: color 140ms ease;
  flex: 1 1 auto;
}

.proj-list-tags {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

.proj-list-date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 4.2rem;
  text-align: right;
}

.archive-empty { color: var(--muted); font-size: 0.9rem; padding: 0.6rem 0.3rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
}

.links {
  display: flex;
  gap: 15px;
  margin-top: auto;
}

.links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 200ms ease;
}

.links a:hover {
  color: var(--accent);
}

/* Footer */
footer {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* ---------- Hello drop message ---------- */
.hello-drop {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-top: none;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1rem;
  padding: 0.9rem 1.7rem;
  border-radius: 0 0 10px 10px;
  z-index: 80;
  transition: transform 480ms cubic-bezier(0.32, 1.4, 0.55, 1);
  pointer-events: none;
}

.hello-drop.show { transform: translate(-50%, 0); }

/* ---------- Floating nav blob (dual-trigger menu) ---------- */
.nav-blob {
  position: fixed;
  z-index: 70;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  transition: left 320ms ease, right 320ms ease, top 320ms ease,
    border-color 160ms ease, transform 160ms ease;
}

.nav-blob.dragging { transition: transform 80ms ease; cursor: grabbing; }
.nav-blob:hover { border-color: var(--accent); }
.nav-blob:active { transform: scale(0.94); }

/* Periodic attention ripple — pulses briefly, rests, repeats. Stops once
   the menu is open (it's done its job by then) and respects reduced motion. */
.nav-blob {
  animation: blob-pulse 6s ease-out infinite;
}
.nav-blob[aria-expanded="true"] { animation: none; }

@keyframes blob-pulse {
  0%, 55% { box-shadow: 0 0 0 0 rgba(217, 164, 65, 0.45); }
  75% { box-shadow: 0 0 0 12px rgba(217, 164, 65, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 164, 65, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-blob { animation: none; }
}

.nav-blob-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transition: background 160ms ease;
}

.nav-blob[aria-expanded="true"] .nav-blob-dot { background: var(--text); }

.blob-menu {
  position: fixed;
  z-index: 70;
  min-width: 12rem;
  background: color-mix(in srgb, var(--bg-raise) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.blob-menu[data-open] { opacity: 1; transform: translateY(0) scale(1); }

.blob-link {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  transition: background 140ms ease, color 140ms ease;
}

.blob-link:hover,
.blob-link:focus-visible { background: var(--accent-soft); color: var(--accent); }

/* ---------- Scroll progress (car on the road) ---------- */
.scroll-progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  height: 34px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.scroll-track {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0, var(--line) 10px,
    transparent 10px, transparent 20px
  );
}

.scroll-car {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 40px;
  height: 20px;
  color: var(--accent);
  transform: translate(0, -50%);
  will-change: transform;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .proj-list-tags {
    display: none;
  }
}
