:root {
  --bg: #0b141b;
  --bg-alt: #111c26;
  --surface: #14202c;
  --surface-alt: #1b2a3a;
  --text: #f5f5f5;
  --text-muted: #b9c5d3;
  --accent: #f6c66f;
  --accent-2: #54d0c7;
  --accent-3: #ff8a5b;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-serif: "Fraunces", "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: radial-gradient(circle at 15% 25%, rgba(84, 208, 199, 0.2), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(246, 198, 111, 0.2), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255, 138, 91, 0.15), transparent 55%),
    linear-gradient(135deg, #0a1117, #121f2b 60%, #0b141b);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -12% -20%;
  background:
    radial-gradient(circle at 25% 25%, rgba(84, 208, 199, 0.14), transparent 50%),
    radial-gradient(circle at 78% 18%, rgba(246, 198, 111, 0.16), transparent 48%),
    radial-gradient(circle at 62% 80%, rgba(255, 138, 91, 0.12), transparent 46%);
  z-index: 0;
  pointer-events: none;
  animation: ambientShift 18s ease-in-out infinite alternate;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 6vw;
  background: rgba(11, 20, 27, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  border-radius: 14px;
  color: #0b141b;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.nav-link.is-active {
  color: var(--text);
}

.cta {
  background: var(--accent);
  color: #111;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(246, 198, 111, 0.35);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  background: rgba(20, 32, 44, 0.45);
}

.social-icon {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
  font-weight: 700;
}

.social-linkedin::before {
  content: "in";
}

.social-email::before {
  content: "@";
}

main {
  padding: 3rem 6vw 5rem;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
}

.search-note {
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-actions {
  margin: 2rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--accent-2);
  color: #041018;
  box-shadow: 0 18px 40px rgba(84, 208, 199, 0.35);
}

.btn.ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  color: var(--text-muted);
}

.meta-value {
  font-weight: 600;
}

.hero-card {
  background: linear-gradient(160deg, var(--surface), rgba(27, 42, 58, 0.65));
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
  animation: floatCard 7s ease-in-out infinite;
}

.avatar-ring {
  background: radial-gradient(circle, rgba(246, 198, 111, 0.3), transparent 65%);
  padding: 0.5rem;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(130deg, #1f2b3d, #2e4563);
  border: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
  background-size: cover;
  background-position: center;
}

.avatar::after {
  content: "RG";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.avatar.has-photo::after {
  content: "";
}

.subtitle {
  color: var(--accent);
  font-weight: 600;
  margin: 0.4rem 0 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.chip {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.section {
  margin-top: 5rem;
  display: grid;
  gap: 2rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.section-lead {
  color: var(--text-muted);
  max-width: 600px;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--surface);
  padding: 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.highlight {
  background: linear-gradient(120deg, rgba(27, 42, 58, 0.85), rgba(14, 24, 34, 0.9));
  padding: 2.5rem;
  border-radius: 28px;
  border: 1px solid var(--border);
}

.projects {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.project-card {
  background: rgba(11, 20, 27, 0.75);
  border-radius: 20px;
  padding: 1.6rem;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.project-card:hover,
.timeline-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.24);
}

.project-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.text-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.callout {
  background: linear-gradient(135deg, rgba(246, 198, 111, 0.2), rgba(255, 138, 91, 0.2));
  border-radius: 28px;
  padding: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
}

.site-footer {
  padding: 2.5rem 6vw 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.page-hero {
  background: linear-gradient(140deg, rgba(84, 208, 199, 0.2), rgba(14, 24, 34, 0.9));
  padding: 3rem;
  border-radius: 28px;
  border: 1px solid var(--border);
}

.page-hero h1 {
  margin-bottom: 1rem;
}

.timeline {
  display: grid;
  gap: 1.5rem;
}

.timeline-item {
  background: var(--surface-alt);
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.form-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

input,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(11, 20, 27, 0.7);
  color: var(--text);
  font-family: var(--font-sans);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-toast {
  margin-top: 1rem;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
}

.form-toast.success {
  background: rgba(84, 208, 199, 0.18);
  color: #bff6ef;
  box-shadow: 0 12px 30px rgba(84, 208, 199, 0.25);
}

.form-toast.error {
  background: rgba(255, 138, 91, 0.2);
  color: #ffd4c3;
  box-shadow: 0 12px 30px rgba(255, 138, 91, 0.25);
}

.fade-in {
  opacity: 0;
  transform: translateY(14px);
}

.fade-in.visible {
  animation: fadeUp 0.8s ease forwards;
}

.fade-in.delay-1.visible { animation-delay: 0.2s; }
.fade-in.delay-2.visible { animation-delay: 0.35s; }
.fade-in.delay-3.visible { animation-delay: 0.5s; }

body:not(.loaded) .hero-text > * {
  opacity: 0;
  transform: translateY(14px);
}

body.loaded .hero-text > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

body.loaded .hero-text > *:nth-child(1) { transition-delay: 0.1s; }
body.loaded .hero-text > *:nth-child(2) { transition-delay: 0.2s; }
body.loaded .hero-text > *:nth-child(3) { transition-delay: 0.3s; }
body.loaded .hero-text > *:nth-child(4) { transition-delay: 0.4s; }
body.loaded .hero-text > *:nth-child(5) { transition-delay: 0.45s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes ambientShift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(1.2%, -1.4%, 0) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before,
  .hero-card {
    animation: none;
  }

  * {
    transition: none !important;
  }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }
  .site-nav {
    width: 100%;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-links {
    width: 100%;
  }
  .social-btn,
  .header-links .cta {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  main {
    padding: 2.5rem 6vw 4rem;
  }
  .page-hero {
    padding: 2rem;
  }
}
