:root {
  --bg: #0b0c10;
  --bg-raised: #121319;
  --bg-card: #16171f;
  --border: #262835;
  --text: #f2f2f5;
  --text-muted: #9a9db0;
  --accent: #7c5cff;
  --accent-bright: #9b82ff;
  --font-display: "Sora", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --hue-violet: #7c5cff;
  --hue-pink: #ff5ca8;
  --hue-cyan: #22d3ee;
  --hue-amber: #ffb020;
  --hue-green: #34d399;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg,
    var(--hue-violet), var(--hue-pink), var(--hue-cyan), var(--hue-amber), var(--hue-green));
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 28px;
  transition: color 0.15s ease;
}

.header-nav a:hover { color: var(--text); }

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.header-socials a {
  display: flex;
  color: var(--text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.header-socials a:hover {
  color: var(--accent-bright);
  transform: translateY(-2px);
}

@media (max-width: 560px) {
  .header-nav { display: none; }
  .header-socials { padding-left: 0; border-left: none; gap: 14px; }
  .header-right { gap: 0; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.28;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  width: 360px;
  height: 360px;
  top: -140px;
  left: -80px;
  background: var(--hue-violet);
}

.hero::after {
  width: 320px;
  height: 320px;
  bottom: -160px;
  right: -60px;
  background: var(--hue-pink);
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 20ch;
  background: linear-gradient(100deg, var(--hue-violet), var(--hue-pink) 55%, var(--hue-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 62ch;
  line-height: 1.6;
  margin: 0;
}

.hero-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.hero-skills li {
  --skill-hue: var(--hue-violet);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: color-mix(in srgb, var(--skill-hue) 14%, var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--skill-hue) 45%, var(--border));
  padding: 7px 14px;
  border-radius: 999px;
}

.hero-skills li:nth-child(5n+1) { --skill-hue: var(--hue-violet); }
.hero-skills li:nth-child(5n+2) { --skill-hue: var(--hue-pink); }
.hero-skills li:nth-child(5n+3) { --skill-hue: var(--hue-cyan); }
.hero-skills li:nth-child(5n+4) { --skill-hue: var(--hue-amber); }
.hero-skills li:nth-child(5n+5) { --skill-hue: var(--hue-green); }

/* Section heading */
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 64px 0 28px;
  position: relative;
  padding-left: 18px;
}

.section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hue-violet), var(--hue-pink), var(--hue-cyan));
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.count-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
}

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 96px;
}

.loading-text, .empty-text {
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.project-card {
  --card-accent: var(--hue-violet);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:nth-child(5n+1) { --card-accent: var(--hue-violet); }
.project-card:nth-child(5n+2) { --card-accent: var(--hue-pink); }
.project-card:nth-child(5n+3) { --card-accent: var(--hue-cyan); }
.project-card:nth-child(5n+4) { --card-accent: var(--hue-amber); }
.project-card:nth-child(5n+5) { --card-accent: var(--hue-green); }

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent);
  z-index: 2;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--card-accent) 30%, transparent);
}

.card-thumb-wrap {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 20%, #1d1f2b), #14151d);
  overflow: hidden;
  position: relative;
}

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

.card-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  color: var(--border);
  letter-spacing: -0.02em;
}

.card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.card-type {
  margin-top: -6px;
  font-size: 0.8rem;
  font-weight: 500;
  font-style: italic;
  color: var(--card-accent);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.card-tags span {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
}

.card-cta {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-card:hover .card-cta { color: var(--card-accent); }

/* Contact */
.contact-section {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
  border-top: 1px solid var(--border);
}

.contact-section::before,
.contact-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}

.contact-section::before {
  width: 340px;
  height: 340px;
  top: -120px;
  right: -60px;
  background: var(--hue-amber);
}

.contact-section::after {
  width: 300px;
  height: 300px;
  bottom: -150px;
  left: -60px;
  background: var(--hue-green);
}

.contact-section .wrap {
  position: relative;
  z-index: 1;
}

.contact-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 56ch;
  line-height: 1.6;
  margin: 0 0 36px;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.contact-card {
  --card-hue: var(--hue-violet);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card--mail { --card-hue: var(--hue-cyan); }
.contact-card--phone { --card-hue: var(--hue-pink); }
.contact-card--github { --card-hue: var(--hue-cyan); }
.contact-card--linkedin { --card-hue: var(--hue-cyan); }
.contact-card--fiverr { --card-hue: var(--hue-green); }
.contact-card--gumroad { --card-hue: var(--hue-amber); }

.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-hue);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--card-hue) 28%, transparent);
}

.contact-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--card-hue) 16%, var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--card-hue) 40%, var(--border));
  color: var(--card-hue);
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.contact-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-value {
  font-size: 0.98rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.contact-card:hover .contact-value { color: var(--card-hue); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 32px;
}

.footer-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-socials a {
  display: flex;
  color: var(--text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.footer-socials a:hover {
  color: var(--accent-bright);
  transform: translateY(-2px);
}

/* Custom Mouse Spotlight Background Effect */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50vw) var(--mouse-y, 50vh),
    rgba(124, 92, 255, 0.05),
    transparent 50%
  );
  pointer-events: none;
}

/* Card transform-style update for smooth 3D tilt */
.project-card {
  transition: transform 0.1s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
}

.project-card * {
  pointer-events: none;
}

/* Robot Widget CSS */
.robot-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  width: 80px;
  height: 90px;
  pointer-events: none;
}

.robot-widget.is-roaming {
  transition: left 2.2s cubic-bezier(0.45, 0, 0.2, 1), top 2.2s cubic-bezier(0.45, 0, 0.2, 1);
}

.robot-container {
  pointer-events: auto;
  cursor: pointer;
  width: 80px;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s ease;
}

.robot-container:hover {
  filter: drop-shadow(0 12px 32px rgba(124, 92, 255, 0.4));
}

/* Tooltip Greeting Bubble */
.robot-tooltip {
  pointer-events: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 12px 12px 2px 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 240px;
  text-align: center;
}

.robot-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Chat Window */
.robot-chat-window {
  pointer-events: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 350px;
  height: 480px;
  max-height: 80vh;
  background: rgba(18, 19, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 20px rgba(124, 92, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transform-origin: bottom right;
  transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1001;
}

.robot-chat-window.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Flip down tooltip/chat for top-of-screen situations */
.robot-widget.flip-down .robot-tooltip {
  bottom: auto;
  top: calc(100% + 4px);
  transform-origin: top right;
  transform: translateY(-10px) scale(0.95);
}

.robot-widget.flip-down .robot-tooltip.show {
  transform: translateY(0) scale(1);
}

.robot-widget.flip-down .robot-chat-window {
  bottom: auto;
  top: calc(100% + 8px);
  transform-origin: top right;
  transform: translateY(-20px) scale(0.9);
}

.robot-widget.flip-down .robot-chat-window.show {
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  padding: 14px 18px;
  background: rgba(22, 23, 31, 0.9);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--hue-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--hue-green);
  display: inline-block;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.chat-header-info h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.status-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.chat-close-btn:hover {
  color: var(--text);
}

/* Chat Messages Area */
.chat-messages {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Chat Message Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
  animation: messageFadeIn 0.3s ease forwards;
}

@keyframes messageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.bot {
  align-self: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 2px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

/* Project Card In Chat */
.chat-project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-project-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.chat-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0;
}

.chat-project-tags span {
  font-size: 0.65rem;
  padding: 1px 6px;
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: var(--accent-bright);
  border-radius: 4px;
}

.chat-project-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.chat-project-btn {
  flex-grow: 1;
  text-align: center;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-project-btn--scroll {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
}

.chat-project-btn--scroll:hover {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.1);
}

.chat-project-btn--link {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

.chat-project-btn--link:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 2px;
  width: fit-content;
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Suggestions Container */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 12px;
  border-top: 1px solid rgba(38, 40, 53, 0.4);
}

.suggestion-chip {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-chip:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.15);
  transform: translateY(-1px);
}

/* Chat Input Form */
.chat-input-form {
  padding: 12px 16px;
  background: rgba(22, 23, 31, 0.9);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-form input {
  flex-grow: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.25);
  outline: none;
}

.chat-send-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--accent-bright);
  transform: scale(1.05);
}

.chat-send-btn svg {
  transition: transform 0.2s;
}

.chat-send-btn:hover svg {
  transform: translate(1px, -1px);
}

/* Project Card Highlight Class */
.project-card--highlight {
  animation: pulseCardHighlight 2.5s ease-out;
}

@keyframes pulseCardHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.8);
    border-color: var(--hue-pink);
    transform: scale(1.02);
  }
  30% {
    box-shadow: 0 0 20px 6px rgba(124, 92, 255, 0.5);
    border-color: var(--hue-cyan);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 92, 255, 0);
    transform: scale(1);
  }
}

/* Robot interaction animations when typing */
.cute-robot.is-thinking .robot-antenna-tip {
  animation: antennaBlinkFast 0.3s infinite alternate;
}

.cute-robot.is-thinking .robot-eyes circle {
  fill: var(--hue-pink);
  filter: drop-shadow(0 0 4px var(--hue-pink));
}

@keyframes antennaBlinkFast {
  from { opacity: 0.3; fill: var(--hue-pink); }
  to { opacity: 1; fill: var(--hue-cyan); }
}

/* Keyframe Animations */
@keyframes robotFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.cute-robot {
  animation: robotFloat 4s ease-in-out infinite;
}

@keyframes headTilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

.robot-head {
  transform-origin: 40px 42px;
  animation: headTilt 6s ease-in-out infinite;
}

@keyframes eyeBlink {
  0%, 45%, 55%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

.robot-eyes {
  transform-origin: 40px 30px;
  animation: eyeBlink 5s infinite;
}

@keyframes fireFlicker {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 0.95; }
  50% { transform: scaleY(0.7) scaleX(0.9); opacity: 0.7; }
}

.robot-fire {
  transform-origin: 40px 76px;
  animation: fireFlicker 0.15s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; fill: var(--hue-pink); }
}

.robot-heart {
  transform-origin: 40px 56px;
  animation: heartPulse 2s ease-in-out infinite;
}

/* Responsive Hide for Mobile */
@media (max-width: 600px) {
  .robot-widget {
    bottom: 16px;
    right: 16px;
    width: 60px;
    height: 68px;
  }
  .robot-container {
    width: 60px;
    height: 68px;
  }
  .robot-tooltip {
    font-size: 0.75rem;
    max-width: 180px;
    padding: 6px 10px;
  }
}

/* Robot Dragging States */
.robot-widget.is-dragging {
  cursor: grabbing !important;
}
.robot-widget.is-dragging .robot-container {
  cursor: grabbing !important;
  transform: scale(1.05);
}

/* Robot Sleeping State */
.robot-widget.is-sleeping .cute-robot {
  opacity: 0.65;
  filter: grayscale(0.3) brightness(0.8) drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.robot-widget.is-sleeping .eye-open {
  display: none !important;
}
.robot-widget.is-sleeping .eye-sleeping {
  display: block !important;
}
.robot-widget.is-sleeping .status-dot {
  background: #6b7280 !important;
  box-shadow: 0 0 8px rgba(107, 114, 128, 0.4);
}
.robot-widget.is-sleeping .status-text {
  color: var(--text-muted) !important;
}
.robot-widget.is-sleeping .robot-heart {
  animation: none !important;
  fill: #4b5563 !important;
}
.robot-widget.is-sleeping .robot-fire {
  display: none !important;
}

/* Zzz particle float animation */
.zzz-particle {
  position: absolute;
  font-family: monospace;
  font-weight: bold;
  color: var(--hue-cyan);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 999;
  animation: float-zzz 3s ease-out forwards;
}

@keyframes float-zzz {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  20% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(-20px, -60px) scale(1.2); }
}

/* Custom 2FA wake up buttons inside tooltip */
.wakeup-prompt-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}
.wakeup-prompt-title {
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--hue-pink);
  margin-bottom: 2px;
}
.wakeup-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.wakeup-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}
.wakeup-btn--confirm {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.wakeup-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .robot-chat-window {
    position: fixed !important;
    width: calc(100vw - 40px) !important;
    right: 20px !important;
    left: 20px !important;
    bottom: 110px !important;
    max-height: 60vh !important;
  }
  .contact-cards {
    grid-template-columns: 1fr !important;
  }
}

/* ── Robot sleep / awake eye visibility (REMOVED conflicting .awake rules) ── */
/* The sleeping state is now handled only by .is-sleeping classes above */

/* ============================================================
   Game-like visual effects: holo card shine, rarity glow,
   cursor particles, motion background, touch feedback.
   ============================================================ */

/* Ambient drifting aurora blobs — sits behind the mouse-spotlight layer */
.fx-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.fx-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  will-change: transform;
}

.fx-blob--1 {
  width: 480px;
  height: 480px;
  top: -12%;
  left: -10%;
  background: var(--hue-violet);
  animation: auroraDrift1 26s ease-in-out infinite;
}

.fx-blob--2 {
  width: 420px;
  height: 420px;
  bottom: -16%;
  right: -6%;
  background: var(--hue-cyan);
  animation: auroraDrift2 32s ease-in-out infinite;
}

.fx-blob--3 {
  width: 380px;
  height: 380px;
  top: 38%;
  left: 58%;
  background: var(--hue-pink);
  animation: auroraDrift3 22s ease-in-out infinite;
}

@keyframes auroraDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.15); }
}

@keyframes auroraDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, -50px) scale(1.1); }
}

@keyframes auroraDrift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, 40px) scale(0.92); }
}

@media (max-width: 640px) {
  .fx-blob { filter: blur(60px); opacity: 0.16; }
  .fx-blob--1, .fx-blob--2, .fx-blob--3 { width: 260px; height: 260px; }
}

/* Holo-foil card shine (CS:GO / trading-card style) — follows --mx/--my set by JS */
.project-card {
  --mx: 50%;
  --my: 50%;
  --shine-opacity: 0;
}

.card-thumb-wrap {
  isolation: isolate;
}

.card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--shine-opacity);
  transition: opacity 0.25s ease;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.55), transparent 45%),
    conic-gradient(from calc(var(--mx) * 3.6deg) at var(--mx) var(--my),
      rgba(255, 92, 168, 0.35), rgba(34, 211, 238, 0.35), rgba(255, 176, 32, 0.35),
      rgba(52, 211, 153, 0.35), rgba(124, 92, 255, 0.35), rgba(255, 92, 168, 0.35));
  mix-blend-mode: color-dodge;
}

/* Rarity-tier glow — an animated gradient border ring that intensifies on hover,
   like a rare weapon-skin outline flaring up. */
.project-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  z-index: 3;
  pointer-events: none;
  background: conic-gradient(from 0deg, var(--card-accent), transparent 30%, var(--card-accent) 60%, transparent 90%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: rarityRotate 3.5s linear infinite paused;
}

.project-card:hover::after,
.project-card.card-pressed::after {
  opacity: 0.9;
  animation-play-state: running;
}

@keyframes rarityRotate {
  to { background: conic-gradient(from 360deg, var(--card-accent), transparent 30%, var(--card-accent) 60%, transparent 90%); }
}

/* Tap/press feedback for touch (and mouse) — a quick "impact" squash */
.project-card.card-pressed {
  transform: scale(0.985) translateY(-2px);
  transition: transform 0.12s ease;
}

/* Cursor trail + click/tap burst particles */
.pointer-trail-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  top: 0;
  left: 0;
  opacity: 0.85;
  filter: blur(0.5px);
  transform: translate(-50%, -50%);
  animation: trailFade 0.7s ease-out forwards;
}

@keyframes trailFade {
  0% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
}

.pointer-burst-particle {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  top: 0;
  left: 0;
  box-shadow: 0 0 8px 2px currentColor;
  transform: translate(-50%, -50%);
  animation: burstFly 0.65s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
}

@keyframes burstFly {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) scale(0); opacity: 0; }
}

/* Robot wave animation — periodic + on wake-up */
@keyframes armWave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-28deg); }
  40% { transform: rotate(16deg); }
  60% { transform: rotate(-22deg); }
  80% { transform: rotate(10deg); }
}

.robot-widget.is-waving .robot-arm-right {
  transform-box: fill-box;
  transform-origin: top center;
  animation: armWave 1.3s ease-in-out;
}

/* Tactile press feedback across interactive elements (mouse + touch alike) */
.header-socials a:active,
.footer-socials a:active,
.contact-card:active,
.chat-project-btn:active,
.suggestion-chip:active,
.chat-send-btn:active,
.wakeup-btn:active {
  transform: scale(0.94);
}

/* Respect reduced-motion preferences: strip decorative animation, keep function */
@media (prefers-reduced-motion: reduce) {
  .fx-blob,
  .cute-robot,
  .robot-head,
  .robot-eyes,
  .robot-fire,
  .robot-heart,
  .robot-widget.is-waving .robot-arm-right,
  .project-card::after,
  .pointer-trail-particle,
  .pointer-burst-particle {
    animation: none !important;
  }
  .project-card { transition: none !important; }
}

/* Extra-narrow phones: keep grid usable at very small widths */
@media (max-width: 380px) {
  .project-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 40px; }
  .wrap { padding: 0 16px; }
}
